windmill-client 0.3.3 → 0.3.4-2
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/client.ts +3 -3
- package/dist/client.d.ts +1 -1
- package/dist/client.js +28 -28
- package/dist/src/client.d.ts +1 -1
- package/dist/src/client.js +28 -28
- package/package.json +1 -1
- package/src/client.ts +3 -3
- package/tsconfig.json +0 -1
package/client.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { JobService, ResourceService, VariableService } from "./index
|
|
2
|
-
import { OpenAPI } from "./index
|
|
1
|
+
import { JobService, ResourceService, VariableService } from "./index";
|
|
2
|
+
import { OpenAPI } from "./index";
|
|
3
3
|
|
|
4
4
|
export {
|
|
5
5
|
AdminService,
|
|
@@ -15,7 +15,7 @@ export {
|
|
|
15
15
|
SettingsService,
|
|
16
16
|
UserService,
|
|
17
17
|
WorkspaceService,
|
|
18
|
-
} from "./index
|
|
18
|
+
} from "./index";
|
|
19
19
|
|
|
20
20
|
export type Sql = string;
|
|
21
21
|
export type Email = string;
|
package/dist/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { AdminService, AuditService, FlowService, GranularAclService, GroupService, JobService, ResourceService, VariableService, ScriptService, ScheduleService, SettingsService, UserService, WorkspaceService, } from "./index
|
|
1
|
+
export { AdminService, AuditService, FlowService, GranularAclService, GroupService, JobService, ResourceService, VariableService, ScriptService, ScheduleService, SettingsService, UserService, WorkspaceService, } from "./index";
|
|
2
2
|
export type Sql = string;
|
|
3
3
|
export type Email = string;
|
|
4
4
|
export type Base64 = string;
|
package/dist/client.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.uint8ArrayToBase64 = exports.base64ToUint8Array = exports.getResumeEndpoints = 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
|
|
5
|
-
const
|
|
6
|
-
var
|
|
7
|
-
Object.defineProperty(exports, "AdminService", { enumerable: true, get: function () { return
|
|
8
|
-
Object.defineProperty(exports, "AuditService", { enumerable: true, get: function () { return
|
|
9
|
-
Object.defineProperty(exports, "FlowService", { enumerable: true, get: function () { return
|
|
10
|
-
Object.defineProperty(exports, "GranularAclService", { enumerable: true, get: function () { return
|
|
11
|
-
Object.defineProperty(exports, "GroupService", { enumerable: true, get: function () { return
|
|
12
|
-
Object.defineProperty(exports, "JobService", { enumerable: true, get: function () { return
|
|
13
|
-
Object.defineProperty(exports, "ResourceService", { enumerable: true, get: function () { return
|
|
14
|
-
Object.defineProperty(exports, "VariableService", { enumerable: true, get: function () { return
|
|
15
|
-
Object.defineProperty(exports, "ScriptService", { enumerable: true, get: function () { return
|
|
16
|
-
Object.defineProperty(exports, "ScheduleService", { enumerable: true, get: function () { return
|
|
17
|
-
Object.defineProperty(exports, "SettingsService", { enumerable: true, get: function () { return
|
|
18
|
-
Object.defineProperty(exports, "UserService", { enumerable: true, get: function () { return
|
|
19
|
-
Object.defineProperty(exports, "WorkspaceService", { enumerable: true, get: function () { return
|
|
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
20
|
exports.SHARED_FOLDER = "/shared";
|
|
21
21
|
function setClient(token, baseUrl) {
|
|
22
22
|
var _a, _b, _c;
|
|
@@ -27,9 +27,9 @@ function setClient(token, baseUrl) {
|
|
|
27
27
|
if (token === undefined) {
|
|
28
28
|
baseUrl = (_c = getEnv("WM_TOKEN")) !== null && _c !== void 0 ? _c : "no_token";
|
|
29
29
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
index_2.OpenAPI.WITH_CREDENTIALS = true;
|
|
31
|
+
index_2.OpenAPI.TOKEN = token;
|
|
32
|
+
index_2.OpenAPI.BASE = baseUrl + "/api";
|
|
33
33
|
}
|
|
34
34
|
exports.setClient = setClient;
|
|
35
35
|
const getEnv = (key) => {
|
|
@@ -59,7 +59,7 @@ async function getResource(path, undefinedIfEmpty) {
|
|
|
59
59
|
const workspace = getWorkspace();
|
|
60
60
|
path = path !== null && path !== void 0 ? path : getStatePath();
|
|
61
61
|
try {
|
|
62
|
-
const resource = await
|
|
62
|
+
const resource = await index_1.ResourceService.getResource({ workspace, path });
|
|
63
63
|
return await _transformLeaf(resource.value);
|
|
64
64
|
}
|
|
65
65
|
catch (e) {
|
|
@@ -96,7 +96,7 @@ async function getFullResource(path, undefinedIfEmpty) {
|
|
|
96
96
|
const workspace = getWorkspace();
|
|
97
97
|
path = path !== null && path !== void 0 ? path : getStatePath();
|
|
98
98
|
try {
|
|
99
|
-
const resource = await
|
|
99
|
+
const resource = await index_1.ResourceService.getResource({ workspace, path });
|
|
100
100
|
const value = await _transformLeaf(resource.value);
|
|
101
101
|
return { ...resource, value };
|
|
102
102
|
}
|
|
@@ -127,15 +127,15 @@ exports.getStatePath = getStatePath;
|
|
|
127
127
|
async function setResource(value, path, initializeToTypeIfNotExist) {
|
|
128
128
|
path = path !== null && path !== void 0 ? path : getStatePath();
|
|
129
129
|
const workspace = getWorkspace();
|
|
130
|
-
if (await
|
|
131
|
-
await
|
|
130
|
+
if (await index_1.ResourceService.existsResource({ workspace, path })) {
|
|
131
|
+
await index_1.ResourceService.updateResourceValue({
|
|
132
132
|
workspace,
|
|
133
133
|
path,
|
|
134
134
|
requestBody: { value },
|
|
135
135
|
});
|
|
136
136
|
}
|
|
137
137
|
else if (initializeToTypeIfNotExist) {
|
|
138
|
-
await
|
|
138
|
+
await index_1.ResourceService.createResource({
|
|
139
139
|
workspace,
|
|
140
140
|
requestBody: { path, value, resource_type: initializeToTypeIfNotExist },
|
|
141
141
|
});
|
|
@@ -202,7 +202,7 @@ exports.getState = getState;
|
|
|
202
202
|
async function getVariable(path) {
|
|
203
203
|
const workspace = getWorkspace();
|
|
204
204
|
try {
|
|
205
|
-
const variable = await
|
|
205
|
+
const variable = await index_1.VariableService.getVariable({ workspace, path });
|
|
206
206
|
return variable.value;
|
|
207
207
|
}
|
|
208
208
|
catch (e) {
|
|
@@ -219,15 +219,15 @@ exports.getVariable = getVariable;
|
|
|
219
219
|
*/
|
|
220
220
|
async function setVariable(path, value, isSecretIfNotExist, descriptionIfNotExist) {
|
|
221
221
|
const workspace = getWorkspace();
|
|
222
|
-
if (await
|
|
223
|
-
await
|
|
222
|
+
if (await index_1.VariableService.existsVariable({ workspace, path })) {
|
|
223
|
+
await index_1.VariableService.updateVariable({
|
|
224
224
|
workspace,
|
|
225
225
|
path,
|
|
226
226
|
requestBody: { value },
|
|
227
227
|
});
|
|
228
228
|
}
|
|
229
229
|
else {
|
|
230
|
-
await
|
|
230
|
+
await index_1.VariableService.createVariable({
|
|
231
231
|
workspace,
|
|
232
232
|
requestBody: {
|
|
233
233
|
path,
|
package/dist/src/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { AdminService, AuditService, FlowService, GranularAclService, GroupService, JobService, ResourceService, VariableService, ScriptService, ScheduleService, SettingsService, UserService, WorkspaceService, } from "./index
|
|
1
|
+
export { AdminService, AuditService, FlowService, GranularAclService, GroupService, JobService, ResourceService, VariableService, ScriptService, ScheduleService, SettingsService, UserService, WorkspaceService, } from "./index";
|
|
2
2
|
export type Sql = string;
|
|
3
3
|
export type Email = string;
|
|
4
4
|
export type Base64 = string;
|
package/dist/src/client.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.uint8ArrayToBase64 = exports.base64ToUint8Array = exports.getResumeEndpoints = 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
|
|
5
|
-
const
|
|
6
|
-
var
|
|
7
|
-
Object.defineProperty(exports, "AdminService", { enumerable: true, get: function () { return
|
|
8
|
-
Object.defineProperty(exports, "AuditService", { enumerable: true, get: function () { return
|
|
9
|
-
Object.defineProperty(exports, "FlowService", { enumerable: true, get: function () { return
|
|
10
|
-
Object.defineProperty(exports, "GranularAclService", { enumerable: true, get: function () { return
|
|
11
|
-
Object.defineProperty(exports, "GroupService", { enumerable: true, get: function () { return
|
|
12
|
-
Object.defineProperty(exports, "JobService", { enumerable: true, get: function () { return
|
|
13
|
-
Object.defineProperty(exports, "ResourceService", { enumerable: true, get: function () { return
|
|
14
|
-
Object.defineProperty(exports, "VariableService", { enumerable: true, get: function () { return
|
|
15
|
-
Object.defineProperty(exports, "ScriptService", { enumerable: true, get: function () { return
|
|
16
|
-
Object.defineProperty(exports, "ScheduleService", { enumerable: true, get: function () { return
|
|
17
|
-
Object.defineProperty(exports, "SettingsService", { enumerable: true, get: function () { return
|
|
18
|
-
Object.defineProperty(exports, "UserService", { enumerable: true, get: function () { return
|
|
19
|
-
Object.defineProperty(exports, "WorkspaceService", { enumerable: true, get: function () { return
|
|
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
20
|
exports.SHARED_FOLDER = "/shared";
|
|
21
21
|
function setClient(token, baseUrl) {
|
|
22
22
|
var _a, _b, _c;
|
|
@@ -27,9 +27,9 @@ function setClient(token, baseUrl) {
|
|
|
27
27
|
if (token === undefined) {
|
|
28
28
|
baseUrl = (_c = getEnv("WM_TOKEN")) !== null && _c !== void 0 ? _c : "no_token";
|
|
29
29
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
index_2.OpenAPI.WITH_CREDENTIALS = true;
|
|
31
|
+
index_2.OpenAPI.TOKEN = token;
|
|
32
|
+
index_2.OpenAPI.BASE = baseUrl + "/api";
|
|
33
33
|
}
|
|
34
34
|
exports.setClient = setClient;
|
|
35
35
|
const getEnv = (key) => {
|
|
@@ -59,7 +59,7 @@ async function getResource(path, undefinedIfEmpty) {
|
|
|
59
59
|
const workspace = getWorkspace();
|
|
60
60
|
path = path !== null && path !== void 0 ? path : getStatePath();
|
|
61
61
|
try {
|
|
62
|
-
const resource = await
|
|
62
|
+
const resource = await index_1.ResourceService.getResource({ workspace, path });
|
|
63
63
|
return await _transformLeaf(resource.value);
|
|
64
64
|
}
|
|
65
65
|
catch (e) {
|
|
@@ -96,7 +96,7 @@ async function getFullResource(path, undefinedIfEmpty) {
|
|
|
96
96
|
const workspace = getWorkspace();
|
|
97
97
|
path = path !== null && path !== void 0 ? path : getStatePath();
|
|
98
98
|
try {
|
|
99
|
-
const resource = await
|
|
99
|
+
const resource = await index_1.ResourceService.getResource({ workspace, path });
|
|
100
100
|
const value = await _transformLeaf(resource.value);
|
|
101
101
|
return { ...resource, value };
|
|
102
102
|
}
|
|
@@ -127,15 +127,15 @@ exports.getStatePath = getStatePath;
|
|
|
127
127
|
async function setResource(value, path, initializeToTypeIfNotExist) {
|
|
128
128
|
path = path !== null && path !== void 0 ? path : getStatePath();
|
|
129
129
|
const workspace = getWorkspace();
|
|
130
|
-
if (await
|
|
131
|
-
await
|
|
130
|
+
if (await index_1.ResourceService.existsResource({ workspace, path })) {
|
|
131
|
+
await index_1.ResourceService.updateResourceValue({
|
|
132
132
|
workspace,
|
|
133
133
|
path,
|
|
134
134
|
requestBody: { value },
|
|
135
135
|
});
|
|
136
136
|
}
|
|
137
137
|
else if (initializeToTypeIfNotExist) {
|
|
138
|
-
await
|
|
138
|
+
await index_1.ResourceService.createResource({
|
|
139
139
|
workspace,
|
|
140
140
|
requestBody: { path, value, resource_type: initializeToTypeIfNotExist },
|
|
141
141
|
});
|
|
@@ -202,7 +202,7 @@ exports.getState = getState;
|
|
|
202
202
|
async function getVariable(path) {
|
|
203
203
|
const workspace = getWorkspace();
|
|
204
204
|
try {
|
|
205
|
-
const variable = await
|
|
205
|
+
const variable = await index_1.VariableService.getVariable({ workspace, path });
|
|
206
206
|
return variable.value;
|
|
207
207
|
}
|
|
208
208
|
catch (e) {
|
|
@@ -219,15 +219,15 @@ exports.getVariable = getVariable;
|
|
|
219
219
|
*/
|
|
220
220
|
async function setVariable(path, value, isSecretIfNotExist, descriptionIfNotExist) {
|
|
221
221
|
const workspace = getWorkspace();
|
|
222
|
-
if (await
|
|
223
|
-
await
|
|
222
|
+
if (await index_1.VariableService.existsVariable({ workspace, path })) {
|
|
223
|
+
await index_1.VariableService.updateVariable({
|
|
224
224
|
workspace,
|
|
225
225
|
path,
|
|
226
226
|
requestBody: { value },
|
|
227
227
|
});
|
|
228
228
|
}
|
|
229
229
|
else {
|
|
230
|
-
await
|
|
230
|
+
await index_1.VariableService.createVariable({
|
|
231
231
|
workspace,
|
|
232
232
|
requestBody: {
|
|
233
233
|
path,
|
package/package.json
CHANGED
package/src/client.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { JobService, ResourceService, VariableService } from "./index
|
|
2
|
-
import { OpenAPI } from "./index
|
|
1
|
+
import { JobService, ResourceService, VariableService } from "./index";
|
|
2
|
+
import { OpenAPI } from "./index";
|
|
3
3
|
|
|
4
4
|
export {
|
|
5
5
|
AdminService,
|
|
@@ -15,7 +15,7 @@ export {
|
|
|
15
15
|
SettingsService,
|
|
16
16
|
UserService,
|
|
17
17
|
WorkspaceService,
|
|
18
|
-
} from "./index
|
|
18
|
+
} from "./index";
|
|
19
19
|
|
|
20
20
|
export type Sql = string;
|
|
21
21
|
export type Email = string;
|