@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
|
@@ -5,20 +5,21 @@
|
|
|
5
5
|
* `listActionInputFieldChoices`, `getActionInputFieldsSchema`) to
|
|
6
6
|
* disambiguate from the trigger-side variants. The unprefixed names
|
|
7
7
|
* stay exported here as deprecated aliases that delegate to the
|
|
8
|
-
* renamed implementations, so existing callers keep working.
|
|
9
|
-
*
|
|
10
|
-
* hide them.
|
|
8
|
+
* renamed implementations, so existing callers keep working. Each carries
|
|
9
|
+
* a `deprecation` field so generated docs and CLI help hide them.
|
|
11
10
|
*
|
|
12
11
|
* @deprecated Use the action-prefixed equivalents:
|
|
13
12
|
* - listInputFields -> listActionInputFields
|
|
14
13
|
* - listInputFieldChoices -> listActionInputFieldChoices
|
|
15
14
|
* - getInputFieldsSchema -> getActionInputFieldsSchema
|
|
16
15
|
*/
|
|
17
|
-
import { definePlugin } from "
|
|
16
|
+
import { definePlugin } from "kitcore";
|
|
18
17
|
import { ListActionInputFieldsInputSchema } from "../listActionInputFields/schemas";
|
|
19
18
|
import { ListActionInputFieldChoicesInputSchema, InputFieldChoiceItemSchema, } from "../listActionInputFieldChoices/schemas";
|
|
20
19
|
import { GetActionInputFieldsSchemaInputSchema } from "../getActionInputFieldsSchema/schemas";
|
|
21
20
|
import { RootFieldItemSchema } from "../../schemas/Field";
|
|
21
|
+
import { rootFieldItemFormatter } from "../../formatters/field";
|
|
22
|
+
import { inputFieldChoiceItemFormatter } from "../../formatters/inputFieldChoice";
|
|
22
23
|
import { DEFAULT_PAGE_SIZE } from "../../constants";
|
|
23
24
|
/**
|
|
24
25
|
* @deprecated Use listActionInputFields instead.
|
|
@@ -28,11 +29,13 @@ export const listInputFieldsDeprecatedPlugin = definePlugin((sdk) => ({
|
|
|
28
29
|
context: {
|
|
29
30
|
meta: {
|
|
30
31
|
listInputFields: {
|
|
31
|
-
categories: ["action"
|
|
32
|
+
categories: ["action"],
|
|
33
|
+
deprecation: { message: "Use listActionInputFields instead." },
|
|
32
34
|
type: "list",
|
|
33
35
|
itemType: "RootField",
|
|
34
36
|
inputSchema: ListActionInputFieldsInputSchema,
|
|
35
37
|
outputSchema: RootFieldItemSchema,
|
|
38
|
+
formatter: rootFieldItemFormatter,
|
|
36
39
|
defaultPageSize: DEFAULT_PAGE_SIZE,
|
|
37
40
|
},
|
|
38
41
|
},
|
|
@@ -46,11 +49,15 @@ export const listInputFieldChoicesDeprecatedPlugin = definePlugin((sdk) => ({
|
|
|
46
49
|
context: {
|
|
47
50
|
meta: {
|
|
48
51
|
listInputFieldChoices: {
|
|
49
|
-
categories: ["action"
|
|
52
|
+
categories: ["action"],
|
|
53
|
+
deprecation: {
|
|
54
|
+
message: "Use listActionInputFieldChoices instead.",
|
|
55
|
+
},
|
|
50
56
|
type: "list",
|
|
51
57
|
itemType: "InputFieldChoiceItem",
|
|
52
58
|
inputSchema: ListActionInputFieldChoicesInputSchema,
|
|
53
59
|
outputSchema: InputFieldChoiceItemSchema,
|
|
60
|
+
formatter: inputFieldChoiceItemFormatter,
|
|
54
61
|
defaultPageSize: DEFAULT_PAGE_SIZE,
|
|
55
62
|
},
|
|
56
63
|
},
|
|
@@ -64,7 +71,8 @@ export const getInputFieldsSchemaDeprecatedPlugin = definePlugin((sdk) => ({
|
|
|
64
71
|
context: {
|
|
65
72
|
meta: {
|
|
66
73
|
getInputFieldsSchema: {
|
|
67
|
-
categories: ["action"
|
|
74
|
+
categories: ["action"],
|
|
75
|
+
deprecation: { message: "Use getActionInputFieldsSchema instead." },
|
|
68
76
|
type: "function",
|
|
69
77
|
inputSchema: GetActionInputFieldsSchemaInputSchema,
|
|
70
78
|
},
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { OnMethodEnd } from "kitcore";
|
|
2
|
+
import type { MethodCalledEventData } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* Build the `onMethodEnd` hook that translates the toolkit-generic
|
|
5
|
+
* end-of-call event into the Zapier-shaped `MethodCalledEvent` payload that
|
|
6
|
+
* `emitMethodCalled` accepts. Bridges the framework's neutral hook surface
|
|
7
|
+
* to the SDK's transport-specific event schema.
|
|
8
|
+
*/
|
|
9
|
+
export declare function makeMethodEndHook(emitMethodCalled: (data: MethodCalledEventData) => void): OnMethodEnd;
|
|
10
|
+
//# sourceMappingURL=event-emission-hook.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-emission-hook.d.ts","sourceRoot":"","sources":["../../../src/plugins/eventEmission/event-emission-hook.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAuBrD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,gBAAgB,EAAE,CAAC,IAAI,EAAE,qBAAqB,KAAK,IAAI,GACtD,WAAW,CAoBb"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { getMethodMetadata } from "./method-metadata";
|
|
2
|
+
/**
|
|
3
|
+
* Compute the historical `argument_count` telemetry field. Methods built
|
|
4
|
+
* through `createPluginMethod` pass a single options object; we count its
|
|
5
|
+
* fields. Variadic callers (e.g. fetch) pass positional args; we count the
|
|
6
|
+
* defined ones.
|
|
7
|
+
*/
|
|
8
|
+
function computeArgumentCount(args) {
|
|
9
|
+
if (args.length === 1) {
|
|
10
|
+
const arg0 = args[0];
|
|
11
|
+
if (arg0 !== null &&
|
|
12
|
+
typeof arg0 === "object" &&
|
|
13
|
+
!Array.isArray(arg0) &&
|
|
14
|
+
Object.getPrototypeOf(arg0) === Object.prototype) {
|
|
15
|
+
return Object.keys(arg0).length;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return args.filter((a) => a !== undefined).length;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Build the `onMethodEnd` hook that translates the toolkit-generic
|
|
22
|
+
* end-of-call event into the Zapier-shaped `MethodCalledEvent` payload that
|
|
23
|
+
* `emitMethodCalled` accepts. Bridges the framework's neutral hook surface
|
|
24
|
+
* to the SDK's transport-specific event schema.
|
|
25
|
+
*/
|
|
26
|
+
export function makeMethodEndHook(emitMethodCalled) {
|
|
27
|
+
return ({ methodName, args, isPaginated, depth, durationMs, error }) => {
|
|
28
|
+
// Only top-level invocations emit telemetry; nested SDK-method
|
|
29
|
+
// calls would otherwise produce duplicate `MethodCalledEvent`s for
|
|
30
|
+
// the same logical work.
|
|
31
|
+
if (depth > 0)
|
|
32
|
+
return;
|
|
33
|
+
const metadata = getMethodMetadata();
|
|
34
|
+
emitMethodCalled({
|
|
35
|
+
method_name: methodName,
|
|
36
|
+
execution_duration_ms: durationMs,
|
|
37
|
+
success_flag: !error,
|
|
38
|
+
error_message: error?.message ?? null,
|
|
39
|
+
error_type: error?.constructor.name ?? null,
|
|
40
|
+
argument_count: computeArgumentCount(args),
|
|
41
|
+
is_paginated: isPaginated,
|
|
42
|
+
selected_api: metadata?.selectedApi ?? null,
|
|
43
|
+
operation_type: metadata?.operationType ?? null,
|
|
44
|
+
operation_key: metadata?.operationKey ?? null,
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
}
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type { BaseSdkOptions } from "../../types/sdk";
|
|
8
8
|
import type { BaseEvent } from "../../types/telemetry-events";
|
|
9
|
+
import type { OnMethodEnd } from "kitcore";
|
|
9
10
|
import type { EventTransport, TransportConfig } from "./transport";
|
|
10
|
-
import type { MethodCalledEventData } from "./types";
|
|
11
11
|
/**
|
|
12
12
|
* Removes all registered process event listeners.
|
|
13
13
|
* Useful for test cleanup to prevent listener accumulation.
|
|
@@ -24,10 +24,12 @@ export interface EventEmissionContext {
|
|
|
24
24
|
config: EventEmissionConfig;
|
|
25
25
|
emit<T extends any>(subject: string, event: T): void;
|
|
26
26
|
createBaseEvent(): Promise<BaseEvent>;
|
|
27
|
-
emitMethodCalled(data: MethodCalledEventData): void;
|
|
28
27
|
flush(): Promise<void>;
|
|
29
28
|
close(exitCode?: number): Promise<void>;
|
|
30
29
|
};
|
|
30
|
+
hooks: {
|
|
31
|
+
onMethodEnd: OnMethodEnd;
|
|
32
|
+
};
|
|
31
33
|
}
|
|
32
34
|
export declare const eventEmissionPlugin: (sdk: {
|
|
33
35
|
context: {
|
|
@@ -35,7 +37,7 @@ export declare const eventEmissionPlugin: (sdk: {
|
|
|
35
37
|
};
|
|
36
38
|
} & {
|
|
37
39
|
context: {
|
|
38
|
-
meta: Record<string, import("
|
|
40
|
+
meta: Record<string, import("kitcore").PluginMeta>;
|
|
39
41
|
};
|
|
40
42
|
}) => {
|
|
41
43
|
context: EventEmissionContext;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/eventEmission/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/eventEmission/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAqDnE;;;GAGG;AACH,wBAAgB,qBAAqB,SAEpC;AAGD,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,WAAW,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;CACrC;AAGD,MAAM,WAAW,oBAAoB;IACnC,aAAa,EAAE;QACb,SAAS,EAAE,cAAc,CAAC;QAC1B,MAAM,EAAE,mBAAmB,CAAC;QAE5B,IAAI,CAAC,CAAC,SAAS,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;QAErD,eAAe,IAAI,OAAO,CAAC,SAAS,CAAC,CAAC;QAEtC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;QAIvB,KAAK,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;KACzC,CAAC;IACF,KAAK,EAAE;QACL,WAAW,EAAE,WAAW,CAAC;KAC1B,CAAC;CACH;AAyFD,eAAO,MAAM,mBAAmB;aAEnB;QAAE,OAAO,CAAC,EAAE,cAAc,CAAA;KAAE;;;;;;aACxB,oBAAoB;CA6VpC,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAG3E,YAAY,EACV,YAAY,EACZ,6BAA6B,EAC7B,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,8BAA8B,EAC9B,0BAA0B,EAC1B,eAAe,EACf,eAAe,EACf,sBAAsB,GACvB,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,SAAS,EACT,iBAAiB,GAClB,MAAM,8BAA8B,CAAC;AACtC,cAAc,SAAS,CAAC"}
|
|
@@ -4,12 +4,13 @@
|
|
|
4
4
|
* Provides silent telemetry event emission capability to the SDK.
|
|
5
5
|
* All events are emitted asynchronously and failures are silently handled.
|
|
6
6
|
*/
|
|
7
|
-
import { definePlugin } from "
|
|
7
|
+
import { definePlugin } from "kitcore";
|
|
8
8
|
import { createTransport } from "./transport";
|
|
9
9
|
import { generateEventId, getCurrentTimestamp, getReleaseId } from "./utils";
|
|
10
10
|
import { extractUserIdsFromJwt } from "../../api/auth";
|
|
11
11
|
import { resolveAuthToken } from "../../auth";
|
|
12
12
|
import { buildApplicationLifecycleEvent, buildErrorEventWithContext, buildMethodCalledEvent, } from "./builders";
|
|
13
|
+
import { makeMethodEndHook } from "./event-emission-hook";
|
|
13
14
|
import { getTrackingBaseUrl } from "../../utils/url-utils";
|
|
14
15
|
// Maximum time to wait for telemetry emission before allowing process to exit
|
|
15
16
|
const TELEMETRY_EMIT_TIMEOUT_MS = 300;
|
|
@@ -154,6 +155,7 @@ export const eventEmissionPlugin = definePlugin((sdk) => {
|
|
|
154
155
|
}
|
|
155
156
|
// If disabled, return noop implementations
|
|
156
157
|
if (!config.enabled) {
|
|
158
|
+
const noopEmitMethodCalled = () => { };
|
|
157
159
|
return {
|
|
158
160
|
context: {
|
|
159
161
|
eventEmission: {
|
|
@@ -170,10 +172,12 @@ export const eventEmissionPlugin = definePlugin((sdk) => {
|
|
|
170
172
|
visitor_id: null,
|
|
171
173
|
correlation_id: null,
|
|
172
174
|
}),
|
|
173
|
-
emitMethodCalled: () => { },
|
|
174
175
|
flush: async () => { },
|
|
175
176
|
close: async () => { },
|
|
176
177
|
},
|
|
178
|
+
hooks: {
|
|
179
|
+
onMethodEnd: makeMethodEndHook(noopEmitMethodCalled),
|
|
180
|
+
},
|
|
177
181
|
},
|
|
178
182
|
};
|
|
179
183
|
}
|
|
@@ -350,6 +354,13 @@ export const eventEmissionPlugin = definePlugin((sdk) => {
|
|
|
350
354
|
await emitWithTimeout(transport, APPLICATION_LIFECYCLE_EVENT_SUBJECT, exitEvent);
|
|
351
355
|
removeExistingListeners();
|
|
352
356
|
};
|
|
357
|
+
const emitMethodCalled = (data) => {
|
|
358
|
+
const event = {
|
|
359
|
+
...buildMethodCalledEvent(data),
|
|
360
|
+
call_context: config.callContext ?? "sdk",
|
|
361
|
+
};
|
|
362
|
+
trackEmission(silentEmit(transport, METHOD_CALLED_EVENT_SUBJECT, event, getUserContext));
|
|
363
|
+
};
|
|
353
364
|
return {
|
|
354
365
|
context: {
|
|
355
366
|
eventEmission: {
|
|
@@ -359,16 +370,12 @@ export const eventEmissionPlugin = definePlugin((sdk) => {
|
|
|
359
370
|
trackEmission(silentEmit(transport, subject, event, getUserContext));
|
|
360
371
|
},
|
|
361
372
|
createBaseEvent: createBaseEventHelper,
|
|
362
|
-
emitMethodCalled: (data) => {
|
|
363
|
-
const event = {
|
|
364
|
-
...buildMethodCalledEvent(data),
|
|
365
|
-
call_context: config.callContext ?? "sdk",
|
|
366
|
-
};
|
|
367
|
-
trackEmission(silentEmit(transport, METHOD_CALLED_EVENT_SUBJECT, event, getUserContext));
|
|
368
|
-
},
|
|
369
373
|
flush,
|
|
370
374
|
close,
|
|
371
375
|
},
|
|
376
|
+
hooks: {
|
|
377
|
+
onMethodEnd: makeMethodEndHook(emitMethodCalled),
|
|
378
|
+
},
|
|
372
379
|
},
|
|
373
380
|
};
|
|
374
381
|
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zapier-specific method metadata stored on the toolkit's per-call scope.
|
|
3
|
+
* Plugins set fields here during a method's execution; eventEmission's
|
|
4
|
+
* `onMethodEnd` hook reads them out when emitting the `MethodCalledEvent`.
|
|
5
|
+
*
|
|
6
|
+
* The toolkit owns the AsyncLocalStorage scope object; this module just
|
|
7
|
+
* reserves the `methodMetadata` key on it for Zapier's purposes.
|
|
8
|
+
*/
|
|
9
|
+
export interface MethodMetadata {
|
|
10
|
+
selectedApi?: string | null;
|
|
11
|
+
operationType?: string | null;
|
|
12
|
+
operationKey?: string | null;
|
|
13
|
+
}
|
|
14
|
+
export declare function setMethodMetadata(metadata: MethodMetadata): void;
|
|
15
|
+
export declare function getMethodMetadata(): MethodMetadata | undefined;
|
|
16
|
+
//# sourceMappingURL=method-metadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"method-metadata.d.ts","sourceRoot":"","sources":["../../../src/plugins/eventEmission/method-metadata.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,MAAM,WAAW,cAAc;IAC7B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI,CAKhE;AAED,wBAAgB,iBAAiB,IAAI,cAAc,GAAG,SAAS,CAE9D"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zapier-specific method metadata stored on the toolkit's per-call scope.
|
|
3
|
+
* Plugins set fields here during a method's execution; eventEmission's
|
|
4
|
+
* `onMethodEnd` hook reads them out when emitting the `MethodCalledEvent`.
|
|
5
|
+
*
|
|
6
|
+
* The toolkit owns the AsyncLocalStorage scope object; this module just
|
|
7
|
+
* reserves the `methodMetadata` key on it for Zapier's purposes.
|
|
8
|
+
*/
|
|
9
|
+
import { getCurrentScope } from "kitcore";
|
|
10
|
+
const SCOPE_KEY = "methodMetadata";
|
|
11
|
+
export function setMethodMetadata(metadata) {
|
|
12
|
+
const scope = getCurrentScope();
|
|
13
|
+
if (!scope)
|
|
14
|
+
return;
|
|
15
|
+
const existing = scope[SCOPE_KEY];
|
|
16
|
+
scope[SCOPE_KEY] = { ...existing, ...metadata };
|
|
17
|
+
}
|
|
18
|
+
export function getMethodMetadata() {
|
|
19
|
+
return getCurrentScope()?.[SCOPE_KEY];
|
|
20
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../../src/plugins/eventEmission/transport.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,CAAC,SAAS,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9D,KAAK,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACzB;AAGD,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAGD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,cAAc,CAwDjB;AAGD,wBAAgB,sBAAsB,IAAI,cAAc,
|
|
1
|
+
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../../src/plugins/eventEmission/transport.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,CAAC,SAAS,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9D,KAAK,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACzB;AAGD,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAGD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,cAAc,CAwDjB;AAGD,wBAAgB,sBAAsB,IAAI,cAAc,CAcvD;AAGD,wBAAgB,mBAAmB,IAAI,cAAc,CAMpD;AAGD,wBAAgB,eAAe,CAAC,MAAM,EAAE,eAAe,GAAG,cAAc,CAyBvE"}
|
|
@@ -60,7 +60,8 @@ export function createConsoleTransport() {
|
|
|
60
60
|
return {
|
|
61
61
|
async emit(subject, event) {
|
|
62
62
|
try {
|
|
63
|
-
|
|
63
|
+
// stderr: telemetry is diagnostic, not the program's data output.
|
|
64
|
+
console.error("[SDK Telemetry]", JSON.stringify({ subject, properties: event }, null, 2));
|
|
64
65
|
}
|
|
65
66
|
catch {
|
|
66
67
|
// Silent failure - never throw
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ApiClient } from "../../api";
|
|
2
2
|
import type { ConnectionsPluginProvides } from "../connections";
|
|
3
3
|
import { z } from "zod";
|
|
4
|
+
import type { AdaptError, MethodHooks } from "kitcore";
|
|
4
5
|
export interface ZapierFetchInitOptions extends RequestInit {
|
|
5
6
|
/** @deprecated Use `connection` instead. */
|
|
6
7
|
connectionId?: string | number;
|
|
@@ -18,12 +19,14 @@ export interface ZapierFetchInitOptions extends RequestInit {
|
|
|
18
19
|
export declare const fetchPlugin: (sdk: {
|
|
19
20
|
context: {
|
|
20
21
|
api: ApiClient;
|
|
22
|
+
hooks: MethodHooks;
|
|
23
|
+
core?: {
|
|
24
|
+
adaptError?: AdaptError;
|
|
25
|
+
};
|
|
21
26
|
} & ConnectionsPluginProvides["context"];
|
|
22
|
-
} & {
|
|
23
|
-
context: import("../eventEmission").EventEmissionContext;
|
|
24
27
|
} & {
|
|
25
28
|
context: {
|
|
26
|
-
meta: Record<string, import("
|
|
29
|
+
meta: Record<string, import("kitcore").PluginMeta>;
|
|
27
30
|
};
|
|
28
31
|
}) => {
|
|
29
32
|
fetch: (url: string | URL, init?: ZapierFetchInitOptions) => Promise<Response>;
|
|
@@ -32,7 +35,10 @@ export declare const fetchPlugin: (sdk: {
|
|
|
32
35
|
fetch: {
|
|
33
36
|
description: string;
|
|
34
37
|
packages: string[];
|
|
35
|
-
categories:
|
|
38
|
+
categories: {
|
|
39
|
+
key: string;
|
|
40
|
+
title: string;
|
|
41
|
+
}[];
|
|
36
42
|
returnType: string;
|
|
37
43
|
inputParameters: ({
|
|
38
44
|
name: string;
|
|
@@ -43,8 +49,8 @@ export declare const fetchPlugin: (sdk: {
|
|
|
43
49
|
method: z.ZodOptional<z.ZodEnum<{
|
|
44
50
|
POST: "POST";
|
|
45
51
|
GET: "GET";
|
|
46
|
-
PUT: "PUT";
|
|
47
52
|
DELETE: "DELETE";
|
|
53
|
+
PUT: "PUT";
|
|
48
54
|
PATCH: "PATCH";
|
|
49
55
|
HEAD: "HEAD";
|
|
50
56
|
OPTIONS: "OPTIONS";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/fetch/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAMhE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/fetch/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAMhE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAaxB,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEvD,MAAM,WAAW,sBAAuB,SAAQ,WAAW;IACzD,4CAA4C;IAC5C,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,4CAA4C;IAC5C,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8EAA8E;IAC9E,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAgHD;;;GAGG;AACH,eAAO,MAAM,WAAW;aAEX;QACP,GAAG,EAAE,SAAS,CAAC;QACf,KAAK,EAAE,WAAW,CAAC;QACnB,IAAI,CAAC,EAAE;YAAE,UAAU,CAAC,EAAE,UAAU,CAAA;SAAE,CAAC;KACpC,GAAG,yBAAyB,CAAC,SAAS,CAAC;;;;;;iBAU/B,MAAM,GAAG,GAAG,SACV,sBAAsB,KAC5B,OAAO,CAAC,QAAQ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiKzB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { definePlugin } from "
|
|
1
|
+
import { definePlugin } from "kitcore";
|
|
2
2
|
import { ZapierRelayError, ZapierTimeoutError } from "../../types/errors";
|
|
3
3
|
import { FetchUrlSchema, FetchInitSchema, FetchInitZapierFieldsSchema, } from "./schemas";
|
|
4
4
|
import { z } from "zod";
|
|
@@ -6,11 +6,11 @@ import { resolveConnectionId } from "../../utils/domain-utils";
|
|
|
6
6
|
import { combineAbortSignals, createTimeoutAbortSignal, } from "../../utils/abort-utils";
|
|
7
7
|
import { isPlainObject } from "../../utils/type-guard-utils";
|
|
8
8
|
import { buildHttpRequestContext } from "@zapier/policy-context";
|
|
9
|
-
// fetch() doesn't
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
import {
|
|
13
|
-
import { createValidator } from "
|
|
9
|
+
// fetch() doesn't go through createPluginMethod (its signature is variadic,
|
|
10
|
+
// not single-options), so it enters its own method scope and fires
|
|
11
|
+
// onMethodStart / onMethodEnd hooks directly.
|
|
12
|
+
import { getCurrentDepth, runInMethodScope } from "kitcore";
|
|
13
|
+
import { createValidator } from "kitcore";
|
|
14
14
|
/**
|
|
15
15
|
* Transforms full URLs into Relay format: /relay/{domain}/{path}
|
|
16
16
|
*/
|
|
@@ -92,18 +92,31 @@ function buildAbortHandle({ maxTimeSeconds, callerSignal, }) {
|
|
|
92
92
|
const FetchInitSdkValidationSchema = z
|
|
93
93
|
.looseObject(FetchInitZapierFieldsSchema.shape)
|
|
94
94
|
.optional();
|
|
95
|
-
const validateFetchInit = createValidator(FetchInitSdkValidationSchema);
|
|
96
95
|
/**
|
|
97
96
|
* Fetch plugin, the primary way to make authenticated HTTP requests through Zapier's Relay service.
|
|
98
97
|
* Mirrors the native fetch(url, init?) signature with additional Zapier-specific options.
|
|
99
98
|
*/
|
|
100
99
|
export const fetchPlugin = definePlugin((sdk) => {
|
|
100
|
+
// Bind the validator to the head's `adaptError` so validation
|
|
101
|
+
// failures surface as `ZapierValidationError` rather than the
|
|
102
|
+
// neutral `CoreError` kitcore would otherwise fall back to.
|
|
103
|
+
const validateFetchInit = createValidator(FetchInitSdkValidationSchema, {
|
|
104
|
+
adaptError: sdk.context.core?.adaptError,
|
|
105
|
+
});
|
|
101
106
|
return {
|
|
102
107
|
fetch: async function fetch(url, init) {
|
|
103
|
-
return
|
|
108
|
+
return runInMethodScope(async () => {
|
|
104
109
|
const { api } = sdk.context;
|
|
110
|
+
const { onMethodStart, onMethodEnd } = sdk.context.hooks;
|
|
105
111
|
const startTime = Date.now();
|
|
106
|
-
const
|
|
112
|
+
const depth = getCurrentDepth();
|
|
113
|
+
const args = init === undefined ? [url] : [url, init];
|
|
114
|
+
onMethodStart?.({
|
|
115
|
+
methodName: "fetch",
|
|
116
|
+
args,
|
|
117
|
+
isPaginated: false,
|
|
118
|
+
depth,
|
|
119
|
+
});
|
|
107
120
|
try {
|
|
108
121
|
if (init) {
|
|
109
122
|
validateFetchInit(init);
|
|
@@ -167,17 +180,13 @@ export const fetchPlugin = definePlugin((sdk) => {
|
|
|
167
180
|
statusCode: result.status,
|
|
168
181
|
});
|
|
169
182
|
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
argument_count: init ? 2 : 1,
|
|
178
|
-
is_paginated: false,
|
|
179
|
-
});
|
|
180
|
-
}
|
|
183
|
+
onMethodEnd?.({
|
|
184
|
+
methodName: "fetch",
|
|
185
|
+
args,
|
|
186
|
+
isPaginated: false,
|
|
187
|
+
depth,
|
|
188
|
+
durationMs: Date.now() - startTime,
|
|
189
|
+
});
|
|
181
190
|
return result;
|
|
182
191
|
}
|
|
183
192
|
catch (error) {
|
|
@@ -192,17 +201,14 @@ export const fetchPlugin = definePlugin((sdk) => {
|
|
|
192
201
|
}
|
|
193
202
|
}
|
|
194
203
|
catch (error) {
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
is_paginated: false,
|
|
204
|
-
});
|
|
205
|
-
}
|
|
204
|
+
onMethodEnd?.({
|
|
205
|
+
methodName: "fetch",
|
|
206
|
+
args,
|
|
207
|
+
isPaginated: false,
|
|
208
|
+
depth,
|
|
209
|
+
durationMs: Date.now() - startTime,
|
|
210
|
+
error: error instanceof Error ? error : new Error(String(error)),
|
|
211
|
+
});
|
|
206
212
|
throw error;
|
|
207
213
|
}
|
|
208
214
|
});
|
|
@@ -215,7 +221,11 @@ export const fetchPlugin = definePlugin((sdk) => {
|
|
|
215
221
|
"(OAuth tokens, API keys, etc.) into the outgoing request. " +
|
|
216
222
|
"Mirrors the native fetch(url, init?) signature with additional Zapier-specific options.",
|
|
217
223
|
packages: ["sdk", "cli", "mcp"],
|
|
218
|
-
|
|
224
|
+
// Auto-derive would produce "Http"/"Https" from the key alone;
|
|
225
|
+
// declare the title explicitly here so the registry renders
|
|
226
|
+
// "HTTP Request". Other plugins in this category use the bare
|
|
227
|
+
// string "http"; the object form wins regardless of order.
|
|
228
|
+
categories: [{ key: "http", title: "HTTP Request" }],
|
|
219
229
|
returnType: "Response",
|
|
220
230
|
inputParameters: [
|
|
221
231
|
{ name: "url", schema: FetchUrlSchema },
|
|
@@ -20,7 +20,7 @@ export declare const findFirstConnectionPlugin: (sdk: {
|
|
|
20
20
|
cursor?: string;
|
|
21
21
|
pageSize?: number;
|
|
22
22
|
maxItems?: number;
|
|
23
|
-
}) | undefined) => import("
|
|
23
|
+
}) | undefined) => import("kitcore").PaginatedSdkResult<{
|
|
24
24
|
date: string;
|
|
25
25
|
is_invite_only: boolean;
|
|
26
26
|
is_private: boolean;
|
|
@@ -52,14 +52,14 @@ export declare const findFirstConnectionPlugin: (sdk: {
|
|
|
52
52
|
} & {
|
|
53
53
|
context: {
|
|
54
54
|
meta: {
|
|
55
|
-
listConnections: import("
|
|
55
|
+
listConnections: import("kitcore").PluginMeta<unknown>;
|
|
56
56
|
};
|
|
57
57
|
};
|
|
58
58
|
} & {
|
|
59
59
|
context: import("../eventEmission").EventEmissionContext;
|
|
60
60
|
} & {
|
|
61
61
|
context: {
|
|
62
|
-
meta: Record<string, import("
|
|
62
|
+
meta: Record<string, import("kitcore").PluginMeta>;
|
|
63
63
|
};
|
|
64
64
|
}) => {
|
|
65
65
|
findFirstConnection: (options?: {
|
|
@@ -107,7 +107,7 @@ export declare const findFirstConnectionPlugin: (sdk: {
|
|
|
107
107
|
} & {
|
|
108
108
|
context: {
|
|
109
109
|
meta: {
|
|
110
|
-
findFirstConnection: import("
|
|
110
|
+
findFirstConnection: import("kitcore").PluginMeta<unknown>;
|
|
111
111
|
};
|
|
112
112
|
};
|
|
113
113
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/findFirstConnection/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/findFirstConnection/index.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BrC,CAAC;AAEF,MAAM,MAAM,iCAAiC,GAAG,UAAU,CACxD,OAAO,yBAAyB,CACjC,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { definePlugin } from "
|
|
2
|
-
import { createPluginMethod } from "
|
|
1
|
+
import { definePlugin } from "kitcore";
|
|
2
|
+
import { createPluginMethod } from "kitcore";
|
|
3
3
|
import { FindFirstConnectionSchema } from "./schemas";
|
|
4
4
|
import { ConnectionItemSchema } from "../../schemas/Connection";
|
|
5
|
+
import { connectionItemFormatter } from "../../formatters/connection";
|
|
5
6
|
import { ZapierResourceNotFoundError } from "../../types/errors";
|
|
6
7
|
export const findFirstConnectionPlugin = definePlugin((sdk) => createPluginMethod(sdk, {
|
|
7
8
|
name: "findFirstConnection",
|
|
@@ -10,6 +11,7 @@ export const findFirstConnectionPlugin = definePlugin((sdk) => createPluginMetho
|
|
|
10
11
|
itemType: "Connection",
|
|
11
12
|
inputSchema: FindFirstConnectionSchema,
|
|
12
13
|
outputSchema: ConnectionItemSchema,
|
|
14
|
+
formatter: connectionItemFormatter,
|
|
13
15
|
handler: async ({ sdk, options = {} }) => {
|
|
14
16
|
const connectionsResponse = await sdk.listConnections({
|
|
15
17
|
...options,
|
|
@@ -4,10 +4,10 @@ export declare const FindFirstConnectionSchema: z.ZodObject<{
|
|
|
4
4
|
title: z.ZodOptional<z.ZodString>;
|
|
5
5
|
search: z.ZodOptional<z.ZodString>;
|
|
6
6
|
appKey: z.ZodOptional<z.ZodString & {
|
|
7
|
-
_def: z.core.$ZodStringDef & import("
|
|
7
|
+
_def: z.core.$ZodStringDef & import("kitcore").PositionalMetadata;
|
|
8
8
|
}>;
|
|
9
9
|
app: z.ZodOptional<z.ZodString & {
|
|
10
|
-
_def: z.core.$ZodStringDef & import("
|
|
10
|
+
_def: z.core.$ZodStringDef & import("kitcore").PositionalMetadata;
|
|
11
11
|
}>;
|
|
12
12
|
owner: z.ZodOptional<z.ZodString>;
|
|
13
13
|
account: z.ZodOptional<z.ZodString>;
|
|
@@ -20,7 +20,7 @@ export declare const findUniqueConnectionPlugin: (sdk: {
|
|
|
20
20
|
cursor?: string;
|
|
21
21
|
pageSize?: number;
|
|
22
22
|
maxItems?: number;
|
|
23
|
-
}) | undefined) => import("
|
|
23
|
+
}) | undefined) => import("kitcore").PaginatedSdkResult<{
|
|
24
24
|
date: string;
|
|
25
25
|
is_invite_only: boolean;
|
|
26
26
|
is_private: boolean;
|
|
@@ -52,14 +52,14 @@ export declare const findUniqueConnectionPlugin: (sdk: {
|
|
|
52
52
|
} & {
|
|
53
53
|
context: {
|
|
54
54
|
meta: {
|
|
55
|
-
listConnections: import("
|
|
55
|
+
listConnections: import("kitcore").PluginMeta<unknown>;
|
|
56
56
|
};
|
|
57
57
|
};
|
|
58
58
|
} & {
|
|
59
59
|
context: import("../eventEmission").EventEmissionContext;
|
|
60
60
|
} & {
|
|
61
61
|
context: {
|
|
62
|
-
meta: Record<string, import("
|
|
62
|
+
meta: Record<string, import("kitcore").PluginMeta>;
|
|
63
63
|
};
|
|
64
64
|
}) => {
|
|
65
65
|
findUniqueConnection: (options?: {
|
|
@@ -107,7 +107,7 @@ export declare const findUniqueConnectionPlugin: (sdk: {
|
|
|
107
107
|
} & {
|
|
108
108
|
context: {
|
|
109
109
|
meta: {
|
|
110
|
-
findUniqueConnection: import("
|
|
110
|
+
findUniqueConnection: import("kitcore").PluginMeta<unknown>;
|
|
111
111
|
};
|
|
112
112
|
};
|
|
113
113
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/findUniqueConnection/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/findUniqueConnection/index.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCtC,CAAC;AAEF,MAAM,MAAM,kCAAkC,GAAG,UAAU,CACzD,OAAO,0BAA0B,CAClC,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { definePlugin } from "
|
|
2
|
-
import { createPluginMethod } from "
|
|
1
|
+
import { definePlugin } from "kitcore";
|
|
2
|
+
import { createPluginMethod } from "kitcore";
|
|
3
3
|
import { FindUniqueConnectionSchema } from "./schemas";
|
|
4
4
|
import { ZapierResourceNotFoundError, ZapierValidationError, } from "../../types/errors";
|
|
5
5
|
import { ConnectionItemSchema } from "../../schemas/Connection";
|
|
6
|
+
import { connectionItemFormatter } from "../../formatters/connection";
|
|
6
7
|
export const findUniqueConnectionPlugin = definePlugin((sdk) => createPluginMethod(sdk, {
|
|
7
8
|
name: "findUniqueConnection",
|
|
8
9
|
categories: ["connection"],
|
|
@@ -10,6 +11,7 @@ export const findUniqueConnectionPlugin = definePlugin((sdk) => createPluginMeth
|
|
|
10
11
|
itemType: "Connection",
|
|
11
12
|
inputSchema: FindUniqueConnectionSchema,
|
|
12
13
|
outputSchema: ConnectionItemSchema,
|
|
14
|
+
formatter: connectionItemFormatter,
|
|
13
15
|
handler: async ({ sdk, options = {} }) => {
|
|
14
16
|
const connectionsResponse = await sdk.listConnections({
|
|
15
17
|
...options,
|
|
@@ -4,10 +4,10 @@ export declare const FindUniqueConnectionSchema: z.ZodObject<{
|
|
|
4
4
|
title: z.ZodOptional<z.ZodString>;
|
|
5
5
|
search: z.ZodOptional<z.ZodString>;
|
|
6
6
|
appKey: z.ZodOptional<z.ZodString & {
|
|
7
|
-
_def: z.core.$ZodStringDef & import("
|
|
7
|
+
_def: z.core.$ZodStringDef & import("kitcore").PositionalMetadata;
|
|
8
8
|
}>;
|
|
9
9
|
app: z.ZodOptional<z.ZodString & {
|
|
10
|
-
_def: z.core.$ZodStringDef & import("
|
|
10
|
+
_def: z.core.$ZodStringDef & import("kitcore").PositionalMetadata;
|
|
11
11
|
}>;
|
|
12
12
|
owner: z.ZodOptional<z.ZodString>;
|
|
13
13
|
account: z.ZodOptional<z.ZodString>;
|