masatomix / uipath-orchestrator-api-node Goto Github PK
View Code? Open in Web Editor NEWUiPath Orchestrator API Wrapper for Node.js
License: Apache License 2.0
UiPath Orchestrator API Wrapper for Node.js
License: Apache License 2.0
MasterブランチのUTが完了したら、npm publishする
参考: https://qiita.com/sadnessOjisan/items/3069e79038c961458ba2
Versions of fstream prior to 1.0.12 are vulnerable to Arbitrary File Overwrite. Extracting tarballs containing a hardlink to a file that already exists in the system and a file that matches the hardlink will overwrite the system's file with the contents of the extracted file. The fstream.DirWriter() function is vulnerable.
utils.ts / index.ts のリクエスト投げる処理で、設定ファイルなどの制御 で strictSSL: false を渡せるようにする。
GET https://xxx/odata/Assets/UiPath.Server.Configuration.OData.GetRobotAsset(robotId='99fcxxxx22',assetName=@assetName)?@assetName='Credential001' HTTP/1.1
Authorization: UiRobot 99fcxxxx22
{"@odata.context":"https://xxx/odata/$metadata#UiPath.Orchestrator.Application.Dto.Assets.RobotAssetDto","Name":"Credential001","ValueType":"Credential","StringValue":"","BoolValue":false,"IntValue":0,"CredentialUsername":"u000_kino","CredentialPassword":"p000_kino","ExternalName":null,"CredentialStoreId":1}
User情報を「Type=User」で絞ってしまったがWindows認証されたユーザは「DirectoryUser」だったので取り得る値を調査して対応する。多分グループ追加されたユーザたちもTypeありそう
追記
Swaggerみると
['User', 'Robot', 'DirectoryUser', 'DirectoryGroup']
stringEnum:"User", "Robot", "DirectoryUser", "DirectoryGroup",
なるほど
をみると、もしかしたら application/x-www-form-urlencoded で投げたリクエストはプリフライトリクエストにならないかもしれない。
Excelからアップロードできたい
┌─────────┬─────────────────────────────────────────────────────────┬─────────────────────────────────────────────────────────┐
│ (index) │ Id │ Name │
├─────────┼─────────────────────────────────────────────────────────┼─────────────────────────────────────────────────────────┤
│ 0 │ 'Abp.Localization.DefaultLanguageName' │ 'Abp.Localization.DefaultLanguageName' │
│ 1 │ 'Abp.Net.Mail.Smtp.Host' │ 'Abp.Net.Mail.Smtp.Host' │
│ 2 │ 'Abp.Net.Mail.Smtp.Port' │ 'Abp.Net.Mail.Smtp.Port' │
│ 3 │ 'Abp.Net.Mail.Smtp.UserName' │ 'Abp.Net.Mail.Smtp.UserName' │
│ 4 │ 'Abp.Net.Mail.Smtp.Password' │ 'Abp.Net.Mail.Smtp.Password' │
│ 5 │ 'Abp.Net.Mail.Smtp.Domain' │ 'Abp.Net.Mail.Smtp.Domain' │
│ 6 │ 'Abp.Net.Mail.Smtp.EnableSsl' │ 'Abp.Net.Mail.Smtp.EnableSsl' │
│ 7 │ 'Abp.Net.Mail.Smtp.UseDefaultCredentials' │ 'Abp.Net.Mail.Smtp.UseDefaultCredentials' │
│ 8 │ 'Abp.Net.Mail.DefaultFromAddress' │ 'Abp.Net.Mail.DefaultFromAddress' │
│ 9 │ 'Abp.Net.Mail.DefaultFromDisplayName' │ 'Abp.Net.Mail.DefaultFromDisplayName' │
│ 10 │ 'Abp.Timing.TimeZone' │ 'Abp.Timing.TimeZone' │
│ 11 │ 'InternalDeployment' │ 'InternalDeployment' │
│ 12 │ 'DeploymentUrl' │ 'DeploymentUrl' │
│ 13 │ 'NuGet.Packages.ApiKey' │ 'NuGet.Packages.ApiKey' │
│ 14 │ 'Deployment.Processes.AuthenticationType' │ 'Deployment.Processes.AuthenticationType' │
│ 15 │ 'DeploymentBasicUsername' │ 'DeploymentBasicUsername' │
│ 16 │ 'DeploymentBasicPassword' │ 'DeploymentBasicPassword' │
│ 17 │ 'Deployment.Libraries.Url' │ 'Deployment.Libraries.Url' │
│ 18 │ 'Deployment.Libraries.Internal' │ 'Deployment.Libraries.Internal' │
│ 19 │ 'Deployment.Libraries.AuthenticationType' │ 'Deployment.Libraries.AuthenticationType' │
│ 20 │ 'NuGet.Activities.ApiKey' │ 'NuGet.Activities.ApiKey' │
│ 21 │ 'Deployment.Libraries.UseSharedFeed' │ 'Deployment.Libraries.UseSharedFeed' │
│ 22 │ 'Deployment.Libraries.BasicUsername' │ 'Deployment.Libraries.BasicUsername' │
│ 23 │ 'Deployment.Libraries.BasicPassword' │ 'Deployment.Libraries.BasicPassword' │
│ 24 │ 'PasswordComplexity' │ 'PasswordComplexity' │
│ 25 │ 'Alerts.Email.Enabled' │ 'Alerts.Email.Enabled' │
│ 26 │ 'Auth.UserLockOut.IsEnabled' │ 'Auth.UserLockOut.IsEnabled' │
│ 27 │ 'Auth.UserLockOut.MaxFailedAccessAttemptsBeforeLockout' │ 'Auth.UserLockOut.MaxFailedAccessAttemptsBeforeLockout' │
│ 28 │ 'Auth.UserLockOut.DefaultAccountLockoutSeconds' │ 'Auth.UserLockOut.DefaultAccountLockoutSeconds' │
│ 29 │ 'Auth.Password.DefaultExpirationDays' │ 'Auth.Password.DefaultExpirationDays' │
│ 30 │ 'Auth.Password.PreviousUseLimit' │ 'Auth.Password.PreviousUseLimit' │
│ 31 │ 'Auth.Password.ShouldChangePasswordAfterFirstLogin' │ 'Auth.Password.ShouldChangePasswordAfterFirstLogin' │
│ 32 │ 'GlobalExecutionSettings' │ 'GlobalExecutionSettings' │
│ 33 │ 'AttendedRobot.RunDisconnectedHours' │ 'AttendedRobot.RunDisconnectedHours' │
│ 34 │ 'Scalability.SignalR.Enabled' │ 'Scalability.SignalR.Enabled' │
│ 35 │ 'Scalability.SignalR.Transport' │ 'Scalability.SignalR.Transport' │
│ 36 │ 'Features.ModernFolders.Enabled' │ 'Features.ModernFolders.Enabled' │
└─────────┴─────────────────────────────────────────────────────────┴─────────────────────────────────────────────────────────┘
いまはAPIを使用しているユーザのフォルダ情報となっているが
ユーザ一覧を取得、ユーザごとのフォルダ一覧を取得
それを出力する、仕様に変更する。
Organization Unitが有効になっている場合は、Headerに、
'X-UIPATH-OrganizationUnitId': 1
をつけないといけない件。。
たとえば、ロボット一覧での
・名前左の、緑・赤(多分これはマシンのステータス)
・右部のステータス(利用可、ビジー 、切断、応答なし)、これはマシンのステータスと思われる
https://docs.uipath.com/orchestrator/lang-ja/v2019/docs/fields-descriptions-robots
・Type横のオレンジと緑(ロボットのライセンス状態(Studio/Attendedのみか)
https://[server]/odata/Sessions?$top=10&$expand=Robot($expand=License) でとれそう
とか、
#30 とか。
とか。
トランザクションからQueueItemを取ろうとしたら
POST https://[xx]/odata/Queues/UiPathODataSvc.StartTransaction HTTP/1.1
Authorization: UiRobot xxxxxxxxx
Accept: application/json
X-UIPATH-Localization: ja
Content-Type: application/json; charset=utf-8
Content-Length: 122
Expect: 100-continue
{
"transactionData": {
"Name": "mailQueue",
"RobotIdentifier": "xxxxx"
}
}
RobotIdentifier が必要だとわかり、、、。
releaseのEnvironmentNameは取得できるので、そのロボット数をカウントして0以上かを返せばいい。
utils.ts の function createCsvArrays(headings: string[], instances: any[]) メソッドが、CSVのためにObjectをstringifyしているが、そのせいでDateも文字になっちゃっていた
Stringifyしてフラットにするか、しないかをフラグで判定できるようにしたい
対応の〇×表があった方がいい
いまのところ、FolderのIDを指定して認証してデータ取得できるようにはしてあるが、
「そのユーザが属しているフォルダのデータをとってきて、データ取得」とかやりたい
ExcelテンプレにもRobot/Releaseを追加する
概要シートをつけて、取り得る値を記載しておけばなお親切
get /api/DirectoryService/SearchForUsersAndGroups
get /api/DirectoryService/GetDomains
get /api/DirectoryService/GetDirectoryPermissions
あたり
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.