@zapier/zapier-sdk 0.64.0 → 0.67.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/CHANGELOG.md +47 -0
- package/README.md +165 -6
- package/dist/api/client.d.ts.map +1 -1
- package/dist/api/client.js +2 -0
- package/dist/api/debug.d.ts.map +1 -1
- package/dist/api/debug.js +6 -4
- package/dist/api/polling.d.ts +2 -0
- package/dist/api/polling.d.ts.map +1 -1
- package/dist/api/polling.js +10 -2
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +8 -5
- package/dist/core-stack.d.ts +24 -0
- package/dist/core-stack.d.ts.map +1 -0
- package/dist/core-stack.js +32 -0
- package/dist/experimental.cjs +1803 -1332
- package/dist/experimental.d.mts +3508 -182
- package/dist/experimental.d.ts +3578 -252
- package/dist/experimental.d.ts.map +1 -1
- package/dist/experimental.js +120 -84
- package/dist/experimental.mjs +1789 -1331
- package/dist/formatters/action.d.ts +4 -0
- package/dist/formatters/action.d.ts.map +1 -0
- package/dist/formatters/action.js +18 -0
- package/dist/formatters/actionResult.d.ts +3 -0
- package/dist/formatters/actionResult.d.ts.map +1 -0
- package/dist/formatters/actionResult.js +25 -0
- package/dist/formatters/app.d.ts +4 -0
- package/dist/formatters/app.d.ts.map +1 -0
- package/dist/formatters/app.js +10 -0
- package/dist/formatters/clientCredentials.d.ts +5 -0
- package/dist/formatters/clientCredentials.d.ts.map +1 -0
- package/dist/formatters/clientCredentials.js +27 -0
- package/dist/formatters/connection.d.ts +4 -0
- package/dist/formatters/connection.d.ts.map +1 -0
- package/dist/formatters/connection.js +26 -0
- package/dist/formatters/field.d.ts +4 -0
- package/dist/formatters/field.d.ts.map +1 -0
- package/dist/formatters/field.js +51 -0
- package/dist/formatters/inputFieldChoice.d.ts +4 -0
- package/dist/formatters/inputFieldChoice.d.ts.map +1 -0
- package/dist/formatters/inputFieldChoice.js +16 -0
- package/dist/formatters/tableField.d.ts +4 -0
- package/dist/formatters/tableField.d.ts.map +1 -0
- package/dist/formatters/tableField.js +7 -0
- package/dist/formatters/tableRecord.d.ts +5 -3
- package/dist/formatters/tableRecord.d.ts.map +1 -1
- package/dist/formatters/tableRecord.js +4 -3
- package/dist/formatters/triggerInbox.d.ts +4 -0
- package/dist/formatters/triggerInbox.d.ts.map +1 -0
- package/dist/formatters/triggerInbox.js +31 -0
- package/dist/formatters/triggerMessage.d.ts +5 -0
- package/dist/formatters/triggerMessage.d.ts.map +1 -0
- package/dist/formatters/triggerMessage.js +34 -0
- package/dist/formatters/userProfile.d.ts +4 -0
- package/dist/formatters/userProfile.d.ts.map +1 -0
- package/dist/formatters/userProfile.js +19 -0
- package/dist/{index-Bfvj0KLi.d.mts → index-Dh0b5NAY.d.mts} +13058 -7731
- package/dist/{index-Bfvj0KLi.d.ts → index-Dh0b5NAY.d.ts} +13058 -7731
- package/dist/index.cjs +1745 -1464
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +12 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -7
- package/dist/index.mjs +1731 -1463
- package/dist/plugins/api/index.d.ts +1 -1
- package/dist/plugins/api/index.js +1 -1
- package/dist/plugins/apps/index.d.ts +8 -5
- package/dist/plugins/apps/index.d.ts.map +1 -1
- package/dist/plugins/apps/index.js +1 -1
- package/dist/plugins/capabilities/index.d.ts +1 -1
- package/dist/plugins/capabilities/index.js +1 -1
- package/dist/plugins/codeSubstrate/cancelDurableRun/index.d.ts +32 -2
- package/dist/plugins/codeSubstrate/cancelDurableRun/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/cancelDurableRun/index.js +1 -1
- package/dist/plugins/codeSubstrate/createWorkflow/index.d.ts +2 -2
- package/dist/plugins/codeSubstrate/createWorkflow/index.js +1 -1
- package/dist/plugins/codeSubstrate/deleteWorkflow/index.d.ts +27 -2
- package/dist/plugins/codeSubstrate/deleteWorkflow/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/deleteWorkflow/index.js +1 -1
- package/dist/plugins/codeSubstrate/disableWorkflow/index.d.ts +27 -2
- package/dist/plugins/codeSubstrate/disableWorkflow/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/disableWorkflow/index.js +1 -1
- package/dist/plugins/codeSubstrate/enableWorkflow/index.d.ts +27 -2
- package/dist/plugins/codeSubstrate/enableWorkflow/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/enableWorkflow/index.js +1 -1
- package/dist/plugins/codeSubstrate/getDurableRun/index.d.ts +32 -2
- package/dist/plugins/codeSubstrate/getDurableRun/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/getDurableRun/index.js +1 -1
- package/dist/plugins/codeSubstrate/getTriggerRun/index.d.ts +47 -0
- package/dist/plugins/codeSubstrate/getTriggerRun/index.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/getTriggerRun/index.js +23 -0
- package/dist/plugins/codeSubstrate/getTriggerRun/schemas.d.ts +24 -0
- package/dist/plugins/codeSubstrate/getTriggerRun/schemas.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/getTriggerRun/schemas.js +30 -0
- package/dist/plugins/codeSubstrate/getWorkflow/index.d.ts +27 -2
- package/dist/plugins/codeSubstrate/getWorkflow/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/getWorkflow/index.js +1 -1
- package/dist/plugins/codeSubstrate/getWorkflowRun/index.d.ts +102 -0
- package/dist/plugins/codeSubstrate/getWorkflowRun/index.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/getWorkflowRun/index.js +25 -0
- package/dist/plugins/codeSubstrate/getWorkflowRun/schemas.d.ts +26 -0
- package/dist/plugins/codeSubstrate/getWorkflowRun/schemas.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/getWorkflowRun/schemas.js +43 -0
- package/dist/plugins/codeSubstrate/getWorkflowVersion/index.d.ts +51 -2
- package/dist/plugins/codeSubstrate/getWorkflowVersion/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/getWorkflowVersion/index.js +1 -1
- package/dist/plugins/codeSubstrate/listDurableRuns/index.d.ts +3 -3
- package/dist/plugins/codeSubstrate/listDurableRuns/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/listDurableRuns/index.js +1 -1
- package/dist/plugins/codeSubstrate/listWorkflowRuns/index.d.ts +78 -0
- package/dist/plugins/codeSubstrate/listWorkflowRuns/index.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/listWorkflowRuns/index.js +34 -0
- package/dist/plugins/codeSubstrate/listWorkflowRuns/schemas.d.ts +65 -0
- package/dist/plugins/codeSubstrate/listWorkflowRuns/schemas.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/listWorkflowRuns/schemas.js +69 -0
- package/dist/plugins/codeSubstrate/listWorkflowVersions/index.d.ts +28 -3
- package/dist/plugins/codeSubstrate/listWorkflowVersions/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/listWorkflowVersions/index.js +1 -1
- package/dist/plugins/codeSubstrate/listWorkflows/index.d.ts +3 -3
- package/dist/plugins/codeSubstrate/listWorkflows/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/listWorkflows/index.js +2 -3
- package/dist/plugins/codeSubstrate/publishWorkflowVersion/index.d.ts +27 -2
- package/dist/plugins/codeSubstrate/publishWorkflowVersion/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/publishWorkflowVersion/index.js +1 -1
- package/dist/plugins/codeSubstrate/runDurable/index.d.ts +2 -2
- package/dist/plugins/codeSubstrate/runDurable/index.js +1 -1
- package/dist/plugins/codeSubstrate/triggerWorkflow/index.d.ts +73 -0
- package/dist/plugins/codeSubstrate/triggerWorkflow/index.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/triggerWorkflow/index.js +52 -0
- package/dist/plugins/codeSubstrate/triggerWorkflow/schemas.d.ts +16 -0
- package/dist/plugins/codeSubstrate/triggerWorkflow/schemas.d.ts.map +1 -0
- package/dist/plugins/codeSubstrate/triggerWorkflow/schemas.js +31 -0
- package/dist/plugins/codeSubstrate/updateWorkflow/index.d.ts +27 -2
- package/dist/plugins/codeSubstrate/updateWorkflow/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/updateWorkflow/index.js +1 -1
- package/dist/plugins/connections/index.d.ts +1 -1
- package/dist/plugins/connections/index.js +1 -1
- package/dist/plugins/createClientCredentials/index.d.ts +2 -2
- package/dist/plugins/createClientCredentials/index.d.ts.map +1 -1
- package/dist/plugins/createClientCredentials/index.js +4 -2
- package/dist/plugins/createClientCredentials/schemas.d.ts +1 -2
- package/dist/plugins/createClientCredentials/schemas.d.ts.map +1 -1
- package/dist/plugins/deleteClientCredentials/index.d.ts +24 -2
- package/dist/plugins/deleteClientCredentials/index.d.ts.map +1 -1
- package/dist/plugins/deleteClientCredentials/index.js +2 -2
- package/dist/plugins/deleteClientCredentials/schemas.d.ts +1 -2
- package/dist/plugins/deleteClientCredentials/schemas.d.ts.map +1 -1
- package/dist/plugins/deprecated/authentications.d.ts +144 -16
- package/dist/plugins/deprecated/authentications.d.ts.map +1 -1
- package/dist/plugins/deprecated/authentications.js +14 -5
- package/dist/plugins/deprecated/inputFields.d.ts +58 -23
- package/dist/plugins/deprecated/inputFields.d.ts.map +1 -1
- package/dist/plugins/deprecated/inputFields.js +15 -7
- package/dist/plugins/eventEmission/event-emission-hook.d.ts +10 -0
- package/dist/plugins/eventEmission/event-emission-hook.d.ts.map +1 -0
- package/dist/plugins/eventEmission/event-emission-hook.js +47 -0
- package/dist/plugins/eventEmission/index.d.ts +5 -3
- package/dist/plugins/eventEmission/index.d.ts.map +1 -1
- package/dist/plugins/eventEmission/index.js +16 -9
- package/dist/plugins/eventEmission/method-metadata.d.ts +16 -0
- package/dist/plugins/eventEmission/method-metadata.d.ts.map +1 -0
- package/dist/plugins/eventEmission/method-metadata.js +20 -0
- package/dist/plugins/eventEmission/transport.d.ts.map +1 -1
- package/dist/plugins/eventEmission/transport.js +2 -1
- package/dist/plugins/fetch/index.d.ts +11 -5
- package/dist/plugins/fetch/index.d.ts.map +1 -1
- package/dist/plugins/fetch/index.js +42 -32
- package/dist/plugins/fetch/schemas.d.ts +1 -1
- package/dist/plugins/findFirstConnection/index.d.ts +4 -4
- package/dist/plugins/findFirstConnection/index.d.ts.map +1 -1
- package/dist/plugins/findFirstConnection/index.js +4 -2
- package/dist/plugins/findFirstConnection/schemas.d.ts +2 -2
- package/dist/plugins/findUniqueConnection/index.d.ts +4 -4
- package/dist/plugins/findUniqueConnection/index.d.ts.map +1 -1
- package/dist/plugins/findUniqueConnection/index.js +4 -2
- package/dist/plugins/findUniqueConnection/schemas.d.ts +2 -2
- package/dist/plugins/getAction/index.d.ts +141 -4
- package/dist/plugins/getAction/index.d.ts.map +1 -1
- package/dist/plugins/getAction/index.js +5 -3
- package/dist/plugins/getAction/schemas.d.ts +6 -6
- package/dist/plugins/getActionInputFieldsSchema/index.d.ts +232 -3
- package/dist/plugins/getActionInputFieldsSchema/index.d.ts.map +1 -1
- package/dist/plugins/getActionInputFieldsSchema/index.js +3 -3
- package/dist/plugins/getActionInputFieldsSchema/schemas.d.ts +6 -6
- package/dist/plugins/getApp/index.d.ts +4 -4
- package/dist/plugins/getApp/index.d.ts.map +1 -1
- package/dist/plugins/getApp/index.js +3 -1
- package/dist/plugins/getApp/schemas.d.ts +4 -4
- package/dist/plugins/getConnection/index.d.ts +125 -2
- package/dist/plugins/getConnection/index.d.ts.map +1 -1
- package/dist/plugins/getConnection/index.js +4 -2
- package/dist/plugins/getProfile/index.d.ts +2 -2
- package/dist/plugins/getProfile/index.d.ts.map +1 -1
- package/dist/plugins/getProfile/index.js +4 -2
- package/dist/plugins/getProfile/schemas.d.ts +1 -2
- package/dist/plugins/getProfile/schemas.d.ts.map +1 -1
- package/dist/plugins/listActionInputFieldChoices/index.d.ts +287 -4
- package/dist/plugins/listActionInputFieldChoices/index.d.ts.map +1 -1
- package/dist/plugins/listActionInputFieldChoices/index.js +6 -4
- package/dist/plugins/listActionInputFieldChoices/schemas.d.ts +8 -8
- package/dist/plugins/listActionInputFieldChoices/schemas.d.ts.map +1 -1
- package/dist/plugins/listActionInputFieldChoices/schemas.js +1 -22
- package/dist/plugins/listActionInputFields/index.d.ts +168 -5
- package/dist/plugins/listActionInputFields/index.d.ts.map +1 -1
- package/dist/plugins/listActionInputFields/index.js +7 -5
- package/dist/plugins/listActionInputFields/schemas.d.ts +6 -6
- package/dist/plugins/listActions/index.d.ts +140 -3
- package/dist/plugins/listActions/index.d.ts.map +1 -1
- package/dist/plugins/listActions/index.js +6 -4
- package/dist/plugins/listActions/schemas.d.ts +4 -4
- package/dist/plugins/listApps/index.d.ts +3 -3
- package/dist/plugins/listApps/index.d.ts.map +1 -1
- package/dist/plugins/listApps/index.js +6 -4
- package/dist/plugins/listClientCredentials/index.d.ts +3 -3
- package/dist/plugins/listClientCredentials/index.d.ts.map +1 -1
- package/dist/plugins/listClientCredentials/index.js +6 -4
- package/dist/plugins/listConnections/index.d.ts +140 -3
- package/dist/plugins/listConnections/index.d.ts.map +1 -1
- package/dist/plugins/listConnections/index.js +7 -5
- package/dist/plugins/listConnections/schemas.d.ts +2 -2
- package/dist/plugins/manifest/index.d.ts +1 -1
- package/dist/plugins/manifest/index.d.ts.map +1 -1
- package/dist/plugins/manifest/index.js +6 -4
- package/dist/plugins/registry/index.d.ts +1 -1
- package/dist/plugins/registry/index.js +1 -1
- package/dist/plugins/request/index.d.ts +8 -5
- package/dist/plugins/request/index.d.ts.map +1 -1
- package/dist/plugins/request/index.js +4 -3
- package/dist/plugins/request/schemas.d.ts +2 -2
- package/dist/plugins/runAction/index.d.ts +168 -5
- package/dist/plugins/runAction/index.d.ts.map +1 -1
- package/dist/plugins/runAction/index.js +9 -5
- package/dist/plugins/runAction/schemas.d.ts +6 -6
- package/dist/plugins/tables/createTable/index.d.ts +2 -2
- package/dist/plugins/tables/createTable/index.js +2 -2
- package/dist/plugins/tables/createTable/schemas.d.ts +1 -2
- package/dist/plugins/tables/createTable/schemas.d.ts.map +1 -1
- package/dist/plugins/tables/createTableFields/index.d.ts +34 -2
- package/dist/plugins/tables/createTableFields/index.d.ts.map +1 -1
- package/dist/plugins/tables/createTableFields/index.js +4 -2
- package/dist/plugins/tables/createTableFields/schemas.d.ts +3 -4
- package/dist/plugins/tables/createTableFields/schemas.d.ts.map +1 -1
- package/dist/plugins/tables/createTableRecords/index.d.ts +63 -2
- package/dist/plugins/tables/createTableRecords/index.d.ts.map +1 -1
- package/dist/plugins/tables/createTableRecords/index.js +2 -2
- package/dist/plugins/tables/createTableRecords/schemas.d.ts +3 -4
- package/dist/plugins/tables/createTableRecords/schemas.d.ts.map +1 -1
- package/dist/plugins/tables/deleteTable/index.d.ts +34 -2
- package/dist/plugins/tables/deleteTable/index.d.ts.map +1 -1
- package/dist/plugins/tables/deleteTable/index.js +2 -2
- package/dist/plugins/tables/deleteTable/schemas.d.ts +3 -4
- package/dist/plugins/tables/deleteTable/schemas.d.ts.map +1 -1
- package/dist/plugins/tables/deleteTableFields/index.d.ts +63 -2
- package/dist/plugins/tables/deleteTableFields/index.d.ts.map +1 -1
- package/dist/plugins/tables/deleteTableFields/index.js +2 -2
- package/dist/plugins/tables/deleteTableFields/schemas.d.ts +4 -5
- package/dist/plugins/tables/deleteTableFields/schemas.d.ts.map +1 -1
- package/dist/plugins/tables/deleteTableRecords/index.d.ts +84 -2
- package/dist/plugins/tables/deleteTableRecords/index.d.ts.map +1 -1
- package/dist/plugins/tables/deleteTableRecords/index.js +2 -2
- package/dist/plugins/tables/deleteTableRecords/schemas.d.ts +4 -5
- package/dist/plugins/tables/deleteTableRecords/schemas.d.ts.map +1 -1
- package/dist/plugins/tables/getTable/index.d.ts +34 -2
- package/dist/plugins/tables/getTable/index.d.ts.map +1 -1
- package/dist/plugins/tables/getTable/index.js +2 -2
- package/dist/plugins/tables/getTable/schemas.d.ts +2 -2
- package/dist/plugins/tables/getTableRecord/index.d.ts +84 -2
- package/dist/plugins/tables/getTableRecord/index.d.ts.map +1 -1
- package/dist/plugins/tables/getTableRecord/index.js +2 -2
- package/dist/plugins/tables/getTableRecord/schemas.d.ts +6 -7
- package/dist/plugins/tables/getTableRecord/schemas.d.ts.map +1 -1
- package/dist/plugins/tables/getTableRecord/schemas.js +1 -10
- package/dist/plugins/tables/listTableFields/index.d.ts +34 -2
- package/dist/plugins/tables/listTableFields/index.d.ts.map +1 -1
- package/dist/plugins/tables/listTableFields/index.js +4 -2
- package/dist/plugins/tables/listTableFields/schemas.d.ts +4 -5
- package/dist/plugins/tables/listTableFields/schemas.d.ts.map +1 -1
- package/dist/plugins/tables/listTableFields/schemas.js +1 -9
- package/dist/plugins/tables/listTableRecords/index.d.ts +65 -4
- package/dist/plugins/tables/listTableRecords/index.d.ts.map +1 -1
- package/dist/plugins/tables/listTableRecords/index.js +3 -3
- package/dist/plugins/tables/listTableRecords/schemas.d.ts +2 -2
- package/dist/plugins/tables/listTables/index.d.ts +3 -3
- package/dist/plugins/tables/listTables/index.d.ts.map +1 -1
- package/dist/plugins/tables/listTables/index.js +4 -4
- package/dist/plugins/tables/updateTableRecords/index.d.ts +63 -2
- package/dist/plugins/tables/updateTableRecords/index.d.ts.map +1 -1
- package/dist/plugins/tables/updateTableRecords/index.js +2 -2
- package/dist/plugins/tables/updateTableRecords/schemas.d.ts +3 -4
- package/dist/plugins/tables/updateTableRecords/schemas.d.ts.map +1 -1
- package/dist/plugins/triggers/ackTriggerInboxMessages/index.d.ts +59 -2
- package/dist/plugins/triggers/ackTriggerInboxMessages/index.d.ts.map +1 -1
- package/dist/plugins/triggers/ackTriggerInboxMessages/index.js +1 -1
- package/dist/plugins/triggers/ackTriggerInboxMessages/schemas.d.ts +1 -1
- package/dist/plugins/triggers/createTriggerInbox/index.d.ts +231 -2
- package/dist/plugins/triggers/createTriggerInbox/index.d.ts.map +1 -1
- package/dist/plugins/triggers/createTriggerInbox/index.js +3 -1
- package/dist/plugins/triggers/createTriggerInbox/schemas.d.ts +3 -4
- package/dist/plugins/triggers/createTriggerInbox/schemas.d.ts.map +1 -1
- package/dist/plugins/triggers/deleteTriggerInbox/index.d.ts +33 -2
- package/dist/plugins/triggers/deleteTriggerInbox/index.d.ts.map +1 -1
- package/dist/plugins/triggers/deleteTriggerInbox/index.js +3 -1
- package/dist/plugins/triggers/deleteTriggerInbox/schemas.d.ts +2 -3
- package/dist/plugins/triggers/deleteTriggerInbox/schemas.d.ts.map +1 -1
- package/dist/plugins/triggers/drainTriggerInbox/index.d.ts +68 -6
- package/dist/plugins/triggers/drainTriggerInbox/index.d.ts.map +1 -1
- package/dist/plugins/triggers/drainTriggerInbox/index.js +1 -1
- package/dist/plugins/triggers/drainTriggerInbox/schemas.d.ts +2 -2
- package/dist/plugins/triggers/ensureTriggerInbox/index.d.ts +231 -2
- package/dist/plugins/triggers/ensureTriggerInbox/index.d.ts.map +1 -1
- package/dist/plugins/triggers/ensureTriggerInbox/index.js +3 -1
- package/dist/plugins/triggers/ensureTriggerInbox/schemas.d.ts +3 -4
- package/dist/plugins/triggers/ensureTriggerInbox/schemas.d.ts.map +1 -1
- package/dist/plugins/triggers/getTriggerInbox/index.d.ts +33 -2
- package/dist/plugins/triggers/getTriggerInbox/index.d.ts.map +1 -1
- package/dist/plugins/triggers/getTriggerInbox/index.js +3 -1
- package/dist/plugins/triggers/getTriggerInbox/schemas.d.ts +2 -3
- package/dist/plugins/triggers/getTriggerInbox/schemas.d.ts.map +1 -1
- package/dist/plugins/triggers/getTriggerInputFieldsSchema/index.d.ts +232 -3
- package/dist/plugins/triggers/getTriggerInputFieldsSchema/index.d.ts.map +1 -1
- package/dist/plugins/triggers/getTriggerInputFieldsSchema/index.js +1 -1
- package/dist/plugins/triggers/getTriggerInputFieldsSchema/schemas.d.ts +2 -2
- package/dist/plugins/triggers/leaseTriggerInboxMessages/index.d.ts +33 -2
- package/dist/plugins/triggers/leaseTriggerInboxMessages/index.d.ts.map +1 -1
- package/dist/plugins/triggers/leaseTriggerInboxMessages/index.js +1 -1
- package/dist/plugins/triggers/leaseTriggerInboxMessages/schemas.d.ts +1 -1
- package/dist/plugins/triggers/listTriggerInboxMessages/index.d.ts +34 -3
- package/dist/plugins/triggers/listTriggerInboxMessages/index.d.ts.map +1 -1
- package/dist/plugins/triggers/listTriggerInboxMessages/index.js +5 -13
- package/dist/plugins/triggers/listTriggerInboxMessages/schemas.d.ts +1 -1
- package/dist/plugins/triggers/listTriggerInboxes/index.d.ts +3 -3
- package/dist/plugins/triggers/listTriggerInboxes/index.d.ts.map +1 -1
- package/dist/plugins/triggers/listTriggerInboxes/index.js +5 -14
- package/dist/plugins/triggers/listTriggerInputFieldChoices/index.d.ts +288 -5
- package/dist/plugins/triggers/listTriggerInputFieldChoices/index.d.ts.map +1 -1
- package/dist/plugins/triggers/listTriggerInputFieldChoices/index.js +7 -5
- package/dist/plugins/triggers/listTriggerInputFieldChoices/schemas.d.ts +3 -3
- package/dist/plugins/triggers/listTriggerInputFields/index.d.ts +234 -5
- package/dist/plugins/triggers/listTriggerInputFields/index.d.ts.map +1 -1
- package/dist/plugins/triggers/listTriggerInputFields/index.js +6 -5
- package/dist/plugins/triggers/listTriggerInputFields/schemas.d.ts +2 -2
- package/dist/plugins/triggers/listTriggers/index.d.ts +142 -5
- package/dist/plugins/triggers/listTriggers/index.d.ts.map +1 -1
- package/dist/plugins/triggers/listTriggers/index.js +6 -5
- package/dist/plugins/triggers/listTriggers/schemas.d.ts +1 -1
- package/dist/plugins/triggers/pauseTriggerInbox/index.d.ts +33 -2
- package/dist/plugins/triggers/pauseTriggerInbox/index.d.ts.map +1 -1
- package/dist/plugins/triggers/pauseTriggerInbox/index.js +3 -1
- package/dist/plugins/triggers/pauseTriggerInbox/schemas.d.ts +2 -3
- package/dist/plugins/triggers/pauseTriggerInbox/schemas.d.ts.map +1 -1
- package/dist/plugins/triggers/releaseTriggerInboxMessages/index.d.ts +59 -2
- package/dist/plugins/triggers/releaseTriggerInboxMessages/index.d.ts.map +1 -1
- package/dist/plugins/triggers/releaseTriggerInboxMessages/index.js +1 -1
- package/dist/plugins/triggers/releaseTriggerInboxMessages/schemas.d.ts +1 -1
- package/dist/plugins/triggers/resumeTriggerInbox/index.d.ts +33 -2
- package/dist/plugins/triggers/resumeTriggerInbox/index.d.ts.map +1 -1
- package/dist/plugins/triggers/resumeTriggerInbox/index.js +3 -1
- package/dist/plugins/triggers/resumeTriggerInbox/schemas.d.ts +2 -3
- package/dist/plugins/triggers/resumeTriggerInbox/schemas.d.ts.map +1 -1
- package/dist/plugins/triggers/updateTriggerInbox/index.d.ts +33 -2
- package/dist/plugins/triggers/updateTriggerInbox/index.d.ts.map +1 -1
- package/dist/plugins/triggers/updateTriggerInbox/index.js +3 -1
- package/dist/plugins/triggers/updateTriggerInbox/schemas.d.ts +2 -3
- package/dist/plugins/triggers/updateTriggerInbox/schemas.d.ts.map +1 -1
- package/dist/plugins/triggers/watchTriggerInbox/index.d.ts +37 -6
- package/dist/plugins/triggers/watchTriggerInbox/index.d.ts.map +1 -1
- package/dist/plugins/triggers/watchTriggerInbox/index.js +1 -1
- package/dist/resolvers/actionKey.d.ts +3 -2
- package/dist/resolvers/actionKey.d.ts.map +1 -1
- package/dist/resolvers/actionType.d.ts +7 -2
- package/dist/resolvers/actionType.d.ts.map +1 -1
- package/dist/resolvers/actionType.js +3 -0
- package/dist/resolvers/appKey.d.ts +10 -5
- package/dist/resolvers/appKey.d.ts.map +1 -1
- package/dist/resolvers/appKey.js +3 -0
- package/dist/resolvers/clientCredentialsName.d.ts +1 -1
- package/dist/resolvers/clientCredentialsName.d.ts.map +1 -1
- package/dist/resolvers/clientId.d.ts +3 -2
- package/dist/resolvers/clientId.d.ts.map +1 -1
- package/dist/resolvers/clientId.js +1 -1
- package/dist/resolvers/connectionId.d.ts +5 -2
- package/dist/resolvers/connectionId.d.ts.map +1 -1
- package/dist/resolvers/connectionId.js +1 -1
- package/dist/resolvers/durableRunId.d.ts +3 -2
- package/dist/resolvers/durableRunId.d.ts.map +1 -1
- package/dist/resolvers/durableRunId.js +3 -2
- package/dist/resolvers/index.d.ts +1 -0
- package/dist/resolvers/index.d.ts.map +1 -1
- package/dist/resolvers/index.js +1 -0
- package/dist/resolvers/inputFieldKey.d.ts +3 -2
- package/dist/resolvers/inputFieldKey.d.ts.map +1 -1
- package/dist/resolvers/inputFieldKey.js +1 -1
- package/dist/resolvers/tableFieldIds.d.ts +3 -2
- package/dist/resolvers/tableFieldIds.d.ts.map +1 -1
- package/dist/resolvers/tableFields.d.ts +2 -2
- package/dist/resolvers/tableFields.d.ts.map +1 -1
- package/dist/resolvers/tableFilters.d.ts +3 -2
- package/dist/resolvers/tableFilters.d.ts.map +1 -1
- package/dist/resolvers/tableId.d.ts +3 -2
- package/dist/resolvers/tableId.d.ts.map +1 -1
- package/dist/resolvers/tableId.js +1 -1
- package/dist/resolvers/tableName.d.ts +1 -1
- package/dist/resolvers/tableName.d.ts.map +1 -1
- package/dist/resolvers/tableRecordId.d.ts +4 -3
- package/dist/resolvers/tableRecordId.d.ts.map +1 -1
- package/dist/resolvers/tableRecords.d.ts +4 -3
- package/dist/resolvers/tableRecords.d.ts.map +1 -1
- package/dist/resolvers/tableSort.d.ts +3 -2
- package/dist/resolvers/tableSort.d.ts.map +1 -1
- package/dist/resolvers/triggerInbox.d.ts +3 -2
- package/dist/resolvers/triggerInbox.d.ts.map +1 -1
- package/dist/resolvers/triggerInbox.js +1 -1
- package/dist/resolvers/triggerMessages.d.ts +3 -2
- package/dist/resolvers/triggerMessages.d.ts.map +1 -1
- package/dist/resolvers/triggerMessages.js +2 -4
- package/dist/resolvers/workflowId.d.ts +3 -2
- package/dist/resolvers/workflowId.d.ts.map +1 -1
- package/dist/resolvers/workflowId.js +3 -2
- package/dist/resolvers/workflowRunId.d.ts +7 -0
- package/dist/resolvers/workflowRunId.d.ts.map +1 -0
- package/dist/resolvers/workflowRunId.js +20 -0
- package/dist/resolvers/workflowVersionId.d.ts +3 -2
- package/dist/resolvers/workflowVersionId.d.ts.map +1 -1
- package/dist/resolvers/workflowVersionId.js +7 -7
- package/dist/schemas/Action.d.ts.map +1 -1
- package/dist/schemas/Action.js +6 -30
- package/dist/schemas/App.d.ts +0 -1
- package/dist/schemas/App.d.ts.map +1 -1
- package/dist/schemas/App.js +2 -14
- package/dist/schemas/ClientCredentials.d.ts.map +1 -1
- package/dist/schemas/ClientCredentials.js +3 -41
- package/dist/schemas/Connection.d.ts.map +1 -1
- package/dist/schemas/Connection.js +2 -28
- package/dist/schemas/Field.d.ts.map +1 -1
- package/dist/schemas/Field.js +3 -70
- package/dist/schemas/Run.d.ts.map +1 -1
- package/dist/schemas/Run.js +3 -29
- package/dist/schemas/TriggerInbox.d.ts.map +1 -1
- package/dist/schemas/TriggerInbox.js +1 -33
- package/dist/schemas/TriggerMessage.d.ts.map +1 -1
- package/dist/schemas/TriggerMessage.js +2 -60
- package/dist/schemas/UserProfile.d.ts +0 -1
- package/dist/schemas/UserProfile.d.ts.map +1 -1
- package/dist/schemas/UserProfile.js +1 -20
- package/dist/sdk.d.ts +2761 -441
- package/dist/sdk.d.ts.map +1 -1
- package/dist/sdk.js +93 -129
- package/dist/types/errors.d.ts +44 -42
- package/dist/types/errors.d.ts.map +1 -1
- package/dist/types/errors.js +79 -33
- package/dist/types/functions.d.ts +1 -41
- package/dist/types/functions.d.ts.map +1 -1
- package/dist/types/properties.d.ts +7 -7
- package/dist/types/properties.js +1 -1
- package/dist/types/sdk.d.ts +1 -1
- package/dist/types/sdk.d.ts.map +1 -1
- package/dist/utils/domain-utils.js +1 -1
- package/dist/utils/logging.d.ts +1 -12
- package/dist/utils/logging.d.ts.map +1 -1
- package/dist/utils/logging.js +2 -20
- package/dist/utils/pagination.d.ts +38 -0
- package/dist/utils/pagination.d.ts.map +1 -0
- package/dist/utils/pagination.js +53 -0
- package/package.json +3 -2
- package/dist/registry.d.ts +0 -9
- package/dist/registry.d.ts.map +0 -1
- package/dist/registry.js +0 -103
- package/dist/types/meta.d.ts +0 -9
- package/dist/types/meta.d.ts.map +0 -1
- package/dist/types/meta.js +0 -3
- package/dist/types/plugin.d.ts +0 -84
- package/dist/types/plugin.d.ts.map +0 -1
- package/dist/types/plugin.js +0 -13
- package/dist/types/registry.d.ts +0 -54
- package/dist/types/registry.d.ts.map +0 -1
- package/dist/types/registry.js +0 -1
- package/dist/utils/function-utils.d.ts +0 -59
- package/dist/utils/function-utils.d.ts.map +0 -1
- package/dist/utils/function-utils.js +0 -245
- package/dist/utils/pagination-utils.d.ts +0 -73
- package/dist/utils/pagination-utils.d.ts.map +0 -1
- package/dist/utils/pagination-utils.js +0 -308
- package/dist/utils/plugin-utils.d.ts +0 -245
- package/dist/utils/plugin-utils.d.ts.map +0 -1
- package/dist/utils/plugin-utils.js +0 -234
- package/dist/utils/schema-utils.d.ts +0 -211
- package/dist/utils/schema-utils.d.ts.map +0 -1
- package/dist/utils/schema-utils.js +0 -72
- package/dist/utils/string-utils.d.ts +0 -40
- package/dist/utils/string-utils.d.ts.map +0 -1
- package/dist/utils/string-utils.js +0 -69
- package/dist/utils/telemetry-context.d.ts +0 -15
- package/dist/utils/telemetry-context.d.ts.map +0 -1
- package/dist/utils/telemetry-context.js +0 -48
- package/dist/utils/telemetry-utils.d.ts +0 -44
- package/dist/utils/telemetry-utils.d.ts.map +0 -1
- package/dist/utils/telemetry-utils.js +0 -60
- package/dist/utils/validation.d.ts +0 -4
- package/dist/utils/validation.d.ts.map +0 -1
- package/dist/utils/validation.js +0 -30
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,52 @@
|
|
|
1
1
|
# @zapier/zapier-sdk
|
|
2
2
|
|
|
3
|
+
## 0.67.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 9096184: Extract the plugin framework into a new sibling package `kitcore` that
|
|
8
|
+
`@zapier/zapier-sdk` consumes as a workspace devDependency (bundled into
|
|
9
|
+
the published dist, not a runtime dep). Existing SDK code is unaffected:
|
|
10
|
+
`createZapierSdk`, `createSdk`, the `ZapierSdk` type, every SDK method, and
|
|
11
|
+
the full `Zapier*` error hierarchy keep their names, codes, and `instanceof`
|
|
12
|
+
semantics. Internally `createZapierSdk` now builds via the linear
|
|
13
|
+
`createPluginStack().use(...).toSdk()` path, which substantially speeds up
|
|
14
|
+
construction. One behavior change to note: `normalizeError` no longer wraps
|
|
15
|
+
thrown `Error` subclasses, so a handler's `TypeError` or a userland
|
|
16
|
+
`MyAppError` bubbles through unchanged and `instanceof` works again; only
|
|
17
|
+
non-`Error` throws get wrapped.
|
|
18
|
+
|
|
19
|
+
New stack-based composition surface for building on top of the SDK:
|
|
20
|
+
`createZapierSdkStack(options)` (from the root and `/experimental`) returns
|
|
21
|
+
the unsealed `PluginStack` that `createZapierSdk` materializes, and
|
|
22
|
+
`createPluginStack`, `createCorePlugin`, and `addPlugin` are re-exported from
|
|
23
|
+
the root. Build by chaining `.use(...)` and sealing with `.toSdk()`, or
|
|
24
|
+
extend a sealed SDK in place with `addPlugin(sdk, plugin)`. The chain-style
|
|
25
|
+
`createSdk().addPlugin(...)` pattern is deprecated (now logs a one-time
|
|
26
|
+
warning) but still works; the CLI and MCP packages moved their internal
|
|
27
|
+
assembly to stacks with no change to their commands or tools.
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- a950509: Route all debug, diagnostic, and telemetry log output to stderr (`console.error`) instead of stdout (`console.log`) across the SDK and CLI packages. The CLI now reserves stdout exclusively for the program's data payload — command output, JSON envelopes, response bodies — so callers can safely pipe CLI output through `jq`, `> redirect`, or `JSON.parse` even when `--debug` is on or telemetry/logging flags are enabled. Interactive terminal users see no change since both streams interleave in a TTY.
|
|
32
|
+
|
|
33
|
+
## 0.66.0
|
|
34
|
+
|
|
35
|
+
### Minor Changes
|
|
36
|
+
|
|
37
|
+
- 0eb6a76: Add the `triggerWorkflow` experimental code-substrate plugin. Lives behind `@zapier/zapier-sdk/experimental` only — the stable subpath does not surface it. Looks up the workflow's `trigger_url` via the durableworkflowzaps API, then POSTs the user-supplied JSON payload to that URL. The trigger endpoint is tokenized (the URL embeds a secret) and takes no auth header, so the SDK uses a raw `fetch` rather than the api plugin for the second leg. Custom fetch flows through `sdk.context.options.fetch` for tests. The workflow id is UUID-validated at the input boundary; trigger endpoint failures (non-2xx, or workflow with no published version) surface as descriptive errors. The CLI gets the `workflowIdResolver` picker for the workflow input.
|
|
38
|
+
|
|
39
|
+
### Patch Changes
|
|
40
|
+
|
|
41
|
+
- 66db7cb: Limit approval polling waits to at most 5 seconds while preserving the existing generic polling cadence.
|
|
42
|
+
- c7c8f64: Route `--debug` log output to stderr (`console.error`) instead of stdout (`console.log`) in `auth.ts` and `api/debug.ts`. This restores stdout's Unix contract — stdout carries only the program's data payload — so callers can safely pipe CLI output through `jq`, redirect to a file, or `JSON.parse` it even when `--debug` is on. Debug output still appears in CI logs and developer terminals (both streams interleave there).
|
|
43
|
+
|
|
44
|
+
## 0.65.0
|
|
45
|
+
|
|
46
|
+
### Minor Changes
|
|
47
|
+
|
|
48
|
+
- 9138968: Add the workflow-run experimental code-substrate plugins: `listWorkflowRuns`, `getWorkflowRun`, and `getTriggerRun`. All three live behind `@zapier/zapier-sdk/experimental` only — the stable subpath does not surface them. `listWorkflowRuns` is paginated against the backend's cursor + limit contract; `getWorkflowRun` looks up a run by id; `getTriggerRun` walks from a trigger id to its associated run, useful immediately after firing a trigger when the caller has the trigger id but not yet the run id. All ID inputs are UUID-validated at the schema boundary. Handlers pass the API response through verbatim — schemas stay as `outputSchema` for docs and types, but consumers see any richer fields the server adds without an SDK release. Adds `workflowRunIdResolver` — a dependent resolver scoped to the parent workflow — so CLI commands taking a run id present an interactive picker via `sdk.listWorkflowRuns({ workflow })`. `getTriggerRun` does not register a picker for `trigger`; users typically have the trigger id from a recent fire and pass it directly.
|
|
49
|
+
|
|
3
50
|
## 0.64.0
|
|
4
51
|
|
|
5
52
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -33,13 +33,17 @@
|
|
|
33
33
|
- [`disableWorkflow`](#disableworkflow--experimental)
|
|
34
34
|
- [`enableWorkflow`](#enableworkflow--experimental)
|
|
35
35
|
- [`getDurableRun`](#getdurablerun--experimental)
|
|
36
|
+
- [`getTriggerRun`](#gettriggerrun--experimental)
|
|
36
37
|
- [`getWorkflow`](#getworkflow--experimental)
|
|
38
|
+
- [`getWorkflowRun`](#getworkflowrun--experimental)
|
|
37
39
|
- [`getWorkflowVersion`](#getworkflowversion--experimental)
|
|
38
40
|
- [`listDurableRuns`](#listdurableruns--experimental)
|
|
41
|
+
- [`listWorkflowRuns`](#listworkflowruns--experimental)
|
|
39
42
|
- [`listWorkflowVersions`](#listworkflowversions--experimental)
|
|
40
43
|
- [`listWorkflows`](#listworkflows--experimental)
|
|
41
44
|
- [`publishWorkflowVersion`](#publishworkflowversion--experimental)
|
|
42
45
|
- [`runDurable`](#rundurable--experimental)
|
|
46
|
+
- [`triggerWorkflow`](#triggerworkflow--experimental)
|
|
43
47
|
- [`updateWorkflow`](#updateworkflow--experimental)
|
|
44
48
|
- [Connections](#connections)
|
|
45
49
|
- [`findFirstConnection`](#findfirstconnection)
|
|
@@ -1245,8 +1249,8 @@ Get the full state of a run-once durable run, including its operations journal
|
|
|
1245
1249
|
| `data` | `object` | ✅ | — | |
|
|
1246
1250
|
| ↳ `id` | `string` | ✅ | — | Run ID (UUID) |
|
|
1247
1251
|
| ↳ `status` | `string` | ✅ | `initialized`, `started`, `finished`, `failed`, `cancelled` | Run lifecycle status. `finished` / `failed` / `cancelled` are terminal. |
|
|
1248
|
-
| ↳ `input` | `
|
|
1249
|
-
| ↳ `output` | `
|
|
1252
|
+
| ↳ `input` | `unknown` | ✅ | — | Input data passed to the run |
|
|
1253
|
+
| ↳ `output` | `unknown` | ✅ | — | Return value, present when status is `finished` |
|
|
1250
1254
|
| ↳ `error` | `object` | ✅ | — | Structured error details when the run failed (null otherwise) |
|
|
1251
1255
|
| ↳ `execution` | `object` | ✅ | — | Linked execution, including the operations journal. Null while the run is still in `initialized` state. |
|
|
1252
1256
|
| ↳ `is_private` | `boolean` | ✅ | — | When true, the run is visible only to the creating user; otherwise visible across the account. |
|
|
@@ -1261,6 +1265,40 @@ const { data: durableRun } = await zapier.getDurableRun({
|
|
|
1261
1265
|
});
|
|
1262
1266
|
```
|
|
1263
1267
|
|
|
1268
|
+
#### `getTriggerRun` 🧪 _experimental_
|
|
1269
|
+
|
|
1270
|
+
Get the workflow run associated with a deployed workflow's trigger. Useful immediately after firing a trigger, when you have the trigger ID but not yet the run ID.
|
|
1271
|
+
|
|
1272
|
+
**Parameters:**
|
|
1273
|
+
|
|
1274
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
1275
|
+
| ------------- | -------- | -------- | ------- | --------------- | ------------------- |
|
|
1276
|
+
| `options` | `object` | ✅ | — | — | |
|
|
1277
|
+
| ↳ `trigger` | `string` | ✅ | — | — | Workflow trigger ID |
|
|
1278
|
+
|
|
1279
|
+
**Returns:** `Promise<WorkflowRunItem>`
|
|
1280
|
+
|
|
1281
|
+
| Name | Type | Required | Possible Values | Description |
|
|
1282
|
+
| ------------------------- | --------- | -------- | ----------------------------------------------------------- | -------------------------------------------------------------------------------- |
|
|
1283
|
+
| `data` | `object` | ✅ | — | |
|
|
1284
|
+
| ↳ `id` | `string` | ✅ | — | Workflow run ID (UUID) |
|
|
1285
|
+
| ↳ `durable_run_id` | `string` | ✅ | — | Linked sdkdurableapi run ID. Null until the durable run is created. |
|
|
1286
|
+
| ↳ `workflow_version_id` | `string` | ✅ | — | Workflow version the run is bound to |
|
|
1287
|
+
| ↳ `status` | `string` | ✅ | `initialized`, `started`, `finished`, `failed`, `cancelled` | Workflow run lifecycle status. `finished` / `failed` / `cancelled` are terminal. |
|
|
1288
|
+
| ↳ `input` | `unknown` | ✅ | — | Input passed to the run |
|
|
1289
|
+
| ↳ `output` | `unknown` | ✅ | — | Return value, present when status is `finished` |
|
|
1290
|
+
| ↳ `error` | `unknown` | ✅ | — | Error payload when status is `failed` (null otherwise) |
|
|
1291
|
+
| ↳ `created_at` | `string` | ✅ | — | When the run was created (ISO-8601) |
|
|
1292
|
+
| ↳ `updated_at` | `string` | ✅ | — | When the run was last updated (ISO-8601) |
|
|
1293
|
+
|
|
1294
|
+
**Example:**
|
|
1295
|
+
|
|
1296
|
+
```typescript
|
|
1297
|
+
const { data: workflowRun } = await zapier.getTriggerRun({
|
|
1298
|
+
trigger: "example-trigger",
|
|
1299
|
+
});
|
|
1300
|
+
```
|
|
1301
|
+
|
|
1264
1302
|
#### `getWorkflow` 🧪 _experimental_
|
|
1265
1303
|
|
|
1266
1304
|
Get a durable workflow with its current version details and trigger claim status
|
|
@@ -1301,6 +1339,42 @@ const { data: workflow } = await zapier.getWorkflow({
|
|
|
1301
1339
|
});
|
|
1302
1340
|
```
|
|
1303
1341
|
|
|
1342
|
+
#### `getWorkflowRun` 🧪 _experimental_
|
|
1343
|
+
|
|
1344
|
+
Get the current state of a workflow run (a triggered execution of a deployed workflow)
|
|
1345
|
+
|
|
1346
|
+
**Parameters:**
|
|
1347
|
+
|
|
1348
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
1349
|
+
| -------------- | -------- | -------- | ------- | --------------- | --------------------------------------------------------------------------------------- |
|
|
1350
|
+
| `options` | `object` | ✅ | — | — | |
|
|
1351
|
+
| ↳ `workflow` | `string` | ❌ | — | — | Parent workflow ID — used only to scope the CLI run-id picker; ignored by the API call. |
|
|
1352
|
+
| ↳ `run` | `string` | ✅ | — | — | Workflow run ID |
|
|
1353
|
+
|
|
1354
|
+
**Returns:** `Promise<WorkflowRunItem>`
|
|
1355
|
+
|
|
1356
|
+
| Name | Type | Required | Possible Values | Description |
|
|
1357
|
+
| ------------------------- | --------- | -------- | ----------------------------------------------------------- | -------------------------------------------------------------------------------- |
|
|
1358
|
+
| `data` | `object` | ✅ | — | |
|
|
1359
|
+
| ↳ `id` | `string` | ✅ | — | Workflow run ID (UUID) |
|
|
1360
|
+
| ↳ `trigger_id` | `string` | ✅ | — | ID of the trigger that fired this run, if any |
|
|
1361
|
+
| ↳ `durable_run_id` | `string` | ✅ | — | Linked sdkdurableapi run ID. Null until the durable run is created. |
|
|
1362
|
+
| ↳ `workflow_version_id` | `string` | ✅ | — | Workflow version the run is bound to |
|
|
1363
|
+
| ↳ `status` | `string` | ✅ | `initialized`, `started`, `finished`, `failed`, `cancelled` | Workflow run lifecycle status. `finished` / `failed` / `cancelled` are terminal. |
|
|
1364
|
+
| ↳ `input` | `unknown` | ✅ | — | Input passed to the run |
|
|
1365
|
+
| ↳ `output` | `unknown` | ✅ | — | Return value, present when status is `finished` |
|
|
1366
|
+
| ↳ `error` | `unknown` | ✅ | — | Error payload when status is `failed` (null otherwise) |
|
|
1367
|
+
| ↳ `created_at` | `string` | ✅ | — | When the run was created (ISO-8601) |
|
|
1368
|
+
| ↳ `updated_at` | `string` | ✅ | — | When the run was last updated (ISO-8601) |
|
|
1369
|
+
|
|
1370
|
+
**Example:**
|
|
1371
|
+
|
|
1372
|
+
```typescript
|
|
1373
|
+
const { data: workflowRun } = await zapier.getWorkflowRun({
|
|
1374
|
+
run: "example-run",
|
|
1375
|
+
});
|
|
1376
|
+
```
|
|
1377
|
+
|
|
1304
1378
|
#### `getWorkflowVersion` 🧪 _experimental_
|
|
1305
1379
|
|
|
1306
1380
|
Get full details of a workflow version including source files
|
|
@@ -1355,8 +1429,8 @@ List run-once durable runs for the authenticated account, newest first
|
|
|
1355
1429
|
| `data[]` | `object[]` | ✅ | — | |
|
|
1356
1430
|
| ↳ `id` | `string` | ✅ | — | Run ID (UUID) |
|
|
1357
1431
|
| ↳ `status` | `string` | ✅ | `initialized`, `started`, `finished`, `failed`, `cancelled` | Run lifecycle status. `finished` / `failed` / `cancelled` are terminal. |
|
|
1358
|
-
| ↳ `input` | `
|
|
1359
|
-
| ↳ `output` | `
|
|
1432
|
+
| ↳ `input` | `unknown` | ✅ | — | Input data passed to the run |
|
|
1433
|
+
| ↳ `output` | `unknown` | ✅ | — | Return value, present when status is `finished` |
|
|
1360
1434
|
| ↳ `error` | `object` | ✅ | — | Structured error details when the run failed (null otherwise) |
|
|
1361
1435
|
| ↳ `execution_id` | `string` | ✅ | — | Linked execution ID. Null until the run leaves the `initialized` state. |
|
|
1362
1436
|
| ↳ `is_private` | `boolean` | ✅ | — | When true, the run is visible only to the creating user; otherwise visible across the account. |
|
|
@@ -1381,6 +1455,62 @@ for await (const durableRun of zapier.listDurableRuns().items()) {
|
|
|
1381
1455
|
}
|
|
1382
1456
|
```
|
|
1383
1457
|
|
|
1458
|
+
#### `listWorkflowRuns` 🧪 _experimental_
|
|
1459
|
+
|
|
1460
|
+
List workflow runs (triggered executions) for a specific deployed workflow, newest first
|
|
1461
|
+
|
|
1462
|
+
**Parameters:**
|
|
1463
|
+
|
|
1464
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
1465
|
+
| -------------- | -------- | -------- | ------- | --------------- | --------------------------------------------- |
|
|
1466
|
+
| `options` | `object` | ✅ | — | — | |
|
|
1467
|
+
| ↳ `workflow` | `string` | ✅ | — | — | Durable workflow ID |
|
|
1468
|
+
| ↳ `pageSize` | `number` | ❌ | — | — | Number of runs per page (max 100) |
|
|
1469
|
+
| ↳ `cursor` | `string` | ❌ | — | — | Pagination cursor |
|
|
1470
|
+
| ↳ `maxItems` | `number` | ❌ | — | — | Maximum total runs to return across all pages |
|
|
1471
|
+
|
|
1472
|
+
**Returns:** `Promise<PaginatedResult<WorkflowRunItem>>`
|
|
1473
|
+
|
|
1474
|
+
| Name | Type | Required | Possible Values | Description |
|
|
1475
|
+
| ------------------------- | ---------- | -------- | ----------------------------------------------------------- | --------------------------------------------------------------------------------------- |
|
|
1476
|
+
| `data[]` | `object[]` | ✅ | — | |
|
|
1477
|
+
| ↳ `id` | `string` | ✅ | — | Workflow run ID (UUID) |
|
|
1478
|
+
| ↳ `trigger_id` | `string` | ✅ | — | ID of the trigger that fired this run, if any. Null for runs created without a trigger. |
|
|
1479
|
+
| ↳ `durable_run_id` | `string` | ✅ | — | Linked sdkdurableapi run ID. Null until the durable run is created. |
|
|
1480
|
+
| ↳ `workflow_version_id` | `string` | ✅ | — | Workflow version the run is bound to. Null in rare edge cases. |
|
|
1481
|
+
| ↳ `status` | `string` | ✅ | `initialized`, `started`, `finished`, `failed`, `cancelled` | Workflow run lifecycle status. `finished` / `failed` / `cancelled` are terminal. |
|
|
1482
|
+
| ↳ `input` | `unknown` | ✅ | — | Input passed to the run |
|
|
1483
|
+
| ↳ `output` | `unknown` | ✅ | — | Return value, present when status is `finished` |
|
|
1484
|
+
| ↳ `error` | `unknown` | ✅ | — | Error payload when status is `failed` (null otherwise) |
|
|
1485
|
+
| ↳ `created_at` | `string` | ✅ | — | When the run was created (ISO-8601) |
|
|
1486
|
+
| ↳ `updated_at` | `string` | ✅ | — | When the run was last updated (ISO-8601) |
|
|
1487
|
+
| `nextCursor` | `string` | ❌ | — | Cursor for the next page; omitted when there are no more pages |
|
|
1488
|
+
|
|
1489
|
+
**Example:**
|
|
1490
|
+
|
|
1491
|
+
```typescript
|
|
1492
|
+
// Get first page and a cursor for the second page
|
|
1493
|
+
const { data: workflowRuns, nextCursor } = await zapier.listWorkflowRuns({
|
|
1494
|
+
workflow: "example-workflow",
|
|
1495
|
+
});
|
|
1496
|
+
|
|
1497
|
+
// Or iterate over all pages
|
|
1498
|
+
for await (const page of zapier.listWorkflowRuns({
|
|
1499
|
+
workflow: "example-workflow",
|
|
1500
|
+
})) {
|
|
1501
|
+
// Do something with each page
|
|
1502
|
+
}
|
|
1503
|
+
|
|
1504
|
+
// Or iterate over individual items across all pages
|
|
1505
|
+
for await (const workflowRun of zapier
|
|
1506
|
+
.listWorkflowRuns({
|
|
1507
|
+
workflow: "example-workflow",
|
|
1508
|
+
})
|
|
1509
|
+
.items()) {
|
|
1510
|
+
// Do something with each workflowRun
|
|
1511
|
+
}
|
|
1512
|
+
```
|
|
1513
|
+
|
|
1384
1514
|
#### `listWorkflowVersions` 🧪 _experimental_
|
|
1385
1515
|
|
|
1386
1516
|
List published versions for a workflow, newest first
|
|
@@ -1526,7 +1656,7 @@ Run a workflow source file as a run-once durable run on sdkdurableapi (no deploy
|
|
|
1526
1656
|
| ---------------------------- | --------- | -------- | ------- | --------------- | --------------------------------------------------------------------------------------------------------------- |
|
|
1527
1657
|
| `options` | `object` | ✅ | — | — | |
|
|
1528
1658
|
| ↳ `source_files` | `object` | ✅ | — | — | Source files keyed by filename → contents |
|
|
1529
|
-
| ↳ `input` | `
|
|
1659
|
+
| ↳ `input` | `unknown` | ❌ | — | — | Input data passed to the run |
|
|
1530
1660
|
| ↳ `dependencies` | `object` | ❌ | — | — | Optional npm package dependencies |
|
|
1531
1661
|
| ↳ `zapier_durable_version` | `string` | ❌ | — | — | Exact semver of @zapier/zapier-durable to use (e.g. "1.2.3"). Defaults to server-configured version if omitted. |
|
|
1532
1662
|
| ↳ `connections` | `object` | ❌ | — | — | Named connection aliases. Maps alias names to Zapier connection IDs. |
|
|
@@ -1551,6 +1681,35 @@ const result = await zapier.runDurable({
|
|
|
1551
1681
|
});
|
|
1552
1682
|
```
|
|
1553
1683
|
|
|
1684
|
+
#### `triggerWorkflow` 🧪 _experimental_
|
|
1685
|
+
|
|
1686
|
+
Look up a workflow's trigger URL and fire it manually. The trigger endpoint is tokenized (the URL contains a secret) and takes no auth header, so the SDK uses a raw fetch rather than the api plugin.
|
|
1687
|
+
|
|
1688
|
+
**Parameters:**
|
|
1689
|
+
|
|
1690
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
1691
|
+
| -------------- | --------- | -------- | ------- | --------------- | -------------------------------------------------------------------------------------------------------- |
|
|
1692
|
+
| `options` | `object` | ✅ | — | — | |
|
|
1693
|
+
| ↳ `workflow` | `string` | ✅ | — | — | Durable workflow ID |
|
|
1694
|
+
| ↳ `input` | `unknown` | ❌ | — | — | JSON payload delivered as the trigger body. Sent as `application/json`; omit to fire with an empty body. |
|
|
1695
|
+
|
|
1696
|
+
**Returns:** `Promise<WorkflowRunItem>`
|
|
1697
|
+
|
|
1698
|
+
| Name | Type | Required | Possible Values | Description |
|
|
1699
|
+
| -------------- | --------- | -------- | --------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
|
|
1700
|
+
| `data` | `object` | ✅ | — | |
|
|
1701
|
+
| ↳ `workflow` | `string` | ✅ | — | The workflow ID that was triggered |
|
|
1702
|
+
| ↳ `status` | `number` | ✅ | — | HTTP status returned by the trigger endpoint |
|
|
1703
|
+
| ↳ `body` | `unknown` | ✅ | — | Response body from the trigger endpoint. Parsed as JSON when the response body parses, otherwise returned as the raw response text. |
|
|
1704
|
+
|
|
1705
|
+
**Example:**
|
|
1706
|
+
|
|
1707
|
+
```typescript
|
|
1708
|
+
const result = await zapier.triggerWorkflow({
|
|
1709
|
+
workflow: "example-workflow",
|
|
1710
|
+
});
|
|
1711
|
+
```
|
|
1712
|
+
|
|
1554
1713
|
#### `updateWorkflow` 🧪 _experimental_
|
|
1555
1714
|
|
|
1556
1715
|
Update a durable workflow's name and/or description
|
|
@@ -2167,7 +2326,7 @@ List records in a table with optional filtering and sorting
|
|
|
2167
2326
|
| ↳ `filters[]` | `object[]` | ❌ | — | — | Filter conditions for the query |
|
|
2168
2327
|
| ↳ `fieldKey` | `string` | ✅ | — | — | The field key to filter on (e.g. f1, f2) |
|
|
2169
2328
|
| ↳ `operator` | `string` | ✅ | — | `exact`, `different`, `contains`, `icontains`, `gte`, `gt`, `lt`, `lte`, `range`, `in`, `isnull`, `startswith`, `search`, `is_within` | The comparison operator |
|
|
2170
|
-
| ↳ `value` | `
|
|
2329
|
+
| ↳ `value` | `unknown` | ❌ | — | — | The value to compare against |
|
|
2171
2330
|
| ↳ `sort` | `object` | ❌ | — | — | Sort records by a field |
|
|
2172
2331
|
| ↳ `fieldKey` | `string` | ✅ | — | — | The field key to sort by |
|
|
2173
2332
|
| ↳ `direction` | `string` | ❌ | `"asc"` | — | Sort direction |
|
package/dist/api/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,SAAS,EACT,gBAAgB,EAGjB,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,SAAS,EACT,gBAAgB,EAGjB,MAAM,SAAS,CAAC;AA8qCjB,eAAO,MAAM,eAAe,GAAI,SAAS,gBAAgB,KAAG,SAW3D,CAAC"}
|
package/dist/api/client.js
CHANGED
|
@@ -28,6 +28,7 @@ const PollApprovalResponseSchema = z.object({
|
|
|
28
28
|
status: ApprovalStatusSchema,
|
|
29
29
|
approval_id: z.string(),
|
|
30
30
|
});
|
|
31
|
+
const APPROVAL_MAX_POLLING_INTERVAL_MS = 5000;
|
|
31
32
|
/**
|
|
32
33
|
* Parse rate limit information from response headers
|
|
33
34
|
*/
|
|
@@ -847,6 +848,7 @@ class ZapierApiClient {
|
|
|
847
848
|
headers: { Accept: "application/json" },
|
|
848
849
|
})),
|
|
849
850
|
timeoutMs,
|
|
851
|
+
maxPollingIntervalMs: APPROVAL_MAX_POLLING_INTERVAL_MS,
|
|
850
852
|
isPending: (body) => {
|
|
851
853
|
const parsed = PollApprovalResponseSchema.safeParse(body);
|
|
852
854
|
return parsed.success && parsed.data.status === "pending_approval";
|
package/dist/api/debug.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../src/api/debug.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAa3C,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,WAAW,
|
|
1
|
+
{"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../src/api/debug.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAa3C,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,WAAW,CA0C/D;AAED,wBAAgB,aAAa,CAC3B,OAAO,CAAC,EAAE,WAAW,GACpB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAwCpC;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE;IACxC,aAAa,EAAE,OAAO,UAAU,CAAC,KAAK,CAAC;IACvC,QAAQ,EAAE,WAAW,CAAC;CACvB,IAEe,OAAO,WAAW,GAAG,GAAG,EAAE,UAAU,WAAW,uBA0C9D"}
|
package/dist/api/debug.js
CHANGED
|
@@ -25,12 +25,14 @@ export function createDebugLogger(enabled) {
|
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
return (message, data) => {
|
|
28
|
+
// Route debug output to stderr so it never pollutes stdout when callers
|
|
29
|
+
// pipe CLI output (e.g. `--json` responses) into a JSON parser.
|
|
28
30
|
if (data === undefined || data === "") {
|
|
29
|
-
console.
|
|
31
|
+
console.error(`[Zapier SDK] ${message}`);
|
|
30
32
|
return;
|
|
31
33
|
}
|
|
32
34
|
// Use cached module if available for sync logging. Yes, this means if the util module isn't yet loaded, we'll fall
|
|
33
|
-
// back to a plain old console.
|
|
35
|
+
// back to a plain old console.error, which might mean we don't see proper formatting/nesting. But that's unlikely
|
|
34
36
|
// since this logging happens during async fetching. Alternatively, we could switch to async logging, but this
|
|
35
37
|
// seems fine since we have to have a fallback anyway.
|
|
36
38
|
if (utilModule) {
|
|
@@ -39,11 +41,11 @@ export function createDebugLogger(enabled) {
|
|
|
39
41
|
depth: null,
|
|
40
42
|
breakLength: 80,
|
|
41
43
|
});
|
|
42
|
-
console.
|
|
44
|
+
console.error(`[Zapier SDK] ${message}`, formatted);
|
|
43
45
|
}
|
|
44
46
|
else {
|
|
45
47
|
// Fallback - browser will handle formatting automatically
|
|
46
|
-
console.
|
|
48
|
+
console.error(`[Zapier SDK] ${message}`, data);
|
|
47
49
|
}
|
|
48
50
|
};
|
|
49
51
|
}
|
package/dist/api/polling.d.ts
CHANGED
|
@@ -29,6 +29,8 @@ export interface PollOptions<TResult = unknown> {
|
|
|
29
29
|
resultExtractor?: (response: unknown) => TResult;
|
|
30
30
|
/** Initial delay before the first poll attempt (in milliseconds) */
|
|
31
31
|
initialDelay?: number;
|
|
32
|
+
/** Maximum sleep duration between poll attempts after backoff is applied. */
|
|
33
|
+
maxPollingIntervalMs?: number;
|
|
32
34
|
/**
|
|
33
35
|
* Abort signal observed by the initial delay, the inter-poll sleep,
|
|
34
36
|
* and (when forwarded into `fetchPoll`) the in-flight HTTP request.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"polling.d.ts","sourceRoot":"","sources":["../../src/api/polling.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAiCH;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAG5D;AAED;;GAEG;AACH,MAAM,WAAW,WAAW,CAAC,OAAO,GAAG,OAAO;IAC5C,8CAA8C;IAC9C,SAAS,EAAE,MAAM,OAAO,CAAC,QAAQ,CAAC,CAAC;IACnC,4DAA4D;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wDAAwD;IACxD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iEAAiE;IACjE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,uGAAuG;IACvG,SAAS,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,OAAO,CAAC;IAC3C,uDAAuD;IACvD,eAAe,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,OAAO,CAAC;IACjD,oEAAoE;IACpE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAWD,mBAAW,UAAU;IACnB,OAAO,YAAY;IACnB,QAAQ,aAAa;CAC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AAI;IAC1C,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,UAAU,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAgEF;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,GAAG,OAAO,EACvD,OAAO,EAAE,WAAW,CAAC,OAAO,CAAC,GAC5B,OAAO,CAAC,OAAO,CAAC,CA4HlB"}
|
package/dist/api/polling.js
CHANGED
|
@@ -96,7 +96,7 @@ const processResponse = async (response, successStatus, pendingStatus, isPending
|
|
|
96
96
|
* @throws {ZapierApiError} When the API returns consecutive errors
|
|
97
97
|
*/
|
|
98
98
|
export async function pollUntilComplete(options) {
|
|
99
|
-
const { fetchPoll, timeoutMs = DEFAULT_TIMEOUT_MS, initialDelay = DEFAULT_INITIAL_DELAY_MS, successStatus = DEFAULT_SUCCESS_STATUS, pendingStatus = DEFAULT_PENDING_STATUS, isPending, resultExtractor = (response) => response, signal, } = options;
|
|
99
|
+
const { fetchPoll, timeoutMs = DEFAULT_TIMEOUT_MS, initialDelay = DEFAULT_INITIAL_DELAY_MS, successStatus = DEFAULT_SUCCESS_STATUS, pendingStatus = DEFAULT_PENDING_STATUS, isPending, resultExtractor = (response) => response, signal, maxPollingIntervalMs, } = options;
|
|
100
100
|
// Validate input parameters
|
|
101
101
|
if (timeoutMs <= 0) {
|
|
102
102
|
throw new ZapierValidationError("Timeout must be greater than 0", {
|
|
@@ -108,6 +108,11 @@ export async function pollUntilComplete(options) {
|
|
|
108
108
|
details: { initialDelay },
|
|
109
109
|
});
|
|
110
110
|
}
|
|
111
|
+
if (maxPollingIntervalMs !== undefined && maxPollingIntervalMs <= 0) {
|
|
112
|
+
throw new ZapierValidationError("Max polling interval must be greater than 0", {
|
|
113
|
+
details: { maxPollingIntervalMs },
|
|
114
|
+
});
|
|
115
|
+
}
|
|
111
116
|
if (signal?.aborted)
|
|
112
117
|
throw makeAbortError();
|
|
113
118
|
const startTime = Date.now();
|
|
@@ -136,7 +141,10 @@ export async function pollUntilComplete(options) {
|
|
|
136
141
|
if (attempts > 0) {
|
|
137
142
|
const interval = getPollingInterval(elapsedTime);
|
|
138
143
|
const waitTime = calculateErrorBackoffMs(interval, errorCount);
|
|
139
|
-
|
|
144
|
+
const cappedWaitTime = maxPollingIntervalMs === undefined
|
|
145
|
+
? waitTime
|
|
146
|
+
: Math.min(waitTime, maxPollingIntervalMs);
|
|
147
|
+
await sleep(cappedWaitTime, signal);
|
|
140
148
|
if (signal?.aborted)
|
|
141
149
|
throw makeAbortError();
|
|
142
150
|
}
|
package/dist/auth.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EACV,WAAW,EAEX,uBAAuB,EACxB,MAAM,qBAAqB,CAAC;AAK7B,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,SAAS,CAAC;AAG9D,YAAY,EACV,WAAW,EACX,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAG5C,YAAY,EACV,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,aAAa,GACd,MAAM,gBAAgB,CAAC;AAGxB,YAAY,EACV,WAAW,EACX,mBAAmB,EACnB,iBAAiB,EACjB,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,qBAAqB,CAAC;AAE7B;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM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,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,KAAK,OAAO,CAAC,uBAAuB,GAAG,SAAS,CAAC,CAAC;CACpD,CAAC;AA6BF;;;GAGG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CAE3D;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,GAAG,SAAS,CAGzD;AA2BD;;;;;GAKG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAK7B;AAkED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CA4B7B;AAqHD;;;;GAIG;AACH,wBAAsB,0BAA0B,CAAC,OAAO,EAAE;IACxD,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB,GAAG,OAAO,CAAC,IAAI,CAAC,CAehB"}
|
package/dist/auth.js
CHANGED
|
@@ -284,7 +284,10 @@ async function tryStoredClientCredentialToken(options) {
|
|
|
284
284
|
const cached = await readCachedToken(cacheKey, cache);
|
|
285
285
|
if (cached !== undefined) {
|
|
286
286
|
if (options.debug)
|
|
287
|
-
|
|
287
|
+
// Debug output goes to stderr so it never pollutes stdout when callers
|
|
288
|
+
// (smoke tests, scripts) pipe `zapier-sdk --debug ... --json` into a
|
|
289
|
+
// JSON parser.
|
|
290
|
+
console.error(`[auth] Using cached token (clientId: ${activeCredential.clientId})`);
|
|
288
291
|
emitAuthResolved(options.onEvent, "client_credentials");
|
|
289
292
|
return cached;
|
|
290
293
|
}
|
|
@@ -302,7 +305,7 @@ async function tryStoredClientCredentialToken(options) {
|
|
|
302
305
|
throw new ZapierAuthenticationError(`Stored client credential is missing its secret (clientId: ${activeCredential.clientId}). Run \`zapier-sdk login\` to recreate it.`);
|
|
303
306
|
}
|
|
304
307
|
if (options.debug)
|
|
305
|
-
console.
|
|
308
|
+
console.error(`[auth] Using stored client credential (clientId: ${storedCredential.clientId})`);
|
|
306
309
|
const token = await resolveAuthTokenFromCredentials(storedCredential, options);
|
|
307
310
|
emitAuthResolved(options.onEvent, "client_credentials");
|
|
308
311
|
return token;
|
|
@@ -337,7 +340,7 @@ export async function resolveAuthToken(options = {}) {
|
|
|
337
340
|
if (storedToken !== undefined)
|
|
338
341
|
return storedToken;
|
|
339
342
|
if (options.debug) {
|
|
340
|
-
console.
|
|
343
|
+
console.error("[auth] Using JWT (no stored client credential found)");
|
|
341
344
|
}
|
|
342
345
|
const jwtToken = await getTokenFromCliLogin({
|
|
343
346
|
onEvent: options.onEvent,
|
|
@@ -379,7 +382,7 @@ async function resolveAuthTokenFromCredentials(credentials, options) {
|
|
|
379
382
|
const cached = await readCachedToken(cacheKey, cache);
|
|
380
383
|
if (cached !== undefined) {
|
|
381
384
|
if (options.debug) {
|
|
382
|
-
console.
|
|
385
|
+
console.error(`[auth] Using cached token (clientId: ${clientId})`);
|
|
383
386
|
}
|
|
384
387
|
return cached;
|
|
385
388
|
}
|
|
@@ -395,7 +398,7 @@ async function resolveAuthTokenFromCredentials(credentials, options) {
|
|
|
395
398
|
const recheck = await readCachedToken(cacheKey, cache);
|
|
396
399
|
if (recheck !== undefined) {
|
|
397
400
|
if (options.debug) {
|
|
398
|
-
console.
|
|
401
|
+
console.error(`[auth] Using cached token (clientId: ${clientId}, locked recheck)`);
|
|
399
402
|
}
|
|
400
403
|
return recheck;
|
|
401
404
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The minimal Zapier stack: an empty kitcore `createPluginStack()` seeded with
|
|
3
|
+
* just Zapier's core error adapter, no SDK methods. `.use(...)` your own
|
|
4
|
+
* plugins and `.toSdk()` to build a custom or test SDK; `createZapierSdkStack`
|
|
5
|
+
* is this plus the full plugin set. Kept in its own light module so importing
|
|
6
|
+
* it doesn't pull in the whole plugin graph.
|
|
7
|
+
*
|
|
8
|
+
* const sdk = createZapierCoreStack()
|
|
9
|
+
* .use(() => ({ context: { options: {} } }))
|
|
10
|
+
* .use(() => ({ context: { api: mockApi } }))
|
|
11
|
+
* .use(myPlugin)
|
|
12
|
+
* .toSdk();
|
|
13
|
+
*/
|
|
14
|
+
export declare function createZapierCoreStack(): import("kitcore").PluginStack<object, {
|
|
15
|
+
context: {
|
|
16
|
+
meta: Record<string, import("kitcore").PluginMeta>;
|
|
17
|
+
hooks: import("kitcore").MethodHooks;
|
|
18
|
+
};
|
|
19
|
+
} & {
|
|
20
|
+
context: {
|
|
21
|
+
core: import("kitcore").CoreOptions;
|
|
22
|
+
};
|
|
23
|
+
}>;
|
|
24
|
+
//# sourceMappingURL=core-stack.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core-stack.d.ts","sourceRoot":"","sources":["../src/core-stack.ts"],"names":[],"mappings":"AAkBA;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB;;;;;;;;;GAEpC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { createCorePlugin, createPluginStack } from "kitcore";
|
|
2
|
+
import { zapierAdaptError } from "./types/errors";
|
|
3
|
+
/**
|
|
4
|
+
* kitcore's core plugin wired with Zapier's `adaptError`, which produces
|
|
5
|
+
* `Zapier*` branded errors from kitcore's internal throw sites (validation,
|
|
6
|
+
* non-Error normalization) so consumers never see a neutral `CoreError`.
|
|
7
|
+
* Shared by every Zapier stack.
|
|
8
|
+
*
|
|
9
|
+
* Pagination shaping is intentionally NOT wired here: each paginated method
|
|
10
|
+
* declares its own `adaptPage` (e.g. `adaptPage: adaptZapierPage`), so the adapter
|
|
11
|
+
* travels with the plugin and stays type-checked, rather than relying on an
|
|
12
|
+
* ambient SDK-wide default that a lifted-out plugin would silently lose.
|
|
13
|
+
*/
|
|
14
|
+
const zapierCorePlugin = createCorePlugin({
|
|
15
|
+
adaptError: zapierAdaptError,
|
|
16
|
+
});
|
|
17
|
+
/**
|
|
18
|
+
* The minimal Zapier stack: an empty kitcore `createPluginStack()` seeded with
|
|
19
|
+
* just Zapier's core error adapter, no SDK methods. `.use(...)` your own
|
|
20
|
+
* plugins and `.toSdk()` to build a custom or test SDK; `createZapierSdkStack`
|
|
21
|
+
* is this plus the full plugin set. Kept in its own light module so importing
|
|
22
|
+
* it doesn't pull in the whole plugin graph.
|
|
23
|
+
*
|
|
24
|
+
* const sdk = createZapierCoreStack()
|
|
25
|
+
* .use(() => ({ context: { options: {} } }))
|
|
26
|
+
* .use(() => ({ context: { api: mockApi } }))
|
|
27
|
+
* .use(myPlugin)
|
|
28
|
+
* .toSdk();
|
|
29
|
+
*/
|
|
30
|
+
export function createZapierCoreStack() {
|
|
31
|
+
return createPluginStack().use(zapierCorePlugin);
|
|
32
|
+
}
|