@epilot/sdk 2.0.0-alpha.0 → 2.0.0-alpha.1
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/README.md +99 -7
- package/dist/{access-token.d-C2qnueDV.d.cts → access-token.d-BuXO-21p.d.cts} +0 -1
- package/dist/{access-token.d-C2qnueDV.d.ts → access-token.d-BuXO-21p.d.ts} +0 -1
- package/dist/{address-suggestions.d-CewXYNYH.d.cts → address-suggestions.d-Cay0qOfA.d.cts} +0 -1
- package/dist/{address-suggestions.d-CewXYNYH.d.ts → address-suggestions.d-Cay0qOfA.d.ts} +0 -1
- package/dist/{address.d-DP_aE2ex.d.cts → address.d-D-oZY0rk.d.cts} +0 -1
- package/dist/{address.d-DP_aE2ex.d.ts → address.d-D-oZY0rk.d.ts} +0 -1
- package/dist/{ai-agents.d-vG-1utqk.d.cts → ai-agents.d-B4_CZTCP.d.cts} +0 -1
- package/dist/{ai-agents.d-vG-1utqk.d.ts → ai-agents.d-B4_CZTCP.d.ts} +0 -1
- package/dist/apis/access-token.cjs +4 -4
- package/dist/apis/access-token.d.cts +2 -2
- package/dist/apis/access-token.d.ts +2 -2
- package/dist/apis/access-token.js +1 -1
- package/dist/apis/address-suggestions.cjs +4 -4
- package/dist/apis/address-suggestions.d.cts +2 -2
- package/dist/apis/address-suggestions.d.ts +2 -2
- package/dist/apis/address-suggestions.js +1 -1
- package/dist/apis/address.cjs +4 -4
- package/dist/apis/address.d.cts +2 -2
- package/dist/apis/address.d.ts +2 -2
- package/dist/apis/address.js +1 -1
- package/dist/apis/ai-agents.cjs +4 -4
- package/dist/apis/ai-agents.d.cts +2 -2
- package/dist/apis/ai-agents.d.ts +2 -2
- package/dist/apis/ai-agents.js +1 -1
- package/dist/apis/app.cjs +4 -4
- package/dist/apis/app.d.cts +2 -2
- package/dist/apis/app.d.ts +2 -2
- package/dist/apis/app.js +1 -1
- package/dist/apis/audit-logs.cjs +4 -4
- package/dist/apis/audit-logs.d.cts +2 -2
- package/dist/apis/audit-logs.d.ts +2 -2
- package/dist/apis/audit-logs.js +1 -1
- package/dist/apis/automation.cjs +4 -4
- package/dist/apis/automation.d.cts +2 -2
- package/dist/apis/automation.d.ts +2 -2
- package/dist/apis/automation.js +1 -1
- package/dist/apis/billing.cjs +4 -4
- package/dist/apis/billing.d.cts +2 -2
- package/dist/apis/billing.d.ts +2 -2
- package/dist/apis/billing.js +1 -1
- package/dist/apis/blueprint-manifest.cjs +4 -4
- package/dist/apis/blueprint-manifest.d.cts +2 -2
- package/dist/apis/blueprint-manifest.d.ts +2 -2
- package/dist/apis/blueprint-manifest.js +1 -1
- package/dist/apis/consent.cjs +4 -4
- package/dist/apis/consent.d.cts +2 -2
- package/dist/apis/consent.d.ts +2 -2
- package/dist/apis/consent.js +1 -1
- package/dist/apis/customer-portal.cjs +4 -4
- package/dist/apis/customer-portal.d.cts +2 -2
- package/dist/apis/customer-portal.d.ts +2 -2
- package/dist/apis/customer-portal.js +1 -1
- package/dist/apis/data-management.cjs +4 -4
- package/dist/apis/data-management.d.cts +2 -2
- package/dist/apis/data-management.d.ts +2 -2
- package/dist/apis/data-management.js +1 -1
- package/dist/apis/deduplication.cjs +4 -4
- package/dist/apis/deduplication.d.cts +2 -2
- package/dist/apis/deduplication.d.ts +2 -2
- package/dist/apis/deduplication.js +1 -1
- package/dist/apis/design.cjs +4 -4
- package/dist/apis/design.d.cts +2 -2
- package/dist/apis/design.d.ts +2 -2
- package/dist/apis/design.js +1 -1
- package/dist/apis/discussion.cjs +4 -4
- package/dist/apis/discussion.d.cts +2 -2
- package/dist/apis/discussion.d.ts +2 -2
- package/dist/apis/discussion.js +1 -1
- package/dist/apis/document.cjs +4 -4
- package/dist/apis/document.d.cts +2 -2
- package/dist/apis/document.d.ts +2 -2
- package/dist/apis/document.js +1 -1
- package/dist/apis/email-settings.cjs +4 -4
- package/dist/apis/email-settings.d.cts +2 -2
- package/dist/apis/email-settings.d.ts +2 -2
- package/dist/apis/email-settings.js +1 -1
- package/dist/apis/email-template.cjs +4 -4
- package/dist/apis/email-template.d.cts +2 -2
- package/dist/apis/email-template.d.ts +2 -2
- package/dist/apis/email-template.js +1 -1
- package/dist/apis/entity-mapping.cjs +4 -4
- package/dist/apis/entity-mapping.d.cts +2 -2
- package/dist/apis/entity-mapping.d.ts +2 -2
- package/dist/apis/entity-mapping.js +1 -1
- package/dist/apis/entity.cjs +4 -4
- package/dist/apis/entity.d.cts +2 -2
- package/dist/apis/entity.d.ts +2 -2
- package/dist/apis/entity.js +1 -1
- package/dist/apis/environments.cjs +4 -4
- package/dist/apis/environments.d.cts +2 -2
- package/dist/apis/environments.d.ts +2 -2
- package/dist/apis/environments.js +1 -1
- package/dist/apis/erp-integration.cjs +4 -4
- package/dist/apis/erp-integration.d.cts +2 -2
- package/dist/apis/erp-integration.d.ts +2 -2
- package/dist/apis/erp-integration.js +1 -1
- package/dist/apis/event-catalog.cjs +4 -4
- package/dist/apis/event-catalog.d.cts +2 -2
- package/dist/apis/event-catalog.d.ts +2 -2
- package/dist/apis/event-catalog.js +1 -1
- package/dist/apis/file.cjs +4 -4
- package/dist/apis/file.d.cts +2 -2
- package/dist/apis/file.d.ts +2 -2
- package/dist/apis/file.js +1 -1
- package/dist/apis/iban.cjs +4 -4
- package/dist/apis/iban.d.cts +2 -2
- package/dist/apis/iban.d.ts +2 -2
- package/dist/apis/iban.js +1 -1
- package/dist/apis/journey.cjs +4 -4
- package/dist/apis/journey.d.cts +2 -2
- package/dist/apis/journey.d.ts +2 -2
- package/dist/apis/journey.js +1 -1
- package/dist/apis/kanban.cjs +4 -4
- package/dist/apis/kanban.d.cts +2 -2
- package/dist/apis/kanban.d.ts +2 -2
- package/dist/apis/kanban.js +1 -1
- package/dist/apis/message.cjs +4 -4
- package/dist/apis/message.d.cts +2 -2
- package/dist/apis/message.d.ts +2 -2
- package/dist/apis/message.js +1 -1
- package/dist/apis/metering.cjs +4 -4
- package/dist/apis/metering.d.cts +2 -2
- package/dist/apis/metering.d.ts +2 -2
- package/dist/apis/metering.js +1 -1
- package/dist/apis/notes.cjs +4 -4
- package/dist/apis/notes.d.cts +2 -2
- package/dist/apis/notes.d.ts +2 -2
- package/dist/apis/notes.js +1 -1
- package/dist/apis/notification.cjs +4 -4
- package/dist/apis/notification.d.cts +2 -2
- package/dist/apis/notification.d.ts +2 -2
- package/dist/apis/notification.js +1 -1
- package/dist/apis/organization.cjs +4 -4
- package/dist/apis/organization.d.cts +2 -2
- package/dist/apis/organization.d.ts +2 -2
- package/dist/apis/organization.js +1 -1
- package/dist/apis/partner-directory.cjs +4 -4
- package/dist/apis/partner-directory.d.cts +2 -2
- package/dist/apis/partner-directory.d.ts +2 -2
- package/dist/apis/partner-directory.js +1 -1
- package/dist/apis/permissions.cjs +4 -4
- package/dist/apis/permissions.d.cts +2 -2
- package/dist/apis/permissions.d.ts +2 -2
- package/dist/apis/permissions.js +1 -1
- package/dist/apis/pricing-tier.cjs +4 -4
- package/dist/apis/pricing-tier.d.cts +2 -2
- package/dist/apis/pricing-tier.d.ts +2 -2
- package/dist/apis/pricing-tier.js +1 -1
- package/dist/apis/pricing.cjs +4 -4
- package/dist/apis/pricing.d.cts +2 -2
- package/dist/apis/pricing.d.ts +2 -2
- package/dist/apis/pricing.js +1 -1
- package/dist/apis/purpose.cjs +4 -4
- package/dist/apis/purpose.d.cts +2 -2
- package/dist/apis/purpose.d.ts +2 -2
- package/dist/apis/purpose.js +1 -1
- package/dist/apis/sandbox.cjs +4 -4
- package/dist/apis/sandbox.d.cts +2 -2
- package/dist/apis/sandbox.d.ts +2 -2
- package/dist/apis/sandbox.js +1 -1
- package/dist/apis/submission.cjs +4 -4
- package/dist/apis/submission.d.cts +2 -2
- package/dist/apis/submission.d.ts +2 -2
- package/dist/apis/submission.js +1 -1
- package/dist/apis/targeting.cjs +4 -4
- package/dist/apis/targeting.d.cts +2 -2
- package/dist/apis/targeting.d.ts +2 -2
- package/dist/apis/targeting.js +1 -1
- package/dist/apis/template-variables.cjs +4 -4
- package/dist/apis/template-variables.d.cts +2 -2
- package/dist/apis/template-variables.d.ts +2 -2
- package/dist/apis/template-variables.js +1 -1
- package/dist/apis/user.cjs +4 -4
- package/dist/apis/user.d.cts +2 -2
- package/dist/apis/user.d.ts +2 -2
- package/dist/apis/user.js +1 -1
- package/dist/apis/validation-rules.cjs +4 -4
- package/dist/apis/validation-rules.d.cts +2 -2
- package/dist/apis/validation-rules.d.ts +2 -2
- package/dist/apis/validation-rules.js +1 -1
- package/dist/apis/webhooks.cjs +4 -4
- package/dist/apis/webhooks.d.cts +2 -2
- package/dist/apis/webhooks.d.ts +2 -2
- package/dist/apis/webhooks.js +1 -1
- package/dist/apis/workflow-definition.cjs +4 -4
- package/dist/apis/workflow-definition.d.cts +2 -2
- package/dist/apis/workflow-definition.d.ts +2 -2
- package/dist/apis/workflow-definition.js +1 -1
- package/dist/apis/workflow.cjs +4 -4
- package/dist/apis/workflow.d.cts +2 -2
- package/dist/apis/workflow.d.ts +2 -2
- package/dist/apis/workflow.js +1 -1
- package/dist/{app.d-Uncn387s.d.cts → app.d-BKyfin-q.d.cts} +0 -1
- package/dist/{app.d-Uncn387s.d.ts → app.d-BKyfin-q.d.ts} +0 -1
- package/dist/{audit-logs.d-BxZqONu5.d.cts → audit-logs.d-19BKb-ur.d.cts} +0 -1
- package/dist/{audit-logs.d-BxZqONu5.d.ts → audit-logs.d-19BKb-ur.d.ts} +0 -1
- package/dist/{automation.d-BteCzeFn.d.cts → automation.d-DKl2VtnW.d.cts} +0 -1
- package/dist/{automation.d-BteCzeFn.d.ts → automation.d-DKl2VtnW.d.ts} +0 -1
- package/dist/{billing.d-BH4__05Y.d.cts → billing.d-58fUMBqj.d.cts} +0 -1
- package/dist/{billing.d-BH4__05Y.d.ts → billing.d-58fUMBqj.d.ts} +0 -1
- package/dist/bin/cli.js +5 -7
- package/dist/{blueprint-manifest.d-CU4v09fj.d.cts → blueprint-manifest.d-Bu1GyXFW.d.cts} +0 -1
- package/dist/{blueprint-manifest.d-CU4v09fj.d.ts → blueprint-manifest.d-Bu1GyXFW.d.ts} +0 -1
- package/dist/{chunk-UJTFRZMS.js → chunk-UCDXDIUX.js} +2 -2
- package/dist/{chunk-YLLKMXS3.cjs → chunk-YYLPAGF4.cjs} +2 -2
- package/dist/{consent.d-BETWwU_2.d.cts → consent.d-CQ88IEj0.d.cts} +0 -1
- package/dist/{consent.d-BETWwU_2.d.ts → consent.d-CQ88IEj0.d.ts} +0 -1
- package/dist/{customer-portal.d-Co_I6psR.d.cts → customer-portal.d-EyndRWh6.d.cts} +0 -1
- package/dist/{customer-portal.d-Co_I6psR.d.ts → customer-portal.d-EyndRWh6.d.ts} +0 -1
- package/dist/{data-management.d-CkR2E_Pm.d.cts → data-management.d-CNExsqJQ.d.cts} +0 -1
- package/dist/{data-management.d-CkR2E_Pm.d.ts → data-management.d-CNExsqJQ.d.ts} +0 -1
- package/dist/{deduplication.d-BlHnjhXk.d.cts → deduplication.d-DCeJzdbM.d.cts} +0 -1
- package/dist/{deduplication.d-BlHnjhXk.d.ts → deduplication.d-DCeJzdbM.d.ts} +0 -1
- package/dist/{design.d-JsNY_cGh.d.cts → design.d-CkwgJ78Z.d.cts} +0 -1
- package/dist/{design.d-JsNY_cGh.d.ts → design.d-CkwgJ78Z.d.ts} +0 -1
- package/dist/{discussion.d-CxxaYKTf.d.cts → discussion.d-DQucoYl_.d.cts} +0 -1
- package/dist/{discussion.d-CxxaYKTf.d.ts → discussion.d-DQucoYl_.d.ts} +0 -1
- package/dist/{document.d-CZ_FGhEn.d.cts → document.d-Y8i32qNV.d.cts} +0 -1
- package/dist/{document.d-CZ_FGhEn.d.ts → document.d-Y8i32qNV.d.ts} +0 -1
- package/dist/{email-settings.d-3eXYEyRr.d.cts → email-settings.d-CPAsRFWN.d.cts} +0 -1
- package/dist/{email-settings.d-3eXYEyRr.d.ts → email-settings.d-CPAsRFWN.d.ts} +0 -1
- package/dist/{email-template.d-C2L0dKqB.d.cts → email-template.d-CQqiCN0N.d.cts} +0 -1
- package/dist/{email-template.d-C2L0dKqB.d.ts → email-template.d-CQqiCN0N.d.ts} +0 -1
- package/dist/{entity-mapping.d-B3Vyepok.d.cts → entity-mapping.d-DiqXqJWb.d.cts} +0 -1
- package/dist/{entity-mapping.d-B3Vyepok.d.ts → entity-mapping.d-DiqXqJWb.d.ts} +0 -1
- package/dist/{entity.d-DmER_7q5.d.cts → entity.d-BtT4mdq4.d.cts} +0 -1
- package/dist/{entity.d-DmER_7q5.d.ts → entity.d-BtT4mdq4.d.ts} +0 -1
- package/dist/{environments.d-CpILpSNF.d.cts → environments.d-C1xIs8N2.d.cts} +0 -1
- package/dist/{environments.d-CpILpSNF.d.ts → environments.d-C1xIs8N2.d.ts} +0 -1
- package/dist/{erp-integration.d-DmxUZOUQ.d.cts → erp-integration.d-CNLzgl4L.d.cts} +0 -1
- package/dist/{erp-integration.d-DmxUZOUQ.d.ts → erp-integration.d-CNLzgl4L.d.ts} +0 -1
- package/dist/{event-catalog.d-B2tq20gn.d.cts → event-catalog.d-DW1dOyVh.d.cts} +0 -1
- package/dist/{event-catalog.d-B2tq20gn.d.ts → event-catalog.d-DW1dOyVh.d.ts} +0 -1
- package/dist/{file.d-Bi0EZkNu.d.cts → file.d-Bpdt2ORN.d.cts} +0 -1
- package/dist/{file.d-Bi0EZkNu.d.ts → file.d-Bpdt2ORN.d.ts} +0 -1
- package/dist/{iban.d-DP7hl0Qt.d.cts → iban.d-3_7FEsbx.d.cts} +0 -1
- package/dist/{iban.d-DP7hl0Qt.d.ts → iban.d-3_7FEsbx.d.ts} +0 -1
- package/dist/index.cjs +70 -7
- package/dist/index.d.cts +71 -47
- package/dist/index.d.ts +71 -47
- package/dist/index.js +66 -3
- package/dist/{journey.d-DxL16X6N.d.cts → journey.d-C2lgynUF.d.cts} +0 -1
- package/dist/{journey.d-DxL16X6N.d.ts → journey.d-C2lgynUF.d.ts} +0 -1
- package/dist/{kanban.d-DDrBwr9h.d.cts → kanban.d-DYVjUQ_S.d.cts} +0 -1
- package/dist/{kanban.d-DDrBwr9h.d.ts → kanban.d-DYVjUQ_S.d.ts} +0 -1
- package/dist/{message.d-BeBH6vof.d.cts → message.d-TAVDRlDJ.d.cts} +0 -1
- package/dist/{message.d-BeBH6vof.d.ts → message.d-TAVDRlDJ.d.ts} +0 -1
- package/dist/{metering.d-D5VR4tVa.d.cts → metering.d-qyYaAU-O.d.cts} +0 -1
- package/dist/{metering.d-D5VR4tVa.d.ts → metering.d-qyYaAU-O.d.ts} +0 -1
- package/dist/{notes.d-DZYeVo0I.d.cts → notes.d-CDyIbegf.d.cts} +0 -1
- package/dist/{notes.d-DZYeVo0I.d.ts → notes.d-CDyIbegf.d.ts} +0 -1
- package/dist/{notification.d-BJwdFZnG.d.cts → notification.d-B7ccbaPr.d.cts} +0 -1
- package/dist/{notification.d-BJwdFZnG.d.ts → notification.d-B7ccbaPr.d.ts} +0 -1
- package/dist/{organization.d-DfUcuwKM.d.cts → organization.d-BxZWnh8L.d.cts} +0 -1
- package/dist/{organization.d-DfUcuwKM.d.ts → organization.d-BxZWnh8L.d.ts} +0 -1
- package/dist/{partner-directory.d-BRRDHFcz.d.cts → partner-directory.d-CzKV3WfP.d.cts} +0 -1
- package/dist/{partner-directory.d-BRRDHFcz.d.ts → partner-directory.d-CzKV3WfP.d.ts} +0 -1
- package/dist/{permissions.d-CL7SwMFy.d.cts → permissions.d-lVoPAfl3.d.cts} +0 -1
- package/dist/{permissions.d-CL7SwMFy.d.ts → permissions.d-lVoPAfl3.d.ts} +0 -1
- package/dist/{pricing-tier.d-VuH-NtlR.d.cts → pricing-tier.d-BW2cZt1w.d.cts} +0 -1
- package/dist/{pricing-tier.d-VuH-NtlR.d.ts → pricing-tier.d-BW2cZt1w.d.ts} +0 -1
- package/dist/{pricing.d-Dd1CaSX_.d.cts → pricing.d-Ehb2JuKY.d.cts} +0 -1
- package/dist/{pricing.d-Dd1CaSX_.d.ts → pricing.d-Ehb2JuKY.d.ts} +0 -1
- package/dist/{purpose.d-D8YCSqt9.d.cts → purpose.d-BVxst611.d.cts} +0 -1
- package/dist/{purpose.d-D8YCSqt9.d.ts → purpose.d-BVxst611.d.ts} +0 -1
- package/dist/{sandbox.d-D1NgPMEc.d.cts → sandbox.d-tRO2movo.d.cts} +0 -1
- package/dist/{sandbox.d-D1NgPMEc.d.ts → sandbox.d-tRO2movo.d.ts} +0 -1
- package/dist/{submission.d-e9MPrbY1.d.cts → submission.d-CSll5Km9.d.cts} +0 -1
- package/dist/{submission.d-e9MPrbY1.d.ts → submission.d-CSll5Km9.d.ts} +0 -1
- package/dist/{targeting.d-1GW3nh-y.d.cts → targeting.d-CDxIsOWy.d.cts} +0 -1
- package/dist/{targeting.d-1GW3nh-y.d.ts → targeting.d-CDxIsOWy.d.ts} +0 -1
- package/dist/{template-variables.d-CqqGe3sd.d.cts → template-variables.d-PwA27Ocv.d.cts} +0 -1
- package/dist/{template-variables.d-CqqGe3sd.d.ts → template-variables.d-PwA27Ocv.d.ts} +0 -1
- package/dist/{user.d-CWBgUia2.d.cts → user.d-DJBp6aX5.d.cts} +0 -1
- package/dist/{user.d-CWBgUia2.d.ts → user.d-DJBp6aX5.d.ts} +0 -1
- package/dist/{validation-rules.d-CMSvveua.d.cts → validation-rules.d-CScjNdxD.d.cts} +0 -1
- package/dist/{validation-rules.d-CMSvveua.d.ts → validation-rules.d-CScjNdxD.d.ts} +0 -1
- package/dist/{webhooks.d-Bzl-u_Zs.d.cts → webhooks.d-C_MQSJEB.d.cts} +0 -1
- package/dist/{webhooks.d-Bzl-u_Zs.d.ts → webhooks.d-C_MQSJEB.d.ts} +0 -1
- package/dist/{workflow-definition.d-BKmIy2Qp.d.cts → workflow-definition.d-CFXrp2Hg.d.cts} +0 -1
- package/dist/{workflow-definition.d-BKmIy2Qp.d.ts → workflow-definition.d-CFXrp2Hg.d.ts} +0 -1
- package/dist/{workflow.d-DElz0XoQ.d.cts → workflow.d-BIWtgMyP.d.cts} +0 -1
- package/dist/{workflow.d-DElz0XoQ.d.ts → workflow.d-BIWtgMyP.d.ts} +0 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -1,12 +1,59 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } 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; }
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkYYLPAGF4cjs = require('./chunk-YYLPAGF4.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
var _chunkOBGZSXTJcjs = require('./chunk-OBGZSXTJ.cjs');
|
|
9
9
|
|
|
10
|
+
// src/large-response.ts
|
|
11
|
+
var CONTENT_TYPE = "application/large-response.vnd+json";
|
|
12
|
+
var REF_PROPERTY = "$payload_ref";
|
|
13
|
+
var applyLargeResponseInterceptor = (params) => {
|
|
14
|
+
const { client, config } = params;
|
|
15
|
+
if (config.enabled === false) return;
|
|
16
|
+
client.interceptors.request.use((requestConfig) => {
|
|
17
|
+
requestConfig.headers.Accept = CONTENT_TYPE;
|
|
18
|
+
return requestConfig;
|
|
19
|
+
});
|
|
20
|
+
client.interceptors.response.use(async (response) => {
|
|
21
|
+
const contentType = response.headers["content-type"];
|
|
22
|
+
if (contentType === CONTENT_TYPE && _optionalChain([response, 'access', _2 => _2.data, 'optionalAccess', _3 => _3[REF_PROPERTY]])) {
|
|
23
|
+
const ref = response.data[REF_PROPERTY];
|
|
24
|
+
const { data } = await client.get(ref, {
|
|
25
|
+
transformResponse: (raw) => JSON.parse(raw)
|
|
26
|
+
});
|
|
27
|
+
response.data = data;
|
|
28
|
+
}
|
|
29
|
+
return response;
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
// src/retry.ts
|
|
34
|
+
var DEFAULT_MAX_RETRIES = 3;
|
|
35
|
+
var DEFAULT_DELAY_MS = 1e3;
|
|
36
|
+
var sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
37
|
+
var RETRY_COUNT_HEADER = "x-epilot-sdk-retry-count";
|
|
38
|
+
var applyRetryInterceptor = (params) => {
|
|
39
|
+
const { client, config } = params;
|
|
40
|
+
const maxRetries = _nullishCoalesce(config.maxRetries, () => ( DEFAULT_MAX_RETRIES));
|
|
41
|
+
if (maxRetries <= 0) return;
|
|
42
|
+
client.interceptors.response.use(void 0, async (error) => {
|
|
43
|
+
if (_optionalChain([error, 'access', _4 => _4.response, 'optionalAccess', _5 => _5.status]) !== 429) throw error;
|
|
44
|
+
const retryCountRaw = _optionalChain([error, 'access', _6 => _6.config, 'optionalAccess', _7 => _7.headers, 'optionalAccess', _8 => _8[RETRY_COUNT_HEADER]]);
|
|
45
|
+
const retryCount = Number(_nullishCoalesce(retryCountRaw, () => ( 0)));
|
|
46
|
+
if (retryCount >= maxRetries) throw error;
|
|
47
|
+
const retryAfterHeader = error.response.headers["retry-after"];
|
|
48
|
+
const retryAfterSeconds = retryAfterHeader ? Number(retryAfterHeader) : NaN;
|
|
49
|
+
const delayMs = Number.isFinite(retryAfterSeconds) ? retryAfterSeconds * 1e3 : _nullishCoalesce(config.defaultDelayMs, () => ( DEFAULT_DELAY_MS));
|
|
50
|
+
await sleep(delayMs);
|
|
51
|
+
const retryConfig = { ...error.config };
|
|
52
|
+
retryConfig.headers.set(RETRY_COUNT_HEADER, String(retryCount + 1));
|
|
53
|
+
return client.request(retryConfig);
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
|
|
10
57
|
// src/registry.ts
|
|
11
58
|
var createRegistry = () => /* @__PURE__ */ new Map();
|
|
12
59
|
var registerApi = (params) => {
|
|
@@ -22,16 +69,18 @@ var resolveClient = async (params) => {
|
|
|
22
69
|
}
|
|
23
70
|
if (!entry.instance) {
|
|
24
71
|
const definition = await entry.loader();
|
|
25
|
-
entry.instance =
|
|
72
|
+
entry.instance = _chunkYYLPAGF4cjs.createApiClient.call(void 0, {
|
|
26
73
|
definition,
|
|
27
74
|
token: state.token,
|
|
28
75
|
headers: state.globalHeaders
|
|
29
76
|
});
|
|
77
|
+
applyLargeResponseInterceptor({ client: entry.instance, config: state.largeResponse });
|
|
78
|
+
applyRetryInterceptor({ client: entry.instance, config: state.retry });
|
|
30
79
|
if (state.tokenFn) {
|
|
31
80
|
const tokenFn = state.tokenFn;
|
|
32
81
|
entry.instance.interceptors.request.use(async (config) => {
|
|
33
82
|
const resolved = await tokenFn();
|
|
34
|
-
config.headers
|
|
83
|
+
config.headers.authorization = `Bearer ${resolved}`;
|
|
35
84
|
return config;
|
|
36
85
|
});
|
|
37
86
|
}
|
|
@@ -490,7 +539,9 @@ var createSDK = () => {
|
|
|
490
539
|
token: null,
|
|
491
540
|
tokenFn: null,
|
|
492
541
|
globalHeaders: {},
|
|
493
|
-
interceptors: []
|
|
542
|
+
interceptors: [],
|
|
543
|
+
retry: { maxRetries: 3 },
|
|
544
|
+
largeResponse: { enabled: true }
|
|
494
545
|
};
|
|
495
546
|
registerBuiltinApis(registry);
|
|
496
547
|
loadOverrides(registry);
|
|
@@ -500,7 +551,7 @@ var createSDK = () => {
|
|
|
500
551
|
const available = [...registry.keys()].join(", ");
|
|
501
552
|
throw new Error(`Unknown API: "${name}". Available: ${available}`);
|
|
502
553
|
}
|
|
503
|
-
return
|
|
554
|
+
return _chunkYYLPAGF4cjs.createApiHandle.call(void 0, {
|
|
504
555
|
resolveClient: () => resolveClient({ registry, name, state }),
|
|
505
556
|
loadDefinition: entry.loader
|
|
506
557
|
});
|
|
@@ -525,6 +576,16 @@ var createSDK = () => {
|
|
|
525
576
|
Object.assign(state.globalHeaders, headers);
|
|
526
577
|
resetAllClients(registry);
|
|
527
578
|
};
|
|
579
|
+
case "retry":
|
|
580
|
+
return (config) => {
|
|
581
|
+
Object.assign(state.retry, config);
|
|
582
|
+
resetAllClients(registry);
|
|
583
|
+
};
|
|
584
|
+
case "largeResponse":
|
|
585
|
+
return (config) => {
|
|
586
|
+
Object.assign(state.largeResponse, config);
|
|
587
|
+
resetAllClients(registry);
|
|
588
|
+
};
|
|
528
589
|
case "interceptors": {
|
|
529
590
|
const interceptorUse = {
|
|
530
591
|
request: (fulfilled, rejected) => {
|
|
@@ -560,4 +621,6 @@ var epilot = createSDK();
|
|
|
560
621
|
|
|
561
622
|
|
|
562
623
|
|
|
563
|
-
|
|
624
|
+
|
|
625
|
+
|
|
626
|
+
exports.applyLargeResponseInterceptor = applyLargeResponseInterceptor; exports.applyRetryInterceptor = applyRetryInterceptor; exports.authorize = _chunkYYLPAGF4cjs.authorize; exports.createSDK = createSDK; exports.epilot = epilot;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
1
|
import { AxiosInstance } from 'axios';
|
|
2
2
|
import { T as TokenArg, H as HeadersConfig, A as ApiHandle } from './types-C5cGIwtq.cjs';
|
|
3
3
|
export { I as Interceptor, O as OverridesConfig, a as authorize } from './types-C5cGIwtq.cjs';
|
|
4
|
-
import { C as Client } from './access-token.d-
|
|
5
|
-
import { C as Client$1 } from './address.d-
|
|
6
|
-
import { C as Client$2 } from './address-suggestions.d-
|
|
7
|
-
import { C as Client$3 } from './ai-agents.d-
|
|
8
|
-
import { C as Client$4 } from './app.d-
|
|
9
|
-
import { C as Client$5 } from './audit-logs.d-
|
|
10
|
-
import { C as Client$6 } from './automation.d-
|
|
11
|
-
import { C as Client$7 } from './billing.d-
|
|
12
|
-
import { C as Client$8 } from './blueprint-manifest.d-
|
|
13
|
-
import { C as Client$9 } from './consent.d-
|
|
14
|
-
import { C as Client$a } from './customer-portal.d-
|
|
15
|
-
import { C as Client$b } from './data-management.d-
|
|
16
|
-
import { C as Client$c } from './deduplication.d-
|
|
17
|
-
import { C as Client$d } from './design.d-
|
|
18
|
-
import { C as Client$e } from './discussion.d-
|
|
19
|
-
import { C as Client$f } from './document.d-
|
|
20
|
-
import { C as Client$g } from './email-settings.d-
|
|
21
|
-
import { C as Client$h } from './email-template.d-
|
|
22
|
-
import { C as Client$i } from './entity.d-
|
|
23
|
-
import { C as Client$j } from './entity-mapping.d-
|
|
24
|
-
import { C as Client$k } from './environments.d-
|
|
25
|
-
import { C as Client$l } from './erp-integration.d-
|
|
26
|
-
import { C as Client$m } from './event-catalog.d-
|
|
27
|
-
import { C as Client$n } from './file.d-
|
|
28
|
-
import { C as Client$o } from './iban.d-
|
|
29
|
-
import { C as Client$p } from './journey.d-
|
|
30
|
-
import { C as Client$q } from './kanban.d-
|
|
31
|
-
import { C as Client$r } from './message.d-
|
|
32
|
-
import { C as Client$s } from './metering.d-
|
|
33
|
-
import { C as Client$t } from './notes.d-
|
|
34
|
-
import { C as Client$u } from './notification.d-
|
|
35
|
-
import { C as Client$v } from './organization.d-
|
|
36
|
-
import { C as Client$w } from './partner-directory.d-
|
|
37
|
-
import { C as Client$x } from './permissions.d-
|
|
38
|
-
import { C as Client$y } from './pricing.d-
|
|
39
|
-
import { C as Client$z } from './pricing-tier.d-
|
|
40
|
-
import { C as Client$A } from './purpose.d-
|
|
41
|
-
import { C as Client$B } from './sandbox.d-
|
|
42
|
-
import { C as Client$C } from './submission.d-
|
|
43
|
-
import { C as Client$D } from './targeting.d-
|
|
44
|
-
import { C as Client$E } from './template-variables.d-
|
|
45
|
-
import { C as Client$F } from './user.d-
|
|
46
|
-
import { C as Client$G } from './validation-rules.d-
|
|
47
|
-
import { C as Client$H } from './webhooks.d-
|
|
48
|
-
import { C as Client$I } from './workflow.d-
|
|
49
|
-
import { C as Client$J } from './workflow-definition.d-
|
|
4
|
+
import { C as Client } from './access-token.d-BuXO-21p.cjs';
|
|
5
|
+
import { C as Client$1 } from './address.d-D-oZY0rk.cjs';
|
|
6
|
+
import { C as Client$2 } from './address-suggestions.d-Cay0qOfA.cjs';
|
|
7
|
+
import { C as Client$3 } from './ai-agents.d-B4_CZTCP.cjs';
|
|
8
|
+
import { C as Client$4 } from './app.d-BKyfin-q.cjs';
|
|
9
|
+
import { C as Client$5 } from './audit-logs.d-19BKb-ur.cjs';
|
|
10
|
+
import { C as Client$6 } from './automation.d-DKl2VtnW.cjs';
|
|
11
|
+
import { C as Client$7 } from './billing.d-58fUMBqj.cjs';
|
|
12
|
+
import { C as Client$8 } from './blueprint-manifest.d-Bu1GyXFW.cjs';
|
|
13
|
+
import { C as Client$9 } from './consent.d-CQ88IEj0.cjs';
|
|
14
|
+
import { C as Client$a } from './customer-portal.d-EyndRWh6.cjs';
|
|
15
|
+
import { C as Client$b } from './data-management.d-CNExsqJQ.cjs';
|
|
16
|
+
import { C as Client$c } from './deduplication.d-DCeJzdbM.cjs';
|
|
17
|
+
import { C as Client$d } from './design.d-CkwgJ78Z.cjs';
|
|
18
|
+
import { C as Client$e } from './discussion.d-DQucoYl_.cjs';
|
|
19
|
+
import { C as Client$f } from './document.d-Y8i32qNV.cjs';
|
|
20
|
+
import { C as Client$g } from './email-settings.d-CPAsRFWN.cjs';
|
|
21
|
+
import { C as Client$h } from './email-template.d-CQqiCN0N.cjs';
|
|
22
|
+
import { C as Client$i } from './entity.d-BtT4mdq4.cjs';
|
|
23
|
+
import { C as Client$j } from './entity-mapping.d-DiqXqJWb.cjs';
|
|
24
|
+
import { C as Client$k } from './environments.d-C1xIs8N2.cjs';
|
|
25
|
+
import { C as Client$l } from './erp-integration.d-CNLzgl4L.cjs';
|
|
26
|
+
import { C as Client$m } from './event-catalog.d-DW1dOyVh.cjs';
|
|
27
|
+
import { C as Client$n } from './file.d-Bpdt2ORN.cjs';
|
|
28
|
+
import { C as Client$o } from './iban.d-3_7FEsbx.cjs';
|
|
29
|
+
import { C as Client$p } from './journey.d-C2lgynUF.cjs';
|
|
30
|
+
import { C as Client$q } from './kanban.d-DYVjUQ_S.cjs';
|
|
31
|
+
import { C as Client$r } from './message.d-TAVDRlDJ.cjs';
|
|
32
|
+
import { C as Client$s } from './metering.d-qyYaAU-O.cjs';
|
|
33
|
+
import { C as Client$t } from './notes.d-CDyIbegf.cjs';
|
|
34
|
+
import { C as Client$u } from './notification.d-B7ccbaPr.cjs';
|
|
35
|
+
import { C as Client$v } from './organization.d-BxZWnh8L.cjs';
|
|
36
|
+
import { C as Client$w } from './partner-directory.d-CzKV3WfP.cjs';
|
|
37
|
+
import { C as Client$x } from './permissions.d-lVoPAfl3.cjs';
|
|
38
|
+
import { C as Client$y } from './pricing.d-Ehb2JuKY.cjs';
|
|
39
|
+
import { C as Client$z } from './pricing-tier.d-BW2cZt1w.cjs';
|
|
40
|
+
import { C as Client$A } from './purpose.d-BVxst611.cjs';
|
|
41
|
+
import { C as Client$B } from './sandbox.d-tRO2movo.cjs';
|
|
42
|
+
import { C as Client$C } from './submission.d-CSll5Km9.cjs';
|
|
43
|
+
import { C as Client$D } from './targeting.d-CDxIsOWy.cjs';
|
|
44
|
+
import { C as Client$E } from './template-variables.d-PwA27Ocv.cjs';
|
|
45
|
+
import { C as Client$F } from './user.d-DJBp6aX5.cjs';
|
|
46
|
+
import { C as Client$G } from './validation-rules.d-CScjNdxD.cjs';
|
|
47
|
+
import { C as Client$H } from './webhooks.d-C_MQSJEB.cjs';
|
|
48
|
+
import { C as Client$I } from './workflow.d-BIWtgMyP.cjs';
|
|
49
|
+
import { C as Client$J } from './workflow-definition.d-CFXrp2Hg.cjs';
|
|
50
50
|
import 'openapi-client-axios';
|
|
51
51
|
|
|
52
52
|
type SDKClientMap = {
|
|
@@ -98,6 +98,26 @@ type SDKClientMap = {
|
|
|
98
98
|
workflowDefinition: Client$J;
|
|
99
99
|
};
|
|
100
100
|
|
|
101
|
+
type LargeResponseConfig = {
|
|
102
|
+
/** Enable large response handling. Default: true */
|
|
103
|
+
enabled?: boolean;
|
|
104
|
+
};
|
|
105
|
+
declare const applyLargeResponseInterceptor: (params: {
|
|
106
|
+
client: AxiosInstance;
|
|
107
|
+
config: LargeResponseConfig;
|
|
108
|
+
}) => void;
|
|
109
|
+
|
|
110
|
+
type RetryConfig = {
|
|
111
|
+
/** Maximum number of retries for 429 responses. Set to 0 to disable. Default: 3 */
|
|
112
|
+
maxRetries?: number;
|
|
113
|
+
/** Default delay in ms when Retry-After header is missing. Default: 1000 */
|
|
114
|
+
defaultDelayMs?: number;
|
|
115
|
+
};
|
|
116
|
+
declare const applyRetryInterceptor: (params: {
|
|
117
|
+
client: AxiosInstance;
|
|
118
|
+
config: RetryConfig;
|
|
119
|
+
}) => void;
|
|
120
|
+
|
|
101
121
|
type InterceptorUse = {
|
|
102
122
|
request: (fulfilled: (config: unknown) => unknown, rejected?: (error: unknown) => unknown) => void;
|
|
103
123
|
response: (fulfilled: (response: unknown) => unknown, rejected?: (error: unknown) => unknown) => void;
|
|
@@ -109,6 +129,10 @@ type EpilotSDK = {
|
|
|
109
129
|
headers: (headers: HeadersConfig) => void;
|
|
110
130
|
/** Register global axios interceptors applied to all clients */
|
|
111
131
|
interceptors: InterceptorUse;
|
|
132
|
+
/** Configure retry behavior for 429 Too Many Requests responses */
|
|
133
|
+
retry: (config: RetryConfig) => void;
|
|
134
|
+
/** Configure large response handling for S3-backed payloads */
|
|
135
|
+
largeResponse: (config: LargeResponseConfig) => void;
|
|
112
136
|
} & {
|
|
113
137
|
[K in keyof SDKClientMap]: ApiHandle<SDKClientMap[K]>;
|
|
114
138
|
} & Record<string, ApiHandle<AxiosInstance>>;
|
|
@@ -116,4 +140,4 @@ declare const createSDK: () => EpilotSDK;
|
|
|
116
140
|
|
|
117
141
|
declare const epilot: EpilotSDK;
|
|
118
142
|
|
|
119
|
-
export { ApiHandle, type EpilotSDK, HeadersConfig, type InterceptorUse, TokenArg, createSDK, epilot };
|
|
143
|
+
export { ApiHandle, type EpilotSDK, HeadersConfig, type InterceptorUse, type LargeResponseConfig, type RetryConfig, TokenArg, applyLargeResponseInterceptor, applyRetryInterceptor, createSDK, epilot };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
1
|
import { AxiosInstance } from 'axios';
|
|
2
2
|
import { T as TokenArg, H as HeadersConfig, A as ApiHandle } from './types-C5cGIwtq.js';
|
|
3
3
|
export { I as Interceptor, O as OverridesConfig, a as authorize } from './types-C5cGIwtq.js';
|
|
4
|
-
import { C as Client } from './access-token.d-
|
|
5
|
-
import { C as Client$1 } from './address.d-
|
|
6
|
-
import { C as Client$2 } from './address-suggestions.d-
|
|
7
|
-
import { C as Client$3 } from './ai-agents.d-
|
|
8
|
-
import { C as Client$4 } from './app.d-
|
|
9
|
-
import { C as Client$5 } from './audit-logs.d-
|
|
10
|
-
import { C as Client$6 } from './automation.d-
|
|
11
|
-
import { C as Client$7 } from './billing.d-
|
|
12
|
-
import { C as Client$8 } from './blueprint-manifest.d-
|
|
13
|
-
import { C as Client$9 } from './consent.d-
|
|
14
|
-
import { C as Client$a } from './customer-portal.d-
|
|
15
|
-
import { C as Client$b } from './data-management.d-
|
|
16
|
-
import { C as Client$c } from './deduplication.d-
|
|
17
|
-
import { C as Client$d } from './design.d-
|
|
18
|
-
import { C as Client$e } from './discussion.d-
|
|
19
|
-
import { C as Client$f } from './document.d-
|
|
20
|
-
import { C as Client$g } from './email-settings.d-
|
|
21
|
-
import { C as Client$h } from './email-template.d-
|
|
22
|
-
import { C as Client$i } from './entity.d-
|
|
23
|
-
import { C as Client$j } from './entity-mapping.d-
|
|
24
|
-
import { C as Client$k } from './environments.d-
|
|
25
|
-
import { C as Client$l } from './erp-integration.d-
|
|
26
|
-
import { C as Client$m } from './event-catalog.d-
|
|
27
|
-
import { C as Client$n } from './file.d-
|
|
28
|
-
import { C as Client$o } from './iban.d-
|
|
29
|
-
import { C as Client$p } from './journey.d-
|
|
30
|
-
import { C as Client$q } from './kanban.d-
|
|
31
|
-
import { C as Client$r } from './message.d-
|
|
32
|
-
import { C as Client$s } from './metering.d-
|
|
33
|
-
import { C as Client$t } from './notes.d-
|
|
34
|
-
import { C as Client$u } from './notification.d-
|
|
35
|
-
import { C as Client$v } from './organization.d-
|
|
36
|
-
import { C as Client$w } from './partner-directory.d-
|
|
37
|
-
import { C as Client$x } from './permissions.d-
|
|
38
|
-
import { C as Client$y } from './pricing.d-
|
|
39
|
-
import { C as Client$z } from './pricing-tier.d-
|
|
40
|
-
import { C as Client$A } from './purpose.d-
|
|
41
|
-
import { C as Client$B } from './sandbox.d-
|
|
42
|
-
import { C as Client$C } from './submission.d-
|
|
43
|
-
import { C as Client$D } from './targeting.d-
|
|
44
|
-
import { C as Client$E } from './template-variables.d-
|
|
45
|
-
import { C as Client$F } from './user.d-
|
|
46
|
-
import { C as Client$G } from './validation-rules.d-
|
|
47
|
-
import { C as Client$H } from './webhooks.d-
|
|
48
|
-
import { C as Client$I } from './workflow.d-
|
|
49
|
-
import { C as Client$J } from './workflow-definition.d-
|
|
4
|
+
import { C as Client } from './access-token.d-BuXO-21p.js';
|
|
5
|
+
import { C as Client$1 } from './address.d-D-oZY0rk.js';
|
|
6
|
+
import { C as Client$2 } from './address-suggestions.d-Cay0qOfA.js';
|
|
7
|
+
import { C as Client$3 } from './ai-agents.d-B4_CZTCP.js';
|
|
8
|
+
import { C as Client$4 } from './app.d-BKyfin-q.js';
|
|
9
|
+
import { C as Client$5 } from './audit-logs.d-19BKb-ur.js';
|
|
10
|
+
import { C as Client$6 } from './automation.d-DKl2VtnW.js';
|
|
11
|
+
import { C as Client$7 } from './billing.d-58fUMBqj.js';
|
|
12
|
+
import { C as Client$8 } from './blueprint-manifest.d-Bu1GyXFW.js';
|
|
13
|
+
import { C as Client$9 } from './consent.d-CQ88IEj0.js';
|
|
14
|
+
import { C as Client$a } from './customer-portal.d-EyndRWh6.js';
|
|
15
|
+
import { C as Client$b } from './data-management.d-CNExsqJQ.js';
|
|
16
|
+
import { C as Client$c } from './deduplication.d-DCeJzdbM.js';
|
|
17
|
+
import { C as Client$d } from './design.d-CkwgJ78Z.js';
|
|
18
|
+
import { C as Client$e } from './discussion.d-DQucoYl_.js';
|
|
19
|
+
import { C as Client$f } from './document.d-Y8i32qNV.js';
|
|
20
|
+
import { C as Client$g } from './email-settings.d-CPAsRFWN.js';
|
|
21
|
+
import { C as Client$h } from './email-template.d-CQqiCN0N.js';
|
|
22
|
+
import { C as Client$i } from './entity.d-BtT4mdq4.js';
|
|
23
|
+
import { C as Client$j } from './entity-mapping.d-DiqXqJWb.js';
|
|
24
|
+
import { C as Client$k } from './environments.d-C1xIs8N2.js';
|
|
25
|
+
import { C as Client$l } from './erp-integration.d-CNLzgl4L.js';
|
|
26
|
+
import { C as Client$m } from './event-catalog.d-DW1dOyVh.js';
|
|
27
|
+
import { C as Client$n } from './file.d-Bpdt2ORN.js';
|
|
28
|
+
import { C as Client$o } from './iban.d-3_7FEsbx.js';
|
|
29
|
+
import { C as Client$p } from './journey.d-C2lgynUF.js';
|
|
30
|
+
import { C as Client$q } from './kanban.d-DYVjUQ_S.js';
|
|
31
|
+
import { C as Client$r } from './message.d-TAVDRlDJ.js';
|
|
32
|
+
import { C as Client$s } from './metering.d-qyYaAU-O.js';
|
|
33
|
+
import { C as Client$t } from './notes.d-CDyIbegf.js';
|
|
34
|
+
import { C as Client$u } from './notification.d-B7ccbaPr.js';
|
|
35
|
+
import { C as Client$v } from './organization.d-BxZWnh8L.js';
|
|
36
|
+
import { C as Client$w } from './partner-directory.d-CzKV3WfP.js';
|
|
37
|
+
import { C as Client$x } from './permissions.d-lVoPAfl3.js';
|
|
38
|
+
import { C as Client$y } from './pricing.d-Ehb2JuKY.js';
|
|
39
|
+
import { C as Client$z } from './pricing-tier.d-BW2cZt1w.js';
|
|
40
|
+
import { C as Client$A } from './purpose.d-BVxst611.js';
|
|
41
|
+
import { C as Client$B } from './sandbox.d-tRO2movo.js';
|
|
42
|
+
import { C as Client$C } from './submission.d-CSll5Km9.js';
|
|
43
|
+
import { C as Client$D } from './targeting.d-CDxIsOWy.js';
|
|
44
|
+
import { C as Client$E } from './template-variables.d-PwA27Ocv.js';
|
|
45
|
+
import { C as Client$F } from './user.d-DJBp6aX5.js';
|
|
46
|
+
import { C as Client$G } from './validation-rules.d-CScjNdxD.js';
|
|
47
|
+
import { C as Client$H } from './webhooks.d-C_MQSJEB.js';
|
|
48
|
+
import { C as Client$I } from './workflow.d-BIWtgMyP.js';
|
|
49
|
+
import { C as Client$J } from './workflow-definition.d-CFXrp2Hg.js';
|
|
50
50
|
import 'openapi-client-axios';
|
|
51
51
|
|
|
52
52
|
type SDKClientMap = {
|
|
@@ -98,6 +98,26 @@ type SDKClientMap = {
|
|
|
98
98
|
workflowDefinition: Client$J;
|
|
99
99
|
};
|
|
100
100
|
|
|
101
|
+
type LargeResponseConfig = {
|
|
102
|
+
/** Enable large response handling. Default: true */
|
|
103
|
+
enabled?: boolean;
|
|
104
|
+
};
|
|
105
|
+
declare const applyLargeResponseInterceptor: (params: {
|
|
106
|
+
client: AxiosInstance;
|
|
107
|
+
config: LargeResponseConfig;
|
|
108
|
+
}) => void;
|
|
109
|
+
|
|
110
|
+
type RetryConfig = {
|
|
111
|
+
/** Maximum number of retries for 429 responses. Set to 0 to disable. Default: 3 */
|
|
112
|
+
maxRetries?: number;
|
|
113
|
+
/** Default delay in ms when Retry-After header is missing. Default: 1000 */
|
|
114
|
+
defaultDelayMs?: number;
|
|
115
|
+
};
|
|
116
|
+
declare const applyRetryInterceptor: (params: {
|
|
117
|
+
client: AxiosInstance;
|
|
118
|
+
config: RetryConfig;
|
|
119
|
+
}) => void;
|
|
120
|
+
|
|
101
121
|
type InterceptorUse = {
|
|
102
122
|
request: (fulfilled: (config: unknown) => unknown, rejected?: (error: unknown) => unknown) => void;
|
|
103
123
|
response: (fulfilled: (response: unknown) => unknown, rejected?: (error: unknown) => unknown) => void;
|
|
@@ -109,6 +129,10 @@ type EpilotSDK = {
|
|
|
109
129
|
headers: (headers: HeadersConfig) => void;
|
|
110
130
|
/** Register global axios interceptors applied to all clients */
|
|
111
131
|
interceptors: InterceptorUse;
|
|
132
|
+
/** Configure retry behavior for 429 Too Many Requests responses */
|
|
133
|
+
retry: (config: RetryConfig) => void;
|
|
134
|
+
/** Configure large response handling for S3-backed payloads */
|
|
135
|
+
largeResponse: (config: LargeResponseConfig) => void;
|
|
112
136
|
} & {
|
|
113
137
|
[K in keyof SDKClientMap]: ApiHandle<SDKClientMap[K]>;
|
|
114
138
|
} & Record<string, ApiHandle<AxiosInstance>>;
|
|
@@ -116,4 +140,4 @@ declare const createSDK: () => EpilotSDK;
|
|
|
116
140
|
|
|
117
141
|
declare const epilot: EpilotSDK;
|
|
118
142
|
|
|
119
|
-
export { ApiHandle, type EpilotSDK, HeadersConfig, type InterceptorUse, TokenArg, createSDK, epilot };
|
|
143
|
+
export { ApiHandle, type EpilotSDK, HeadersConfig, type InterceptorUse, type LargeResponseConfig, type RetryConfig, TokenArg, applyLargeResponseInterceptor, applyRetryInterceptor, createSDK, epilot };
|
package/dist/index.js
CHANGED
|
@@ -2,11 +2,58 @@ import {
|
|
|
2
2
|
authorize,
|
|
3
3
|
createApiClient,
|
|
4
4
|
createApiHandle
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-UCDXDIUX.js";
|
|
6
6
|
import {
|
|
7
7
|
__require
|
|
8
8
|
} from "./chunk-3RG5ZIWI.js";
|
|
9
9
|
|
|
10
|
+
// src/large-response.ts
|
|
11
|
+
var CONTENT_TYPE = "application/large-response.vnd+json";
|
|
12
|
+
var REF_PROPERTY = "$payload_ref";
|
|
13
|
+
var applyLargeResponseInterceptor = (params) => {
|
|
14
|
+
const { client, config } = params;
|
|
15
|
+
if (config.enabled === false) return;
|
|
16
|
+
client.interceptors.request.use((requestConfig) => {
|
|
17
|
+
requestConfig.headers.Accept = CONTENT_TYPE;
|
|
18
|
+
return requestConfig;
|
|
19
|
+
});
|
|
20
|
+
client.interceptors.response.use(async (response) => {
|
|
21
|
+
const contentType = response.headers["content-type"];
|
|
22
|
+
if (contentType === CONTENT_TYPE && response.data?.[REF_PROPERTY]) {
|
|
23
|
+
const ref = response.data[REF_PROPERTY];
|
|
24
|
+
const { data } = await client.get(ref, {
|
|
25
|
+
transformResponse: (raw) => JSON.parse(raw)
|
|
26
|
+
});
|
|
27
|
+
response.data = data;
|
|
28
|
+
}
|
|
29
|
+
return response;
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
// src/retry.ts
|
|
34
|
+
var DEFAULT_MAX_RETRIES = 3;
|
|
35
|
+
var DEFAULT_DELAY_MS = 1e3;
|
|
36
|
+
var sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
37
|
+
var RETRY_COUNT_HEADER = "x-epilot-sdk-retry-count";
|
|
38
|
+
var applyRetryInterceptor = (params) => {
|
|
39
|
+
const { client, config } = params;
|
|
40
|
+
const maxRetries = config.maxRetries ?? DEFAULT_MAX_RETRIES;
|
|
41
|
+
if (maxRetries <= 0) return;
|
|
42
|
+
client.interceptors.response.use(void 0, async (error) => {
|
|
43
|
+
if (error.response?.status !== 429) throw error;
|
|
44
|
+
const retryCountRaw = error.config?.headers?.[RETRY_COUNT_HEADER];
|
|
45
|
+
const retryCount = Number(retryCountRaw ?? 0);
|
|
46
|
+
if (retryCount >= maxRetries) throw error;
|
|
47
|
+
const retryAfterHeader = error.response.headers["retry-after"];
|
|
48
|
+
const retryAfterSeconds = retryAfterHeader ? Number(retryAfterHeader) : NaN;
|
|
49
|
+
const delayMs = Number.isFinite(retryAfterSeconds) ? retryAfterSeconds * 1e3 : config.defaultDelayMs ?? DEFAULT_DELAY_MS;
|
|
50
|
+
await sleep(delayMs);
|
|
51
|
+
const retryConfig = { ...error.config };
|
|
52
|
+
retryConfig.headers.set(RETRY_COUNT_HEADER, String(retryCount + 1));
|
|
53
|
+
return client.request(retryConfig);
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
|
|
10
57
|
// src/registry.ts
|
|
11
58
|
var createRegistry = () => /* @__PURE__ */ new Map();
|
|
12
59
|
var registerApi = (params) => {
|
|
@@ -27,11 +74,13 @@ var resolveClient = async (params) => {
|
|
|
27
74
|
token: state.token,
|
|
28
75
|
headers: state.globalHeaders
|
|
29
76
|
});
|
|
77
|
+
applyLargeResponseInterceptor({ client: entry.instance, config: state.largeResponse });
|
|
78
|
+
applyRetryInterceptor({ client: entry.instance, config: state.retry });
|
|
30
79
|
if (state.tokenFn) {
|
|
31
80
|
const tokenFn = state.tokenFn;
|
|
32
81
|
entry.instance.interceptors.request.use(async (config) => {
|
|
33
82
|
const resolved = await tokenFn();
|
|
34
|
-
config.headers
|
|
83
|
+
config.headers.authorization = `Bearer ${resolved}`;
|
|
35
84
|
return config;
|
|
36
85
|
});
|
|
37
86
|
}
|
|
@@ -490,7 +539,9 @@ var createSDK = () => {
|
|
|
490
539
|
token: null,
|
|
491
540
|
tokenFn: null,
|
|
492
541
|
globalHeaders: {},
|
|
493
|
-
interceptors: []
|
|
542
|
+
interceptors: [],
|
|
543
|
+
retry: { maxRetries: 3 },
|
|
544
|
+
largeResponse: { enabled: true }
|
|
494
545
|
};
|
|
495
546
|
registerBuiltinApis(registry);
|
|
496
547
|
loadOverrides(registry);
|
|
@@ -525,6 +576,16 @@ var createSDK = () => {
|
|
|
525
576
|
Object.assign(state.globalHeaders, headers);
|
|
526
577
|
resetAllClients(registry);
|
|
527
578
|
};
|
|
579
|
+
case "retry":
|
|
580
|
+
return (config) => {
|
|
581
|
+
Object.assign(state.retry, config);
|
|
582
|
+
resetAllClients(registry);
|
|
583
|
+
};
|
|
584
|
+
case "largeResponse":
|
|
585
|
+
return (config) => {
|
|
586
|
+
Object.assign(state.largeResponse, config);
|
|
587
|
+
resetAllClients(registry);
|
|
588
|
+
};
|
|
528
589
|
case "interceptors": {
|
|
529
590
|
const interceptorUse = {
|
|
530
591
|
request: (fulfilled, rejected) => {
|
|
@@ -557,6 +618,8 @@ var createSDK = () => {
|
|
|
557
618
|
// src/index.ts
|
|
558
619
|
var epilot = createSDK();
|
|
559
620
|
export {
|
|
621
|
+
applyLargeResponseInterceptor,
|
|
622
|
+
applyRetryInterceptor,
|
|
560
623
|
authorize,
|
|
561
624
|
createSDK,
|
|
562
625
|
epilot
|