windmill-cli 1.554.0 → 1.555.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.554.0',
35
+ VERSION: '1.555.0',
36
36
  WITH_CREDENTIALS: true,
37
37
  interceptors: {
38
38
  request: new Interceptors(),
@@ -4027,6 +4027,7 @@ export const runWaitResultScriptByPathGet = (data) => {
4027
4027
  *
4028
4028
  * @param data.jobId The job id to assign to the created job. if missing, job is chosen randomly using the ULID scheme. If a job id already exists in the queue or as a completed job, the request to create one will fail (Bad Request)
4029
4029
  * @param data.skipPreprocessor skip the preprocessor
4030
+ * @param data.memoryId memory ID for chat-enabled flows
4030
4031
  * @returns unknown job result
4031
4032
  * @throws ApiError
4032
4033
  */
@@ -4042,12 +4043,260 @@ export const runWaitResultFlowByPath = (data) => {
4042
4043
  include_header: data.includeHeader,
4043
4044
  queue_limit: data.queueLimit,
4044
4045
  job_id: data.jobId,
4045
- skip_preprocessor: data.skipPreprocessor
4046
+ skip_preprocessor: data.skipPreprocessor,
4047
+ memory_id: data.memoryId
4048
+ },
4049
+ body: data.requestBody,
4050
+ mediaType: 'application/json'
4051
+ });
4052
+ };
4053
+ /**
4054
+ * run flow by path and stream updates via SSE
4055
+ * @param data The data for the request.
4056
+ * @param data.workspace
4057
+ * @param data.path
4058
+ * @param data.requestBody flow args
4059
+ * @param data.includeHeader List of headers's keys (separated with ',') whove value are added to the args
4060
+ * Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key
4061
+ *
4062
+ * @param data.queueLimit The maximum size of the queue for which the request would get rejected if that job would push it above that limit
4063
+ *
4064
+ * @param data.jobId The job id to assign to the created job. if missing, job is chosen randomly using the ULID scheme. If a job id already exists in the queue or as a completed job, the request to create one will fail (Bad Request)
4065
+ * @param data.skipPreprocessor skip the preprocessor
4066
+ * @param data.memoryId memory ID for chat-enabled flows
4067
+ * @param data.pollDelayMs delay between polling for job updates in milliseconds
4068
+ * @returns string server-sent events stream of job updates
4069
+ * @throws ApiError
4070
+ */
4071
+ export const runAndStreamFlowByPath = (data) => {
4072
+ return __request(OpenAPI, {
4073
+ method: 'POST',
4074
+ url: '/w/{workspace}/jobs/run_and_stream/f/{path}',
4075
+ path: {
4076
+ workspace: data.workspace,
4077
+ path: data.path
4078
+ },
4079
+ query: {
4080
+ include_header: data.includeHeader,
4081
+ queue_limit: data.queueLimit,
4082
+ job_id: data.jobId,
4083
+ skip_preprocessor: data.skipPreprocessor,
4084
+ memory_id: data.memoryId,
4085
+ poll_delay_ms: data.pollDelayMs
4086
+ },
4087
+ body: data.requestBody,
4088
+ mediaType: 'application/json'
4089
+ });
4090
+ };
4091
+ /**
4092
+ * run flow by path with GET and stream updates via SSE
4093
+ * @param data The data for the request.
4094
+ * @param data.workspace
4095
+ * @param data.path
4096
+ * @param data.includeHeader List of headers's keys (separated with ',') whove value are added to the args
4097
+ * Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key
4098
+ *
4099
+ * @param data.queueLimit The maximum size of the queue for which the request would get rejected if that job would push it above that limit
4100
+ *
4101
+ * @param data.payload The base64 encoded payload that has been encoded as a JSON. e.g how to encode such payload encodeURIComponent
4102
+ * `encodeURIComponent(btoa(JSON.stringify({a: 2})))`
4103
+ *
4104
+ * @param data.jobId The job id to assign to the created job. if missing, job is chosen randomly using the ULID scheme. If a job id already exists in the queue or as a completed job, the request to create one will fail (Bad Request)
4105
+ * @param data.skipPreprocessor skip the preprocessor
4106
+ * @param data.memoryId memory ID for chat-enabled flows
4107
+ * @param data.pollDelayMs delay between polling for job updates in milliseconds
4108
+ * @returns string server-sent events stream of job updates
4109
+ * @throws ApiError
4110
+ */
4111
+ export const runAndStreamFlowByPathGet = (data) => {
4112
+ return __request(OpenAPI, {
4113
+ method: 'GET',
4114
+ url: '/w/{workspace}/jobs/run_and_stream/f/{path}',
4115
+ path: {
4116
+ workspace: data.workspace,
4117
+ path: data.path
4118
+ },
4119
+ query: {
4120
+ include_header: data.includeHeader,
4121
+ queue_limit: data.queueLimit,
4122
+ payload: data.payload,
4123
+ job_id: data.jobId,
4124
+ skip_preprocessor: data.skipPreprocessor,
4125
+ memory_id: data.memoryId,
4126
+ poll_delay_ms: data.pollDelayMs
4127
+ }
4128
+ });
4129
+ };
4130
+ /**
4131
+ * run script by path and stream updates via SSE
4132
+ * @param data The data for the request.
4133
+ * @param data.workspace
4134
+ * @param data.path
4135
+ * @param data.requestBody script args
4136
+ * @param data.parentJob The parent job that is at the origin and responsible for the execution of this script if any
4137
+ * @param data.tag Override the tag to use
4138
+ * @param data.cacheTtl Override the cache time to live (in seconds). Can not be used to disable caching, only override with a new cache ttl
4139
+ * @param data.jobId The job id to assign to the created job. if missing, job is chosen randomly using the ULID scheme. If a job id already exists in the queue or as a completed job, the request to create one will fail (Bad Request)
4140
+ * @param data.includeHeader List of headers's keys (separated with ',') whove value are added to the args
4141
+ * Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key
4142
+ *
4143
+ * @param data.queueLimit The maximum size of the queue for which the request would get rejected if that job would push it above that limit
4144
+ *
4145
+ * @param data.skipPreprocessor skip the preprocessor
4146
+ * @param data.pollDelayMs delay between polling for job updates in milliseconds
4147
+ * @returns string server-sent events stream of job updates
4148
+ * @throws ApiError
4149
+ */
4150
+ export const runAndStreamScriptByPath = (data) => {
4151
+ return __request(OpenAPI, {
4152
+ method: 'POST',
4153
+ url: '/w/{workspace}/jobs/run_and_stream/p/{path}',
4154
+ path: {
4155
+ workspace: data.workspace,
4156
+ path: data.path
4157
+ },
4158
+ query: {
4159
+ parent_job: data.parentJob,
4160
+ tag: data.tag,
4161
+ cache_ttl: data.cacheTtl,
4162
+ job_id: data.jobId,
4163
+ include_header: data.includeHeader,
4164
+ queue_limit: data.queueLimit,
4165
+ skip_preprocessor: data.skipPreprocessor,
4166
+ poll_delay_ms: data.pollDelayMs
4167
+ },
4168
+ body: data.requestBody,
4169
+ mediaType: 'application/json'
4170
+ });
4171
+ };
4172
+ /**
4173
+ * run script by path with GET and stream updates via SSE
4174
+ * @param data The data for the request.
4175
+ * @param data.workspace
4176
+ * @param data.path
4177
+ * @param data.parentJob The parent job that is at the origin and responsible for the execution of this script if any
4178
+ * @param data.tag Override the tag to use
4179
+ * @param data.cacheTtl Override the cache time to live (in seconds). Can not be used to disable caching, only override with a new cache ttl
4180
+ * @param data.jobId The job id to assign to the created job. if missing, job is chosen randomly using the ULID scheme. If a job id already exists in the queue or as a completed job, the request to create one will fail (Bad Request)
4181
+ * @param data.includeHeader List of headers's keys (separated with ',') whove value are added to the args
4182
+ * Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key
4183
+ *
4184
+ * @param data.queueLimit The maximum size of the queue for which the request would get rejected if that job would push it above that limit
4185
+ *
4186
+ * @param data.payload The base64 encoded payload that has been encoded as a JSON. e.g how to encode such payload encodeURIComponent
4187
+ * `encodeURIComponent(btoa(JSON.stringify({a: 2})))`
4188
+ *
4189
+ * @param data.skipPreprocessor skip the preprocessor
4190
+ * @param data.pollDelayMs delay between polling for job updates in milliseconds
4191
+ * @returns string server-sent events stream of job updates
4192
+ * @throws ApiError
4193
+ */
4194
+ export const runAndStreamScriptByPathGet = (data) => {
4195
+ return __request(OpenAPI, {
4196
+ method: 'GET',
4197
+ url: '/w/{workspace}/jobs/run_and_stream/p/{path}',
4198
+ path: {
4199
+ workspace: data.workspace,
4200
+ path: data.path
4201
+ },
4202
+ query: {
4203
+ parent_job: data.parentJob,
4204
+ tag: data.tag,
4205
+ cache_ttl: data.cacheTtl,
4206
+ job_id: data.jobId,
4207
+ include_header: data.includeHeader,
4208
+ queue_limit: data.queueLimit,
4209
+ payload: data.payload,
4210
+ skip_preprocessor: data.skipPreprocessor,
4211
+ poll_delay_ms: data.pollDelayMs
4212
+ }
4213
+ });
4214
+ };
4215
+ /**
4216
+ * run script by hash and stream updates via SSE
4217
+ * @param data The data for the request.
4218
+ * @param data.workspace
4219
+ * @param data.hash
4220
+ * @param data.requestBody script args
4221
+ * @param data.parentJob The parent job that is at the origin and responsible for the execution of this script if any
4222
+ * @param data.tag Override the tag to use
4223
+ * @param data.cacheTtl Override the cache time to live (in seconds). Can not be used to disable caching, only override with a new cache ttl
4224
+ * @param data.jobId The job id to assign to the created job. if missing, job is chosen randomly using the ULID scheme. If a job id already exists in the queue or as a completed job, the request to create one will fail (Bad Request)
4225
+ * @param data.includeHeader List of headers's keys (separated with ',') whove value are added to the args
4226
+ * Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key
4227
+ *
4228
+ * @param data.queueLimit The maximum size of the queue for which the request would get rejected if that job would push it above that limit
4229
+ *
4230
+ * @param data.skipPreprocessor skip the preprocessor
4231
+ * @param data.pollDelayMs delay between polling for job updates in milliseconds
4232
+ * @returns string server-sent events stream of job updates
4233
+ * @throws ApiError
4234
+ */
4235
+ export const runAndStreamScriptByHash = (data) => {
4236
+ return __request(OpenAPI, {
4237
+ method: 'POST',
4238
+ url: '/w/{workspace}/jobs/run_and_stream/h/{hash}',
4239
+ path: {
4240
+ workspace: data.workspace,
4241
+ hash: data.hash
4242
+ },
4243
+ query: {
4244
+ parent_job: data.parentJob,
4245
+ tag: data.tag,
4246
+ cache_ttl: data.cacheTtl,
4247
+ job_id: data.jobId,
4248
+ include_header: data.includeHeader,
4249
+ queue_limit: data.queueLimit,
4250
+ skip_preprocessor: data.skipPreprocessor,
4251
+ poll_delay_ms: data.pollDelayMs
4046
4252
  },
4047
4253
  body: data.requestBody,
4048
4254
  mediaType: 'application/json'
4049
4255
  });
4050
4256
  };
4257
+ /**
4258
+ * run script by hash with GET and stream updates via SSE
4259
+ * @param data The data for the request.
4260
+ * @param data.workspace
4261
+ * @param data.hash
4262
+ * @param data.parentJob The parent job that is at the origin and responsible for the execution of this script if any
4263
+ * @param data.tag Override the tag to use
4264
+ * @param data.cacheTtl Override the cache time to live (in seconds). Can not be used to disable caching, only override with a new cache ttl
4265
+ * @param data.jobId The job id to assign to the created job. if missing, job is chosen randomly using the ULID scheme. If a job id already exists in the queue or as a completed job, the request to create one will fail (Bad Request)
4266
+ * @param data.includeHeader List of headers's keys (separated with ',') whove value are added to the args
4267
+ * Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key
4268
+ *
4269
+ * @param data.queueLimit The maximum size of the queue for which the request would get rejected if that job would push it above that limit
4270
+ *
4271
+ * @param data.payload The base64 encoded payload that has been encoded as a JSON. e.g how to encode such payload encodeURIComponent
4272
+ * `encodeURIComponent(btoa(JSON.stringify({a: 2})))`
4273
+ *
4274
+ * @param data.skipPreprocessor skip the preprocessor
4275
+ * @param data.pollDelayMs delay between polling for job updates in milliseconds
4276
+ * @returns string server-sent events stream of job updates
4277
+ * @throws ApiError
4278
+ */
4279
+ export const runAndStreamScriptByHashGet = (data) => {
4280
+ return __request(OpenAPI, {
4281
+ method: 'GET',
4282
+ url: '/w/{workspace}/jobs/run_and_stream/h/{hash}',
4283
+ path: {
4284
+ workspace: data.workspace,
4285
+ hash: data.hash
4286
+ },
4287
+ query: {
4288
+ parent_job: data.parentJob,
4289
+ tag: data.tag,
4290
+ cache_ttl: data.cacheTtl,
4291
+ job_id: data.jobId,
4292
+ include_header: data.includeHeader,
4293
+ queue_limit: data.queueLimit,
4294
+ payload: data.payload,
4295
+ skip_preprocessor: data.skipPreprocessor,
4296
+ poll_delay_ms: data.pollDelayMs
4297
+ }
4298
+ });
4299
+ };
4051
4300
  /**
4052
4301
  * get job result by id
4053
4302
  * @param data The data for the request.
@@ -4467,6 +4716,72 @@ export const deleteFlowByPath = (data) => {
4467
4716
  }
4468
4717
  });
4469
4718
  };
4719
+ /**
4720
+ * list flow conversations
4721
+ * @param data The data for the request.
4722
+ * @param data.workspace
4723
+ * @param data.page which page to return (start at 1, default 1)
4724
+ * @param data.perPage number of items to return for a given page (default 30, max 100)
4725
+ * @param data.flowPath filter conversations by flow path
4726
+ * @returns FlowConversation flow conversations list
4727
+ * @throws ApiError
4728
+ */
4729
+ export const listFlowConversations = (data) => {
4730
+ return __request(OpenAPI, {
4731
+ method: 'GET',
4732
+ url: '/w/{workspace}/flow_conversations/list',
4733
+ path: {
4734
+ workspace: data.workspace
4735
+ },
4736
+ query: {
4737
+ page: data.page,
4738
+ per_page: data.perPage,
4739
+ flow_path: data.flowPath
4740
+ }
4741
+ });
4742
+ };
4743
+ /**
4744
+ * delete flow conversation
4745
+ * @param data The data for the request.
4746
+ * @param data.workspace
4747
+ * @param data.conversationId conversation id
4748
+ * @returns string flow conversation deleted
4749
+ * @throws ApiError
4750
+ */
4751
+ export const deleteFlowConversation = (data) => {
4752
+ return __request(OpenAPI, {
4753
+ method: 'DELETE',
4754
+ url: '/w/{workspace}/flow_conversations/delete/{conversation_id}',
4755
+ path: {
4756
+ workspace: data.workspace,
4757
+ conversation_id: data.conversationId
4758
+ }
4759
+ });
4760
+ };
4761
+ /**
4762
+ * list conversation messages
4763
+ * @param data The data for the request.
4764
+ * @param data.workspace
4765
+ * @param data.conversationId conversation id
4766
+ * @param data.page which page to return (start at 1, default 1)
4767
+ * @param data.perPage number of items to return for a given page (default 30, max 100)
4768
+ * @returns FlowConversationMessage conversation messages
4769
+ * @throws ApiError
4770
+ */
4771
+ export const listConversationMessages = (data) => {
4772
+ return __request(OpenAPI, {
4773
+ method: 'GET',
4774
+ url: '/w/{workspace}/flow_conversations/{conversation_id}/messages',
4775
+ path: {
4776
+ workspace: data.workspace,
4777
+ conversation_id: data.conversationId
4778
+ },
4779
+ query: {
4780
+ page: data.page,
4781
+ per_page: data.perPage
4782
+ }
4783
+ });
4784
+ };
4470
4785
  /**
4471
4786
  * list all raw apps
4472
4787
  * @param data The data for the request.
@@ -4844,6 +5159,24 @@ export const getPublicSecretOfApp = (data) => {
4844
5159
  }
4845
5160
  });
4846
5161
  };
5162
+ /**
5163
+ * get public secret of latest version of an app bundle
5164
+ * @param data The data for the request.
5165
+ * @param data.workspace
5166
+ * @param data.path
5167
+ * @returns string app secret
5168
+ * @throws ApiError
5169
+ */
5170
+ export const getPublicSecretOfLatestVersionOfApp = (data) => {
5171
+ return __request(OpenAPI, {
5172
+ method: 'GET',
5173
+ url: '/w/{workspace}/apps/secret_of_latest_version/{path}',
5174
+ path: {
5175
+ workspace: data.workspace,
5176
+ path: data.path
5177
+ }
5178
+ });
5179
+ };
4847
5180
  /**
4848
5181
  * get app by version
4849
5182
  * @param data The data for the request.
@@ -5111,6 +5444,7 @@ export const deleteS3FileFromApp = (data) => {
5111
5444
  * Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key
5112
5445
  *
5113
5446
  * @param data.invisibleToOwner make the run invisible to the the flow owner (default false)
5447
+ * @param data.memoryId memory ID for chat-enabled flows
5114
5448
  * @returns string job created
5115
5449
  * @throws ApiError
5116
5450
  */
@@ -5130,7 +5464,8 @@ export const runFlowByPath = (data) => {
5130
5464
  tag: data.tag,
5131
5465
  job_id: data.jobId,
5132
5466
  include_header: data.includeHeader,
5133
- invisible_to_owner: data.invisibleToOwner
5467
+ invisible_to_owner: data.invisibleToOwner,
5468
+ memory_id: data.memoryId
5134
5469
  },
5135
5470
  body: data.requestBody,
5136
5471
  mediaType: 'application/json'
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.554.0";
41
+ export const VERSION = "1.555.0";
42
42
  export const WM_FORK_PREFIX = "wm-fork";
43
43
  const command = new Command()
44
44
  .name("wmill")
@@ -5,15 +5,18 @@ import { newPathAssigner } from "../path-utils/path-assigner.js";
5
5
  *
6
6
  * @param modules - Array of flow modules to process
7
7
  * @param mapping - Optional mapping of module IDs to custom file paths
8
+ * @param separator - Path separator to use
8
9
  * @param defaultTs - Default TypeScript runtime to use ("bun" or "deno")
10
+ * @param pathAssigner - Optional path assigner to reuse (for nested calls)
9
11
  * @returns Array of inline scripts with their paths and content
10
12
  */
11
- export function extractInlineScripts(modules, mapping = {}, separator = "/", defaultTs) {
12
- const pathAssigner = newPathAssigner(defaultTs ?? "bun");
13
+ export function extractInlineScripts(modules, mapping = {}, separator = "/", defaultTs, pathAssigner) {
14
+ // Create pathAssigner only if not provided (top-level call), but reuse it for nested calls
15
+ const assigner = pathAssigner ?? newPathAssigner(defaultTs ?? "bun");
13
16
  return modules.flatMap((m) => {
14
17
  if (m.value.type == "rawscript") {
15
18
  let basePath, ext;
16
- [basePath, ext] = pathAssigner.assignPath(m.summary, m.value.language);
19
+ [basePath, ext] = assigner.assignPath(m.summary, m.value.language);
17
20
  const path = mapping[m.id] ?? basePath + ext;
18
21
  const content = m.value.content;
19
22
  const r = [{ path: path, content: content }];
@@ -27,18 +30,18 @@ export function extractInlineScripts(modules, mapping = {}, separator = "/", def
27
30
  return r;
28
31
  }
29
32
  else if (m.value.type == "forloopflow") {
30
- return extractInlineScripts(m.value.modules, mapping, separator, defaultTs);
33
+ return extractInlineScripts(m.value.modules, mapping, separator, defaultTs, assigner);
31
34
  }
32
35
  else if (m.value.type == "branchall") {
33
- return m.value.branches.flatMap((b) => extractInlineScripts(b.modules, mapping, separator, defaultTs));
36
+ return m.value.branches.flatMap((b) => extractInlineScripts(b.modules, mapping, separator, defaultTs, assigner));
34
37
  }
35
38
  else if (m.value.type == "whileloopflow") {
36
- return extractInlineScripts(m.value.modules, mapping, separator, defaultTs);
39
+ return extractInlineScripts(m.value.modules, mapping, separator, defaultTs, assigner);
37
40
  }
38
41
  else if (m.value.type == "branchone") {
39
42
  return [
40
- ...m.value.branches.flatMap((b) => extractInlineScripts(b.modules, mapping, separator, defaultTs)),
41
- ...extractInlineScripts(m.value.default, mapping, separator, defaultTs),
43
+ ...m.value.branches.flatMap((b) => extractInlineScripts(b.modules, mapping, separator, defaultTs, assigner)),
44
+ ...extractInlineScripts(m.value.default, mapping, separator, defaultTs, assigner),
42
45
  ];
43
46
  }
44
47
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "windmill-cli",
3
- "version": "1.554.0",
3
+ "version": "1.555.0",
4
4
  "description": "CLI for Windmill",
5
5
  "repository": {
6
6
  "type": "git",