@epilot/sdk 2.0.0-beta.3 → 2.0.0-beta.4

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 (189) hide show
  1. package/definitions/access-token-runtime.json +1 -0
  2. package/definitions/access-token.json +663 -0
  3. package/definitions/address-runtime.json +1 -0
  4. package/definitions/address-suggestions-runtime.json +1 -0
  5. package/definitions/address-suggestions.json +582 -0
  6. package/definitions/address.json +578 -0
  7. package/definitions/ai-agents-runtime.json +1 -0
  8. package/definitions/ai-agents.json +1711 -0
  9. package/definitions/app-runtime.json +1 -0
  10. package/definitions/app.json +4443 -0
  11. package/definitions/audit-logs-runtime.json +1 -0
  12. package/definitions/audit-logs.json +305 -0
  13. package/definitions/automation-runtime.json +1 -0
  14. package/definitions/automation.json +4850 -0
  15. package/definitions/billing-runtime.json +1 -0
  16. package/definitions/billing.json +837 -0
  17. package/definitions/blueprint-manifest-runtime.json +1 -0
  18. package/definitions/blueprint-manifest.json +3376 -0
  19. package/definitions/consent-runtime.json +1 -0
  20. package/definitions/consent.json +344 -0
  21. package/definitions/customer-portal-runtime.json +1 -0
  22. package/definitions/customer-portal.json +15000 -0
  23. package/definitions/dashboard-runtime.json +1 -0
  24. package/definitions/dashboard.json +484 -0
  25. package/definitions/data-management-runtime.json +1 -0
  26. package/definitions/data-management.json +962 -0
  27. package/definitions/deduplication-runtime.json +1 -0
  28. package/definitions/deduplication.json +183 -0
  29. package/definitions/design-runtime.json +1 -0
  30. package/definitions/design.json +1423 -0
  31. package/definitions/document-runtime.json +1 -0
  32. package/definitions/document.json +758 -0
  33. package/definitions/email-settings-runtime.json +1 -0
  34. package/definitions/email-settings.json +2627 -0
  35. package/definitions/email-template-runtime.json +1 -0
  36. package/definitions/email-template.json +1419 -0
  37. package/definitions/entity-mapping-runtime.json +1 -0
  38. package/definitions/entity-mapping.json +1642 -0
  39. package/definitions/entity-runtime.json +1 -0
  40. package/definitions/entity.json +10074 -0
  41. package/definitions/environments-runtime.json +1 -0
  42. package/definitions/environments.json +363 -0
  43. package/definitions/erp-integration-runtime.json +1 -0
  44. package/definitions/erp-integration.json +5845 -0
  45. package/definitions/event-catalog-runtime.json +1 -0
  46. package/definitions/event-catalog.json +1051 -0
  47. package/definitions/file-runtime.json +1 -0
  48. package/definitions/file.json +2842 -0
  49. package/definitions/iban-runtime.json +1 -0
  50. package/definitions/iban.json +132 -0
  51. package/definitions/journey-runtime.json +1 -0
  52. package/definitions/journey.json +2341 -0
  53. package/definitions/kanban-runtime.json +1 -0
  54. package/definitions/kanban.json +929 -0
  55. package/definitions/message-runtime.json +1 -0
  56. package/definitions/message.json +2660 -0
  57. package/definitions/metering-runtime.json +1 -0
  58. package/definitions/metering.json +2321 -0
  59. package/definitions/notes-runtime.json +1 -0
  60. package/definitions/notes.json +1531 -0
  61. package/definitions/notification-runtime.json +1 -0
  62. package/definitions/notification.json +1425 -0
  63. package/definitions/organization-runtime.json +1 -0
  64. package/definitions/organization.json +629 -0
  65. package/definitions/partner-directory-runtime.json +1 -0
  66. package/definitions/partner-directory.json +1718 -0
  67. package/definitions/permissions-runtime.json +1 -0
  68. package/definitions/permissions.json +1480 -0
  69. package/definitions/pricing-runtime.json +1 -0
  70. package/definitions/pricing-tier-runtime.json +1 -0
  71. package/definitions/pricing-tier.json +105 -0
  72. package/definitions/pricing.json +9884 -0
  73. package/definitions/purpose-runtime.json +1 -0
  74. package/definitions/purpose.json +524 -0
  75. package/definitions/sandbox-runtime.json +1 -0
  76. package/definitions/sandbox.json +453 -0
  77. package/definitions/submission-runtime.json +1 -0
  78. package/definitions/submission.json +313 -0
  79. package/definitions/targeting-runtime.json +1 -0
  80. package/definitions/targeting.json +1474 -0
  81. package/definitions/template-variables-runtime.json +1 -0
  82. package/definitions/template-variables.json +1408 -0
  83. package/definitions/user-runtime.json +1 -0
  84. package/definitions/user.json +2408 -0
  85. package/definitions/validation-rules-runtime.json +1 -0
  86. package/definitions/validation-rules.json +1491 -0
  87. package/definitions/webhooks-runtime.json +1 -0
  88. package/definitions/webhooks.json +1525 -0
  89. package/definitions/workflow-definition-runtime.json +1 -0
  90. package/definitions/workflow-definition.json +3417 -0
  91. package/definitions/workflow-runtime.json +1 -0
  92. package/definitions/workflow.json +4106 -0
  93. package/dist/apis/access-token.cjs +13 -84
  94. package/dist/apis/access-token.js +11 -82
  95. package/dist/apis/address-suggestions.cjs +13 -127
  96. package/dist/apis/address-suggestions.js +11 -125
  97. package/dist/apis/address.cjs +13 -79
  98. package/dist/apis/address.js +11 -77
  99. package/dist/apis/ai-agents.cjs +13 -210
  100. package/dist/apis/ai-agents.js +11 -208
  101. package/dist/apis/app.cjs +13 -568
  102. package/dist/apis/app.js +11 -566
  103. package/dist/apis/audit-logs.cjs +13 -50
  104. package/dist/apis/audit-logs.js +11 -48
  105. package/dist/apis/automation.cjs +13 -277
  106. package/dist/apis/automation.js +11 -275
  107. package/dist/apis/billing.cjs +13 -170
  108. package/dist/apis/billing.js +11 -168
  109. package/dist/apis/blueprint-manifest.cjs +13 -499
  110. package/dist/apis/blueprint-manifest.js +11 -497
  111. package/dist/apis/consent.cjs +13 -79
  112. package/dist/apis/consent.js +11 -77
  113. package/dist/apis/customer-portal.cjs +13 -2247
  114. package/dist/apis/customer-portal.js +11 -2245
  115. package/dist/apis/dashboard.cjs +13 -79
  116. package/dist/apis/dashboard.js +11 -77
  117. package/dist/apis/data-management.cjs +13 -235
  118. package/dist/apis/data-management.js +11 -233
  119. package/dist/apis/deduplication.cjs +13 -37
  120. package/dist/apis/deduplication.js +11 -35
  121. package/dist/apis/design.cjs +13 -214
  122. package/dist/apis/design.js +11 -212
  123. package/dist/apis/document.cjs +13 -73
  124. package/dist/apis/document.js +11 -71
  125. package/dist/apis/email-settings.cjs +13 -528
  126. package/dist/apis/email-settings.js +11 -526
  127. package/dist/apis/email-template.cjs +13 -117
  128. package/dist/apis/email-template.js +11 -115
  129. package/dist/apis/entity-mapping.cjs +13 -210
  130. package/dist/apis/entity-mapping.js +11 -208
  131. package/dist/apis/entity.cjs +13 -1595
  132. package/dist/apis/entity.js +11 -1593
  133. package/dist/apis/environments.cjs +13 -66
  134. package/dist/apis/environments.js +11 -64
  135. package/dist/apis/erp-integration.cjs +13 -581
  136. package/dist/apis/erp-integration.js +11 -579
  137. package/dist/apis/event-catalog.cjs +13 -125
  138. package/dist/apis/event-catalog.js +11 -123
  139. package/dist/apis/file.cjs +13 -568
  140. package/dist/apis/file.js +11 -566
  141. package/dist/apis/iban.cjs +13 -38
  142. package/dist/apis/iban.js +11 -36
  143. package/dist/apis/journey.cjs +13 -265
  144. package/dist/apis/journey.js +11 -263
  145. package/dist/apis/kanban.cjs +13 -159
  146. package/dist/apis/kanban.js +11 -157
  147. package/dist/apis/message.cjs +13 -668
  148. package/dist/apis/message.js +11 -666
  149. package/dist/apis/metering.cjs +13 -394
  150. package/dist/apis/metering.js +11 -392
  151. package/dist/apis/notes.cjs +13 -214
  152. package/dist/apis/notes.js +11 -212
  153. package/dist/apis/notification.cjs +13 -232
  154. package/dist/apis/notification.js +11 -230
  155. package/dist/apis/organization.cjs +13 -113
  156. package/dist/apis/organization.js +11 -111
  157. package/dist/apis/partner-directory.cjs +13 -277
  158. package/dist/apis/partner-directory.js +11 -275
  159. package/dist/apis/permissions.cjs +13 -173
  160. package/dist/apis/permissions.js +11 -171
  161. package/dist/apis/pricing-tier.cjs +14 -32
  162. package/dist/apis/pricing-tier.js +11 -29
  163. package/dist/apis/pricing.cjs +13 -434
  164. package/dist/apis/pricing.js +11 -432
  165. package/dist/apis/purpose.cjs +13 -175
  166. package/dist/apis/purpose.js +11 -173
  167. package/dist/apis/sandbox.cjs +13 -95
  168. package/dist/apis/sandbox.js +11 -93
  169. package/dist/apis/submission.cjs +13 -50
  170. package/dist/apis/submission.js +11 -48
  171. package/dist/apis/targeting.cjs +13 -270
  172. package/dist/apis/targeting.js +11 -268
  173. package/dist/apis/template-variables.cjs +13 -154
  174. package/dist/apis/template-variables.js +11 -152
  175. package/dist/apis/user.cjs +13 -483
  176. package/dist/apis/user.js +11 -481
  177. package/dist/apis/validation-rules.cjs +13 -115
  178. package/dist/apis/validation-rules.js +11 -113
  179. package/dist/apis/webhooks.cjs +13 -247
  180. package/dist/apis/webhooks.js +11 -245
  181. package/dist/apis/workflow-definition.cjs +13 -337
  182. package/dist/apis/workflow-definition.js +11 -335
  183. package/dist/apis/workflow.cjs +13 -397
  184. package/dist/apis/workflow.js +11 -395
  185. package/dist/{chunk-D7ICL3AM.cjs → chunk-5LXNSDG2.cjs} +51 -2
  186. package/dist/{chunk-DGCGLG7G.js → chunk-QMQNMCOC.js} +49 -0
  187. package/dist/index.cjs +56 -54
  188. package/dist/index.js +53 -51
  189. package/package.json +50 -3
@@ -2,411 +2,27 @@ import {
2
2
  __commonJS,
3
3
  authorize,
4
4
  createApiClient,
5
- createApiHandle
6
- } from "../chunk-DGCGLG7G.js";
5
+ createApiHandle,
6
+ expand
7
+ } from "../chunk-QMQNMCOC.js";
7
8
 
8
- // src/definitions/workflow.json
9
- var require_workflow = __commonJS({
10
- "src/definitions/workflow.json"(exports, module) {
11
- module.exports = {
12
- openapi: "3.0.0",
13
- info: {
14
- title: "",
15
- version: ""
16
- },
17
- servers: [
18
- {
19
- url: "https://workflows-execution.sls.epilot.io"
20
- }
21
- ],
22
- paths: {
23
- "/v1/workflows/executions": {
24
- get: {
25
- operationId: "getExecutions",
26
- parameters: [
27
- {
28
- in: "query",
29
- name: "context",
30
- required: false
31
- },
32
- {
33
- in: "query",
34
- name: "schema",
35
- required: false
36
- }
37
- ],
38
- responses: {}
39
- },
40
- post: {
41
- operationId: "createExecution",
42
- requestBody: {
43
- required: true,
44
- content: {
45
- "application/json": {}
46
- }
47
- },
48
- responses: {}
49
- }
50
- },
51
- "/v1/workflows/executions/{executionId}": {
52
- get: {
53
- operationId: "getExecution",
54
- parameters: [
55
- {
56
- in: "path",
57
- name: "executionId",
58
- required: true
59
- }
60
- ],
61
- responses: {}
62
- },
63
- patch: {
64
- operationId: "updateExecution",
65
- parameters: [
66
- {
67
- in: "path",
68
- name: "executionId",
69
- required: true
70
- }
71
- ],
72
- requestBody: {
73
- required: true,
74
- content: {
75
- "application/json": {}
76
- }
77
- },
78
- responses: {}
79
- },
80
- delete: {
81
- operationId: "deleteExecution",
82
- parameters: [
83
- {
84
- in: "path",
85
- name: "executionId",
86
- required: true
87
- }
88
- ],
89
- responses: {}
90
- }
91
- },
92
- "/v1/workflows/executions/{executionId}/steps": {
93
- post: {
94
- operationId: "createStep",
95
- parameters: [
96
- {
97
- in: "path",
98
- name: "executionId",
99
- required: true
100
- }
101
- ],
102
- requestBody: {
103
- required: true,
104
- content: {
105
- "application/json": {}
106
- }
107
- },
108
- responses: {}
109
- }
110
- },
111
- "/v1/workflows/executions/{executionId}/steps/{stepId}": {
112
- patch: {
113
- operationId: "updateStep",
114
- parameters: [
115
- {
116
- in: "path",
117
- name: "executionId",
118
- required: true
119
- },
120
- {
121
- in: "path",
122
- name: "stepId",
123
- required: true
124
- }
125
- ],
126
- requestBody: {
127
- required: true,
128
- content: {
129
- "application/json": {}
130
- }
131
- },
132
- responses: {}
133
- },
134
- delete: {
135
- operationId: "deleteStep",
136
- parameters: [
137
- {
138
- in: "path",
139
- name: "executionId",
140
- required: true
141
- },
142
- {
143
- in: "path",
144
- name: "stepId",
145
- required: true
146
- }
147
- ],
148
- responses: {}
149
- }
150
- },
151
- "/v1/workflows/executions/search": {
152
- post: {
153
- deprecated: true,
154
- operationId: "searchExecutions",
155
- requestBody: {
156
- required: true,
157
- content: {
158
- "application/json": {}
159
- }
160
- },
161
- responses: {}
162
- }
163
- },
164
- "/v1/workflows/executions/steps/search": {
165
- post: {
166
- deprecated: true,
167
- operationId: "searchSteps",
168
- requestBody: {
169
- required: true,
170
- content: {
171
- "application/json": {}
172
- }
173
- },
174
- responses: {}
175
- }
176
- },
177
- "/v1/workflows/executions/{executionId}/closing-reasons": {
178
- get: {
179
- operationId: "getClosingReasonExecution",
180
- parameters: [
181
- {
182
- in: "path",
183
- name: "executionId",
184
- required: true
185
- }
186
- ],
187
- responses: {}
188
- }
189
- },
190
- "/v2/flows/executions": {
191
- post: {
192
- operationId: "startFlowExecution",
193
- requestBody: {
194
- required: true,
195
- content: {
196
- "application/json": {}
197
- }
198
- },
199
- responses: {}
200
- }
201
- },
202
- "/v2/flows/executions/{execution_id}": {
203
- get: {
204
- operationId: "getFlowExecution",
205
- parameters: [
206
- {
207
- $ref: "#/components/parameters/ExecutionIdParam"
208
- }
209
- ],
210
- responses: {}
211
- },
212
- patch: {
213
- operationId: "patchFlowExecution",
214
- parameters: [
215
- {
216
- $ref: "#/components/parameters/ExecutionIdParam"
217
- }
218
- ],
219
- requestBody: {
220
- required: true,
221
- content: {
222
- "application/json": {}
223
- }
224
- },
225
- responses: {}
226
- },
227
- delete: {
228
- operationId: "deleteFlowExecution",
229
- parameters: [
230
- {
231
- $ref: "#/components/parameters/ExecutionIdParam"
232
- },
233
- {
234
- $ref: "#/components/parameters/SoftDeleteParam"
235
- }
236
- ],
237
- responses: {}
238
- }
239
- },
240
- "/v2/flows/executions:search": {
241
- post: {
242
- operationId: "searchFlowExecutions",
243
- requestBody: {
244
- required: true,
245
- content: {
246
- "application/json": {}
247
- }
248
- },
249
- responses: {}
250
- }
251
- },
252
- "/v2/flows/executions/{execution_id}/tasks/{task_id}": {
253
- patch: {
254
- operationId: "patchTask",
255
- parameters: [
256
- {
257
- $ref: "#/components/parameters/ExecutionIdParam"
258
- },
259
- {
260
- $ref: "#/components/parameters/TaskIdParam"
261
- }
262
- ],
263
- requestBody: {
264
- required: true,
265
- content: {
266
- "application/json": {}
267
- }
268
- },
269
- responses: {}
270
- }
271
- },
272
- "/v2/flows/executions/{execution_id}/tasks/{task_id}/automation:run": {
273
- post: {
274
- operationId: "runTaskAutomation",
275
- parameters: [
276
- {
277
- $ref: "#/components/parameters/ExecutionIdParam"
278
- },
279
- {
280
- $ref: "#/components/parameters/TaskIdParam"
281
- }
282
- ],
283
- responses: {}
284
- }
285
- },
286
- "/v2/flows/executions/{execution_id}/tasks/{task_id}/execute": {
287
- post: {
288
- operationId: "executeTask",
289
- parameters: [
290
- {
291
- $ref: "#/components/parameters/ExecutionIdParam"
292
- },
293
- {
294
- $ref: "#/components/parameters/TaskIdParam"
295
- }
296
- ],
297
- responses: {}
298
- }
299
- },
300
- "/v2/flows/executions/{execution_id}/phases/{phase_id}": {
301
- patch: {
302
- operationId: "patchPhase",
303
- parameters: [
304
- {
305
- $ref: "#/components/parameters/ExecutionIdParam"
306
- },
307
- {
308
- $ref: "#/components/parameters/PhaseIdParam"
309
- }
310
- ],
311
- requestBody: {
312
- required: true,
313
- content: {
314
- "application/json": {}
315
- }
316
- },
317
- responses: {}
318
- }
319
- },
320
- "/v2/flows/executions/{execution_id}/tasks": {
321
- post: {
322
- operationId: "addTask",
323
- parameters: [
324
- {
325
- $ref: "#/components/parameters/ExecutionIdParam"
326
- }
327
- ],
328
- requestBody: {
329
- required: true,
330
- content: {
331
- "application/json": {}
332
- }
333
- },
334
- responses: {}
335
- }
336
- },
337
- "/v2/flows/executions/{execution_id}/tasks/{task_id}/schedule": {
338
- delete: {
339
- operationId: "cancelTaskSchedule",
340
- parameters: [
341
- {
342
- $ref: "#/components/parameters/ExecutionIdParam"
343
- },
344
- {
345
- $ref: "#/components/parameters/TaskIdParam"
346
- }
347
- ],
348
- responses: {}
349
- }
350
- },
351
- "/v2/flows/executions/{execution_id}/schedules/{schedule_id}": {
352
- post: {
353
- operationId: "cancelSchedule",
354
- deprecated: true,
355
- parameters: [
356
- {
357
- $ref: "#/components/parameters/ExecutionIdParam"
358
- },
359
- {
360
- $ref: "#/components/parameters/ScheduleIdParam"
361
- }
362
- ],
363
- responses: {}
364
- }
365
- }
366
- },
367
- components: {
368
- parameters: {
369
- ExecutionIdParam: {
370
- in: "path",
371
- name: "execution_id",
372
- required: true
373
- },
374
- TaskIdParam: {
375
- in: "path",
376
- name: "task_id",
377
- required: true
378
- },
379
- PhaseIdParam: {
380
- in: "path",
381
- name: "phase_id",
382
- required: true
383
- },
384
- ScheduleIdParam: {
385
- in: "path",
386
- name: "schedule_id",
387
- required: true
388
- },
389
- SoftDeleteParam: {
390
- in: "query",
391
- name: "soft",
392
- required: false
393
- }
394
- }
395
- }
396
- };
9
+ // src/definitions/workflow-runtime.json
10
+ var require_workflow_runtime = __commonJS({
11
+ "src/definitions/workflow-runtime.json"(exports, module) {
12
+ module.exports = { s: "https://workflows-execution.sls.epilot.io", o: [["getExecutions", "get", "/v1/workflows/executions", [["context", "q"], ["schema", "q"]]], ["createExecution", "post", "/v1/workflows/executions", null, 1], ["getExecution", "get", "/v1/workflows/executions/{executionId}", [["executionId", "p", true]]], ["updateExecution", "patch", "/v1/workflows/executions/{executionId}", [["executionId", "p", true]], 1], ["deleteExecution", "delete", "/v1/workflows/executions/{executionId}", [["executionId", "p", true]]], ["createStep", "post", "/v1/workflows/executions/{executionId}/steps", [["executionId", "p", true]], 1], ["updateStep", "patch", "/v1/workflows/executions/{executionId}/steps/{stepId}", [["executionId", "p", true], ["stepId", "p", true]], 1], ["deleteStep", "delete", "/v1/workflows/executions/{executionId}/steps/{stepId}", [["executionId", "p", true], ["stepId", "p", true]]], ["searchExecutions", "post", "/v1/workflows/executions/search", null, 1], ["searchSteps", "post", "/v1/workflows/executions/steps/search", null, 1], ["getClosingReasonExecution", "get", "/v1/workflows/executions/{executionId}/closing-reasons", [["executionId", "p", true]]], ["startFlowExecution", "post", "/v2/flows/executions", null, 1], ["getFlowExecution", "get", "/v2/flows/executions/{execution_id}", [["ExecutionIdParam"]]], ["patchFlowExecution", "patch", "/v2/flows/executions/{execution_id}", [["ExecutionIdParam"]], 1], ["deleteFlowExecution", "delete", "/v2/flows/executions/{execution_id}", [["ExecutionIdParam"], ["SoftDeleteParam"]]], ["searchFlowExecutions", "post", "/v2/flows/executions:search", null, 1], ["patchTask", "patch", "/v2/flows/executions/{execution_id}/tasks/{task_id}", [["ExecutionIdParam"], ["TaskIdParam"]], 1], ["runTaskAutomation", "post", "/v2/flows/executions/{execution_id}/tasks/{task_id}/automation:run", [["ExecutionIdParam"], ["TaskIdParam"]]], ["executeTask", "post", "/v2/flows/executions/{execution_id}/tasks/{task_id}/execute", [["ExecutionIdParam"], ["TaskIdParam"]]], ["patchPhase", "patch", "/v2/flows/executions/{execution_id}/phases/{phase_id}", [["ExecutionIdParam"], ["PhaseIdParam"]], 1], ["addTask", "post", "/v2/flows/executions/{execution_id}/tasks", [["ExecutionIdParam"]], 1], ["cancelTaskSchedule", "delete", "/v2/flows/executions/{execution_id}/tasks/{task_id}/schedule", [["ExecutionIdParam"], ["TaskIdParam"]]], ["cancelSchedule", "post", "/v2/flows/executions/{execution_id}/schedules/{schedule_id}", [["ExecutionIdParam"], ["ScheduleIdParam"]]]], v: "3.0.0", cp: { ExecutionIdParam: ["execution_id", "p", true], TaskIdParam: ["task_id", "p", true], PhaseIdParam: ["phase_id", "p", true], ScheduleIdParam: ["schedule_id", "p", true], SoftDeleteParam: ["soft", "q"] } };
397
13
  }
398
14
  });
399
15
 
400
16
  // src/apis/workflow.ts
401
17
  var loadDefinition = () => {
402
- const mod = require_workflow();
403
- return mod.default ?? mod;
18
+ const mod = require_workflow_runtime();
19
+ return expand(mod.default ?? mod);
404
20
  };
405
21
  var _instance = null;
406
22
  var resolve = () => {
407
23
  if (!_instance) {
408
- const definition = loadDefinition();
409
- _instance = createApiClient({ definition });
24
+ const def = loadDefinition();
25
+ _instance = createApiClient({ definition: def });
410
26
  }
411
27
  return _instance;
412
28
  };
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }var __getOwnPropNames = Object.getOwnPropertyNames;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var __getOwnPropNames = Object.getOwnPropertyNames;
2
2
  var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
3
3
  get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
4
4
  }) : x)(function(x) {
@@ -23,6 +23,54 @@ var authorize = (client, token) => {
23
23
  return client;
24
24
  };
25
25
 
26
+ // src/compact.ts
27
+ var L = { p: "path", q: "query", h: "header", c: "cookie" };
28
+ var ep = (p) => {
29
+ const r = { name: p[0], in: L[p[1]] };
30
+ let i = 2;
31
+ if (typeof p[i] === "boolean") {
32
+ if (p[i]) r.required = true;
33
+ i++;
34
+ }
35
+ if (typeof p[i] === "string") {
36
+ r.style = p[i];
37
+ i++;
38
+ }
39
+ if (typeof p[i] === "boolean") {
40
+ r.explode = p[i];
41
+ i++;
42
+ }
43
+ return r;
44
+ };
45
+ var mp = (ps) => ps.map((p) => p.length === 1 ? { $ref: `#/components/parameters/${p[0]}` } : ep(p));
46
+ var expand = (c) => {
47
+ const paths = {};
48
+ for (const [id, m, p, ps, b] of c.o) {
49
+ const op = { operationId: id, responses: {} };
50
+ if (_optionalChain([ps, 'optionalAccess', _2 => _2.length])) op.parameters = mp(ps);
51
+ if (b) op.requestBody = { content: { "application/json": {} } };
52
+ if (!paths[p]) paths[p] = {};
53
+ paths[p][m] = op;
54
+ }
55
+ if (c.pp)
56
+ for (const [p, ps] of Object.entries(c.pp)) {
57
+ if (!paths[p]) paths[p] = {};
58
+ paths[p].parameters = mp(ps);
59
+ }
60
+ const doc = {
61
+ openapi: c.v || "3.0.2",
62
+ info: { title: "", version: "" },
63
+ paths,
64
+ servers: [{ url: c.s }]
65
+ };
66
+ if (c.cp) {
67
+ const params = {};
68
+ for (const [k, v] of Object.entries(c.cp)) params[k] = ep(v);
69
+ doc.components = { parameters: params };
70
+ }
71
+ return doc;
72
+ };
73
+
26
74
  // src/client-factory.ts
27
75
  var _openapiclientaxios = require('openapi-client-axios'); var _openapiclientaxios2 = _interopRequireDefault(_openapiclientaxios);
28
76
  var createApiClient = (params) => {
@@ -73,4 +121,5 @@ var createApiHandle = (params) => {
73
121
 
74
122
 
75
123
 
76
- exports.__require = __require; exports.__commonJS = __commonJS; exports.authorize = authorize; exports.createApiClient = createApiClient; exports.createApiHandle = createApiHandle;
124
+
125
+ exports.__require = __require; exports.__commonJS = __commonJS; exports.authorize = authorize; exports.expand = expand; exports.createApiClient = createApiClient; exports.createApiHandle = createApiHandle;
@@ -23,6 +23,54 @@ var authorize = (client, token) => {
23
23
  return client;
24
24
  };
25
25
 
26
+ // src/compact.ts
27
+ var L = { p: "path", q: "query", h: "header", c: "cookie" };
28
+ var ep = (p) => {
29
+ const r = { name: p[0], in: L[p[1]] };
30
+ let i = 2;
31
+ if (typeof p[i] === "boolean") {
32
+ if (p[i]) r.required = true;
33
+ i++;
34
+ }
35
+ if (typeof p[i] === "string") {
36
+ r.style = p[i];
37
+ i++;
38
+ }
39
+ if (typeof p[i] === "boolean") {
40
+ r.explode = p[i];
41
+ i++;
42
+ }
43
+ return r;
44
+ };
45
+ var mp = (ps) => ps.map((p) => p.length === 1 ? { $ref: `#/components/parameters/${p[0]}` } : ep(p));
46
+ var expand = (c) => {
47
+ const paths = {};
48
+ for (const [id, m, p, ps, b] of c.o) {
49
+ const op = { operationId: id, responses: {} };
50
+ if (ps?.length) op.parameters = mp(ps);
51
+ if (b) op.requestBody = { content: { "application/json": {} } };
52
+ if (!paths[p]) paths[p] = {};
53
+ paths[p][m] = op;
54
+ }
55
+ if (c.pp)
56
+ for (const [p, ps] of Object.entries(c.pp)) {
57
+ if (!paths[p]) paths[p] = {};
58
+ paths[p].parameters = mp(ps);
59
+ }
60
+ const doc = {
61
+ openapi: c.v || "3.0.2",
62
+ info: { title: "", version: "" },
63
+ paths,
64
+ servers: [{ url: c.s }]
65
+ };
66
+ if (c.cp) {
67
+ const params = {};
68
+ for (const [k, v] of Object.entries(c.cp)) params[k] = ep(v);
69
+ doc.components = { parameters: params };
70
+ }
71
+ return doc;
72
+ };
73
+
26
74
  // src/client-factory.ts
27
75
  import OpenAPIClientAxios from "openapi-client-axios";
28
76
  var createApiClient = (params) => {
@@ -71,6 +119,7 @@ export {
71
119
  __require,
72
120
  __commonJS,
73
121
  authorize,
122
+ expand,
74
123
  createApiClient,
75
124
  createApiHandle
76
125
  };