@epilot/sdk 2.1.10 → 2.2.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.
Files changed (95) hide show
  1. package/dist/bin/cli.js +35 -11
  2. package/dist/{js-yaml-DLCVPJ7G.js → js-yaml-UPZKYVRY.js} +15 -17
  3. package/package.json +1 -1
  4. package/definitions/access-token-runtime.json +0 -1
  5. package/definitions/access-token.json +0 -663
  6. package/definitions/address-runtime.json +0 -1
  7. package/definitions/address-suggestions-runtime.json +0 -1
  8. package/definitions/address-suggestions.json +0 -582
  9. package/definitions/address.json +0 -578
  10. package/definitions/ai-agents-runtime.json +0 -1
  11. package/definitions/ai-agents.json +0 -1711
  12. package/definitions/app-runtime.json +0 -1
  13. package/definitions/app.json +0 -4493
  14. package/definitions/audit-logs-runtime.json +0 -1
  15. package/definitions/audit-logs.json +0 -305
  16. package/definitions/automation-runtime.json +0 -1
  17. package/definitions/automation.json +0 -4815
  18. package/definitions/billing-runtime.json +0 -1
  19. package/definitions/billing.json +0 -837
  20. package/definitions/blueprint-manifest-runtime.json +0 -1
  21. package/definitions/blueprint-manifest.json +0 -3490
  22. package/definitions/consent-runtime.json +0 -1
  23. package/definitions/consent.json +0 -344
  24. package/definitions/customer-portal-runtime.json +0 -1
  25. package/definitions/customer-portal.json +0 -15676
  26. package/definitions/dashboard-runtime.json +0 -1
  27. package/definitions/dashboard.json +0 -484
  28. package/definitions/data-management-runtime.json +0 -1
  29. package/definitions/data-management.json +0 -972
  30. package/definitions/deduplication-runtime.json +0 -1
  31. package/definitions/deduplication.json +0 -183
  32. package/definitions/design-runtime.json +0 -1
  33. package/definitions/design.json +0 -1423
  34. package/definitions/document-runtime.json +0 -1
  35. package/definitions/document.json +0 -758
  36. package/definitions/email-settings-runtime.json +0 -1
  37. package/definitions/email-settings.json +0 -2748
  38. package/definitions/email-template-runtime.json +0 -1
  39. package/definitions/email-template.json +0 -1441
  40. package/definitions/entity-mapping-runtime.json +0 -1
  41. package/definitions/entity-mapping.json +0 -1642
  42. package/definitions/entity-runtime.json +0 -1
  43. package/definitions/entity.json +0 -10276
  44. package/definitions/environments-runtime.json +0 -1
  45. package/definitions/environments.json +0 -363
  46. package/definitions/erp-integration-runtime.json +0 -1
  47. package/definitions/erp-integration.json +0 -6304
  48. package/definitions/event-catalog-runtime.json +0 -1
  49. package/definitions/event-catalog.json +0 -1051
  50. package/definitions/file-runtime.json +0 -1
  51. package/definitions/file.json +0 -2842
  52. package/definitions/iban-runtime.json +0 -1
  53. package/definitions/iban.json +0 -132
  54. package/definitions/journey-runtime.json +0 -1
  55. package/definitions/journey.json +0 -2603
  56. package/definitions/kanban-runtime.json +0 -1
  57. package/definitions/kanban.json +0 -1505
  58. package/definitions/message-runtime.json +0 -1
  59. package/definitions/message.json +0 -2660
  60. package/definitions/metering-runtime.json +0 -1
  61. package/definitions/metering.json +0 -2321
  62. package/definitions/notes-runtime.json +0 -1
  63. package/definitions/notes.json +0 -1531
  64. package/definitions/notification-runtime.json +0 -1
  65. package/definitions/notification.json +0 -1425
  66. package/definitions/organization-runtime.json +0 -1
  67. package/definitions/organization.json +0 -1192
  68. package/definitions/partner-directory-runtime.json +0 -1
  69. package/definitions/partner-directory.json +0 -2284
  70. package/definitions/permissions-runtime.json +0 -1
  71. package/definitions/permissions.json +0 -1515
  72. package/definitions/pricing-runtime.json +0 -1
  73. package/definitions/pricing-tier-runtime.json +0 -1
  74. package/definitions/pricing-tier.json +0 -105
  75. package/definitions/pricing.json +0 -9884
  76. package/definitions/purpose-runtime.json +0 -1
  77. package/definitions/purpose.json +0 -524
  78. package/definitions/sandbox-runtime.json +0 -1
  79. package/definitions/sandbox.json +0 -453
  80. package/definitions/submission-runtime.json +0 -1
  81. package/definitions/submission.json +0 -313
  82. package/definitions/targeting-runtime.json +0 -1
  83. package/definitions/targeting.json +0 -1474
  84. package/definitions/template-variables-runtime.json +0 -1
  85. package/definitions/template-variables.json +0 -1408
  86. package/definitions/user-runtime.json +0 -1
  87. package/definitions/user.json +0 -2408
  88. package/definitions/validation-rules-runtime.json +0 -1
  89. package/definitions/validation-rules.json +0 -1491
  90. package/definitions/webhooks-runtime.json +0 -1
  91. package/definitions/webhooks.json +0 -1634
  92. package/definitions/workflow-definition-runtime.json +0 -1
  93. package/definitions/workflow-definition.json +0 -3417
  94. package/definitions/workflow-runtime.json +0 -1
  95. package/definitions/workflow.json +0 -4146
package/dist/bin/cli.js CHANGED
@@ -22,7 +22,7 @@ Examples:
22
22
  };
23
23
  var isYamlFile = (filePath) => filePath.endsWith(".yaml") || filePath.endsWith(".yml");
24
24
  var parseYaml = async (content) => {
25
- const { load } = await import("../js-yaml-DLCVPJ7G.js");
25
+ const { load } = await import("../js-yaml-UPZKYVRY.js");
26
26
  return load(content);
27
27
  };
28
28
  var readOverrides = () => {
@@ -127,15 +127,13 @@ var overrideCmd = async (args) => {
127
127
  const overrides2 = readOverrides();
128
128
  overrides2[apiName] = specPath;
129
129
  writeOverrides(overrides2);
130
- console.log(`Added override: ${apiName} -> ${specPath}`);
131
- console.log(`Run 'npx epilot-sdk override' to apply, then 'npx epilot-sdk typegen' to regenerate types.`);
132
- return;
130
+ console.log(`Saved override: ${apiName} -> ${specPath}`);
133
131
  }
134
132
  const overrides = readOverrides();
135
133
  const entries = Object.entries(overrides);
136
134
  if (entries.length === 0) {
137
135
  console.log(`No overrides found in ${OVERRIDES_PATH}`);
138
- console.log(`Create one with: npx epilot-sdk override <api-name> <spec-path>`);
136
+ console.log(`Usage: npx epilot-sdk override <api-name> <spec-path>`);
139
137
  return;
140
138
  }
141
139
  const sdkRoot = findSdkRoot();
@@ -163,8 +161,8 @@ var overrideCmd = async (args) => {
163
161
  console.error(` Error: ${err.message}`);
164
162
  }
165
163
  }
166
- console.log(`
167
- Done. Run 'npx epilot-sdk typegen' to regenerate types.`);
164
+ console.log("");
165
+ await typegenCmd();
168
166
  };
169
167
  var typegenCmd = async () => {
170
168
  try {
@@ -191,11 +189,37 @@ var typegenCmd = async () => {
191
189
  }
192
190
  console.log(`Generating types for ${apiName}...`);
193
191
  try {
194
- const typesPath = resolve(distDir, `apis/${kebabName}.d.ts`);
195
- execSync(`npx openapi-client-axios-typegen ${specPath} --client > ${typesPath}`, { stdio: "pipe" });
192
+ const dtsPath = resolve(distDir, `apis/${kebabName}.d.ts`);
193
+ const dctsPath = resolve(distDir, `apis/${kebabName}.d.cts`);
194
+ const generatedTypes = execSync(`npx openapi-client-axios-typegen ${specPath} --client`, {
195
+ stdio: "pipe",
196
+ encoding: "utf-8"
197
+ });
198
+ const moduleExports = [
199
+ "",
200
+ `import type { ApiHandle } from '../types';`,
201
+ `export { authorize } from '../authorize';`,
202
+ `export type { TokenArg } from '../authorize';`,
203
+ `export type { OpenAPIClient } from 'openapi-client-axios';`,
204
+ "",
205
+ "/** Get the cached singleton client (lazy-initialized on first call) */",
206
+ "declare const getClient: () => Client;",
207
+ "/** Create a fresh client instance (not cached) */",
208
+ "declare const createClient: () => Client;",
209
+ "/**",
210
+ " * API handle \u2014 also exposes operations directly:",
211
+ ` * \`${apiName}.getEntity(...)\` calls forwarded to lazy singleton`,
212
+ " */",
213
+ `declare const ${apiName}: ApiHandle<Client>;`,
214
+ "",
215
+ `export { getClient, createClient, ${apiName} };`
216
+ ].join("\n");
217
+ const fullContent = `${generatedTypes.trimEnd()}
218
+ ${moduleExports}
219
+ `;
220
+ writeFileSync(dtsPath, fullContent);
196
221
  console.log(` -> dist/apis/${kebabName}.d.ts`);
197
- const ctypesPath = resolve(distDir, `apis/${kebabName}.d.cts`);
198
- execSync(`npx openapi-client-axios-typegen ${specPath} --client > ${ctypesPath}`, { stdio: "pipe" });
222
+ writeFileSync(dctsPath, fullContent);
199
223
  console.log(` -> dist/apis/${kebabName}.d.cts`);
200
224
  } catch (err) {
201
225
  console.error(` Error generating types for ${apiName}: ${err.message}`);
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- // ../../node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/dist/js-yaml.mjs
3
+ // ../../node_modules/js-yaml/dist/js-yaml.mjs
4
4
  function isNothing(subject) {
5
5
  return typeof subject === "undefined" || subject === null;
6
6
  }
@@ -864,18 +864,6 @@ function charFromCodepoint(c) {
864
864
  (c - 65536 & 1023) + 56320
865
865
  );
866
866
  }
867
- function setProperty(object, key, value) {
868
- if (key === "__proto__") {
869
- Object.defineProperty(object, key, {
870
- configurable: true,
871
- enumerable: true,
872
- writable: true,
873
- value
874
- });
875
- } else {
876
- object[key] = value;
877
- }
878
- }
879
867
  var simpleEscapeCheck = new Array(256);
880
868
  var simpleEscapeMap = new Array(256);
881
869
  for (i = 0; i < 256; i++) {
@@ -995,7 +983,7 @@ function mergeMappings(state, destination, source, overridableKeys) {
995
983
  for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
996
984
  key = sourceKeys[index];
997
985
  if (!_hasOwnProperty$1.call(destination, key)) {
998
- setProperty(destination, key, source[key]);
986
+ destination[key] = source[key];
999
987
  overridableKeys[key] = true;
1000
988
  }
1001
989
  }
@@ -1035,7 +1023,16 @@ function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valu
1035
1023
  state.position = startPos || state.position;
1036
1024
  throwError(state, "duplicated mapping key");
1037
1025
  }
1038
- setProperty(_result, keyNode, valueNode);
1026
+ if (keyNode === "__proto__") {
1027
+ Object.defineProperty(_result, keyNode, {
1028
+ configurable: true,
1029
+ enumerable: true,
1030
+ writable: true,
1031
+ value: valueNode
1032
+ });
1033
+ } else {
1034
+ _result[keyNode] = valueNode;
1035
+ }
1039
1036
  delete overridableKeys[keyNode];
1040
1037
  }
1041
1038
  return _result;
@@ -2623,6 +2620,7 @@ var jsYaml = {
2623
2620
  safeLoadAll,
2624
2621
  safeDump
2625
2622
  };
2623
+ var js_yaml_default = jsYaml;
2626
2624
  export {
2627
2625
  CORE_SCHEMA,
2628
2626
  DEFAULT_SCHEMA,
@@ -2631,7 +2629,7 @@ export {
2631
2629
  Schema,
2632
2630
  Type,
2633
2631
  YAMLException,
2634
- jsYaml as default,
2632
+ js_yaml_default as default,
2635
2633
  dump,
2636
2634
  load,
2637
2635
  loadAll,
@@ -2643,5 +2641,5 @@ export {
2643
2641
  /*! Bundled license information:
2644
2642
 
2645
2643
  js-yaml/dist/js-yaml.mjs:
2646
- (*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT *)
2644
+ (*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT *)
2647
2645
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/sdk",
3
- "version": "2.1.10",
3
+ "version": "2.2.0",
4
4
  "description": "JavaScript/TypeScript SDK for epilot APIs",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -1 +0,0 @@
1
- {"s":"https://access-token.sls.epilot.io","o":[["createAccessToken","post","/v1/access-tokens",null,1],["listAccessTokens","get","/v1/access-tokens",[["token_type","q"]]],["revokeAccessToken","delete","/v1/access-tokens/{id}",[["id","p",true]]],["getAccessTokenJwks","get","/v1/access-tokens/.well-known/jwks.json"],["getAccessTokenOIDC","get","/v1/access-tokens/.well-known/openid-configuration"],["getPublicTokenJwks","get","/v1/access-tokens/public/.well-known/jwks.json"],["getPublicTokenOIDC","get","/v1/access-tokens/public/.well-known/openid-configuration"]],"v":"3.0.3"}