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 CHANGED
@@ -1,5 +1,5 @@
1
- import { JobService, ResourceService, VariableService } from "./index.ts";
2
- import { OpenAPI } from "./index.ts";
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.ts";
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.ts";
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 index_ts_1 = require("./index.ts");
5
- const index_ts_2 = require("./index.ts");
6
- var index_ts_3 = require("./index.ts");
7
- Object.defineProperty(exports, "AdminService", { enumerable: true, get: function () { return index_ts_3.AdminService; } });
8
- Object.defineProperty(exports, "AuditService", { enumerable: true, get: function () { return index_ts_3.AuditService; } });
9
- Object.defineProperty(exports, "FlowService", { enumerable: true, get: function () { return index_ts_3.FlowService; } });
10
- Object.defineProperty(exports, "GranularAclService", { enumerable: true, get: function () { return index_ts_3.GranularAclService; } });
11
- Object.defineProperty(exports, "GroupService", { enumerable: true, get: function () { return index_ts_3.GroupService; } });
12
- Object.defineProperty(exports, "JobService", { enumerable: true, get: function () { return index_ts_3.JobService; } });
13
- Object.defineProperty(exports, "ResourceService", { enumerable: true, get: function () { return index_ts_3.ResourceService; } });
14
- Object.defineProperty(exports, "VariableService", { enumerable: true, get: function () { return index_ts_3.VariableService; } });
15
- Object.defineProperty(exports, "ScriptService", { enumerable: true, get: function () { return index_ts_3.ScriptService; } });
16
- Object.defineProperty(exports, "ScheduleService", { enumerable: true, get: function () { return index_ts_3.ScheduleService; } });
17
- Object.defineProperty(exports, "SettingsService", { enumerable: true, get: function () { return index_ts_3.SettingsService; } });
18
- Object.defineProperty(exports, "UserService", { enumerable: true, get: function () { return index_ts_3.UserService; } });
19
- Object.defineProperty(exports, "WorkspaceService", { enumerable: true, get: function () { return index_ts_3.WorkspaceService; } });
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
- index_ts_2.OpenAPI.WITH_CREDENTIALS = true;
31
- index_ts_2.OpenAPI.TOKEN = token;
32
- index_ts_2.OpenAPI.BASE = baseUrl + "/api";
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 index_ts_1.ResourceService.getResource({ workspace, path });
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 index_ts_1.ResourceService.getResource({ workspace, path });
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 index_ts_1.ResourceService.existsResource({ workspace, path })) {
131
- await index_ts_1.ResourceService.updateResourceValue({
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 index_ts_1.ResourceService.createResource({
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 index_ts_1.VariableService.getVariable({ workspace, path });
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 index_ts_1.VariableService.existsVariable({ workspace, path })) {
223
- await index_ts_1.VariableService.updateVariable({
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 index_ts_1.VariableService.createVariable({
230
+ await index_1.VariableService.createVariable({
231
231
  workspace,
232
232
  requestBody: {
233
233
  path,
@@ -1,4 +1,4 @@
1
- export { AdminService, AuditService, FlowService, GranularAclService, GroupService, JobService, ResourceService, VariableService, ScriptService, ScheduleService, SettingsService, UserService, WorkspaceService, } from "./index.ts";
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;
@@ -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 index_ts_1 = require("./index.ts");
5
- const index_ts_2 = require("./index.ts");
6
- var index_ts_3 = require("./index.ts");
7
- Object.defineProperty(exports, "AdminService", { enumerable: true, get: function () { return index_ts_3.AdminService; } });
8
- Object.defineProperty(exports, "AuditService", { enumerable: true, get: function () { return index_ts_3.AuditService; } });
9
- Object.defineProperty(exports, "FlowService", { enumerable: true, get: function () { return index_ts_3.FlowService; } });
10
- Object.defineProperty(exports, "GranularAclService", { enumerable: true, get: function () { return index_ts_3.GranularAclService; } });
11
- Object.defineProperty(exports, "GroupService", { enumerable: true, get: function () { return index_ts_3.GroupService; } });
12
- Object.defineProperty(exports, "JobService", { enumerable: true, get: function () { return index_ts_3.JobService; } });
13
- Object.defineProperty(exports, "ResourceService", { enumerable: true, get: function () { return index_ts_3.ResourceService; } });
14
- Object.defineProperty(exports, "VariableService", { enumerable: true, get: function () { return index_ts_3.VariableService; } });
15
- Object.defineProperty(exports, "ScriptService", { enumerable: true, get: function () { return index_ts_3.ScriptService; } });
16
- Object.defineProperty(exports, "ScheduleService", { enumerable: true, get: function () { return index_ts_3.ScheduleService; } });
17
- Object.defineProperty(exports, "SettingsService", { enumerable: true, get: function () { return index_ts_3.SettingsService; } });
18
- Object.defineProperty(exports, "UserService", { enumerable: true, get: function () { return index_ts_3.UserService; } });
19
- Object.defineProperty(exports, "WorkspaceService", { enumerable: true, get: function () { return index_ts_3.WorkspaceService; } });
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
- index_ts_2.OpenAPI.WITH_CREDENTIALS = true;
31
- index_ts_2.OpenAPI.TOKEN = token;
32
- index_ts_2.OpenAPI.BASE = baseUrl + "/api";
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 index_ts_1.ResourceService.getResource({ workspace, path });
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 index_ts_1.ResourceService.getResource({ workspace, path });
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 index_ts_1.ResourceService.existsResource({ workspace, path })) {
131
- await index_ts_1.ResourceService.updateResourceValue({
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 index_ts_1.ResourceService.createResource({
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 index_ts_1.VariableService.getVariable({ workspace, path });
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 index_ts_1.VariableService.existsVariable({ workspace, path })) {
223
- await index_ts_1.VariableService.updateVariable({
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 index_ts_1.VariableService.createVariable({
230
+ await index_1.VariableService.createVariable({
231
231
  workspace,
232
232
  requestBody: {
233
233
  path,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "windmill-client",
3
3
  "description": "Windmill SDK client for browsers and Node.js",
4
- "version": "0.3.3",
4
+ "version": "0.3.4-2",
5
5
  "author": "Ruben Fiszel",
6
6
  "license": "Apache 2.0",
7
7
  "dependencies": {},
package/src/client.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { JobService, ResourceService, VariableService } from "./index.ts";
2
- import { OpenAPI } from "./index.ts";
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.ts";
18
+ } from "./index";
19
19
 
20
20
  export type Sql = string;
21
21
  export type Email = string;
package/tsconfig.json CHANGED
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "compilerOptions": {
3
3
  /* Visit https://aka.ms/tsconfig to read more about this file */
4
- "allowImportingTsExtensions": true,
5
4
  "declaration": true,
6
5
  "outDir": "dist",
7
6
  /* Projects */