windmill-client 0.3.6 → 0.3.8

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.
Files changed (148) hide show
  1. package/dist/client.js +159 -156
  2. package/dist/core/ApiError.js +1 -5
  3. package/dist/core/ApiRequestOptions.js +1 -2
  4. package/dist/core/ApiResult.js +1 -2
  5. package/dist/core/CancelablePromise.js +2 -7
  6. package/dist/core/OpenAPI.js +1 -4
  7. package/dist/core/request.js +66 -92
  8. package/dist/index.d.ts +1 -0
  9. package/dist/index.js +42 -86
  10. package/dist/models/AccountId.js +1 -2
  11. package/dist/models/ActionKind.js +2 -5
  12. package/dist/models/After.js +1 -2
  13. package/dist/models/AppWithLastVersion.js +2 -5
  14. package/dist/models/AppWithLastVersionWDraft.js +1 -2
  15. package/dist/models/ArgsFilter.js +1 -2
  16. package/dist/models/AuditLog.js +2 -5
  17. package/dist/models/Before.js +1 -2
  18. package/dist/models/BranchAll.js +1 -2
  19. package/dist/models/BranchOne.js +1 -2
  20. package/dist/models/ClientName.js +1 -2
  21. package/dist/models/CompletedJob.js +2 -5
  22. package/dist/models/ContextualVariable.js +1 -2
  23. package/dist/models/CreateInput.js +1 -2
  24. package/dist/models/CreateResource.js +1 -2
  25. package/dist/models/CreateVariable.js +1 -2
  26. package/dist/models/CreateWorkspace.js +1 -2
  27. package/dist/models/CreatedBy.js +1 -2
  28. package/dist/models/EditResource.js +1 -2
  29. package/dist/models/EditResourceType.js +1 -2
  30. package/dist/models/EditSchedule.js +1 -2
  31. package/dist/models/EditVariable.js +1 -2
  32. package/dist/models/EditWorkspaceUser.js +1 -2
  33. package/dist/models/Flow.js +1 -2
  34. package/dist/models/FlowMetadata.js +1 -2
  35. package/dist/models/FlowModule.js +1 -2
  36. package/dist/models/FlowModuleValue.js +1 -2
  37. package/dist/models/FlowPreview.js +1 -2
  38. package/dist/models/FlowStatus.js +1 -2
  39. package/dist/models/FlowStatusModule.js +2 -5
  40. package/dist/models/FlowValue.js +1 -2
  41. package/dist/models/Folder.js +1 -2
  42. package/dist/models/ForloopFlow.js +1 -2
  43. package/dist/models/GlobalUserInfo.js +2 -5
  44. package/dist/models/Graphql.js +1 -2
  45. package/dist/models/Group.js +1 -2
  46. package/dist/models/Http.js +1 -2
  47. package/dist/models/Identity.js +1 -2
  48. package/dist/models/IncludeHeader.js +1 -2
  49. package/dist/models/Input.js +1 -2
  50. package/dist/models/InputId.js +1 -2
  51. package/dist/models/InputTransform.js +1 -2
  52. package/dist/models/JavascriptTransform.js +1 -2
  53. package/dist/models/Job.js +2 -5
  54. package/dist/models/JobId.js +1 -2
  55. package/dist/models/JobKinds.js +1 -2
  56. package/dist/models/ListableApp.js +2 -5
  57. package/dist/models/ListableRawApp.js +1 -2
  58. package/dist/models/ListableResource.js +1 -2
  59. package/dist/models/ListableVariable.js +1 -2
  60. package/dist/models/Login.js +1 -2
  61. package/dist/models/MainArgSignature.js +2 -5
  62. package/dist/models/Name.js +1 -2
  63. package/dist/models/NewJobId.js +1 -2
  64. package/dist/models/NewSchedule.js +1 -2
  65. package/dist/models/NewScript.js +2 -5
  66. package/dist/models/NewScriptWithDraft.js +1 -2
  67. package/dist/models/NewToken.js +1 -2
  68. package/dist/models/NewTokenImpersonate.js +1 -2
  69. package/dist/models/NewUser.js +1 -2
  70. package/dist/models/OpenFlow.js +1 -2
  71. package/dist/models/OpenFlowWPath.js +1 -2
  72. package/dist/models/Operation.js +1 -2
  73. package/dist/models/OrderDesc.js +1 -2
  74. package/dist/models/Page.js +1 -2
  75. package/dist/models/ParentJob.js +1 -2
  76. package/dist/models/Path.js +1 -2
  77. package/dist/models/PathFlow.js +1 -2
  78. package/dist/models/PathId.js +1 -2
  79. package/dist/models/PathScript.js +1 -2
  80. package/dist/models/Payload.js +1 -2
  81. package/dist/models/PerPage.js +1 -2
  82. package/dist/models/Policy.js +2 -5
  83. package/dist/models/Preview.js +2 -5
  84. package/dist/models/QueueLimit.js +1 -2
  85. package/dist/models/QueuedJob.js +2 -5
  86. package/dist/models/RawScript.js +2 -5
  87. package/dist/models/Resource.js +1 -2
  88. package/dist/models/ResourceName.js +1 -2
  89. package/dist/models/ResourceType.js +1 -2
  90. package/dist/models/ResultFilter.js +1 -2
  91. package/dist/models/Retry.js +1 -2
  92. package/dist/models/RunnableId.js +1 -2
  93. package/dist/models/RunnableType.js +2 -5
  94. package/dist/models/RunnableTypeQuery.js +1 -2
  95. package/dist/models/Running.js +1 -2
  96. package/dist/models/Schedule.js +1 -2
  97. package/dist/models/SchedulePath.js +1 -2
  98. package/dist/models/ScheduleWJobs.js +1 -2
  99. package/dist/models/Script.js +2 -5
  100. package/dist/models/ScriptArgs.js +1 -2
  101. package/dist/models/ScriptExactHash.js +1 -2
  102. package/dist/models/ScriptExactPath.js +1 -2
  103. package/dist/models/ScriptHash.js +1 -2
  104. package/dist/models/ScriptPath.js +1 -2
  105. package/dist/models/ScriptStartPath.js +1 -2
  106. package/dist/models/SlackToken.js +1 -2
  107. package/dist/models/StartedAfter.js +1 -2
  108. package/dist/models/StartedBefore.js +1 -2
  109. package/dist/models/StaticTransform.js +1 -2
  110. package/dist/models/Success.js +1 -2
  111. package/dist/models/Suspended.js +1 -2
  112. package/dist/models/Tag.js +1 -2
  113. package/dist/models/Token.js +1 -2
  114. package/dist/models/TokenResponse.js +1 -2
  115. package/dist/models/TruncatedToken.js +1 -2
  116. package/dist/models/UpdateInput.js +1 -2
  117. package/dist/models/Usage.js +1 -2
  118. package/dist/models/User.js +1 -2
  119. package/dist/models/UserWorkspaceList.js +1 -2
  120. package/dist/models/Username.js +1 -2
  121. package/dist/models/VersionId.js +1 -2
  122. package/dist/models/WorkerPing.js +1 -2
  123. package/dist/models/Workspace.js +1 -2
  124. package/dist/models/WorkspaceId.js +1 -2
  125. package/dist/models/WorkspaceInvite.js +1 -2
  126. package/dist/services/AdminService.js +6 -10
  127. package/dist/services/AppService.js +16 -20
  128. package/dist/services/AuditService.js +5 -9
  129. package/dist/services/CaptureService.js +6 -10
  130. package/dist/services/DraftService.js +5 -9
  131. package/dist/services/FavoriteService.js +5 -9
  132. package/dist/services/FlowService.js +15 -19
  133. package/dist/services/FolderService.js +12 -16
  134. package/dist/services/GranularAclService.js +6 -10
  135. package/dist/services/GroupService.js +11 -15
  136. package/dist/services/InputService.js +8 -12
  137. package/dist/services/JobService.js +34 -38
  138. package/dist/services/OauthService.js +11 -15
  139. package/dist/services/RawAppService.js +9 -13
  140. package/dist/services/ResourceService.js +18 -22
  141. package/dist/services/ScheduleService.js +12 -16
  142. package/dist/services/ScriptService.js +21 -25
  143. package/dist/services/SettingsService.js +7 -11
  144. package/dist/services/UserService.js +32 -36
  145. package/dist/services/VariableService.js +11 -15
  146. package/dist/services/WorkerService.js +5 -9
  147. package/dist/services/WorkspaceService.js +24 -28
  148. package/package.json +1 -1
package/dist/client.js CHANGED
@@ -1,24 +1,17 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.uint8ArrayToBase64 = exports.base64ToUint8Array = exports.databaseUrlFromResource = exports.setVariable = exports.getVariable = exports.getState = exports.getInternalState = exports.setState = exports.setInternalState = exports.setResource = exports.getStatePath = exports.getFullResource = exports.resolveDefaultResource = exports.getResource = exports.getWorkspace = exports.setClient = exports.SHARED_FOLDER = exports.WorkspaceService = exports.UserService = exports.SettingsService = exports.ScheduleService = exports.ScriptService = exports.VariableService = exports.ResourceService = exports.JobService = exports.GroupService = exports.GranularAclService = exports.FlowService = exports.AuditService = exports.AdminService = void 0;
4
- const index_1 = require("./index");
5
- const index_2 = require("./index");
6
- var index_3 = require("./index");
7
- Object.defineProperty(exports, "AdminService", { enumerable: true, get: function () { return index_3.AdminService; } });
8
- Object.defineProperty(exports, "AuditService", { enumerable: true, get: function () { return index_3.AuditService; } });
9
- Object.defineProperty(exports, "FlowService", { enumerable: true, get: function () { return index_3.FlowService; } });
10
- Object.defineProperty(exports, "GranularAclService", { enumerable: true, get: function () { return index_3.GranularAclService; } });
11
- Object.defineProperty(exports, "GroupService", { enumerable: true, get: function () { return index_3.GroupService; } });
12
- Object.defineProperty(exports, "JobService", { enumerable: true, get: function () { return index_3.JobService; } });
13
- Object.defineProperty(exports, "ResourceService", { enumerable: true, get: function () { return index_3.ResourceService; } });
14
- Object.defineProperty(exports, "VariableService", { enumerable: true, get: function () { return index_3.VariableService; } });
15
- Object.defineProperty(exports, "ScriptService", { enumerable: true, get: function () { return index_3.ScriptService; } });
16
- Object.defineProperty(exports, "ScheduleService", { enumerable: true, get: function () { return index_3.ScheduleService; } });
17
- Object.defineProperty(exports, "SettingsService", { enumerable: true, get: function () { return index_3.SettingsService; } });
18
- Object.defineProperty(exports, "UserService", { enumerable: true, get: function () { return index_3.UserService; } });
19
- Object.defineProperty(exports, "WorkspaceService", { enumerable: true, get: function () { return index_3.WorkspaceService; } });
20
- exports.SHARED_FOLDER = "/shared";
21
- function setClient(token, baseUrl) {
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { ResourceService, VariableService } from "./index";
11
+ import { OpenAPI } from "./index";
12
+ export { AdminService, AuditService, FlowService, GranularAclService, GroupService, JobService, ResourceService, VariableService, ScriptService, ScheduleService, SettingsService, UserService, WorkspaceService, } from "./index";
13
+ export const SHARED_FOLDER = "/shared";
14
+ export function setClient(token, baseUrl) {
22
15
  var _a, _b, _c;
23
16
  if (baseUrl === undefined) {
24
17
  baseUrl =
@@ -27,11 +20,10 @@ function setClient(token, baseUrl) {
27
20
  if (token === undefined) {
28
21
  baseUrl = (_c = getEnv("WM_TOKEN")) !== null && _c !== void 0 ? _c : "no_token";
29
22
  }
30
- index_2.OpenAPI.WITH_CREDENTIALS = true;
31
- index_2.OpenAPI.TOKEN = token;
32
- index_2.OpenAPI.BASE = baseUrl + "/api";
23
+ OpenAPI.WITH_CREDENTIALS = true;
24
+ OpenAPI.TOKEN = token;
25
+ OpenAPI.BASE = baseUrl + "/api";
33
26
  }
34
- exports.setClient = setClient;
35
27
  const getEnv = (key) => {
36
28
  if (typeof window === "undefined") {
37
29
  // node
@@ -44,124 +36,128 @@ const getEnv = (key) => {
44
36
  * Create a client configuration from env variables
45
37
  * @returns client configuration
46
38
  */
47
- function getWorkspace() {
39
+ export function getWorkspace() {
48
40
  var _a;
49
41
  return (_a = getEnv("WM_WORKSPACE")) !== null && _a !== void 0 ? _a : "no_workspace";
50
42
  }
51
- exports.getWorkspace = getWorkspace;
52
43
  /**
53
44
  * Get a resource value by path
54
45
  * @param path path of the resource, default to internal state path
55
46
  * @param undefinedIfEmpty if the resource does not exist, return undefined instead of throwing an error
56
47
  * @returns resource value
57
48
  */
58
- async function getResource(path, undefinedIfEmpty) {
59
- const workspace = getWorkspace();
60
- path = path !== null && path !== void 0 ? path : getStatePath();
61
- try {
62
- const resource = await index_1.ResourceService.getResource({ workspace, path });
63
- return await _transformLeaf(resource.value);
64
- }
65
- catch (e) {
66
- if (undefinedIfEmpty && e.status === 404) {
67
- return undefined;
49
+ export function getResource(path, undefinedIfEmpty) {
50
+ return __awaiter(this, void 0, void 0, function* () {
51
+ const workspace = getWorkspace();
52
+ path = path !== null && path !== void 0 ? path : getStatePath();
53
+ try {
54
+ const resource = yield ResourceService.getResource({ workspace, path });
55
+ return yield _transformLeaf(resource.value);
68
56
  }
69
- else {
70
- throw Error(`Resource not found at ${path} or not visible to you`);
57
+ catch (e) {
58
+ if (undefinedIfEmpty && e.status === 404) {
59
+ return undefined;
60
+ }
61
+ else {
62
+ throw Error(`Resource not found at ${path} or not visible to you`);
63
+ }
71
64
  }
72
- }
65
+ });
73
66
  }
74
- exports.getResource = getResource;
75
67
  /**
76
68
  * Resolve a resource value in case the default value was picked because the input payload was undefined
77
69
  * @param obj resource value or path of the resource under the format `$res:path`
78
70
  * @returns resource value
79
71
  */
80
- async function resolveDefaultResource(obj) {
81
- if (typeof obj === "string" && obj.startsWith("$res:")) {
82
- return await getResource(obj.substring(5), true);
83
- }
84
- else {
85
- return obj;
86
- }
72
+ export function resolveDefaultResource(obj) {
73
+ return __awaiter(this, void 0, void 0, function* () {
74
+ if (typeof obj === "string" && obj.startsWith("$res:")) {
75
+ return yield getResource(obj.substring(5), true);
76
+ }
77
+ else {
78
+ return obj;
79
+ }
80
+ });
87
81
  }
88
- exports.resolveDefaultResource = resolveDefaultResource;
89
82
  /**
90
83
  * Get the full resource value by path
91
84
  * @param path path of the resource, default to internal state path
92
85
  * @param undefinedIfEmpty if the resource does not exist, return undefined instead of throwing an error
93
86
  * @returns full resource
94
87
  */
95
- async function getFullResource(path, undefinedIfEmpty) {
96
- const workspace = getWorkspace();
97
- path = path !== null && path !== void 0 ? path : getStatePath();
98
- try {
99
- const resource = await index_1.ResourceService.getResource({ workspace, path });
100
- const value = await _transformLeaf(resource.value);
101
- return { ...resource, value };
102
- }
103
- catch (e) {
104
- if (undefinedIfEmpty && e.status === 404) {
105
- return undefined;
88
+ export function getFullResource(path, undefinedIfEmpty) {
89
+ return __awaiter(this, void 0, void 0, function* () {
90
+ const workspace = getWorkspace();
91
+ path = path !== null && path !== void 0 ? path : getStatePath();
92
+ try {
93
+ const resource = yield ResourceService.getResource({ workspace, path });
94
+ const value = yield _transformLeaf(resource.value);
95
+ return Object.assign(Object.assign({}, resource), { value });
106
96
  }
107
- else {
108
- throw Error(`Resource not found at ${path} or not visible to you`);
97
+ catch (e) {
98
+ if (undefinedIfEmpty && e.status === 404) {
99
+ return undefined;
100
+ }
101
+ else {
102
+ throw Error(`Resource not found at ${path} or not visible to you`);
103
+ }
109
104
  }
110
- }
105
+ });
111
106
  }
112
- exports.getFullResource = getFullResource;
113
- function getStatePath() {
107
+ export function getStatePath() {
114
108
  const state_path = getEnv("WM_STATE_PATH");
115
109
  if (state_path === undefined) {
116
110
  throw Error("State path not set");
117
111
  }
118
112
  return state_path;
119
113
  }
120
- exports.getStatePath = getStatePath;
121
114
  /**
122
115
  * Set a resource value by path
123
116
  * @param path path of the resource to set, default to state path
124
117
  * @param value new value of the resource to set
125
118
  * @param initializeToTypeIfNotExist if the resource does not exist, initialize it with this type
126
119
  */
127
- async function setResource(value, path, initializeToTypeIfNotExist) {
128
- path = path !== null && path !== void 0 ? path : getStatePath();
129
- const workspace = getWorkspace();
130
- if (await index_1.ResourceService.existsResource({ workspace, path })) {
131
- await index_1.ResourceService.updateResourceValue({
132
- workspace,
133
- path,
134
- requestBody: { value },
135
- });
136
- }
137
- else if (initializeToTypeIfNotExist) {
138
- await index_1.ResourceService.createResource({
139
- workspace,
140
- requestBody: { path, value, resource_type: initializeToTypeIfNotExist },
141
- });
142
- }
143
- else {
144
- throw Error(`Resource at path ${path} does not exist and no type was provided to initialize it`);
145
- }
120
+ export function setResource(value, path, initializeToTypeIfNotExist) {
121
+ return __awaiter(this, void 0, void 0, function* () {
122
+ path = path !== null && path !== void 0 ? path : getStatePath();
123
+ const workspace = getWorkspace();
124
+ if (yield ResourceService.existsResource({ workspace, path })) {
125
+ yield ResourceService.updateResourceValue({
126
+ workspace,
127
+ path,
128
+ requestBody: { value },
129
+ });
130
+ }
131
+ else if (initializeToTypeIfNotExist) {
132
+ yield ResourceService.createResource({
133
+ workspace,
134
+ requestBody: { path, value, resource_type: initializeToTypeIfNotExist },
135
+ });
136
+ }
137
+ else {
138
+ throw Error(`Resource at path ${path} does not exist and no type was provided to initialize it`);
139
+ }
140
+ });
146
141
  }
147
- exports.setResource = setResource;
148
142
  /**
149
143
  * Set the state
150
144
  * @param state state to set
151
145
  * @deprecated use setState instead
152
146
  */
153
- async function setInternalState(state) {
154
- await setResource(state, undefined, "state");
147
+ export function setInternalState(state) {
148
+ return __awaiter(this, void 0, void 0, function* () {
149
+ yield setResource(state, undefined, "state");
150
+ });
155
151
  }
156
- exports.setInternalState = setInternalState;
157
152
  /**
158
153
  * Set the state
159
154
  * @param state state to set
160
155
  */
161
- async function setState(state) {
162
- await setResource(state, undefined, "state");
156
+ export function setState(state) {
157
+ return __awaiter(this, void 0, void 0, function* () {
158
+ yield setResource(state, undefined, "state");
159
+ });
163
160
  }
164
- exports.setState = setState;
165
161
  // /**
166
162
  // * Set the shared state
167
163
  // * @param state state to set
@@ -183,33 +179,36 @@ exports.setState = setState;
183
179
  * Get the internal state
184
180
  * @deprecated use getState instead
185
181
  */
186
- async function getInternalState() {
187
- return await getResource(getStatePath(), true);
182
+ export function getInternalState() {
183
+ return __awaiter(this, void 0, void 0, function* () {
184
+ return yield getResource(getStatePath(), true);
185
+ });
188
186
  }
189
- exports.getInternalState = getInternalState;
190
187
  /**
191
188
  * Get the state shared across executions
192
189
  */
193
- async function getState() {
194
- return await getResource(getStatePath(), true);
190
+ export function getState() {
191
+ return __awaiter(this, void 0, void 0, function* () {
192
+ return yield getResource(getStatePath(), true);
193
+ });
195
194
  }
196
- exports.getState = getState;
197
195
  /**
198
196
  * Get a variable by path
199
197
  * @param path path of the variable
200
198
  * @returns variable value
201
199
  */
202
- async function getVariable(path) {
203
- const workspace = getWorkspace();
204
- try {
205
- const variable = await index_1.VariableService.getVariable({ workspace, path });
206
- return variable.value;
207
- }
208
- catch (e) {
209
- throw Error(`Variable not found at ${path} or not visible to you`);
210
- }
200
+ export function getVariable(path) {
201
+ return __awaiter(this, void 0, void 0, function* () {
202
+ const workspace = getWorkspace();
203
+ try {
204
+ const variable = yield VariableService.getVariable({ workspace, path });
205
+ return variable.value;
206
+ }
207
+ catch (e) {
208
+ throw Error(`Variable not found at ${path} or not visible to you`);
209
+ }
210
+ });
211
211
  }
212
- exports.getVariable = getVariable;
213
212
  /**
214
213
  * Set a variable by path, create if not exist
215
214
  * @param path path of the variable
@@ -217,57 +216,63 @@ exports.getVariable = getVariable;
217
216
  * @param isSecretIfNotExist if the variable does not exist, create it as secret or not (default: false)
218
217
  * @param descriptionIfNotExist if the variable does not exist, create it with this description (default: "")
219
218
  */
220
- async function setVariable(path, value, isSecretIfNotExist, descriptionIfNotExist) {
221
- const workspace = getWorkspace();
222
- if (await index_1.VariableService.existsVariable({ workspace, path })) {
223
- await index_1.VariableService.updateVariable({
224
- workspace,
225
- path,
226
- requestBody: { value },
227
- });
228
- }
229
- else {
230
- await index_1.VariableService.createVariable({
231
- workspace,
232
- requestBody: {
219
+ export function setVariable(path, value, isSecretIfNotExist, descriptionIfNotExist) {
220
+ return __awaiter(this, void 0, void 0, function* () {
221
+ const workspace = getWorkspace();
222
+ if (yield VariableService.existsVariable({ workspace, path })) {
223
+ yield VariableService.updateVariable({
224
+ workspace,
233
225
  path,
234
- value,
235
- is_secret: isSecretIfNotExist !== null && isSecretIfNotExist !== void 0 ? isSecretIfNotExist : false,
236
- description: descriptionIfNotExist !== null && descriptionIfNotExist !== void 0 ? descriptionIfNotExist : "",
237
- },
238
- });
239
- }
226
+ requestBody: { value },
227
+ });
228
+ }
229
+ else {
230
+ yield VariableService.createVariable({
231
+ workspace,
232
+ requestBody: {
233
+ path,
234
+ value,
235
+ is_secret: isSecretIfNotExist !== null && isSecretIfNotExist !== void 0 ? isSecretIfNotExist : false,
236
+ description: descriptionIfNotExist !== null && descriptionIfNotExist !== void 0 ? descriptionIfNotExist : "",
237
+ },
238
+ });
239
+ }
240
+ });
240
241
  }
241
- exports.setVariable = setVariable;
242
- async function transformLeaves(d) {
243
- for (const k in d) {
244
- d[k] = await _transformLeaf(d[k]);
245
- }
246
- return d;
242
+ function transformLeaves(d) {
243
+ return __awaiter(this, void 0, void 0, function* () {
244
+ for (const k in d) {
245
+ d[k] = yield _transformLeaf(d[k]);
246
+ }
247
+ return d;
248
+ });
247
249
  }
248
250
  const VAR_RESOURCE_PREFIX = "$var:";
249
251
  const RES_RESOURCE_PREFIX = "$res:";
250
- async function _transformLeaf(v) {
251
- if (typeof v === "object") {
252
- return transformLeaves(v);
253
- }
254
- else if (typeof v === "string" && v.startsWith(VAR_RESOURCE_PREFIX)) {
255
- const varName = v.substring(VAR_RESOURCE_PREFIX.length);
256
- return await getVariable(varName);
257
- }
258
- else if (typeof v === "string" && v.startsWith(RES_RESOURCE_PREFIX)) {
259
- const resName = v.substring(RES_RESOURCE_PREFIX.length);
260
- return await getResource(resName);
261
- }
262
- else {
263
- return v;
264
- }
252
+ function _transformLeaf(v) {
253
+ return __awaiter(this, void 0, void 0, function* () {
254
+ if (typeof v === "object") {
255
+ return transformLeaves(v);
256
+ }
257
+ else if (typeof v === "string" && v.startsWith(VAR_RESOURCE_PREFIX)) {
258
+ const varName = v.substring(VAR_RESOURCE_PREFIX.length);
259
+ return yield getVariable(varName);
260
+ }
261
+ else if (typeof v === "string" && v.startsWith(RES_RESOURCE_PREFIX)) {
262
+ const resName = v.substring(RES_RESOURCE_PREFIX.length);
263
+ return yield getResource(resName);
264
+ }
265
+ else {
266
+ return v;
267
+ }
268
+ });
265
269
  }
266
- async function databaseUrlFromResource(path) {
267
- const resource = await getResource(path);
268
- return `postgresql://${resource.user}:${resource.password}@${resource.host}:${resource.port}/${resource.dbname}?sslmode=${resource.sslmode}`;
270
+ export function databaseUrlFromResource(path) {
271
+ return __awaiter(this, void 0, void 0, function* () {
272
+ const resource = yield getResource(path);
273
+ return `postgresql://${resource.user}:${resource.password}@${resource.host}:${resource.port}/${resource.dbname}?sslmode=${resource.sslmode}`;
274
+ });
269
275
  }
270
- exports.databaseUrlFromResource = databaseUrlFromResource;
271
276
  // /**
272
277
  // * Get URLs needed for resuming a flow after this step
273
278
  // * @param approver approver name
@@ -287,11 +292,10 @@ exports.databaseUrlFromResource = databaseUrlFromResource;
287
292
  // id: process.env.get("WM_JOB_ID") ?? "NO_JOB_ID",
288
293
  // });
289
294
  // }
290
- function base64ToUint8Array(data) {
295
+ export function base64ToUint8Array(data) {
291
296
  return Uint8Array.from(atob(data), (c) => c.charCodeAt(0));
292
297
  }
293
- exports.base64ToUint8Array = base64ToUint8Array;
294
- function uint8ArrayToBase64(arrayBuffer) {
298
+ export function uint8ArrayToBase64(arrayBuffer) {
295
299
  let base64 = "";
296
300
  const encodings = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
297
301
  const bytes = new Uint8Array(arrayBuffer);
@@ -330,4 +334,3 @@ function uint8ArrayToBase64(arrayBuffer) {
330
334
  }
331
335
  return base64;
332
336
  }
333
- exports.uint8ArrayToBase64 = uint8ArrayToBase64;
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ApiError = void 0;
4
- class ApiError extends Error {
1
+ export class ApiError extends Error {
5
2
  constructor(request, response, message) {
6
3
  super(message);
7
4
  this.name = 'ApiError';
@@ -12,4 +9,3 @@ class ApiError extends Error {
12
9
  this.request = request;
13
10
  }
14
11
  }
15
- exports.ApiError = ApiError;
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
3
2
  if (kind === "m") throw new TypeError("Private method is not writable");
4
3
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
@@ -11,13 +10,11 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
11
10
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
12
11
  };
13
12
  var _CancelablePromise_isResolved, _CancelablePromise_isRejected, _CancelablePromise_isCancelled, _CancelablePromise_cancelHandlers, _CancelablePromise_promise, _CancelablePromise_resolve, _CancelablePromise_reject;
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.CancelablePromise = exports.CancelError = void 0;
16
13
  /* generated using openapi-typescript-codegen -- do no edit */
17
14
  /* istanbul ignore file */
18
15
  /* tslint:disable */
19
16
  /* eslint-disable */
20
- class CancelError extends Error {
17
+ export class CancelError extends Error {
21
18
  constructor(message) {
22
19
  super(message);
23
20
  this.name = 'CancelError';
@@ -26,8 +23,7 @@ class CancelError extends Error {
26
23
  return true;
27
24
  }
28
25
  }
29
- exports.CancelError = CancelError;
30
- class CancelablePromise {
26
+ export class CancelablePromise {
31
27
  constructor(executor) {
32
28
  _CancelablePromise_isResolved.set(this, void 0);
33
29
  _CancelablePromise_isRejected.set(this, void 0);
@@ -113,4 +109,3 @@ class CancelablePromise {
113
109
  return __classPrivateFieldGet(this, _CancelablePromise_isCancelled, "f");
114
110
  }
115
111
  }
116
- exports.CancelablePromise = CancelablePromise;
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OpenAPI = void 0;
4
- exports.OpenAPI = {
1
+ export const OpenAPI = {
5
2
  BASE: '/api',
6
3
  VERSION: '1.125.0',
7
4
  WITH_CREDENTIALS: false,