windmill-cli 1.538.0 → 1.539.0

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.
@@ -32,7 +32,7 @@ export const OpenAPI = {
32
32
  PASSWORD: undefined,
33
33
  TOKEN: getEnv("WM_TOKEN"),
34
34
  USERNAME: undefined,
35
- VERSION: '1.538.0',
35
+ VERSION: '1.539.0',
36
36
  WITH_CREDENTIALS: true,
37
37
  interceptors: {
38
38
  request: new Interceptors(),
@@ -2214,6 +2214,8 @@ export const getVariable = (data) => {
2214
2214
  * @param data The data for the request.
2215
2215
  * @param data.workspace
2216
2216
  * @param data.path
2217
+ * @param data.allowCache allow getting a cached value for improved performance
2218
+ *
2217
2219
  * @returns string variable
2218
2220
  * @throws ApiError
2219
2221
  */
@@ -2224,6 +2226,9 @@ export const getVariableValue = (data) => {
2224
2226
  path: {
2225
2227
  workspace: data.workspace,
2226
2228
  path: data.path
2229
+ },
2230
+ query: {
2231
+ allow_cache: data.allowCache
2227
2232
  }
2228
2233
  });
2229
2234
  };
@@ -2732,6 +2737,7 @@ export const getResource = (data) => {
2732
2737
  * @param data.workspace
2733
2738
  * @param data.path
2734
2739
  * @param data.jobId job id
2740
+ * @param data.allowCache allow getting a cached value for improved performance
2735
2741
  * @returns unknown resource value
2736
2742
  * @throws ApiError
2737
2743
  */
@@ -2744,7 +2750,8 @@ export const getResourceValueInterpolated = (data) => {
2744
2750
  path: data.path
2745
2751
  },
2746
2752
  query: {
2747
- job_id: data.jobId
2753
+ job_id: data.jobId,
2754
+ allow_cache: data.allowCache
2748
2755
  }
2749
2756
  });
2750
2757
  };
package/esm/src/main.js CHANGED
@@ -38,7 +38,7 @@ export { flow, app, script, workspace, resource, resourceType, user, variable, h
38
38
  // console.error(JSON.stringify(event.error, null, 4));
39
39
  // }
40
40
  // });
41
- export const VERSION = "1.538.0";
41
+ export const VERSION = "1.539.0";
42
42
  const command = new Command()
43
43
  .name("wmill")
44
44
  .action(() => log.info(`Welcome to Windmill CLI ${VERSION}. Use -h for help.`))
@@ -242,7 +242,7 @@ const imports = {
242
242
  const ret = Object.entries(arg0);
243
243
  return ret;
244
244
  },
245
- __wbg_eval_5e26645562cd9430: function (arg0, arg1) {
245
+ __wbg_eval_d0dfcbbfaeff4b3c: function (arg0, arg1) {
246
246
  const ret = eval(getStringFromWasm0(arg0, arg1));
247
247
  return ret;
248
248
  },
@@ -7,39 +7,39 @@
7
7
  * @param oldS - Existing schema property to update with new type information
8
8
  */
9
9
  export function argSigToJsonSchemaType(t, oldS) {
10
- const newS = { type: '' };
11
- if (t === 'int') {
12
- newS.type = 'integer';
10
+ const newS = { type: "" };
11
+ if (t === "int") {
12
+ newS.type = "integer";
13
13
  }
14
- else if (t === 'float') {
15
- newS.type = 'number';
14
+ else if (t === "float") {
15
+ newS.type = "number";
16
16
  }
17
- else if (t === 'bool') {
18
- newS.type = 'boolean';
17
+ else if (t === "bool") {
18
+ newS.type = "boolean";
19
19
  }
20
- else if (t === 'email') {
21
- newS.type = 'string';
22
- newS.format = 'email';
20
+ else if (t === "email") {
21
+ newS.type = "string";
22
+ newS.format = "email";
23
23
  }
24
- else if (t === 'sql') {
25
- newS.type = 'string';
26
- newS.format = 'sql';
24
+ else if (t === "sql") {
25
+ newS.type = "string";
26
+ newS.format = "sql";
27
27
  }
28
- else if (t === 'yaml') {
29
- newS.type = 'string';
30
- newS.format = 'yaml';
28
+ else if (t === "yaml") {
29
+ newS.type = "string";
30
+ newS.format = "yaml";
31
31
  }
32
- else if (t === 'bytes') {
33
- newS.type = 'string';
34
- newS.contentEncoding = 'base64';
35
- newS.originalType = 'bytes';
32
+ else if (t === "bytes") {
33
+ newS.type = "string";
34
+ newS.contentEncoding = "base64";
35
+ newS.originalType = "bytes";
36
36
  }
37
- else if (t === 'datetime') {
38
- newS.type = 'string';
39
- newS.format = 'date-time';
37
+ else if (t === "datetime") {
38
+ newS.type = "string";
39
+ newS.format = "date-time";
40
40
  }
41
- else if (typeof t !== 'string' && 'oneof' in t) {
42
- newS.type = 'object';
41
+ else if (typeof t !== "string" && "oneof" in t) {
42
+ newS.type = "object";
43
43
  if (t.oneof) {
44
44
  newS.oneOf = t.oneof.map((obj) => {
45
45
  const oldObjS = oldS.oneOf?.find((o) => o?.title === obj.label) ?? undefined;
@@ -49,21 +49,21 @@ export function argSigToJsonSchemaType(t, oldS) {
49
49
  properties[prop.key] = oldObjS?.properties[prop.key];
50
50
  }
51
51
  else {
52
- properties[prop.key] = { description: '', type: '' };
52
+ properties[prop.key] = { description: "", type: "" };
53
53
  }
54
54
  argSigToJsonSchemaType(prop.typ, properties[prop.key]);
55
55
  }
56
56
  return {
57
- type: 'object',
57
+ type: "object",
58
58
  title: obj.label,
59
59
  properties,
60
- order: oldObjS?.order ?? undefined
60
+ order: oldObjS?.order ?? undefined,
61
61
  };
62
62
  });
63
63
  }
64
64
  }
65
- else if (typeof t !== 'string' && `object` in t) {
66
- newS.type = 'object';
65
+ else if (typeof t !== "string" && `object` in t) {
66
+ newS.type = "object";
67
67
  if (t.object.name) {
68
68
  newS.format = `resource-${t.object.name}`;
69
69
  }
@@ -74,102 +74,116 @@ export function argSigToJsonSchemaType(t, oldS) {
74
74
  properties[prop.key] = oldS.properties[prop.key];
75
75
  }
76
76
  else {
77
- properties[prop.key] = { description: '', type: '' };
77
+ properties[prop.key] = { description: "", type: "" };
78
78
  }
79
79
  argSigToJsonSchemaType(prop.typ, properties[prop.key]);
80
80
  }
81
81
  newS.properties = properties;
82
82
  }
83
83
  }
84
- else if (typeof t !== 'string' && `str` in t) {
85
- newS.type = 'string';
84
+ else if (typeof t !== "string" && `str` in t) {
85
+ newS.type = "string";
86
86
  if (t.str) {
87
- newS.originalType = 'enum';
87
+ newS.originalType = "enum";
88
88
  newS.enum = t.str;
89
89
  }
90
- else if (oldS.originalType == 'string' && oldS.enum) {
91
- newS.originalType = 'string';
90
+ else if (oldS.originalType == "string" && oldS.enum) {
91
+ newS.originalType = "string";
92
92
  newS.enum = oldS.enum;
93
93
  }
94
94
  else {
95
- newS.originalType = 'string';
95
+ newS.originalType = "string";
96
96
  newS.enum = undefined;
97
97
  }
98
98
  }
99
- else if (typeof t !== 'string' && `resource` in t) {
100
- newS.type = 'object';
99
+ else if (typeof t !== "string" && `resource` in t) {
100
+ newS.type = "object";
101
101
  newS.format = `resource-${t.resource}`;
102
102
  }
103
- else if (typeof t !== 'string' && `dynselect` in t) {
104
- newS.type = 'object';
103
+ else if (typeof t !== "string" && `dynselect` in t) {
104
+ newS.type = "object";
105
105
  newS.format = `dynselect-${t.dynselect}`;
106
106
  }
107
- else if (typeof t !== 'string' && `list` in t) {
108
- newS.type = 'array';
109
- if (t.list === 'int' || t.list === 'float') {
110
- newS.items = { type: 'number' };
111
- newS.originalType = 'number[]';
107
+ else if (typeof t !== "string" && `dynmultiselect` in t) {
108
+ newS.type = "object";
109
+ newS.format = `dynmultiselect-${t.dynmultiselect}`;
110
+ }
111
+ else if (typeof t !== "string" && `list` in t) {
112
+ newS.type = "array";
113
+ if (t.list === "int" || t.list === "float") {
114
+ newS.items = { type: "number" };
115
+ newS.originalType = "number[]";
112
116
  }
113
- else if (t.list === 'bytes') {
114
- newS.items = { type: 'string', contentEncoding: 'base64' };
115
- newS.originalType = 'bytes[]';
117
+ else if (t.list === "bytes") {
118
+ newS.items = { type: "string", contentEncoding: "base64" };
119
+ newS.originalType = "bytes[]";
116
120
  }
117
- else if (t.list && typeof t.list == 'object' && 'str' in t.list && t.list.str) {
118
- newS.items = { type: 'string', enum: t.list.str };
119
- newS.originalType = 'enum[]';
121
+ else if (t.list &&
122
+ typeof t.list == "object" &&
123
+ "str" in t.list &&
124
+ t.list.str) {
125
+ newS.items = { type: "string", enum: t.list.str };
126
+ newS.originalType = "enum[]";
120
127
  }
121
- else if (t.list == 'string' || (t.list && typeof t.list == 'object' && 'str' in t.list)) {
122
- newS.items = { type: 'string', enum: oldS.items?.enum };
123
- newS.originalType = 'string[]';
128
+ else if (t.list == "string" ||
129
+ (t.list && typeof t.list == "object" && "str" in t.list)) {
130
+ newS.items = { type: "string", enum: oldS.items?.enum };
131
+ newS.originalType = "string[]";
124
132
  }
125
- else if (t.list && typeof t.list == 'object' && 'resource' in t.list && t.list.resource) {
133
+ else if (t.list &&
134
+ typeof t.list == "object" &&
135
+ "resource" in t.list &&
136
+ t.list.resource) {
126
137
  newS.items = {
127
- type: 'resource',
128
- resourceType: t.list.resource
138
+ type: "resource",
139
+ resourceType: t.list.resource,
129
140
  };
130
- newS.originalType = 'resource[]';
141
+ newS.originalType = "resource[]";
131
142
  }
132
- else if (t.list && typeof t.list == 'object' && 'object' in t.list && t.list.object) {
143
+ else if (t.list &&
144
+ typeof t.list == "object" &&
145
+ "object" in t.list &&
146
+ t.list.object) {
133
147
  if (t.list.object.name) {
134
148
  newS.format = `resource-${t.list.object.name}`;
135
149
  }
136
150
  if (t.list.object.props && t.list.object.props.length > 0) {
137
151
  const properties = {};
138
152
  for (const prop of t.list.object.props) {
139
- properties[prop.key] = { description: '', type: '' };
153
+ properties[prop.key] = { description: "", type: "" };
140
154
  argSigToJsonSchemaType(prop.typ, properties[prop.key]);
141
155
  }
142
- newS.items = { type: 'object', properties: properties };
156
+ newS.items = { type: "object", properties: properties };
143
157
  }
144
158
  else {
145
- newS.items = { type: 'object' };
159
+ newS.items = { type: "object" };
146
160
  }
147
- newS.originalType = 'record[]';
161
+ newS.originalType = "record[]";
148
162
  }
149
163
  else {
150
- newS.items = { type: 'object' };
151
- newS.originalType = 'object[]';
164
+ newS.items = { type: "object" };
165
+ newS.originalType = "object[]";
152
166
  }
153
167
  }
154
168
  else {
155
- newS.type = 'object';
169
+ newS.type = "object";
156
170
  }
157
171
  const preservedFields = [
158
- 'description',
159
- 'pattern',
160
- 'min',
161
- 'max',
162
- 'currency',
163
- 'currencyLocale',
164
- 'multiselect',
165
- 'customErrorMessage',
166
- 'required',
167
- 'showExpr',
168
- 'password',
169
- 'order',
170
- 'dateFormat',
171
- 'title',
172
- 'placeholder'
172
+ "description",
173
+ "pattern",
174
+ "min",
175
+ "max",
176
+ "currency",
177
+ "currencyLocale",
178
+ "multiselect",
179
+ "customErrorMessage",
180
+ "required",
181
+ "showExpr",
182
+ "password",
183
+ "order",
184
+ "dateFormat",
185
+ "title",
186
+ "placeholder",
173
187
  ];
174
188
  preservedFields.forEach((field) => {
175
189
  // @ts-ignore
@@ -180,22 +194,30 @@ export function argSigToJsonSchemaType(t, oldS) {
180
194
  });
181
195
  if (oldS.type != newS.type) {
182
196
  for (const prop of Object.getOwnPropertyNames(newS)) {
183
- if (prop != 'description') {
197
+ if (prop != "description") {
184
198
  // @ts-ignore
185
199
  delete oldS[prop];
186
200
  }
187
201
  }
188
202
  }
189
- else if ((oldS.format == 'date' || oldS.format === 'date-time') && newS.format == 'string') {
203
+ else if ((oldS.format == "date" || oldS.format === "date-time") &&
204
+ newS.format == "string") {
190
205
  newS.format = oldS.format;
191
206
  }
192
- else if (newS.format == 'date-time' && oldS.format == 'date') {
193
- newS.format = 'date';
207
+ else if (newS.format == "date-time" && oldS.format == "date") {
208
+ newS.format = "date";
209
+ }
210
+ else if (newS.format == "date" || newS.format == "date-time") {
211
+ newS.format = oldS.format;
194
212
  }
195
213
  else if (oldS.items?.type != newS.items?.type) {
196
214
  delete oldS.items;
197
215
  }
198
- if (oldS.format && !newS.format) {
216
+ else if (oldS.type == "string" && oldS.format != undefined) {
217
+ newS.format = oldS.format;
218
+ }
219
+ if ((oldS.type != newS.type || newS.type != "string") &&
220
+ newS.format == undefined) {
199
221
  oldS.format = undefined;
200
222
  }
201
223
  Object.assign(oldS, newS);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "windmill-cli",
3
- "version": "1.538.0",
3
+ "version": "1.539.0",
4
4
  "description": "CLI for Windmill",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1108,6 +1108,8 @@ export declare const getVariable: (data: GetVariableData) => CancelablePromise<G
1108
1108
  * @param data The data for the request.
1109
1109
  * @param data.workspace
1110
1110
  * @param data.path
1111
+ * @param data.allowCache allow getting a cached value for improved performance
1112
+ *
1111
1113
  * @returns string variable
1112
1114
  * @throws ApiError
1113
1115
  */
@@ -1363,6 +1365,7 @@ export declare const getResource: (data: GetResourceData) => CancelablePromise<G
1363
1365
  * @param data.workspace
1364
1366
  * @param data.path
1365
1367
  * @param data.jobId job id
1368
+ * @param data.allowCache allow getting a cached value for improved performance
1366
1369
  * @returns unknown resource value
1367
1370
  * @throws ApiError
1368
1371
  */