@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.
- package/dist/bin/cli.js +35 -11
- package/dist/{js-yaml-DLCVPJ7G.js → js-yaml-UPZKYVRY.js} +15 -17
- package/package.json +1 -1
- package/definitions/access-token-runtime.json +0 -1
- package/definitions/access-token.json +0 -663
- package/definitions/address-runtime.json +0 -1
- package/definitions/address-suggestions-runtime.json +0 -1
- package/definitions/address-suggestions.json +0 -582
- package/definitions/address.json +0 -578
- package/definitions/ai-agents-runtime.json +0 -1
- package/definitions/ai-agents.json +0 -1711
- package/definitions/app-runtime.json +0 -1
- package/definitions/app.json +0 -4493
- package/definitions/audit-logs-runtime.json +0 -1
- package/definitions/audit-logs.json +0 -305
- package/definitions/automation-runtime.json +0 -1
- package/definitions/automation.json +0 -4815
- package/definitions/billing-runtime.json +0 -1
- package/definitions/billing.json +0 -837
- package/definitions/blueprint-manifest-runtime.json +0 -1
- package/definitions/blueprint-manifest.json +0 -3490
- package/definitions/consent-runtime.json +0 -1
- package/definitions/consent.json +0 -344
- package/definitions/customer-portal-runtime.json +0 -1
- package/definitions/customer-portal.json +0 -15676
- package/definitions/dashboard-runtime.json +0 -1
- package/definitions/dashboard.json +0 -484
- package/definitions/data-management-runtime.json +0 -1
- package/definitions/data-management.json +0 -972
- package/definitions/deduplication-runtime.json +0 -1
- package/definitions/deduplication.json +0 -183
- package/definitions/design-runtime.json +0 -1
- package/definitions/design.json +0 -1423
- package/definitions/document-runtime.json +0 -1
- package/definitions/document.json +0 -758
- package/definitions/email-settings-runtime.json +0 -1
- package/definitions/email-settings.json +0 -2748
- package/definitions/email-template-runtime.json +0 -1
- package/definitions/email-template.json +0 -1441
- package/definitions/entity-mapping-runtime.json +0 -1
- package/definitions/entity-mapping.json +0 -1642
- package/definitions/entity-runtime.json +0 -1
- package/definitions/entity.json +0 -10276
- package/definitions/environments-runtime.json +0 -1
- package/definitions/environments.json +0 -363
- package/definitions/erp-integration-runtime.json +0 -1
- package/definitions/erp-integration.json +0 -6304
- package/definitions/event-catalog-runtime.json +0 -1
- package/definitions/event-catalog.json +0 -1051
- package/definitions/file-runtime.json +0 -1
- package/definitions/file.json +0 -2842
- package/definitions/iban-runtime.json +0 -1
- package/definitions/iban.json +0 -132
- package/definitions/journey-runtime.json +0 -1
- package/definitions/journey.json +0 -2603
- package/definitions/kanban-runtime.json +0 -1
- package/definitions/kanban.json +0 -1505
- package/definitions/message-runtime.json +0 -1
- package/definitions/message.json +0 -2660
- package/definitions/metering-runtime.json +0 -1
- package/definitions/metering.json +0 -2321
- package/definitions/notes-runtime.json +0 -1
- package/definitions/notes.json +0 -1531
- package/definitions/notification-runtime.json +0 -1
- package/definitions/notification.json +0 -1425
- package/definitions/organization-runtime.json +0 -1
- package/definitions/organization.json +0 -1192
- package/definitions/partner-directory-runtime.json +0 -1
- package/definitions/partner-directory.json +0 -2284
- package/definitions/permissions-runtime.json +0 -1
- package/definitions/permissions.json +0 -1515
- package/definitions/pricing-runtime.json +0 -1
- package/definitions/pricing-tier-runtime.json +0 -1
- package/definitions/pricing-tier.json +0 -105
- package/definitions/pricing.json +0 -9884
- package/definitions/purpose-runtime.json +0 -1
- package/definitions/purpose.json +0 -524
- package/definitions/sandbox-runtime.json +0 -1
- package/definitions/sandbox.json +0 -453
- package/definitions/submission-runtime.json +0 -1
- package/definitions/submission.json +0 -313
- package/definitions/targeting-runtime.json +0 -1
- package/definitions/targeting.json +0 -1474
- package/definitions/template-variables-runtime.json +0 -1
- package/definitions/template-variables.json +0 -1408
- package/definitions/user-runtime.json +0 -1
- package/definitions/user.json +0 -2408
- package/definitions/validation-rules-runtime.json +0 -1
- package/definitions/validation-rules.json +0 -1491
- package/definitions/webhooks-runtime.json +0 -1
- package/definitions/webhooks.json +0 -1634
- package/definitions/workflow-definition-runtime.json +0 -1
- package/definitions/workflow-definition.json +0 -3417
- package/definitions/workflow-runtime.json +0 -1
- 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-
|
|
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(`
|
|
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(`
|
|
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
|
-
|
|
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
|
|
195
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
2644
|
+
(*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT *)
|
|
2647
2645
|
*/
|
package/package.json
CHANGED
|
@@ -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"}
|