@epilot/cli 0.1.9 → 0.1.11

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 (78) hide show
  1. package/README.md +3 -3
  2. package/definitions/app.json +56 -6
  3. package/definitions/blueprint-manifest.json +115 -1
  4. package/definitions/customer-portal.json +757 -81
  5. package/definitions/data-management.json +10 -0
  6. package/definitions/email-settings.json +121 -0
  7. package/definitions/email-template.json +25 -3
  8. package/definitions/entity.json +328 -10
  9. package/definitions/erp-integration.json +472 -13
  10. package/definitions/journey.json +274 -12
  11. package/definitions/kanban.json +654 -78
  12. package/definitions/organization.json +614 -51
  13. package/definitions/partner-directory.json +795 -229
  14. package/definitions/permissions.json +41 -6
  15. package/definitions/webhooks.json +111 -2
  16. package/definitions/workflow.json +40 -0
  17. package/dist/{access-token-PTTCRMGK.js → access-token-CIM4RLBP.js} +1 -1
  18. package/dist/add-component-IW4644NE.js +241 -0
  19. package/dist/{address-2FDPEPR6.js → address-EDRTUWTP.js} +1 -1
  20. package/dist/{address-suggestions-XBEK5DDQ.js → address-suggestions-S5WEST2N.js} +1 -1
  21. package/dist/{ai-agents-ZY5BNVTN.js → ai-agents-RXDDJDAR.js} +1 -1
  22. package/dist/{app-IT5FWGUK.js → api-36XROHLK.js} +5 -5
  23. package/dist/app-BKS7M4UQ.js +24 -0
  24. package/dist/{audit-logs-FB4TE4TI.js → audit-logs-PXGDGJGV.js} +1 -1
  25. package/dist/{automation-JE5LDKJM.js → automation-LS6MVLP2.js} +1 -1
  26. package/dist/{billing-GOFCP5T3.js → billing-KVYFUKZK.js} +1 -1
  27. package/dist/bin/epilot.js +52 -52
  28. package/dist/{blueprint-manifest-WJIQKFYK.js → blueprint-manifest-W4ZGJD2Z.js} +1 -1
  29. package/dist/{chunk-P5IZZW4Y.js → chunk-BYAEI4Z2.js} +1 -1
  30. package/dist/{chunk-PHXL66VA.js → chunk-K2UQOP3Q.js} +28 -11
  31. package/dist/chunk-POCU2J27.js +365 -0
  32. package/dist/{completion-EKFXGPNK.js → completion-HTO64G2S.js} +1 -1
  33. package/dist/{consent-DSMWWHUL.js → consent-M4QB2HPM.js} +1 -1
  34. package/dist/{customer-portal-IJYTJYUZ.js → customer-portal-SVO2YCXA.js} +1 -1
  35. package/dist/{dashboard-DOAX6XDG.js → dashboard-CYCXIX74.js} +1 -1
  36. package/dist/{data-management-C4JPPUPD.js → data-management-KXAPA7ZU.js} +1 -1
  37. package/dist/{deduplication-7OGLZLAC.js → deduplication-M3KEVJRG.js} +1 -1
  38. package/dist/deploy-UQZAUHAB.js +214 -0
  39. package/dist/{design-3CAYTWFY.js → design-UVJJ2KO2.js} +1 -1
  40. package/dist/{document-NT5JOJQV.js → document-5HB632XE.js} +1 -1
  41. package/dist/{email-settings-2M3WJTQS.js → email-settings-H7HQTDYE.js} +1 -1
  42. package/dist/{email-template-F4PLBPPC.js → email-template-2DHZ3VKF.js} +1 -1
  43. package/dist/{entity-32LKMZAU.js → entity-HED6QHG7.js} +1 -1
  44. package/dist/{entity-mapping-OBCZDYQJ.js → entity-mapping-QP22B65Z.js} +1 -1
  45. package/dist/{environments-H3TBCDQE.js → environments-6LLEIGWV.js} +1 -1
  46. package/dist/{erp-integration-UW6H55EK.js → erp-integration-DXFYJ2F3.js} +1 -1
  47. package/dist/{event-catalog-NVAPTZ4M.js → event-catalog-2ZCZTATY.js} +1 -1
  48. package/dist/export-US5GMHTS.js +44 -0
  49. package/dist/{file-US2HR4SV.js → file-R6IIXOIZ.js} +1 -1
  50. package/dist/{iban-7QUCOULB.js → iban-EQD2VROZ.js} +1 -1
  51. package/dist/init-DGPWBRRB.js +524 -0
  52. package/dist/{journey-E5T4BZZX.js → journey-V7X2KUKH.js} +1 -1
  53. package/dist/{kanban-7UHU5VE6.js → kanban-EPI6C3FR.js} +1 -1
  54. package/dist/{message-7KY33RJE.js → message-477EJ5JO.js} +1 -1
  55. package/dist/{metering-P7BZGMY7.js → metering-5EAEKRSL.js} +1 -1
  56. package/dist/{notes-TNJ7FPA3.js → notes-CVXNRULU.js} +1 -1
  57. package/dist/{notification-6KXEFVO5.js → notification-6HXS76XP.js} +1 -1
  58. package/dist/{organization-FF4Y3PBO.js → organization-O33CZQKD.js} +1 -1
  59. package/dist/{partner-directory-VH2SBAS2.js → partner-directory-NZWGCKSB.js} +2 -2
  60. package/dist/{permissions-KENZ4HNY.js → permissions-6QEOBJ6M.js} +1 -1
  61. package/dist/{pricing-P6QZ77VJ.js → pricing-KNYSULCW.js} +1 -1
  62. package/dist/{pricing-tier-2IRJMTM6.js → pricing-tier-OCHP6SHT.js} +1 -1
  63. package/dist/{purpose-IHROR6LQ.js → purpose-NGM42XWB.js} +1 -1
  64. package/dist/remove-component-B2GMICMD.js +89 -0
  65. package/dist/review-QFPON37R.js +69 -0
  66. package/dist/{sandbox-62XQPOU6.js → sandbox-YX3VVAQG.js} +1 -1
  67. package/dist/{submission-PUWGOYQB.js → submission-YOWVSZNA.js} +1 -1
  68. package/dist/{targeting-QB3DFYNI.js → targeting-BMZCOG72.js} +1 -1
  69. package/dist/{template-variables-IPKRUJ4E.js → template-variables-YTABZL3E.js} +1 -1
  70. package/dist/{upgrade-KDDTJRUC.js → upgrade-KZSOPDCR.js} +1 -1
  71. package/dist/{user-2CP75TFC.js → user-3N5ZOUYS.js} +1 -1
  72. package/dist/validate-G7K6AVBI.js +53 -0
  73. package/dist/{validation-rules-GNI4EEG5.js → validation-rules-QVS7LKEP.js} +1 -1
  74. package/dist/versions-UTPAWTIU.js +109 -0
  75. package/dist/{webhooks-2OWUX7UL.js → webhooks-6WMWACOW.js} +1 -1
  76. package/dist/{workflow-WSLERVJI.js → workflow-ZO2MKDBS.js} +1 -1
  77. package/dist/{workflow-definition-FP3WKHGG.js → workflow-definition-RCWKIPYI.js} +1 -1
  78. package/package.json +2 -1
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  callApi
4
- } from "./chunk-P5IZZW4Y.js";
4
+ } from "./chunk-BYAEI4Z2.js";
5
5
  import "./chunk-RSA7K5HB.js";
6
6
  import "./chunk-PDMWUCWD.js";
7
7
  import "./chunk-IOLKUHUB.js";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  API_LIST
4
- } from "../chunk-PHXL66VA.js";
4
+ } from "../chunk-K2UQOP3Q.js";
5
5
 
6
6
  // bin/epilot.ts
7
7
  import { runMain } from "citty";
@@ -11,7 +11,7 @@ import { defineCommand } from "citty";
11
11
  var main = defineCommand({
12
12
  meta: {
13
13
  name: "epilot",
14
- version: "0.1.9",
14
+ version: "0.1.11",
15
15
  description: "CLI for epilot APIs"
16
16
  },
17
17
  args: {
@@ -27,54 +27,54 @@ var main = defineCommand({
27
27
  subCommands: {
28
28
  auth: () => import("../auth-AAF6Z5WZ.js").then((m) => m.default),
29
29
  profile: () => import("../profile-EK4HSQ57.js").then((m) => m.default),
30
- completion: () => import("../completion-EKFXGPNK.js").then((m) => m.default),
31
- upgrade: () => import("../upgrade-KDDTJRUC.js").then((m) => m.default),
32
- "access-token": () => import("../access-token-PTTCRMGK.js").then((m) => m.default),
33
- address: () => import("../address-2FDPEPR6.js").then((m) => m.default),
34
- "address-suggestions": () => import("../address-suggestions-XBEK5DDQ.js").then((m) => m.default),
35
- "ai-agents": () => import("../ai-agents-ZY5BNVTN.js").then((m) => m.default),
36
- app: () => import("../app-IT5FWGUK.js").then((m) => m.default),
37
- "audit-logs": () => import("../audit-logs-FB4TE4TI.js").then((m) => m.default),
38
- automation: () => import("../automation-JE5LDKJM.js").then((m) => m.default),
39
- billing: () => import("../billing-GOFCP5T3.js").then((m) => m.default),
40
- "blueprint-manifest": () => import("../blueprint-manifest-WJIQKFYK.js").then((m) => m.default),
41
- consent: () => import("../consent-DSMWWHUL.js").then((m) => m.default),
42
- "customer-portal": () => import("../customer-portal-IJYTJYUZ.js").then((m) => m.default),
43
- dashboard: () => import("../dashboard-DOAX6XDG.js").then((m) => m.default),
44
- "data-management": () => import("../data-management-C4JPPUPD.js").then((m) => m.default),
45
- deduplication: () => import("../deduplication-7OGLZLAC.js").then((m) => m.default),
46
- design: () => import("../design-3CAYTWFY.js").then((m) => m.default),
47
- document: () => import("../document-NT5JOJQV.js").then((m) => m.default),
48
- "email-settings": () => import("../email-settings-2M3WJTQS.js").then((m) => m.default),
49
- "email-template": () => import("../email-template-F4PLBPPC.js").then((m) => m.default),
50
- entity: () => import("../entity-32LKMZAU.js").then((m) => m.default),
51
- "entity-mapping": () => import("../entity-mapping-OBCZDYQJ.js").then((m) => m.default),
52
- environments: () => import("../environments-H3TBCDQE.js").then((m) => m.default),
53
- "erp-integration": () => import("../erp-integration-UW6H55EK.js").then((m) => m.default),
54
- "event-catalog": () => import("../event-catalog-NVAPTZ4M.js").then((m) => m.default),
55
- file: () => import("../file-US2HR4SV.js").then((m) => m.default),
56
- iban: () => import("../iban-7QUCOULB.js").then((m) => m.default),
57
- journey: () => import("../journey-E5T4BZZX.js").then((m) => m.default),
58
- kanban: () => import("../kanban-7UHU5VE6.js").then((m) => m.default),
59
- message: () => import("../message-7KY33RJE.js").then((m) => m.default),
60
- metering: () => import("../metering-P7BZGMY7.js").then((m) => m.default),
61
- notes: () => import("../notes-TNJ7FPA3.js").then((m) => m.default),
62
- notification: () => import("../notification-6KXEFVO5.js").then((m) => m.default),
63
- organization: () => import("../organization-FF4Y3PBO.js").then((m) => m.default),
64
- "partner-directory": () => import("../partner-directory-VH2SBAS2.js").then((m) => m.default),
65
- permissions: () => import("../permissions-KENZ4HNY.js").then((m) => m.default),
66
- pricing: () => import("../pricing-P6QZ77VJ.js").then((m) => m.default),
67
- "pricing-tier": () => import("../pricing-tier-2IRJMTM6.js").then((m) => m.default),
68
- purpose: () => import("../purpose-IHROR6LQ.js").then((m) => m.default),
69
- sandbox: () => import("../sandbox-62XQPOU6.js").then((m) => m.default),
70
- submission: () => import("../submission-PUWGOYQB.js").then((m) => m.default),
71
- targeting: () => import("../targeting-QB3DFYNI.js").then((m) => m.default),
72
- "template-variables": () => import("../template-variables-IPKRUJ4E.js").then((m) => m.default),
73
- user: () => import("../user-2CP75TFC.js").then((m) => m.default),
74
- "validation-rules": () => import("../validation-rules-GNI4EEG5.js").then((m) => m.default),
75
- webhooks: () => import("../webhooks-2OWUX7UL.js").then((m) => m.default),
76
- workflow: () => import("../workflow-WSLERVJI.js").then((m) => m.default),
77
- "workflow-definition": () => import("../workflow-definition-FP3WKHGG.js").then((m) => m.default)
30
+ completion: () => import("../completion-HTO64G2S.js").then((m) => m.default),
31
+ upgrade: () => import("../upgrade-KZSOPDCR.js").then((m) => m.default),
32
+ "access-token": () => import("../access-token-CIM4RLBP.js").then((m) => m.default),
33
+ address: () => import("../address-EDRTUWTP.js").then((m) => m.default),
34
+ "address-suggestions": () => import("../address-suggestions-S5WEST2N.js").then((m) => m.default),
35
+ "ai-agents": () => import("../ai-agents-RXDDJDAR.js").then((m) => m.default),
36
+ app: () => import("../app-BKS7M4UQ.js").then((m) => m.default),
37
+ "audit-logs": () => import("../audit-logs-PXGDGJGV.js").then((m) => m.default),
38
+ automation: () => import("../automation-LS6MVLP2.js").then((m) => m.default),
39
+ billing: () => import("../billing-KVYFUKZK.js").then((m) => m.default),
40
+ "blueprint-manifest": () => import("../blueprint-manifest-W4ZGJD2Z.js").then((m) => m.default),
41
+ consent: () => import("../consent-M4QB2HPM.js").then((m) => m.default),
42
+ "customer-portal": () => import("../customer-portal-SVO2YCXA.js").then((m) => m.default),
43
+ dashboard: () => import("../dashboard-CYCXIX74.js").then((m) => m.default),
44
+ "data-management": () => import("../data-management-KXAPA7ZU.js").then((m) => m.default),
45
+ deduplication: () => import("../deduplication-M3KEVJRG.js").then((m) => m.default),
46
+ design: () => import("../design-UVJJ2KO2.js").then((m) => m.default),
47
+ document: () => import("../document-5HB632XE.js").then((m) => m.default),
48
+ "email-settings": () => import("../email-settings-H7HQTDYE.js").then((m) => m.default),
49
+ "email-template": () => import("../email-template-2DHZ3VKF.js").then((m) => m.default),
50
+ entity: () => import("../entity-HED6QHG7.js").then((m) => m.default),
51
+ "entity-mapping": () => import("../entity-mapping-QP22B65Z.js").then((m) => m.default),
52
+ environments: () => import("../environments-6LLEIGWV.js").then((m) => m.default),
53
+ "erp-integration": () => import("../erp-integration-DXFYJ2F3.js").then((m) => m.default),
54
+ "event-catalog": () => import("../event-catalog-2ZCZTATY.js").then((m) => m.default),
55
+ file: () => import("../file-R6IIXOIZ.js").then((m) => m.default),
56
+ iban: () => import("../iban-EQD2VROZ.js").then((m) => m.default),
57
+ journey: () => import("../journey-V7X2KUKH.js").then((m) => m.default),
58
+ kanban: () => import("../kanban-EPI6C3FR.js").then((m) => m.default),
59
+ message: () => import("../message-477EJ5JO.js").then((m) => m.default),
60
+ metering: () => import("../metering-5EAEKRSL.js").then((m) => m.default),
61
+ notes: () => import("../notes-CVXNRULU.js").then((m) => m.default),
62
+ notification: () => import("../notification-6HXS76XP.js").then((m) => m.default),
63
+ organization: () => import("../organization-O33CZQKD.js").then((m) => m.default),
64
+ "partner-directory": () => import("../partner-directory-NZWGCKSB.js").then((m) => m.default),
65
+ permissions: () => import("../permissions-6QEOBJ6M.js").then((m) => m.default),
66
+ pricing: () => import("../pricing-KNYSULCW.js").then((m) => m.default),
67
+ "pricing-tier": () => import("../pricing-tier-OCHP6SHT.js").then((m) => m.default),
68
+ purpose: () => import("../purpose-NGM42XWB.js").then((m) => m.default),
69
+ sandbox: () => import("../sandbox-YX3VVAQG.js").then((m) => m.default),
70
+ submission: () => import("../submission-YOWVSZNA.js").then((m) => m.default),
71
+ targeting: () => import("../targeting-BMZCOG72.js").then((m) => m.default),
72
+ "template-variables": () => import("../template-variables-YTABZL3E.js").then((m) => m.default),
73
+ user: () => import("../user-3N5ZOUYS.js").then((m) => m.default),
74
+ "validation-rules": () => import("../validation-rules-QVS7LKEP.js").then((m) => m.default),
75
+ webhooks: () => import("../webhooks-6WMWACOW.js").then((m) => m.default),
76
+ workflow: () => import("../workflow-ZO2MKDBS.js").then((m) => m.default),
77
+ "workflow-definition": () => import("../workflow-definition-RCWKIPYI.js").then((m) => m.default)
78
78
  }
79
79
  });
80
80
 
@@ -87,11 +87,11 @@ process.stderr.on("error", (err) => {
87
87
  if (err.code === "EPIPE") process.exit(0);
88
88
  throw err;
89
89
  });
90
- var VERSION = true ? "0.1.9" : (await null).default.version;
90
+ var VERSION = true ? "0.1.11" : (await null).default.version;
91
91
  var args = process.argv.slice(2);
92
92
  var completionsIdx = args.indexOf("--_completions");
93
93
  if (completionsIdx >= 0) {
94
- const { handleCompletions } = await import("../completion-EKFXGPNK.js");
94
+ const { handleCompletions } = await import("../completion-HTO64G2S.js");
95
95
  handleCompletions(args[completionsIdx + 1], args[completionsIdx + 2]);
96
96
  process.exit(0);
97
97
  }
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  callApi
4
- } from "./chunk-P5IZZW4Y.js";
4
+ } from "./chunk-BYAEI4Z2.js";
5
5
  import "./chunk-RSA7K5HB.js";
6
6
  import "./chunk-PDMWUCWD.js";
7
7
  import "./chunk-IOLKUHUB.js";
@@ -468,7 +468,7 @@ ${BOLD}epilot ${apiName} ${operationId}${RESET}`);
468
468
 
469
469
  `);
470
470
  }
471
- const params = getOperationParams(spec, operationId);
471
+ const { params } = getOperationParams(spec, operationId);
472
472
  if (params.length > 0) {
473
473
  w(`${BOLD}PARAMETERS${RESET}
474
474
 
@@ -151,7 +151,7 @@ var API_LIST = [
151
151
  kebabName: "blueprint-manifest",
152
152
  title: "Blueprint Manifest API",
153
153
  serverUrl: "https://blueprint-manifest.sls.epilot.io",
154
- operationCount: 33,
154
+ operationCount: 35,
155
155
  operationIds: [
156
156
  "getJob",
157
157
  "createExport",
@@ -174,6 +174,8 @@ var API_LIST = [
174
174
  "deleteBlueprint",
175
175
  "validateBlueprint",
176
176
  "exportBlueprint",
177
+ "listMarketplaceSlugs",
178
+ "publishBlueprint",
177
179
  "formatBlueprintDescription",
178
180
  "addBlueprintResource",
179
181
  "syncDependencies",
@@ -201,7 +203,7 @@ var API_LIST = [
201
203
  kebabName: "customer-portal",
202
204
  title: "Portal API",
203
205
  serverUrl: "https://customer-portal-api.sls.epilot.io",
204
- operationCount: 134,
206
+ operationCount: 138,
205
207
  operationIds: [
206
208
  "upsertPortal",
207
209
  "createUser",
@@ -235,6 +237,9 @@ var API_LIST = [
235
237
  "getPublicPortalWidgets",
236
238
  "getPortalWidgets",
237
239
  "upsertPortalWidget",
240
+ "getPortalWidgetsV3",
241
+ "upsertPortalWidgetV3",
242
+ "savePortalFilesV3",
238
243
  "replaceECPTemplateVariables",
239
244
  "getOrganizationSettings",
240
245
  "getSchemas",
@@ -314,6 +319,7 @@ var API_LIST = [
314
319
  "getPortalPages",
315
320
  "createPortalPage",
316
321
  "getPublicPages",
322
+ "interpolatePortalPages",
317
323
  "getDefaultPages",
318
324
  "getPortalPageBlocks",
319
325
  "createPortalPageBlock",
@@ -417,7 +423,7 @@ var API_LIST = [
417
423
  kebabName: "email-settings",
418
424
  title: "Messaging Settings API",
419
425
  serverUrl: "https://email-settings.sls.epilot.io",
420
- operationCount: 31,
426
+ operationCount: 34,
421
427
  operationIds: [
422
428
  "provisionEpilotEmailAddress",
423
429
  "setEmailAddressPrimary",
@@ -435,6 +441,9 @@ var API_LIST = [
435
441
  "connectOutlook",
436
442
  "getOutlookConnectionStatus",
437
443
  "disconnectOutlook",
444
+ "connectMsTeams",
445
+ "disconnectMsTeams",
446
+ "getMsTeamsStatus",
438
447
  "connectOutlookMailbox",
439
448
  "disconnectOutlookMailbox",
440
449
  "startMailboxSync",
@@ -473,15 +482,18 @@ var API_LIST = [
473
482
  kebabName: "entity",
474
483
  title: "Entity API",
475
484
  serverUrl: "https://entity.sls.epilot.io",
476
- operationCount: 81,
485
+ operationCount: 84,
477
486
  operationIds: [
478
487
  "listSchemas",
488
+ "listSchemasV2",
479
489
  "getSchema",
480
490
  "putSchema",
481
491
  "deleteSchema",
482
492
  "getJsonSchema",
483
493
  "getSchemaExample",
484
494
  "getSchemaVersions",
495
+ "freezeSchema",
496
+ "unfreezeSchema",
485
497
  "listAvailableCapabilities",
486
498
  "listSchemaBlueprints",
487
499
  "searchEntities",
@@ -598,7 +610,7 @@ var API_LIST = [
598
610
  kebabName: "erp-integration",
599
611
  title: "ERP Integration API",
600
612
  serverUrl: "https://erp-integration-api.sls.epilot.io",
601
- operationCount: 33,
613
+ operationCount: 35,
602
614
  operationIds: [
603
615
  "acknowledgeTracking",
604
616
  "triggerErp",
@@ -632,7 +644,9 @@ var API_LIST = [
632
644
  "getMonitoringTimeSeries",
633
645
  "getOutboundStatus",
634
646
  "queryAccessLogs",
635
- "queryOutboundMonitoringEvents"
647
+ "queryOutboundMonitoringEvents",
648
+ "listSecureProxies",
649
+ "secureProxy"
636
650
  ]
637
651
  },
638
652
  {
@@ -868,22 +882,24 @@ var API_LIST = [
868
882
  kebabName: "organization",
869
883
  title: "Organization API",
870
884
  serverUrl: "https://organization-v2.sls.epilot.io",
871
- operationCount: 6,
885
+ operationCount: 8,
872
886
  operationIds: [
873
887
  "getCurrentOrganization",
874
888
  "getOrganization",
875
889
  "updateOrganization",
876
890
  "getSettings",
877
891
  "putSettingsValue",
878
- "deleteSettingsValue"
892
+ "deleteSettingsValue",
893
+ "getOrganizationFeatureSettings",
894
+ "getFeatureSettings"
879
895
  ]
880
896
  },
881
897
  {
882
898
  apiName: "partnerDirectory",
883
899
  kebabName: "partner-directory",
884
- title: "Partner API",
900
+ title: "Partner Directory API",
885
901
  serverUrl: "https://partner-directory-api.sls.epilot.io",
886
- operationCount: 16,
902
+ operationCount: 17,
887
903
  operationIds: [
888
904
  "approvePartner",
889
905
  "rejectPartner",
@@ -899,6 +915,7 @@ var API_LIST = [
899
915
  "getPartnerRoles",
900
916
  "createPartnerRole",
901
917
  "updatePartnerRole",
918
+ "deletePartnerRole",
902
919
  "assignPartnerUserRoles",
903
920
  "unassignPartnerUserRoles"
904
921
  ]
@@ -907,7 +924,7 @@ var API_LIST = [
907
924
  apiName: "permissions",
908
925
  kebabName: "permissions",
909
926
  title: "Permissions API",
910
- serverUrl: "https://permissions.sls.epilot.io",
927
+ serverUrl: "",
911
928
  operationCount: 13,
912
929
  operationIds: [
913
930
  "listCurrentRoles",
@@ -0,0 +1,365 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ resolveToken
4
+ } from "./chunk-RSA7K5HB.js";
5
+ import {
6
+ BOLD,
7
+ DIM,
8
+ GREEN,
9
+ RED,
10
+ RESET,
11
+ YELLOW
12
+ } from "./chunk-7ZQ666ZQ.js";
13
+
14
+ // src/commands/app/manifest.ts
15
+ import { readFileSync, writeFileSync, existsSync, statSync } from "fs";
16
+ import { resolve, extname } from "path";
17
+ import { execSync } from "child_process";
18
+ var log = {
19
+ success: (msg) => process.stdout.write(`${GREEN}\u2713${RESET} ${msg}
20
+ `),
21
+ error: (msg) => process.stderr.write(`${RED}\u2717${RESET} ${msg}
22
+ `),
23
+ warn: (msg) => process.stdout.write(`${YELLOW}!${RESET} ${msg}
24
+ `),
25
+ info: (msg) => process.stdout.write(` ${msg}
26
+ `),
27
+ dim: (msg) => process.stdout.write(` ${DIM}${msg}${RESET}
28
+ `),
29
+ header: (msg) => process.stdout.write(`
30
+ ${BOLD}${msg}${RESET}
31
+ `)
32
+ };
33
+ var COMPONENT_TYPES = [
34
+ "CUSTOM_JOURNEY_BLOCK",
35
+ "CUSTOM_PORTAL_BLOCK",
36
+ "PORTAL_EXTENSION",
37
+ "CUSTOM_FLOW_ACTION",
38
+ "CUSTOM_CAPABILITY",
39
+ "EXTERNAL_PRODUCT_CATALOG",
40
+ "CUSTOM_PAGE"
41
+ ];
42
+ function validateManifest(data) {
43
+ const errors = [];
44
+ if (!data || typeof data !== "object") {
45
+ return { valid: false, errors: [{ path: "/", message: "Must be an object" }] };
46
+ }
47
+ const obj = data;
48
+ if (obj.manifest_version !== 1) {
49
+ errors.push({ path: "/manifest_version", message: "Must be 1" });
50
+ }
51
+ if (!obj.name || typeof obj.name !== "string") {
52
+ errors.push({ path: "/name", message: "Required string" });
53
+ }
54
+ if (!obj.description || typeof obj.description !== "object") {
55
+ errors.push({ path: "/description", message: 'Required object with "de" field' });
56
+ } else if (!obj.description.de) {
57
+ errors.push({ path: "/description/de", message: "Required" });
58
+ }
59
+ if (!Array.isArray(obj.components)) {
60
+ errors.push({ path: "/components", message: "Required array" });
61
+ } else {
62
+ for (let i = 0; i < obj.components.length; i++) {
63
+ const comp = obj.components[i];
64
+ if (!comp.id) errors.push({ path: `/components/${i}/id`, message: "Required" });
65
+ if (!comp.component_type || !COMPONENT_TYPES.includes(comp.component_type)) {
66
+ errors.push({
67
+ path: `/components/${i}/component_type`,
68
+ message: `Must be one of: ${COMPONENT_TYPES.join(", ")}`
69
+ });
70
+ }
71
+ if (!comp.configuration || typeof comp.configuration !== "object") {
72
+ errors.push({ path: `/components/${i}/configuration`, message: "Required object" });
73
+ }
74
+ }
75
+ }
76
+ if (errors.length > 0) return { valid: false, errors };
77
+ return { valid: true, errors: [], manifest: data };
78
+ }
79
+ function readManifest(path) {
80
+ const absPath = resolve(path);
81
+ if (!existsSync(absPath)) {
82
+ throw new Error(`File not found: ${absPath}`);
83
+ }
84
+ const content = readFileSync(absPath, "utf-8");
85
+ const data = JSON.parse(content);
86
+ const result = validateManifest(data);
87
+ if (!result.valid) {
88
+ const msgs = result.errors.map((e) => ` ${e.path}: ${e.message}`).join("\n");
89
+ throw new Error(`Invalid manifest:
90
+ ${msgs}`);
91
+ }
92
+ return result.manifest;
93
+ }
94
+ function writeManifest(path, manifest) {
95
+ writeFileSync(resolve(path), `${JSON.stringify(manifest, null, 2)}
96
+ `, "utf-8");
97
+ }
98
+ var DEFAULT_BASE_URL = "https://app.sls.epilot.io";
99
+ async function request(baseUrl, token, method, path, body) {
100
+ const url = `${baseUrl}${path}`;
101
+ const headers = {
102
+ Authorization: `Bearer ${token}`,
103
+ "Content-Type": "application/json"
104
+ };
105
+ const response = await fetch(url, {
106
+ method,
107
+ headers,
108
+ body: body ? JSON.stringify(body) : void 0
109
+ });
110
+ if (!response.ok) {
111
+ const text2 = await response.text().catch(() => "");
112
+ throw new Error(`API ${method} ${path} failed (${response.status}): ${text2}`);
113
+ }
114
+ if (response.status === 204) return void 0;
115
+ const contentType = response.headers.get("content-type") ?? "";
116
+ const text = await response.text();
117
+ if (!text) return void 0;
118
+ if (contentType.includes("application/json")) {
119
+ return JSON.parse(text);
120
+ }
121
+ return text;
122
+ }
123
+ function createAppApiClient(opts) {
124
+ const baseUrl = opts.server ?? DEFAULT_BASE_URL;
125
+ const getToken = () => {
126
+ const token = resolveToken(opts.token, opts.profile);
127
+ if (!token) {
128
+ log.error('Not authenticated. Run "epilot auth login" first.');
129
+ process.exit(1);
130
+ }
131
+ return token;
132
+ };
133
+ return {
134
+ async createConfiguration(payload) {
135
+ return request(baseUrl, getToken(), "POST", "/v1/app-configurations", payload);
136
+ },
137
+ async getConfiguration(appId) {
138
+ return request(baseUrl, getToken(), "GET", `/v1/app-configurations/${appId}`);
139
+ },
140
+ async patchMetadata(appId, payload) {
141
+ await request(baseUrl, getToken(), "PATCH", `/v1/app-configurations/${appId}`, payload);
142
+ },
143
+ async getVersion(appId, version) {
144
+ return request(baseUrl, getToken(), "GET", `/v1/app-configurations/${appId}/versions/${version}`);
145
+ },
146
+ async listVersions(appId) {
147
+ return request(baseUrl, getToken(), "GET", `/v1/app-configurations/${appId}/versions`);
148
+ },
149
+ async patchVersion(appId, version, payload) {
150
+ await request(baseUrl, getToken(), "PATCH", `/v1/app-configurations/${appId}/versions/${version}`, payload);
151
+ },
152
+ async cloneVersion(appId, version) {
153
+ return request(
154
+ baseUrl,
155
+ getToken(),
156
+ "POST",
157
+ `/v1/app-configurations/${appId}/versions/${version}/clone`
158
+ );
159
+ },
160
+ async upsertComponent(appId, version, component) {
161
+ const componentId = component.id;
162
+ if (componentId) {
163
+ try {
164
+ await request(
165
+ baseUrl,
166
+ getToken(),
167
+ "PATCH",
168
+ `/v1/app-configurations/${appId}/versions/${version}/components/${componentId}`,
169
+ component
170
+ );
171
+ } catch (err) {
172
+ if (err instanceof Error && err.message.includes("404")) {
173
+ await request(
174
+ baseUrl,
175
+ getToken(),
176
+ "POST",
177
+ `/v1/app-configurations/${appId}/versions/${version}/components`,
178
+ component
179
+ );
180
+ } else {
181
+ throw err;
182
+ }
183
+ }
184
+ } else {
185
+ await request(
186
+ baseUrl,
187
+ getToken(),
188
+ "POST",
189
+ `/v1/app-configurations/${appId}/versions/${version}/components`,
190
+ component
191
+ );
192
+ }
193
+ },
194
+ async deleteComponent(appId, version, componentId) {
195
+ await request(
196
+ baseUrl,
197
+ getToken(),
198
+ "DELETE",
199
+ `/v1/app-configurations/${appId}/versions/${version}/components/${componentId}`
200
+ );
201
+ },
202
+ async createLogoUploadUrl(appId, filename, mimeType) {
203
+ return request(baseUrl, getToken(), "POST", `/v1/app-configurations/${appId}/logo`, {
204
+ filename,
205
+ mime_type: mimeType
206
+ });
207
+ },
208
+ async createBundleUploadUrl(appId, version, componentId) {
209
+ return request(baseUrl, getToken(), "POST", `/v1/app-configurations/${appId}/bundle`, {
210
+ version,
211
+ component_id: componentId
212
+ });
213
+ },
214
+ async createZipUploadUrl(appId, version, componentId) {
215
+ return request(baseUrl, getToken(), "POST", `/v1/app-configurations/${appId}/zip`, {
216
+ version,
217
+ component_id: componentId
218
+ });
219
+ },
220
+ async createReview(appId, version, payload) {
221
+ return request(
222
+ baseUrl,
223
+ getToken(),
224
+ "POST",
225
+ `/v1/app-configurations/${appId}/versions/${version}/review`,
226
+ payload
227
+ );
228
+ }
229
+ };
230
+ }
231
+ async function uploadFileToPresignedUrl(uploadUrl, filePath) {
232
+ const absolutePath = resolve(filePath);
233
+ const fileBuffer = readFileSync(absolutePath);
234
+ const ext = extname(filePath).toLowerCase();
235
+ const mimeTypes = {
236
+ ".js": "application/javascript",
237
+ ".mjs": "application/javascript",
238
+ ".json": "application/json",
239
+ ".html": "text/html",
240
+ ".css": "text/css",
241
+ ".png": "image/png",
242
+ ".jpg": "image/jpeg",
243
+ ".jpeg": "image/jpeg",
244
+ ".svg": "image/svg+xml",
245
+ ".zip": "application/zip"
246
+ };
247
+ const mimeType = mimeTypes[ext] ?? "application/octet-stream";
248
+ const response = await fetch(uploadUrl, {
249
+ method: "PUT",
250
+ body: fileBuffer,
251
+ headers: { "Content-Type": mimeType }
252
+ });
253
+ if (!response.ok) {
254
+ throw new Error(`Upload failed (${response.status}): ${response.statusText}`);
255
+ }
256
+ }
257
+ async function uploadDirectoryAsZip(uploadUrl, dirPath) {
258
+ const absoluteDir = resolve(dirPath);
259
+ if (!existsSync(absoluteDir) || !statSync(absoluteDir).isDirectory()) {
260
+ throw new Error(`Not a directory: ${absoluteDir}`);
261
+ }
262
+ const tmpZip = resolve(absoluteDir, "..", `.${Date.now()}-archive.zip`);
263
+ try {
264
+ execSync(`cd ${JSON.stringify(absoluteDir)} && zip -r ${JSON.stringify(tmpZip)} .`, { stdio: "pipe" });
265
+ const zipBuffer = readFileSync(tmpZip);
266
+ const response = await fetch(uploadUrl, {
267
+ method: "PUT",
268
+ body: zipBuffer,
269
+ headers: { "Content-Type": "application/zip" }
270
+ });
271
+ if (!response.ok) {
272
+ throw new Error(`Upload failed (${response.status}): ${response.statusText}`);
273
+ }
274
+ return zipBuffer.length;
275
+ } finally {
276
+ try {
277
+ execSync(`rm -f ${JSON.stringify(tmpZip)}`, { stdio: "pipe" });
278
+ } catch {
279
+ }
280
+ }
281
+ }
282
+ function formatFileSize(bytes) {
283
+ if (bytes < 1024) return `${bytes} B`;
284
+ if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(0)} KB`;
285
+ return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
286
+ }
287
+ function toManifest(config, version) {
288
+ const manifest = {
289
+ $schema: "https://cdn.app.sls.epilot.io/v1/schema.json",
290
+ manifest_version: 1,
291
+ app_id: config.app_id,
292
+ name: config.name,
293
+ description: config.description,
294
+ components: []
295
+ };
296
+ if (config.category) manifest.category = config.category;
297
+ if (config.author) manifest.author = config.author;
298
+ if (config.documentation_url) manifest.documentation_url = config.documentation_url;
299
+ if (config.support_email) manifest.support_email = config.support_email;
300
+ if (config.pricing) manifest.pricing = config.pricing;
301
+ if (config.notifications) manifest.notifications = config.notifications;
302
+ const role = version.role;
303
+ if (role?.grants?.length) {
304
+ manifest.permissions = role.grants.map((g) => ({
305
+ action: g.action,
306
+ ...g.resource ? { resource: g.resource } : {}
307
+ }));
308
+ }
309
+ const blueprintRef = version.blueprint_ref;
310
+ if (blueprintRef?.manifest_id) {
311
+ manifest.blueprint = { manifest_id: blueprintRef.manifest_id };
312
+ }
313
+ if (config.icon_url) {
314
+ manifest.assets = { logo: "./assets/logo.png" };
315
+ }
316
+ const components = version.components ?? [];
317
+ manifest.components = components.map((comp) => {
318
+ const component = {
319
+ id: comp.id,
320
+ component_type: comp.component_type,
321
+ configuration: comp.configuration ?? {}
322
+ };
323
+ if (comp.name) component.name = comp.name;
324
+ if (comp.description) component.description = comp.description;
325
+ if (Array.isArray(comp.options) && comp.options.length > 0) {
326
+ component.options = comp.options.map((opt) => {
327
+ const option = { key: opt.key, type: opt.type };
328
+ if (opt.label) option.label = opt.label;
329
+ if (opt.required) option.required = opt.required;
330
+ if (opt.description) option.description = opt.description;
331
+ return option;
332
+ });
333
+ }
334
+ if (comp.surfaces && typeof comp.surfaces === "object" && Object.keys(comp.surfaces).length > 0) {
335
+ component.surfaces = comp.surfaces;
336
+ }
337
+ const assets = {};
338
+ if (comp.component_type === "CUSTOM_JOURNEY_BLOCK") {
339
+ const cfg = comp.configuration;
340
+ if (cfg?.component_url) assets.bundle = `./dist/${comp.id}/bundle.js`;
341
+ }
342
+ if (comp.surfaces && typeof comp.surfaces === "object") {
343
+ for (const surface of Object.values(comp.surfaces)) {
344
+ if (surface && typeof surface === "object" && "zip_url" in surface && surface.zip_url) {
345
+ assets.zip = `./dist/${comp.id}/`;
346
+ }
347
+ }
348
+ }
349
+ if (Object.keys(assets).length > 0) component.assets = assets;
350
+ return component;
351
+ });
352
+ return manifest;
353
+ }
354
+
355
+ export {
356
+ log,
357
+ validateManifest,
358
+ readManifest,
359
+ writeManifest,
360
+ createAppApiClient,
361
+ uploadFileToPresignedUrl,
362
+ uploadDirectoryAsZip,
363
+ formatFileSize,
364
+ toManifest
365
+ };