windmill-client 0.3.15 → 1.145.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.js +1 -1
- package/dist/core/OpenAPI.js +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -1
- package/dist/models/AuditLog.d.ts +72 -2
- package/dist/models/AuditLog.js +71 -1
- package/dist/models/CompletedJob.d.ts +6 -2
- package/dist/models/CompletedJob.js +5 -1
- package/dist/models/FlowMetadata.d.ts +1 -0
- package/dist/models/FlowModule.d.ts +1 -0
- package/dist/models/FlowModuleValue.d.ts +1 -2
- package/dist/models/FlowPreview.d.ts +1 -0
- package/dist/models/Http.d.ts +6 -1
- package/dist/models/Http.js +8 -0
- package/dist/models/Input.d.ts +1 -0
- package/dist/models/InstanceGroup.d.ts +4 -0
- package/dist/{src/models/AccountId.js → models/InstanceGroup.js} +2 -1
- package/dist/models/NewScript.d.ts +7 -0
- package/dist/models/NewScript.js +5 -0
- package/dist/models/OpenFlowWPath.d.ts +1 -0
- package/dist/models/Preview.d.ts +5 -0
- package/dist/models/Preview.js +5 -0
- package/dist/models/QueuedJob.d.ts +6 -2
- package/dist/models/QueuedJob.js +5 -1
- package/dist/models/RawScript.d.ts +7 -0
- package/dist/models/RawScript.js +5 -0
- package/dist/models/Script.d.ts +7 -0
- package/dist/models/Script.js +5 -0
- package/dist/models/WorkerPing.d.ts +1 -0
- package/dist/services/GroupService.d.ts +15 -0
- package/dist/services/GroupService.js +25 -0
- package/dist/services/JobService.d.ts +2 -2
- package/dist/services/JobService.js +2 -2
- package/dist/services/OauthService.d.ts +5 -2
- package/dist/services/OauthService.js +1 -1
- package/dist/services/ScheduleService.d.ts +6 -1
- package/dist/services/ScheduleService.js +3 -1
- package/dist/services/UserService.d.ts +6 -0
- package/dist/services/UserService.js +11 -0
- package/dist/services/WorkspaceService.d.ts +38 -0
- package/dist/services/WorkspaceService.js +46 -0
- package/package.json +1 -1
- package/dist/src/client.d.ts +0 -77
- package/dist/src/client.js +0 -301
- package/dist/src/core/ApiError.d.ts +0 -10
- package/dist/src/core/ApiError.js +0 -11
- package/dist/src/core/ApiRequestOptions.d.ts +0 -13
- package/dist/src/core/ApiRequestOptions.js +0 -1
- package/dist/src/core/ApiResult.d.ts +0 -7
- package/dist/src/core/ApiResult.js +0 -1
- package/dist/src/core/CancelablePromise.d.ts +0 -20
- package/dist/src/core/CancelablePromise.js +0 -108
- package/dist/src/core/OpenAPI.d.ts +0 -16
- package/dist/src/core/OpenAPI.js +0 -11
- package/dist/src/core/request.d.ts +0 -30
- package/dist/src/core/request.js +0 -274
- package/dist/src/index.d.ts +0 -143
- package/dist/src/index.js +0 -46
- package/dist/src/models/AccountId.d.ts +0 -1
- package/dist/src/models/ActionKind.d.ts +0 -9
- package/dist/src/models/ActionKind.js +0 -14
- package/dist/src/models/After.d.ts +0 -4
- package/dist/src/models/After.js +0 -5
- package/dist/src/models/AppWithLastVersion.d.ts +0 -21
- package/dist/src/models/AppWithLastVersion.js +0 -13
- package/dist/src/models/AppWithLastVersionWDraft.d.ts +0 -5
- package/dist/src/models/AppWithLastVersionWDraft.js +0 -5
- package/dist/src/models/ArgsFilter.d.ts +0 -4
- package/dist/src/models/ArgsFilter.js +0 -5
- package/dist/src/models/AuditLog.d.ts +0 -32
- package/dist/src/models/AuditLog.js +0 -30
- package/dist/src/models/Before.d.ts +0 -4
- package/dist/src/models/Before.js +0 -5
- package/dist/src/models/BranchAll.d.ts +0 -10
- package/dist/src/models/BranchAll.js +0 -5
- package/dist/src/models/BranchOne.d.ts +0 -10
- package/dist/src/models/BranchOne.js +0 -5
- package/dist/src/models/ClientName.d.ts +0 -1
- package/dist/src/models/ClientName.js +0 -5
- package/dist/src/models/CompletedJob.d.ts +0 -61
- package/dist/src/models/CompletedJob.js +0 -28
- package/dist/src/models/ContextualVariable.d.ts +0 -5
- package/dist/src/models/ContextualVariable.js +0 -5
- package/dist/src/models/CreateInput.d.ts +0 -4
- package/dist/src/models/CreateInput.js +0 -5
- package/dist/src/models/CreateResource.d.ts +0 -6
- package/dist/src/models/CreateResource.js +0 -5
- package/dist/src/models/CreateVariable.d.ts +0 -8
- package/dist/src/models/CreateVariable.js +0 -5
- package/dist/src/models/CreateWorkspace.d.ts +0 -5
- package/dist/src/models/CreateWorkspace.js +0 -5
- package/dist/src/models/CreatedBy.d.ts +0 -4
- package/dist/src/models/CreatedBy.js +0 -5
- package/dist/src/models/EditResource.d.ts +0 -5
- package/dist/src/models/EditResource.js +0 -5
- package/dist/src/models/EditResourceType.d.ts +0 -4
- package/dist/src/models/EditResourceType.js +0 -5
- package/dist/src/models/EditSchedule.d.ts +0 -7
- package/dist/src/models/EditSchedule.js +0 -5
- package/dist/src/models/EditVariable.d.ts +0 -6
- package/dist/src/models/EditVariable.js +0 -5
- package/dist/src/models/EditWorkspaceUser.d.ts +0 -5
- package/dist/src/models/EditWorkspaceUser.js +0 -5
- package/dist/src/models/Flow.d.ts +0 -3
- package/dist/src/models/Flow.js +0 -5
- package/dist/src/models/FlowMetadata.d.ts +0 -11
- package/dist/src/models/FlowMetadata.js +0 -5
- package/dist/src/models/FlowModule.d.ts +0 -26
- package/dist/src/models/FlowModule.js +0 -5
- package/dist/src/models/FlowModuleValue.d.ts +0 -10
- package/dist/src/models/FlowModuleValue.js +0 -5
- package/dist/src/models/FlowPreview.d.ts +0 -7
- package/dist/src/models/FlowPreview.js +0 -5
- package/dist/src/models/FlowStatus.d.ts +0 -12
- package/dist/src/models/FlowStatus.js +0 -5
- package/dist/src/models/FlowStatusModule.d.ts +0 -34
- package/dist/src/models/FlowStatusModule.js +0 -16
- package/dist/src/models/FlowValue.d.ts +0 -6
- package/dist/src/models/FlowValue.js +0 -5
- package/dist/src/models/Folder.d.ts +0 -5
- package/dist/src/models/Folder.js +0 -5
- package/dist/src/models/ForloopFlow.d.ts +0 -9
- package/dist/src/models/ForloopFlow.js +0 -5
- package/dist/src/models/GlobalUserInfo.d.ts +0 -14
- package/dist/src/models/GlobalUserInfo.js +0 -12
- package/dist/src/models/Graphql.d.ts +0 -3
- package/dist/src/models/Graphql.js +0 -5
- package/dist/src/models/Group.d.ts +0 -6
- package/dist/src/models/Group.js +0 -5
- package/dist/src/models/Http.d.ts +0 -3
- package/dist/src/models/Http.js +0 -5
- package/dist/src/models/Identity.d.ts +0 -4
- package/dist/src/models/Identity.js +0 -5
- package/dist/src/models/IncludeHeader.d.ts +0 -6
- package/dist/src/models/IncludeHeader.js +0 -5
- package/dist/src/models/Input.d.ts +0 -8
- package/dist/src/models/Input.js +0 -5
- package/dist/src/models/InputId.d.ts +0 -1
- package/dist/src/models/InputId.js +0 -5
- package/dist/src/models/InputTransform.d.ts +0 -3
- package/dist/src/models/InputTransform.js +0 -5
- package/dist/src/models/JavascriptTransform.d.ts +0 -4
- package/dist/src/models/JavascriptTransform.js +0 -5
- package/dist/src/models/Job.d.ts +0 -11
- package/dist/src/models/Job.js +0 -12
- package/dist/src/models/JobId.d.ts +0 -1
- package/dist/src/models/JobId.js +0 -5
- package/dist/src/models/JobKinds.d.ts +0 -4
- package/dist/src/models/JobKinds.js +0 -5
- package/dist/src/models/ListableApp.d.ts +0 -18
- package/dist/src/models/ListableApp.js +0 -13
- package/dist/src/models/ListableRawApp.d.ts +0 -9
- package/dist/src/models/ListableRawApp.js +0 -5
- package/dist/src/models/ListableResource.d.ts +0 -14
- package/dist/src/models/ListableResource.js +0 -5
- package/dist/src/models/ListableVariable.d.ts +0 -14
- package/dist/src/models/ListableVariable.js +0 -5
- package/dist/src/models/Login.d.ts +0 -4
- package/dist/src/models/Login.js +0 -5
- package/dist/src/models/MainArgSignature.d.ts +0 -33
- package/dist/src/models/MainArgSignature.js +0 -12
- package/dist/src/models/Name.d.ts +0 -1
- package/dist/src/models/Name.js +0 -5
- package/dist/src/models/NewJobId.d.ts +0 -4
- package/dist/src/models/NewJobId.js +0 -5
- package/dist/src/models/NewSchedule.d.ts +0 -11
- package/dist/src/models/NewSchedule.js +0 -5
- package/dist/src/models/NewScript.d.ts +0 -33
- package/dist/src/models/NewScript.js +0 -25
- package/dist/src/models/NewScriptWithDraft.d.ts +0 -5
- package/dist/src/models/NewScriptWithDraft.js +0 -5
- package/dist/src/models/NewToken.d.ts +0 -5
- package/dist/src/models/NewToken.js +0 -5
- package/dist/src/models/NewTokenImpersonate.d.ts +0 -5
- package/dist/src/models/NewTokenImpersonate.js +0 -5
- package/dist/src/models/NewUser.d.ts +0 -5
- package/dist/src/models/NewUser.js +0 -5
- package/dist/src/models/OpenFlow.d.ts +0 -7
- package/dist/src/models/OpenFlow.js +0 -5
- package/dist/src/models/OpenFlowWPath.d.ts +0 -4
- package/dist/src/models/OpenFlowWPath.js +0 -5
- package/dist/src/models/Operation.d.ts +0 -4
- package/dist/src/models/Operation.js +0 -5
- package/dist/src/models/OrderDesc.d.ts +0 -4
- package/dist/src/models/OrderDesc.js +0 -5
- package/dist/src/models/Page.d.ts +0 -4
- package/dist/src/models/Page.js +0 -5
- package/dist/src/models/ParentJob.d.ts +0 -4
- package/dist/src/models/ParentJob.js +0 -5
- package/dist/src/models/Path.d.ts +0 -1
- package/dist/src/models/Path.js +0 -5
- package/dist/src/models/PathFlow.d.ts +0 -6
- package/dist/src/models/PathFlow.js +0 -5
- package/dist/src/models/PathId.d.ts +0 -1
- package/dist/src/models/PathId.js +0 -5
- package/dist/src/models/PathScript.d.ts +0 -7
- package/dist/src/models/PathScript.js +0 -5
- package/dist/src/models/Payload.d.ts +0 -6
- package/dist/src/models/Payload.js +0 -5
- package/dist/src/models/PerPage.d.ts +0 -4
- package/dist/src/models/PerPage.js +0 -5
- package/dist/src/models/Policy.d.ts +0 -13
- package/dist/src/models/Policy.js +0 -13
- package/dist/src/models/Preview.d.ts +0 -25
- package/dist/src/models/Preview.js +0 -23
- package/dist/src/models/QueueLimit.d.ts +0 -5
- package/dist/src/models/QueueLimit.js +0 -5
- package/dist/src/models/QueuedJob.d.ts +0 -59
- package/dist/src/models/QueuedJob.js +0 -28
- package/dist/src/models/RawScript.d.ts +0 -20
- package/dist/src/models/RawScript.js +0 -16
- package/dist/src/models/Resource.d.ts +0 -9
- package/dist/src/models/Resource.js +0 -5
- package/dist/src/models/ResourceName.d.ts +0 -4
- package/dist/src/models/ResourceName.js +0 -5
- package/dist/src/models/ResourceType.d.ts +0 -6
- package/dist/src/models/ResourceType.js +0 -5
- package/dist/src/models/ResultFilter.d.ts +0 -4
- package/dist/src/models/ResultFilter.js +0 -5
- package/dist/src/models/Retry.d.ts +0 -11
- package/dist/src/models/Retry.js +0 -5
- package/dist/src/models/RunnableId.d.ts +0 -1
- package/dist/src/models/RunnableId.js +0 -5
- package/dist/src/models/RunnableType.d.ts +0 -5
- package/dist/src/models/RunnableType.js +0 -10
- package/dist/src/models/RunnableTypeQuery.d.ts +0 -2
- package/dist/src/models/RunnableTypeQuery.js +0 -5
- package/dist/src/models/Running.d.ts +0 -4
- package/dist/src/models/Running.js +0 -5
- package/dist/src/models/Schedule.d.ts +0 -16
- package/dist/src/models/Schedule.js +0 -5
- package/dist/src/models/SchedulePath.d.ts +0 -4
- package/dist/src/models/SchedulePath.js +0 -5
- package/dist/src/models/ScheduleWJobs.d.ts +0 -8
- package/dist/src/models/ScheduleWJobs.js +0 -5
- package/dist/src/models/Script.d.ts +0 -47
- package/dist/src/models/Script.js +0 -25
- package/dist/src/models/ScriptArgs.d.ts +0 -1
- package/dist/src/models/ScriptArgs.js +0 -5
- package/dist/src/models/ScriptExactHash.d.ts +0 -4
- package/dist/src/models/ScriptExactHash.js +0 -5
- package/dist/src/models/ScriptExactPath.d.ts +0 -4
- package/dist/src/models/ScriptExactPath.js +0 -5
- package/dist/src/models/ScriptHash.d.ts +0 -1
- package/dist/src/models/ScriptHash.js +0 -5
- package/dist/src/models/ScriptPath.d.ts +0 -1
- package/dist/src/models/ScriptPath.js +0 -5
- package/dist/src/models/ScriptStartPath.d.ts +0 -4
- package/dist/src/models/ScriptStartPath.js +0 -5
- package/dist/src/models/SlackToken.d.ts +0 -8
- package/dist/src/models/SlackToken.js +0 -5
- package/dist/src/models/StartedAfter.d.ts +0 -4
- package/dist/src/models/StartedAfter.js +0 -5
- package/dist/src/models/StartedBefore.d.ts +0 -4
- package/dist/src/models/StartedBefore.js +0 -5
- package/dist/src/models/StaticTransform.d.ts +0 -4
- package/dist/src/models/StaticTransform.js +0 -5
- package/dist/src/models/Success.d.ts +0 -4
- package/dist/src/models/Success.js +0 -5
- package/dist/src/models/Suspended.d.ts +0 -4
- package/dist/src/models/Suspended.js +0 -5
- package/dist/src/models/Tag.d.ts +0 -4
- package/dist/src/models/Tag.js +0 -5
- package/dist/src/models/Token.d.ts +0 -1
- package/dist/src/models/Token.js +0 -5
- package/dist/src/models/TokenResponse.d.ts +0 -6
- package/dist/src/models/TokenResponse.js +0 -5
- package/dist/src/models/TruncatedToken.d.ts +0 -8
- package/dist/src/models/TruncatedToken.js +0 -5
- package/dist/src/models/UpdateInput.d.ts +0 -5
- package/dist/src/models/UpdateInput.js +0 -5
- package/dist/src/models/Usage.d.ts +0 -3
- package/dist/src/models/Usage.js +0 -5
- package/dist/src/models/User.d.ts +0 -14
- package/dist/src/models/User.js +0 -5
- package/dist/src/models/UserWorkspaceList.d.ts +0 -8
- package/dist/src/models/UserWorkspaceList.js +0 -5
- package/dist/src/models/Username.d.ts +0 -4
- package/dist/src/models/Username.js +0 -5
- package/dist/src/models/VersionId.d.ts +0 -1
- package/dist/src/models/VersionId.js +0 -5
- package/dist/src/models/WorkerPing.d.ts +0 -8
- package/dist/src/models/WorkerPing.js +0 -5
- package/dist/src/models/Workspace.d.ts +0 -6
- package/dist/src/models/Workspace.js +0 -5
- package/dist/src/models/WorkspaceId.d.ts +0 -1
- package/dist/src/models/WorkspaceId.js +0 -5
- package/dist/src/models/WorkspaceInvite.d.ts +0 -6
- package/dist/src/models/WorkspaceInvite.js +0 -5
- package/dist/src/services/AdminService.d.ts +0 -39
- package/dist/src/services/AdminService.js +0 -52
- package/dist/src/services/AppService.d.ts +0 -195
- package/dist/src/services/AppService.js +0 -207
- package/dist/src/services/AuditService.d.ts +0 -53
- package/dist/src/services/AuditService.js +0 -43
- package/dist/src/services/CaptureService.d.ts +0 -30
- package/dist/src/services/CaptureService.js +0 -52
- package/dist/src/services/DraftService.d.ts +0 -26
- package/dist/src/services/DraftService.js +0 -36
- package/dist/src/services/FavoriteService.d.ts +0 -27
- package/dist/src/services/FavoriteService.js +0 -36
- package/dist/src/services/FlowService.d.ts +0 -186
- package/dist/src/services/FlowService.js +0 -196
- package/dist/src/services/FolderService.d.ts +0 -128
- package/dist/src/services/FolderService.js +0 -151
- package/dist/src/services/GranularAclService.d.ts +0 -46
- package/dist/src/services/GranularAclService.js +0 -56
- package/dist/src/services/GroupService.d.ts +0 -110
- package/dist/src/services/GroupService.js +0 -136
- package/dist/src/services/InputService.d.ts +0 -78
- package/dist/src/services/InputService.js +0 -95
- package/dist/src/services/JobService.d.ts +0 -761
- package/dist/src/services/JobService.js +0 -646
- package/dist/src/services/OauthService.d.ts +0 -95
- package/dist/src/services/OauthService.js +0 -120
- package/dist/src/services/RawAppService.d.ts +0 -103
- package/dist/src/services/RawAppService.js +0 -106
- package/dist/src/services/ResourceService.d.ts +0 -178
- package/dist/src/services/ResourceService.js +0 -243
- package/dist/src/services/ScheduleService.d.ts +0 -120
- package/dist/src/services/ScheduleService.js +0 -148
- package/dist/src/services/ScriptService.d.ts +0 -258
- package/dist/src/services/ScriptService.js +0 -283
- package/dist/src/services/SettingsService.d.ts +0 -27
- package/dist/src/services/SettingsService.js +0 -48
- package/dist/src/services/UserService.d.ts +0 -306
- package/dist/src/services/UserService.js +0 -397
- package/dist/src/services/VariableService.d.ts +0 -95
- package/dist/src/services/VariableService.js +0 -135
- package/dist/src/services/WorkerService.d.ts +0 -25
- package/dist/src/services/WorkerService.js +0 -30
- package/dist/src/services/WorkspaceService.d.ts +0 -249
- package/dist/src/services/WorkspaceService.js +0 -301
|
@@ -586,7 +586,7 @@ class JobService {
|
|
|
586
586
|
}
|
|
587
587
|
/**
|
|
588
588
|
* cancel a job for a suspended flow
|
|
589
|
-
* @returns string job
|
|
589
|
+
* @returns string job canceled
|
|
590
590
|
* @throws ApiError
|
|
591
591
|
*/
|
|
592
592
|
static cancelSuspendedJobGet({ workspace, id, resumeId, signature, approver, }) {
|
|
@@ -606,7 +606,7 @@ class JobService {
|
|
|
606
606
|
}
|
|
607
607
|
/**
|
|
608
608
|
* cancel a job for a suspended flow
|
|
609
|
-
* @returns string job
|
|
609
|
+
* @returns string job canceled
|
|
610
610
|
* @throws ApiError
|
|
611
611
|
*/
|
|
612
612
|
static cancelSuspendedJobPost({ workspace, id, resumeId, signature, requestBody, approver, }) {
|
|
@@ -82,10 +82,13 @@ export declare class OauthService {
|
|
|
82
82
|
}): CancelablePromise<string>;
|
|
83
83
|
/**
|
|
84
84
|
* list oauth logins
|
|
85
|
-
* @returns
|
|
85
|
+
* @returns any list of oauth and saml login clients
|
|
86
86
|
* @throws ApiError
|
|
87
87
|
*/
|
|
88
|
-
static listOAuthLogins(): CancelablePromise<
|
|
88
|
+
static listOAuthLogins(): CancelablePromise<{
|
|
89
|
+
oauth: Array<string>;
|
|
90
|
+
saml?: string;
|
|
91
|
+
}>;
|
|
89
92
|
/**
|
|
90
93
|
* list oauth connects
|
|
91
94
|
* @returns any list of oauth connects clients
|
|
@@ -90,7 +90,7 @@ export declare class ScheduleService {
|
|
|
90
90
|
* @returns Schedule schedule list
|
|
91
91
|
* @throws ApiError
|
|
92
92
|
*/
|
|
93
|
-
static listSchedules({ workspace, page, perPage, }: {
|
|
93
|
+
static listSchedules({ workspace, page, perPage, path, isFlow, }: {
|
|
94
94
|
workspace: string;
|
|
95
95
|
/**
|
|
96
96
|
* which page to return (start at 1, default 1)
|
|
@@ -100,6 +100,11 @@ export declare class ScheduleService {
|
|
|
100
100
|
* number of items to return for a given page (default 30, max 100)
|
|
101
101
|
*/
|
|
102
102
|
perPage?: number;
|
|
103
|
+
/**
|
|
104
|
+
* filter by path
|
|
105
|
+
*/
|
|
106
|
+
path?: string;
|
|
107
|
+
isFlow?: boolean;
|
|
103
108
|
}): CancelablePromise<Array<Schedule>>;
|
|
104
109
|
/**
|
|
105
110
|
* list schedules with last 20 jobs
|
|
@@ -117,7 +117,7 @@ class ScheduleService {
|
|
|
117
117
|
* @returns Schedule schedule list
|
|
118
118
|
* @throws ApiError
|
|
119
119
|
*/
|
|
120
|
-
static listSchedules({ workspace, page, perPage, }) {
|
|
120
|
+
static listSchedules({ workspace, page, perPage, path, isFlow, }) {
|
|
121
121
|
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
122
122
|
method: 'GET',
|
|
123
123
|
url: '/w/{workspace}/schedules/list',
|
|
@@ -127,6 +127,8 @@ class ScheduleService {
|
|
|
127
127
|
query: {
|
|
128
128
|
'page': page,
|
|
129
129
|
'per_page': perPage,
|
|
130
|
+
'path': path,
|
|
131
|
+
'is_flow': isFlow,
|
|
130
132
|
},
|
|
131
133
|
});
|
|
132
134
|
}
|
|
@@ -128,6 +128,12 @@ export declare class UserService {
|
|
|
128
128
|
* @throws ApiError
|
|
129
129
|
*/
|
|
130
130
|
static getCurrentEmail(): CancelablePromise<string>;
|
|
131
|
+
/**
|
|
132
|
+
* refresh the current token
|
|
133
|
+
* @returns string free usage
|
|
134
|
+
* @throws ApiError
|
|
135
|
+
*/
|
|
136
|
+
static refreshUserToken(): CancelablePromise<string>;
|
|
131
137
|
/**
|
|
132
138
|
* get current usage outside of premium workspaces
|
|
133
139
|
* @returns number free usage
|
|
@@ -159,6 +159,17 @@ class UserService {
|
|
|
159
159
|
url: '/users/email',
|
|
160
160
|
});
|
|
161
161
|
}
|
|
162
|
+
/**
|
|
163
|
+
* refresh the current token
|
|
164
|
+
* @returns string free usage
|
|
165
|
+
* @throws ApiError
|
|
166
|
+
*/
|
|
167
|
+
static refreshUserToken() {
|
|
168
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
169
|
+
method: 'GET',
|
|
170
|
+
url: '/users/refresh_token',
|
|
171
|
+
});
|
|
172
|
+
}
|
|
162
173
|
/**
|
|
163
174
|
* get current usage outside of premium workspaces
|
|
164
175
|
* @returns number free usage
|
|
@@ -171,6 +171,8 @@ export declare class WorkspaceService {
|
|
|
171
171
|
customer_id?: string;
|
|
172
172
|
webhook?: string;
|
|
173
173
|
deploy_to?: string;
|
|
174
|
+
openai_resource_path?: string;
|
|
175
|
+
error_handler?: string;
|
|
174
176
|
}>;
|
|
175
177
|
/**
|
|
176
178
|
* get deploy to
|
|
@@ -246,4 +248,40 @@ export declare class WorkspaceService {
|
|
|
246
248
|
webhook?: string;
|
|
247
249
|
};
|
|
248
250
|
}): CancelablePromise<string>;
|
|
251
|
+
/**
|
|
252
|
+
* edit OpenAI resource path
|
|
253
|
+
* @returns string status
|
|
254
|
+
* @throws ApiError
|
|
255
|
+
*/
|
|
256
|
+
static editOpenaiResourcePath({ workspace, requestBody, }: {
|
|
257
|
+
workspace: string;
|
|
258
|
+
/**
|
|
259
|
+
* WorkspaceOpenaiResourcePath
|
|
260
|
+
*/
|
|
261
|
+
requestBody: {
|
|
262
|
+
openai_resource_path?: string;
|
|
263
|
+
};
|
|
264
|
+
}): CancelablePromise<string>;
|
|
265
|
+
/**
|
|
266
|
+
* OpenAI resource path exists
|
|
267
|
+
* @returns boolean status
|
|
268
|
+
* @throws ApiError
|
|
269
|
+
*/
|
|
270
|
+
static existsOpenaiResourcePath({ workspace, }: {
|
|
271
|
+
workspace: string;
|
|
272
|
+
}): CancelablePromise<boolean>;
|
|
273
|
+
/**
|
|
274
|
+
* edit error handler
|
|
275
|
+
* @returns string status
|
|
276
|
+
* @throws ApiError
|
|
277
|
+
*/
|
|
278
|
+
static editErrorHandler({ workspace, requestBody, }: {
|
|
279
|
+
workspace: string;
|
|
280
|
+
/**
|
|
281
|
+
* WorkspaceErrorHandler
|
|
282
|
+
*/
|
|
283
|
+
requestBody: {
|
|
284
|
+
error_handler?: string;
|
|
285
|
+
};
|
|
286
|
+
}): CancelablePromise<string>;
|
|
249
287
|
}
|
|
@@ -301,5 +301,51 @@ class WorkspaceService {
|
|
|
301
301
|
mediaType: 'application/json',
|
|
302
302
|
});
|
|
303
303
|
}
|
|
304
|
+
/**
|
|
305
|
+
* edit OpenAI resource path
|
|
306
|
+
* @returns string status
|
|
307
|
+
* @throws ApiError
|
|
308
|
+
*/
|
|
309
|
+
static editOpenaiResourcePath({ workspace, requestBody, }) {
|
|
310
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
311
|
+
method: 'POST',
|
|
312
|
+
url: '/w/{workspace}/workspaces/edit_openai_resource_path',
|
|
313
|
+
path: {
|
|
314
|
+
'workspace': workspace,
|
|
315
|
+
},
|
|
316
|
+
body: requestBody,
|
|
317
|
+
mediaType: 'application/json',
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* OpenAI resource path exists
|
|
322
|
+
* @returns boolean status
|
|
323
|
+
* @throws ApiError
|
|
324
|
+
*/
|
|
325
|
+
static existsOpenaiResourcePath({ workspace, }) {
|
|
326
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
327
|
+
method: 'GET',
|
|
328
|
+
url: '/w/{workspace}/workspaces/exists_openai_resource_path',
|
|
329
|
+
path: {
|
|
330
|
+
'workspace': workspace,
|
|
331
|
+
},
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* edit error handler
|
|
336
|
+
* @returns string status
|
|
337
|
+
* @throws ApiError
|
|
338
|
+
*/
|
|
339
|
+
static editErrorHandler({ workspace, requestBody, }) {
|
|
340
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
341
|
+
method: 'POST',
|
|
342
|
+
url: '/w/{workspace}/workspaces/edit_error_handler',
|
|
343
|
+
path: {
|
|
344
|
+
'workspace': workspace,
|
|
345
|
+
},
|
|
346
|
+
body: requestBody,
|
|
347
|
+
mediaType: 'application/json',
|
|
348
|
+
});
|
|
349
|
+
}
|
|
304
350
|
}
|
|
305
351
|
exports.WorkspaceService = WorkspaceService;
|
package/package.json
CHANGED
package/dist/src/client.d.ts
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
export { AdminService, AuditService, FlowService, GranularAclService, GroupService, JobService, ResourceService, VariableService, ScriptService, ScheduleService, SettingsService, UserService, WorkspaceService, } from "./index";
|
|
2
|
-
export type Sql = string;
|
|
3
|
-
export type Email = string;
|
|
4
|
-
export type Base64 = string;
|
|
5
|
-
export type Resource<S extends string> = any;
|
|
6
|
-
export declare const SHARED_FOLDER = "/shared";
|
|
7
|
-
export declare function setClient(token?: string, baseUrl?: string): void;
|
|
8
|
-
/**
|
|
9
|
-
* Create a client configuration from env variables
|
|
10
|
-
* @returns client configuration
|
|
11
|
-
*/
|
|
12
|
-
export declare function getWorkspace(): string;
|
|
13
|
-
/**
|
|
14
|
-
* Get a resource value by path
|
|
15
|
-
* @param path path of the resource, default to internal state path
|
|
16
|
-
* @param undefinedIfEmpty if the resource does not exist, return undefined instead of throwing an error
|
|
17
|
-
* @returns resource value
|
|
18
|
-
*/
|
|
19
|
-
export declare function getResource(path?: string, undefinedIfEmpty?: boolean): Promise<any>;
|
|
20
|
-
/**
|
|
21
|
-
* Resolve a resource value in case the default value was picked because the input payload was undefined
|
|
22
|
-
* @param obj resource value or path of the resource under the format `$res:path`
|
|
23
|
-
* @returns resource value
|
|
24
|
-
*/
|
|
25
|
-
export declare function resolveDefaultResource(obj: any): Promise<any>;
|
|
26
|
-
/**
|
|
27
|
-
* Get the full resource value by path
|
|
28
|
-
* @param path path of the resource, default to internal state path
|
|
29
|
-
* @param undefinedIfEmpty if the resource does not exist, return undefined instead of throwing an error
|
|
30
|
-
* @returns full resource
|
|
31
|
-
*/
|
|
32
|
-
export declare function getFullResource(path?: string, undefinedIfEmpty?: boolean): Promise<any>;
|
|
33
|
-
export declare function getStatePath(): string;
|
|
34
|
-
/**
|
|
35
|
-
* Set a resource value by path
|
|
36
|
-
* @param path path of the resource to set, default to state path
|
|
37
|
-
* @param value new value of the resource to set
|
|
38
|
-
* @param initializeToTypeIfNotExist if the resource does not exist, initialize it with this type
|
|
39
|
-
*/
|
|
40
|
-
export declare function setResource(value: any, path?: string, initializeToTypeIfNotExist?: string): Promise<void>;
|
|
41
|
-
/**
|
|
42
|
-
* Set the state
|
|
43
|
-
* @param state state to set
|
|
44
|
-
* @deprecated use setState instead
|
|
45
|
-
*/
|
|
46
|
-
export declare function setInternalState(state: any): Promise<void>;
|
|
47
|
-
/**
|
|
48
|
-
* Set the state
|
|
49
|
-
* @param state state to set
|
|
50
|
-
*/
|
|
51
|
-
export declare function setState(state: any): Promise<void>;
|
|
52
|
-
/**
|
|
53
|
-
* Get the internal state
|
|
54
|
-
* @deprecated use getState instead
|
|
55
|
-
*/
|
|
56
|
-
export declare function getInternalState(): Promise<any>;
|
|
57
|
-
/**
|
|
58
|
-
* Get the state shared across executions
|
|
59
|
-
*/
|
|
60
|
-
export declare function getState(): Promise<any>;
|
|
61
|
-
/**
|
|
62
|
-
* Get a variable by path
|
|
63
|
-
* @param path path of the variable
|
|
64
|
-
* @returns variable value
|
|
65
|
-
*/
|
|
66
|
-
export declare function getVariable(path: string): Promise<string | undefined>;
|
|
67
|
-
/**
|
|
68
|
-
* Set a variable by path, create if not exist
|
|
69
|
-
* @param path path of the variable
|
|
70
|
-
* @param value value of the variable
|
|
71
|
-
* @param isSecretIfNotExist if the variable does not exist, create it as secret or not (default: false)
|
|
72
|
-
* @param descriptionIfNotExist if the variable does not exist, create it with this description (default: "")
|
|
73
|
-
*/
|
|
74
|
-
export declare function setVariable(path: string, value: string, isSecretIfNotExist?: boolean, descriptionIfNotExist?: string): Promise<void>;
|
|
75
|
-
export declare function databaseUrlFromResource(path: string): Promise<string>;
|
|
76
|
-
export declare function base64ToUint8Array(data: string): Uint8Array;
|
|
77
|
-
export declare function uint8ArrayToBase64(arrayBuffer: Uint8Array): string;
|
package/dist/src/client.js
DELETED
|
@@ -1,301 +0,0 @@
|
|
|
1
|
-
import { ResourceService, VariableService } from "./index.js";
|
|
2
|
-
import { OpenAPI } from "./index.js";
|
|
3
|
-
export { AdminService, AuditService, FlowService, GranularAclService, GroupService, JobService, ResourceService, VariableService, ScriptService, ScheduleService, SettingsService, UserService, WorkspaceService, } from "./index.js";
|
|
4
|
-
export const SHARED_FOLDER = "/shared";
|
|
5
|
-
export function setClient(token, baseUrl) {
|
|
6
|
-
if (baseUrl === undefined) {
|
|
7
|
-
baseUrl =
|
|
8
|
-
getEnv("BASE_INTERNAL_URL") ??
|
|
9
|
-
getEnv("BASE_URL") ??
|
|
10
|
-
"http://localhost:8000";
|
|
11
|
-
}
|
|
12
|
-
if (token === undefined) {
|
|
13
|
-
token = getEnv("WM_TOKEN") ?? "no_token";
|
|
14
|
-
}
|
|
15
|
-
OpenAPI.WITH_CREDENTIALS = true;
|
|
16
|
-
OpenAPI.TOKEN = token;
|
|
17
|
-
OpenAPI.BASE = baseUrl + "/api";
|
|
18
|
-
}
|
|
19
|
-
const getEnv = (key) => {
|
|
20
|
-
if (typeof window === "undefined") {
|
|
21
|
-
// node
|
|
22
|
-
return process.env[key];
|
|
23
|
-
}
|
|
24
|
-
// browser
|
|
25
|
-
return window.process.env[key];
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* Create a client configuration from env variables
|
|
29
|
-
* @returns client configuration
|
|
30
|
-
*/
|
|
31
|
-
export function getWorkspace() {
|
|
32
|
-
return getEnv("WM_WORKSPACE") ?? "no_workspace";
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Get a resource value by path
|
|
36
|
-
* @param path path of the resource, default to internal state path
|
|
37
|
-
* @param undefinedIfEmpty if the resource does not exist, return undefined instead of throwing an error
|
|
38
|
-
* @returns resource value
|
|
39
|
-
*/
|
|
40
|
-
export async function getResource(path, undefinedIfEmpty) {
|
|
41
|
-
const workspace = getWorkspace();
|
|
42
|
-
path = path ?? getStatePath();
|
|
43
|
-
try {
|
|
44
|
-
const resource = await ResourceService.getResource({ workspace, path });
|
|
45
|
-
return await _transformLeaf(resource.value);
|
|
46
|
-
}
|
|
47
|
-
catch (e) {
|
|
48
|
-
if (undefinedIfEmpty && e.status === 404) {
|
|
49
|
-
return undefined;
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
throw Error(`Resource not found at ${path} or not visible to you`);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Resolve a resource value in case the default value was picked because the input payload was undefined
|
|
58
|
-
* @param obj resource value or path of the resource under the format `$res:path`
|
|
59
|
-
* @returns resource value
|
|
60
|
-
*/
|
|
61
|
-
export async function resolveDefaultResource(obj) {
|
|
62
|
-
if (typeof obj === "string" && obj.startsWith("$res:")) {
|
|
63
|
-
return await getResource(obj.substring(5), true);
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
return obj;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Get the full resource value by path
|
|
71
|
-
* @param path path of the resource, default to internal state path
|
|
72
|
-
* @param undefinedIfEmpty if the resource does not exist, return undefined instead of throwing an error
|
|
73
|
-
* @returns full resource
|
|
74
|
-
*/
|
|
75
|
-
export async function getFullResource(path, undefinedIfEmpty) {
|
|
76
|
-
const workspace = getWorkspace();
|
|
77
|
-
path = path ?? getStatePath();
|
|
78
|
-
try {
|
|
79
|
-
const resource = await ResourceService.getResource({ workspace, path });
|
|
80
|
-
const value = await _transformLeaf(resource.value);
|
|
81
|
-
return { ...resource, value };
|
|
82
|
-
}
|
|
83
|
-
catch (e) {
|
|
84
|
-
if (undefinedIfEmpty && e.status === 404) {
|
|
85
|
-
return undefined;
|
|
86
|
-
}
|
|
87
|
-
else {
|
|
88
|
-
throw Error(`Resource not found at ${path} or not visible to you`);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
export function getStatePath() {
|
|
93
|
-
const state_path = getEnv("WM_STATE_PATH");
|
|
94
|
-
if (state_path === undefined) {
|
|
95
|
-
throw Error("State path not set");
|
|
96
|
-
}
|
|
97
|
-
return state_path;
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Set a resource value by path
|
|
101
|
-
* @param path path of the resource to set, default to state path
|
|
102
|
-
* @param value new value of the resource to set
|
|
103
|
-
* @param initializeToTypeIfNotExist if the resource does not exist, initialize it with this type
|
|
104
|
-
*/
|
|
105
|
-
export async function setResource(value, path, initializeToTypeIfNotExist) {
|
|
106
|
-
path = path ?? getStatePath();
|
|
107
|
-
const workspace = getWorkspace();
|
|
108
|
-
if (await ResourceService.existsResource({ workspace, path })) {
|
|
109
|
-
await ResourceService.updateResourceValue({
|
|
110
|
-
workspace,
|
|
111
|
-
path,
|
|
112
|
-
requestBody: { value },
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
else if (initializeToTypeIfNotExist) {
|
|
116
|
-
await ResourceService.createResource({
|
|
117
|
-
workspace,
|
|
118
|
-
requestBody: { path, value, resource_type: initializeToTypeIfNotExist },
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
else {
|
|
122
|
-
throw Error(`Resource at path ${path} does not exist and no type was provided to initialize it`);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* Set the state
|
|
127
|
-
* @param state state to set
|
|
128
|
-
* @deprecated use setState instead
|
|
129
|
-
*/
|
|
130
|
-
export async function setInternalState(state) {
|
|
131
|
-
await setResource(state, undefined, "state");
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Set the state
|
|
135
|
-
* @param state state to set
|
|
136
|
-
*/
|
|
137
|
-
export async function setState(state) {
|
|
138
|
-
await setResource(state, undefined, "state");
|
|
139
|
-
}
|
|
140
|
-
// /**
|
|
141
|
-
// * Set the shared state
|
|
142
|
-
// * @param state state to set
|
|
143
|
-
// */
|
|
144
|
-
// export async function setSharedState(
|
|
145
|
-
// state: any,
|
|
146
|
-
// path = "state.json"
|
|
147
|
-
// ): Promise<void> {
|
|
148
|
-
// await Deno.writeTextFile(SHARED_FOLDER + "/" + path, JSON.stringify(state));
|
|
149
|
-
// }
|
|
150
|
-
// /**
|
|
151
|
-
// * Get the shared state
|
|
152
|
-
// * @param state state to set
|
|
153
|
-
// */
|
|
154
|
-
// export async function getSharedState(path = "state.json"): Promise<any> {
|
|
155
|
-
// return JSON.parse(await Deno.readTextFile(SHARED_FOLDER + "/" + path));
|
|
156
|
-
// }
|
|
157
|
-
/**
|
|
158
|
-
* Get the internal state
|
|
159
|
-
* @deprecated use getState instead
|
|
160
|
-
*/
|
|
161
|
-
export async function getInternalState() {
|
|
162
|
-
return await getResource(getStatePath(), true);
|
|
163
|
-
}
|
|
164
|
-
/**
|
|
165
|
-
* Get the state shared across executions
|
|
166
|
-
*/
|
|
167
|
-
export async function getState() {
|
|
168
|
-
return await getResource(getStatePath(), true);
|
|
169
|
-
}
|
|
170
|
-
/**
|
|
171
|
-
* Get a variable by path
|
|
172
|
-
* @param path path of the variable
|
|
173
|
-
* @returns variable value
|
|
174
|
-
*/
|
|
175
|
-
export async function getVariable(path) {
|
|
176
|
-
const workspace = getWorkspace();
|
|
177
|
-
try {
|
|
178
|
-
const variable = await VariableService.getVariable({ workspace, path });
|
|
179
|
-
return variable.value;
|
|
180
|
-
}
|
|
181
|
-
catch (e) {
|
|
182
|
-
throw Error(`Variable not found at ${path} or not visible to you`);
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
/**
|
|
186
|
-
* Set a variable by path, create if not exist
|
|
187
|
-
* @param path path of the variable
|
|
188
|
-
* @param value value of the variable
|
|
189
|
-
* @param isSecretIfNotExist if the variable does not exist, create it as secret or not (default: false)
|
|
190
|
-
* @param descriptionIfNotExist if the variable does not exist, create it with this description (default: "")
|
|
191
|
-
*/
|
|
192
|
-
export async function setVariable(path, value, isSecretIfNotExist, descriptionIfNotExist) {
|
|
193
|
-
const workspace = getWorkspace();
|
|
194
|
-
if (await VariableService.existsVariable({ workspace, path })) {
|
|
195
|
-
await VariableService.updateVariable({
|
|
196
|
-
workspace,
|
|
197
|
-
path,
|
|
198
|
-
requestBody: { value },
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
|
-
else {
|
|
202
|
-
await VariableService.createVariable({
|
|
203
|
-
workspace,
|
|
204
|
-
requestBody: {
|
|
205
|
-
path,
|
|
206
|
-
value,
|
|
207
|
-
is_secret: isSecretIfNotExist ?? false,
|
|
208
|
-
description: descriptionIfNotExist ?? "",
|
|
209
|
-
},
|
|
210
|
-
});
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
async function transformLeaves(d) {
|
|
214
|
-
for (const k in d) {
|
|
215
|
-
d[k] = await _transformLeaf(d[k]);
|
|
216
|
-
}
|
|
217
|
-
return d;
|
|
218
|
-
}
|
|
219
|
-
const VAR_RESOURCE_PREFIX = "$var:";
|
|
220
|
-
const RES_RESOURCE_PREFIX = "$res:";
|
|
221
|
-
async function _transformLeaf(v) {
|
|
222
|
-
if (typeof v === "object") {
|
|
223
|
-
return transformLeaves(v);
|
|
224
|
-
}
|
|
225
|
-
else if (typeof v === "string" && v.startsWith(VAR_RESOURCE_PREFIX)) {
|
|
226
|
-
const varName = v.substring(VAR_RESOURCE_PREFIX.length);
|
|
227
|
-
return await getVariable(varName);
|
|
228
|
-
}
|
|
229
|
-
else if (typeof v === "string" && v.startsWith(RES_RESOURCE_PREFIX)) {
|
|
230
|
-
const resName = v.substring(RES_RESOURCE_PREFIX.length);
|
|
231
|
-
return await getResource(resName);
|
|
232
|
-
}
|
|
233
|
-
else {
|
|
234
|
-
return v;
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
export async function databaseUrlFromResource(path) {
|
|
238
|
-
const resource = await getResource(path);
|
|
239
|
-
return `postgresql://${resource.user}:${resource.password}@${resource.host}:${resource.port}/${resource.dbname}?sslmode=${resource.sslmode}`;
|
|
240
|
-
}
|
|
241
|
-
// /**
|
|
242
|
-
// * Get URLs needed for resuming a flow after this step
|
|
243
|
-
// * @param approver approver name
|
|
244
|
-
// * @returns approval page UI URL, resume and cancel API URLs for resumeing the flow
|
|
245
|
-
// */
|
|
246
|
-
// export async function getResumeUrls(approver?: string): Promise<{
|
|
247
|
-
// approvalPage: string;
|
|
248
|
-
// resume: string;
|
|
249
|
-
// cancel: string;
|
|
250
|
-
// }> {
|
|
251
|
-
// const nonce = Math.floor(Math.random() * 4294967295);
|
|
252
|
-
// const workspace = getWorkspace();
|
|
253
|
-
// return await JobService.getResumeUrls({
|
|
254
|
-
// workspace,
|
|
255
|
-
// resumeId: nonce,
|
|
256
|
-
// approver,
|
|
257
|
-
// id: process.env.get("WM_JOB_ID") ?? "NO_JOB_ID",
|
|
258
|
-
// });
|
|
259
|
-
// }
|
|
260
|
-
export function base64ToUint8Array(data) {
|
|
261
|
-
return Uint8Array.from(atob(data), (c) => c.charCodeAt(0));
|
|
262
|
-
}
|
|
263
|
-
export function uint8ArrayToBase64(arrayBuffer) {
|
|
264
|
-
let base64 = "";
|
|
265
|
-
const encodings = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
266
|
-
const bytes = new Uint8Array(arrayBuffer);
|
|
267
|
-
const byteLength = bytes.byteLength;
|
|
268
|
-
const byteRemainder = byteLength % 3;
|
|
269
|
-
const mainLength = byteLength - byteRemainder;
|
|
270
|
-
let a, b, c, d;
|
|
271
|
-
let chunk;
|
|
272
|
-
// Main loop deals with bytes in chunks of 3
|
|
273
|
-
for (let i = 0; i < mainLength; i = i + 3) {
|
|
274
|
-
// Combine the three bytes into a single integer
|
|
275
|
-
chunk = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2];
|
|
276
|
-
// Use bitmasks to extract 6-bit segments from the triplet
|
|
277
|
-
a = (chunk & 16515072) >> 18; // 16515072 = (2^6 - 1) << 18
|
|
278
|
-
b = (chunk & 258048) >> 12; // 258048 = (2^6 - 1) << 12
|
|
279
|
-
c = (chunk & 4032) >> 6; // 4032 = (2^6 - 1) << 6
|
|
280
|
-
d = chunk & 63; // 63 = 2^6 - 1
|
|
281
|
-
// Convert the raw binary segments to the appropriate ASCII encoding
|
|
282
|
-
base64 += encodings[a] + encodings[b] + encodings[c] + encodings[d];
|
|
283
|
-
}
|
|
284
|
-
// Deal with the remaining bytes and padding
|
|
285
|
-
if (byteRemainder == 1) {
|
|
286
|
-
chunk = bytes[mainLength];
|
|
287
|
-
a = (chunk & 252) >> 2; // 252 = (2^6 - 1) << 2
|
|
288
|
-
// Set the 4 least significant bits to zero
|
|
289
|
-
b = (chunk & 3) << 4; // 3 = 2^2 - 1
|
|
290
|
-
base64 += encodings[a] + encodings[b] + "==";
|
|
291
|
-
}
|
|
292
|
-
else if (byteRemainder == 2) {
|
|
293
|
-
chunk = (bytes[mainLength] << 8) | bytes[mainLength + 1];
|
|
294
|
-
a = (chunk & 64512) >> 10; // 64512 = (2^6 - 1) << 10
|
|
295
|
-
b = (chunk & 1008) >> 4; // 1008 = (2^6 - 1) << 4
|
|
296
|
-
// Set the 2 least significant bits to zero
|
|
297
|
-
c = (chunk & 15) << 2; // 15 = 2^4 - 1
|
|
298
|
-
base64 += encodings[a] + encodings[b] + encodings[c] + "=";
|
|
299
|
-
}
|
|
300
|
-
return base64;
|
|
301
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { ApiRequestOptions } from './ApiRequestOptions';
|
|
2
|
-
import type { ApiResult } from './ApiResult';
|
|
3
|
-
export declare class ApiError extends Error {
|
|
4
|
-
readonly url: string;
|
|
5
|
-
readonly status: number;
|
|
6
|
-
readonly statusText: string;
|
|
7
|
-
readonly body: any;
|
|
8
|
-
readonly request: ApiRequestOptions;
|
|
9
|
-
constructor(request: ApiRequestOptions, response: ApiResult, message: string);
|
|
10
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export class ApiError extends Error {
|
|
2
|
-
constructor(request, response, message) {
|
|
3
|
-
super(message);
|
|
4
|
-
this.name = 'ApiError';
|
|
5
|
-
this.url = response.url;
|
|
6
|
-
this.status = response.status;
|
|
7
|
-
this.statusText = response.statusText;
|
|
8
|
-
this.body = response.body;
|
|
9
|
-
this.request = request;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export type ApiRequestOptions = {
|
|
2
|
-
readonly method: 'GET' | 'PUT' | 'POST' | 'DELETE' | 'OPTIONS' | 'HEAD' | 'PATCH';
|
|
3
|
-
readonly url: string;
|
|
4
|
-
readonly path?: Record<string, any>;
|
|
5
|
-
readonly cookies?: Record<string, any>;
|
|
6
|
-
readonly headers?: Record<string, any>;
|
|
7
|
-
readonly query?: Record<string, any>;
|
|
8
|
-
readonly formData?: Record<string, any>;
|
|
9
|
-
readonly body?: any;
|
|
10
|
-
readonly mediaType?: string;
|
|
11
|
-
readonly responseHeader?: string;
|
|
12
|
-
readonly errors?: Record<number, string>;
|
|
13
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export declare class CancelError extends Error {
|
|
2
|
-
constructor(message: string);
|
|
3
|
-
get isCancelled(): boolean;
|
|
4
|
-
}
|
|
5
|
-
export interface OnCancel {
|
|
6
|
-
readonly isResolved: boolean;
|
|
7
|
-
readonly isRejected: boolean;
|
|
8
|
-
readonly isCancelled: boolean;
|
|
9
|
-
(cancelHandler: () => void): void;
|
|
10
|
-
}
|
|
11
|
-
export declare class CancelablePromise<T> implements Promise<T> {
|
|
12
|
-
#private;
|
|
13
|
-
constructor(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void, onCancel: OnCancel) => void);
|
|
14
|
-
get [Symbol.toStringTag](): string;
|
|
15
|
-
then<TResult1 = T, TResult2 = never>(onFulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null, onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
|
|
16
|
-
catch<TResult = never>(onRejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null): Promise<T | TResult>;
|
|
17
|
-
finally(onFinally?: (() => void) | null): Promise<T>;
|
|
18
|
-
cancel(): void;
|
|
19
|
-
get isCancelled(): boolean;
|
|
20
|
-
}
|