@zapier/zapier-sdk 0.65.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 +41 -0
- package/README.md +64 -34
- 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 +1598 -1323
- package/dist/experimental.d.mts +3476 -224
- package/dist/experimental.d.ts +3508 -256
- package/dist/experimental.d.ts.map +1 -1
- package/dist/experimental.js +117 -87
- package/dist/experimental.mjs +1585 -1322
- 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-JhNxS_mq.d.mts → index-Dh0b5NAY.d.mts} +13207 -7904
- package/dist/{index-JhNxS_mq.d.ts → index-Dh0b5NAY.d.ts} +13207 -7904
- package/dist/index.cjs +1729 -1469
- 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 +1716 -1468
- 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 +2 -2
- package/dist/plugins/codeSubstrate/getTriggerRun/index.js +1 -1
- 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 +55 -2
- package/dist/plugins/codeSubstrate/getWorkflowRun/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/getWorkflowRun/index.js +1 -1
- 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 +28 -3
- package/dist/plugins/codeSubstrate/listWorkflowRuns/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/listWorkflowRuns/index.js +1 -1
- 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/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 +3 -2
- package/dist/resolvers/workflowRunId.d.ts.map +1 -1
- package/dist/resolvers/workflowRunId.js +5 -5
- 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
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import type { ZapierSdk } from "../sdk";
|
|
3
|
-
export interface FormattedItem {
|
|
4
|
-
title: string;
|
|
5
|
-
id?: string;
|
|
6
|
-
key?: string;
|
|
7
|
-
keys?: string[];
|
|
8
|
-
description?: string;
|
|
9
|
-
data?: unknown;
|
|
10
|
-
details: Array<{
|
|
11
|
-
label?: string;
|
|
12
|
-
text: string;
|
|
13
|
-
style: "normal" | "dim" | "accent" | "warning" | "success";
|
|
14
|
-
}>;
|
|
15
|
-
}
|
|
16
|
-
export interface FormatMetadata<TItem = unknown> {
|
|
17
|
-
format: (item: TItem) => FormattedItem;
|
|
18
|
-
}
|
|
19
|
-
export interface OutputFormatter<TItem = unknown, TParams = Record<string, unknown>, TContext = unknown> {
|
|
20
|
-
fetch?: (sdk: ZapierSdk, params: TParams, item: TItem, context: TContext | undefined) => Promise<TContext>;
|
|
21
|
-
format: (item: TItem, context?: TContext) => FormattedItem;
|
|
22
|
-
}
|
|
23
|
-
export declare function withFormatter<T extends z.ZodType>(schema: T, formatMeta: FormatMetadata<z.infer<T>>): T;
|
|
24
|
-
export declare function getOutputSchema(inputSchema: z.ZodType): z.ZodType | undefined;
|
|
25
|
-
export declare function withOutputSchema<T extends z.ZodType>(inputSchema: T, outputSchema: z.ZodType): T & {
|
|
26
|
-
_def: T["_def"] & {
|
|
27
|
-
outputSchema: z.ZodType;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
export interface PromptConfig {
|
|
31
|
-
type: "list" | "checkbox" | "confirm";
|
|
32
|
-
name: string;
|
|
33
|
-
message: string;
|
|
34
|
-
choices?: Array<{
|
|
35
|
-
name: string;
|
|
36
|
-
value: unknown;
|
|
37
|
-
/**
|
|
38
|
-
* Optional secondary info shown after `name`. The CLI wraps it in
|
|
39
|
-
* dimmed parens; an array is joined with ", ". Use for keys, ids, or
|
|
40
|
-
* other context that's useful but shouldn't compete visually with
|
|
41
|
-
* the primary label.
|
|
42
|
-
*/
|
|
43
|
-
hint?: string | string[];
|
|
44
|
-
}>;
|
|
45
|
-
default?: unknown;
|
|
46
|
-
filter?: (value: unknown) => unknown;
|
|
47
|
-
/**
|
|
48
|
-
* Return `true` for valid; a string for a custom invalid message; or
|
|
49
|
-
* `false` for invalid with a generic fallback message ("X: invalid
|
|
50
|
-
* value."). Prefer returning a string so users see something specific.
|
|
51
|
-
*/
|
|
52
|
-
validate?: (value: unknown) => boolean | string;
|
|
53
|
-
}
|
|
54
|
-
/** A PromptConfig narrowed to single-select list mode. */
|
|
55
|
-
export type ListPromptConfig = PromptConfig & {
|
|
56
|
-
type: "list";
|
|
57
|
-
};
|
|
58
|
-
export interface Resolver {
|
|
59
|
-
type: string;
|
|
60
|
-
depends?: readonly string[] | string[];
|
|
61
|
-
}
|
|
62
|
-
export interface StaticResolver extends Resolver {
|
|
63
|
-
type: "static";
|
|
64
|
-
inputType?: "text" | "password" | "email";
|
|
65
|
-
placeholder?: string;
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* A resolver that always resolves to a fixed value, never prompts. Use to
|
|
69
|
-
* pin an implicit parameter that downstream resolvers or SDK calls require
|
|
70
|
-
* but the user shouldn't have to provide. Triggers, for example, are always
|
|
71
|
-
* `actionType: "read"` from the SDK's perspective; createTriggerInbox
|
|
72
|
-
* declares `actionType: { type: "constant", value: "read" }` so the
|
|
73
|
-
* standard `actionKeyResolver` and `inputsResolver` (which depend on
|
|
74
|
-
* `actionType`) work without any pinned variants.
|
|
75
|
-
*
|
|
76
|
-
* Constants attached to keys that aren't in the schema are seeded into
|
|
77
|
-
* `resolvedParams` upfront, so dependent resolvers find them in context
|
|
78
|
-
* without the key appearing in the user-facing surface (TS option type,
|
|
79
|
-
* CLI flags, generated docs).
|
|
80
|
-
*/
|
|
81
|
-
export interface ConstantResolver extends Resolver {
|
|
82
|
-
type: "constant";
|
|
83
|
-
value: unknown;
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Fields shared by both variants of {@link DynamicResolver}.
|
|
87
|
-
*/
|
|
88
|
-
interface DynamicResolverBase<TItem, TParams> extends Resolver {
|
|
89
|
-
type: "dynamic";
|
|
90
|
-
prompt: (items: TItem[], params: TParams) => PromptConfig;
|
|
91
|
-
/** Capabilities that expand results. The parameter resolver shows a hint for any that aren't enabled. */
|
|
92
|
-
requireCapabilities?: string[];
|
|
93
|
-
/**
|
|
94
|
-
* Optional hook called before fetch/prompt. If it returns a non-null object,
|
|
95
|
-
* resolvedValue is used directly and fetch/prompt are skipped entirely. Return
|
|
96
|
-
* null to fall through to the normal resolution flow. Implementations should
|
|
97
|
-
* catch their own errors and return null on failure rather than throwing, so
|
|
98
|
-
* that a transient API error does not block the CLI entirely.
|
|
99
|
-
*/
|
|
100
|
-
tryResolveWithoutPrompt?: (sdk: ZapierSdk, params: TParams) => Promise<{
|
|
101
|
-
resolvedValue: unknown;
|
|
102
|
-
} | null>;
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* The classic dynamic-resolver variant: `fetch` returns a list of items
|
|
106
|
-
* that the CLI renders as a search-filterable dropdown. The user picks one.
|
|
107
|
-
*/
|
|
108
|
-
export interface DynamicListResolver<TItem, TParams> extends DynamicResolverBase<TItem, TParams> {
|
|
109
|
-
/** Explicitly absent on the list variant — set `inputType: "search"` to opt into the search variant. */
|
|
110
|
-
inputType?: never;
|
|
111
|
-
/** Only meaningful for the search variant; set to `never` here so TS catches misuse. */
|
|
112
|
-
placeholder?: never;
|
|
113
|
-
fetch: (sdk: ZapierSdk, resolvedParams: TParams) => PromiseLike<TItem[] | {
|
|
114
|
-
data: TItem[];
|
|
115
|
-
nextCursor?: string;
|
|
116
|
-
} | AsyncIterable<{
|
|
117
|
-
data: TItem[];
|
|
118
|
-
nextCursor?: string;
|
|
119
|
-
}>>;
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* The search-input variant: the CLI prompts the user for free-form text
|
|
123
|
-
* first, then calls `fetch` with `{ ...resolvedParams, search }`.
|
|
124
|
-
*
|
|
125
|
-
* `fetch` can short-circuit by returning a primitive (`string | number`),
|
|
126
|
-
* which the CLI treats as an exact match — no dropdown is rendered. Any
|
|
127
|
-
* other return (array, page, async iterable) is rendered as the normal
|
|
128
|
-
* search-filterable dropdown.
|
|
129
|
-
*
|
|
130
|
-
* The `search` key is injected by the CLI at call time; it isn't part of
|
|
131
|
-
* `TParams` because callers that invoke `fetch` directly (outside the CLI)
|
|
132
|
-
* are responsible for passing it themselves. Search-mode resolvers should
|
|
133
|
-
* type `TParams` as `{ search?: string; ...otherDeps }` to make this
|
|
134
|
-
* explicit.
|
|
135
|
-
*/
|
|
136
|
-
export interface DynamicSearchResolver<TItem, TParams> extends Omit<DynamicResolverBase<TItem, TParams>, "prompt"> {
|
|
137
|
-
inputType: "search";
|
|
138
|
-
/**
|
|
139
|
-
* Hint text appended to the search prompt's message. NOT used as
|
|
140
|
-
* inquirer's `default` value, because inquirer prefills `default` as
|
|
141
|
-
* editable text that the user has to delete before typing.
|
|
142
|
-
*/
|
|
143
|
-
placeholder?: string;
|
|
144
|
-
/**
|
|
145
|
-
* Search-mode always renders a single-select @inquirer/search dropdown,
|
|
146
|
-
* so `prompt` must return a list-typed PromptConfig. Checkbox/confirm
|
|
147
|
-
* configs would be silently ignored at runtime; the type narrows so
|
|
148
|
-
* misuse fails at compile time.
|
|
149
|
-
*
|
|
150
|
-
* Note: a primitive return from `fetch` (string | number) is treated
|
|
151
|
-
* as an exact match and short-circuits without running this prompt or
|
|
152
|
-
* the resolver's validate/filter. Canonicalize inside `fetch` if the
|
|
153
|
-
* exact-match path needs normalization.
|
|
154
|
-
*/
|
|
155
|
-
prompt: (items: TItem[], params: TParams) => ListPromptConfig;
|
|
156
|
-
fetch: (sdk: ZapierSdk, resolvedParams: TParams) => PromiseLike<string | number | TItem[] | {
|
|
157
|
-
data: TItem[];
|
|
158
|
-
nextCursor?: string;
|
|
159
|
-
} | AsyncIterable<{
|
|
160
|
-
data: TItem[];
|
|
161
|
-
nextCursor?: string;
|
|
162
|
-
}>>;
|
|
163
|
-
}
|
|
164
|
-
/**
|
|
165
|
-
* A dynamic resolver — either a classic list (`inputType` absent) or a
|
|
166
|
-
* search-input variant (`inputType: "search"`). The discriminator is the
|
|
167
|
-
* `inputType` field; TS narrows to the right variant when you check it.
|
|
168
|
-
*/
|
|
169
|
-
export type DynamicResolver<TItem = unknown, TParams = Record<string, unknown>> = DynamicListResolver<TItem, TParams> | DynamicSearchResolver<TItem, TParams>;
|
|
170
|
-
export interface ResolverFieldItem {
|
|
171
|
-
type: string;
|
|
172
|
-
key: string;
|
|
173
|
-
title?: string;
|
|
174
|
-
is_required?: boolean;
|
|
175
|
-
value_type?: string;
|
|
176
|
-
choices?: Array<{
|
|
177
|
-
label: string;
|
|
178
|
-
value: string;
|
|
179
|
-
}>;
|
|
180
|
-
fields?: ResolverFieldItem[];
|
|
181
|
-
resolver?: ResolverMetadata<any, any>;
|
|
182
|
-
}
|
|
183
|
-
export interface FieldsResolver<TParams = Record<string, unknown>, TResult = Record<string, unknown>> extends Resolver {
|
|
184
|
-
type: "fields";
|
|
185
|
-
fetch: (sdk: ZapierSdk, resolvedParams: TParams) => Promise<ResolverFieldItem[]>;
|
|
186
|
-
transform?: (value: Record<string, unknown>) => TResult;
|
|
187
|
-
}
|
|
188
|
-
export interface ArrayResolver<TParams = Record<string, unknown>> extends Resolver {
|
|
189
|
-
type: "array";
|
|
190
|
-
fetch: (sdk: ZapierSdk, resolvedParams: TParams) => Promise<ResolverMetadata<unknown, TParams>>;
|
|
191
|
-
minItems?: number;
|
|
192
|
-
maxItems?: number;
|
|
193
|
-
}
|
|
194
|
-
export type ResolverMetadata<TItem = unknown, TParams = Record<string, unknown>> = StaticResolver | ConstantResolver | DynamicResolver<TItem, TParams> | FieldsResolver<TParams> | ArrayResolver<TParams>;
|
|
195
|
-
export interface ResolverConfig<TItem = unknown, TParams = Record<string, unknown>> {
|
|
196
|
-
resolver: ResolverMetadata<TItem, TParams>;
|
|
197
|
-
}
|
|
198
|
-
export declare function withResolver<T extends z.ZodType, TItem = unknown, TParams = Record<string, unknown>>(schema: T, config: ResolverConfig<TItem, TParams>): T;
|
|
199
|
-
export declare function getSchemaDescription(schema: z.ZodSchema): string | undefined;
|
|
200
|
-
export declare function getFieldDescriptions(schema: z.ZodObject<z.ZodRawShape>): Record<string, string>;
|
|
201
|
-
export interface PositionalMetadata {
|
|
202
|
-
positionalMeta: {
|
|
203
|
-
positional: true;
|
|
204
|
-
};
|
|
205
|
-
}
|
|
206
|
-
export declare function withPositional<T extends z.ZodType>(schema: T): T & {
|
|
207
|
-
_def: T["_def"] & PositionalMetadata;
|
|
208
|
-
};
|
|
209
|
-
export declare function isPositional(schema: z.ZodType): boolean;
|
|
210
|
-
export {};
|
|
211
|
-
//# sourceMappingURL=schema-utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema-utils.d.ts","sourceRoot":"","sources":["../../src/utils/schema-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAMxC,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,WAAW,CAAC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AAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAWxB;AAMD,MAAM,WAAW,kBAAkB;IACjC,cAAc,EAAE;QACd,UAAU,EAAE,IAAI,CAAC;KAClB,CAAC;CACH;AAGD,wBAAgB,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,EAChD,MAAM,EAAE,CAAC,GACR,CAAC,GAAG;IACL,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,kBAAkB,CAAC;CACtC,CAQA;AAWD,wBAAgB,YAAY,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,GAAG,OAAO,CAqBvD"}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
// Helper function to add format metadata to schemas
|
|
3
|
-
export function withFormatter(schema, formatMeta) {
|
|
4
|
-
// Store format metadata on the schema definition
|
|
5
|
-
Object.assign(schema._zod.def, {
|
|
6
|
-
formatMeta: formatMeta,
|
|
7
|
-
});
|
|
8
|
-
return schema;
|
|
9
|
-
}
|
|
10
|
-
// Helper function to get output schema from an input schema
|
|
11
|
-
export function getOutputSchema(inputSchema) {
|
|
12
|
-
return inputSchema._zod.def.outputSchema;
|
|
13
|
-
}
|
|
14
|
-
// Helper function to link input schemas to output schemas
|
|
15
|
-
export function withOutputSchema(inputSchema, outputSchema) {
|
|
16
|
-
// Store output schema reference on the input schema
|
|
17
|
-
Object.assign(inputSchema._zod.def, {
|
|
18
|
-
outputSchema,
|
|
19
|
-
});
|
|
20
|
-
return inputSchema;
|
|
21
|
-
}
|
|
22
|
-
// Helper function to add resolver metadata to schemas
|
|
23
|
-
export function withResolver(schema, config) {
|
|
24
|
-
// Store resolver metadata on the schema definition
|
|
25
|
-
schema._zod.def.resolverMeta = config;
|
|
26
|
-
return schema;
|
|
27
|
-
}
|
|
28
|
-
// ============================================================================
|
|
29
|
-
// Schema Description Utilities
|
|
30
|
-
// ============================================================================
|
|
31
|
-
export function getSchemaDescription(schema) {
|
|
32
|
-
return schema.description;
|
|
33
|
-
}
|
|
34
|
-
export function getFieldDescriptions(schema) {
|
|
35
|
-
const descriptions = {};
|
|
36
|
-
const shape = schema.shape;
|
|
37
|
-
for (const [key, fieldSchema] of Object.entries(shape)) {
|
|
38
|
-
if (fieldSchema instanceof z.ZodType && fieldSchema.description) {
|
|
39
|
-
descriptions[key] = fieldSchema.description;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
return descriptions;
|
|
43
|
-
}
|
|
44
|
-
// Helper function to mark a parameter as positional for CLI
|
|
45
|
-
export function withPositional(schema) {
|
|
46
|
-
// Store positional metadata on the schema definition
|
|
47
|
-
Object.assign(schema._zod.def, {
|
|
48
|
-
positionalMeta: { positional: true },
|
|
49
|
-
});
|
|
50
|
-
return schema;
|
|
51
|
-
}
|
|
52
|
-
function schemaHasPositionalMeta(schema) {
|
|
53
|
-
return "positionalMeta" in schema._zod.def;
|
|
54
|
-
}
|
|
55
|
-
// Helper function to check if a parameter should be positional
|
|
56
|
-
export function isPositional(schema) {
|
|
57
|
-
// Check the current schema first
|
|
58
|
-
if (schemaHasPositionalMeta(schema) &&
|
|
59
|
-
schema._zod.def
|
|
60
|
-
.positionalMeta?.positional) {
|
|
61
|
-
return true;
|
|
62
|
-
}
|
|
63
|
-
// If this is a ZodOptional, check the inner type
|
|
64
|
-
if (schema instanceof z.ZodOptional) {
|
|
65
|
-
return isPositional(schema._zod.def.innerType);
|
|
66
|
-
}
|
|
67
|
-
// If this is a ZodDefault, check the inner type
|
|
68
|
-
if (schema instanceof z.ZodDefault) {
|
|
69
|
-
return isPositional(schema._zod.def.innerType);
|
|
70
|
-
}
|
|
71
|
-
return false;
|
|
72
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* String utility functions for the Zapier SDK
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Converts a string to title case, handling various input formats:
|
|
6
|
-
* - camelCase: "firstName" → "First Name"
|
|
7
|
-
* - snake_case: "first_name" → "First Name"
|
|
8
|
-
* - kebab-case: "first-name" → "First Name"
|
|
9
|
-
* - mixed formats: "first_name-value" → "First Name Value"
|
|
10
|
-
*/
|
|
11
|
-
export declare function toTitleCase(input: string): string;
|
|
12
|
-
/**
|
|
13
|
-
* Converts a string to snake_case, handling various input formats:
|
|
14
|
-
* - camelCase: "firstName" → "first_name"
|
|
15
|
-
* - kebab-case: "first-name" → "first_name"
|
|
16
|
-
* - title case: "First Name" → "first_name"
|
|
17
|
-
* - mixed formats: "first-Name Value" → "first_name_value"
|
|
18
|
-
* - starts with number: "123abc" → "_123abc"
|
|
19
|
-
*/
|
|
20
|
-
export declare function toSnakeCase(input: string): string;
|
|
21
|
-
/**
|
|
22
|
-
* Strips the "Page" suffix from a function name, used for deriving method names
|
|
23
|
-
* from paginated function implementations.
|
|
24
|
-
*
|
|
25
|
-
* This is commonly used with `createPaginatedFunction` where the internal function
|
|
26
|
-
* has a "Page" suffix (e.g., "listAppsPage") but the public method name should not
|
|
27
|
-
* (e.g., "listApps").
|
|
28
|
-
*
|
|
29
|
-
* @param functionName - The function name, typically from `function.name`
|
|
30
|
-
* @returns The function name with "Page" suffix removed, or original if no suffix
|
|
31
|
-
*
|
|
32
|
-
* @example
|
|
33
|
-
* ```typescript
|
|
34
|
-
* stripPageSuffix("listAppsPage") // "listApps"
|
|
35
|
-
* stripPageSuffix("listApps") // "listApps" (no change)
|
|
36
|
-
* stripPageSuffix("myPageFunction") // "myPageFunction" (only strips from end)
|
|
37
|
-
* ```
|
|
38
|
-
*/
|
|
39
|
-
export declare function stripPageSuffix(functionName: string): string;
|
|
40
|
-
//# sourceMappingURL=string-utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"string-utils.d.ts","sourceRoot":"","sources":["../../src/utils/string-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAcjD;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAkBjD;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAE5D"}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* String utility functions for the Zapier SDK
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Converts a string to title case, handling various input formats:
|
|
6
|
-
* - camelCase: "firstName" → "First Name"
|
|
7
|
-
* - snake_case: "first_name" → "First Name"
|
|
8
|
-
* - kebab-case: "first-name" → "First Name"
|
|
9
|
-
* - mixed formats: "first_name-value" → "First Name Value"
|
|
10
|
-
*/
|
|
11
|
-
export function toTitleCase(input) {
|
|
12
|
-
return (input
|
|
13
|
-
// insert a space before capital letters (handles camelCase)
|
|
14
|
-
.replace(/([a-z0-9])([A-Z])/g, "$1 $2")
|
|
15
|
-
// replace delimiters (underscore, dash, multiple spaces) with single space
|
|
16
|
-
.replace(/[_\-]+/g, " ")
|
|
17
|
-
.replace(/\s+/g, " ")
|
|
18
|
-
.trim()
|
|
19
|
-
// split and capitalize each word
|
|
20
|
-
.split(" ")
|
|
21
|
-
.map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())
|
|
22
|
-
.join(" "));
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Converts a string to snake_case, handling various input formats:
|
|
26
|
-
* - camelCase: "firstName" → "first_name"
|
|
27
|
-
* - kebab-case: "first-name" → "first_name"
|
|
28
|
-
* - title case: "First Name" → "first_name"
|
|
29
|
-
* - mixed formats: "first-Name Value" → "first_name_value"
|
|
30
|
-
* - starts with number: "123abc" → "_123abc"
|
|
31
|
-
*/
|
|
32
|
-
export function toSnakeCase(input) {
|
|
33
|
-
let result = input
|
|
34
|
-
// insert underscore before capital letters (handles camelCase)
|
|
35
|
-
.replace(/([a-z0-9])([A-Z])/g, "$1_$2")
|
|
36
|
-
// replace spaces and dashes with underscores
|
|
37
|
-
.replace(/[\s\-]+/g, "_")
|
|
38
|
-
// replace multiple underscores with single underscore
|
|
39
|
-
.replace(/_+/g, "_")
|
|
40
|
-
// remove leading/trailing underscores and convert to lowercase
|
|
41
|
-
.replace(/^_|_$/g, "")
|
|
42
|
-
.toLowerCase();
|
|
43
|
-
// If the result starts with a number, prefix with underscore
|
|
44
|
-
if (/^[0-9]/.test(result)) {
|
|
45
|
-
result = "_" + result;
|
|
46
|
-
}
|
|
47
|
-
return result;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Strips the "Page" suffix from a function name, used for deriving method names
|
|
51
|
-
* from paginated function implementations.
|
|
52
|
-
*
|
|
53
|
-
* This is commonly used with `createPaginatedFunction` where the internal function
|
|
54
|
-
* has a "Page" suffix (e.g., "listAppsPage") but the public method name should not
|
|
55
|
-
* (e.g., "listApps").
|
|
56
|
-
*
|
|
57
|
-
* @param functionName - The function name, typically from `function.name`
|
|
58
|
-
* @returns The function name with "Page" suffix removed, or original if no suffix
|
|
59
|
-
*
|
|
60
|
-
* @example
|
|
61
|
-
* ```typescript
|
|
62
|
-
* stripPageSuffix("listAppsPage") // "listApps"
|
|
63
|
-
* stripPageSuffix("listApps") // "listApps" (no change)
|
|
64
|
-
* stripPageSuffix("myPageFunction") // "myPageFunction" (only strips from end)
|
|
65
|
-
* ```
|
|
66
|
-
*/
|
|
67
|
-
export function stripPageSuffix(functionName) {
|
|
68
|
-
return functionName.replace(/Page$/, "");
|
|
69
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Async-local storage context for per-invocation telemetry state. Each top-level
|
|
3
|
-
* SDK method call runs in its own ALS scope (via runWithTelemetryContext), isolating
|
|
4
|
-
* its depth counter and method metadata from concurrent calls.
|
|
5
|
-
*/
|
|
6
|
-
export interface MethodMetadata {
|
|
7
|
-
selectedApi?: string | null;
|
|
8
|
-
operationType?: string | null;
|
|
9
|
-
operationKey?: string | null;
|
|
10
|
-
}
|
|
11
|
-
export declare function isTelemetryNested(): boolean;
|
|
12
|
-
export declare function runWithTelemetryContext<T>(fn: () => T): T;
|
|
13
|
-
export declare function setMethodMetadata(metadata: MethodMetadata): void;
|
|
14
|
-
export declare function getMethodMetadata(): MethodMetadata | undefined;
|
|
15
|
-
//# sourceMappingURL=telemetry-context.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"telemetry-context.d.ts","sourceRoot":"","sources":["../../src/utils/telemetry-context.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH,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;AAwBD,wBAAgB,iBAAiB,IAAI,OAAO,CAI3C;AAED,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAIzD;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI,CAKhE;AAED,wBAAgB,iBAAiB,IAAI,cAAc,GAAG,SAAS,CAG9D"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Async-local storage context for per-invocation telemetry state. Each top-level
|
|
3
|
-
* SDK method call runs in its own ALS scope (via runWithTelemetryContext), isolating
|
|
4
|
-
* its depth counter and method metadata from concurrent calls.
|
|
5
|
-
*/
|
|
6
|
-
import { AsyncLocalStorage, } from "node:async_hooks";
|
|
7
|
-
// Static import of `AsyncLocalStorage` works in both CJS and ESM tsup bundles
|
|
8
|
-
// because tsup converts the import statement directly (to `require()` in CJS,
|
|
9
|
-
// kept as native `import` in ESM), bypassing the `__require` shim that
|
|
10
|
-
// silently broke the previous `require("node:async_hooks")` pattern in ESM —
|
|
11
|
-
// the bug that left ESM consumers (notably the CLI) without a telemetry
|
|
12
|
-
// store and dropped nested-call detection on every call.
|
|
13
|
-
//
|
|
14
|
-
// Browsers can't resolve `node:async_hooks` at bundle time; consumers who
|
|
15
|
-
// bundle the SDK for browsers need to mark this module external or polyfill
|
|
16
|
-
// it. The try/catch covers any other instantiation failure.
|
|
17
|
-
let telemetryStore = null;
|
|
18
|
-
try {
|
|
19
|
-
telemetryStore = new AsyncLocalStorage();
|
|
20
|
-
}
|
|
21
|
-
catch {
|
|
22
|
-
// Non-Node environment (browser, etc.) — telemetry context disabled.
|
|
23
|
-
}
|
|
24
|
-
export function isTelemetryNested() {
|
|
25
|
-
if (!telemetryStore)
|
|
26
|
-
return true;
|
|
27
|
-
const store = telemetryStore.getStore();
|
|
28
|
-
return store !== undefined && store.depth > 0;
|
|
29
|
-
}
|
|
30
|
-
export function runWithTelemetryContext(fn) {
|
|
31
|
-
if (!telemetryStore)
|
|
32
|
-
return fn();
|
|
33
|
-
const currentDepth = telemetryStore.getStore()?.depth ?? -1;
|
|
34
|
-
return telemetryStore.run({ depth: currentDepth + 1 }, fn);
|
|
35
|
-
}
|
|
36
|
-
export function setMethodMetadata(metadata) {
|
|
37
|
-
if (!telemetryStore)
|
|
38
|
-
return;
|
|
39
|
-
const store = telemetryStore.getStore();
|
|
40
|
-
if (!store)
|
|
41
|
-
return;
|
|
42
|
-
store.methodMetadata = { ...store.methodMetadata, ...metadata };
|
|
43
|
-
}
|
|
44
|
-
export function getMethodMetadata() {
|
|
45
|
-
if (!telemetryStore)
|
|
46
|
-
return undefined;
|
|
47
|
-
return telemetryStore.getStore()?.methodMetadata;
|
|
48
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type { TelemetryCallbacks } from "./function-utils";
|
|
2
|
-
import type { EventEmissionContext } from "../plugins/eventEmission";
|
|
3
|
-
/**
|
|
4
|
-
* Creates a standardized telemetry callback for SDK method invocations.
|
|
5
|
-
*
|
|
6
|
-
* This factory eliminates boilerplate by providing a consistent implementation
|
|
7
|
-
* of the onMethodCalled callback used by createFunction and createPaginatedFunction.
|
|
8
|
-
*
|
|
9
|
-
* @param emitMethodCalled - The event emission function from EventEmissionContext
|
|
10
|
-
* @param methodName - The method name to report in telemetry. Use `function.name` to derive
|
|
11
|
-
* this automatically from the function declaration, ensuring DRY principles and making
|
|
12
|
-
* refactoring easier. Function names are preserved through bundling.
|
|
13
|
-
* @returns TelemetryCallbacks object with standardized onMethodCalled implementation
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* Basic usage with createFunction:
|
|
17
|
-
* ```typescript
|
|
18
|
-
* async function listApps(options: ListAppsOptions) { ... }
|
|
19
|
-
*
|
|
20
|
-
* const listAppsDefinition = createFunction(
|
|
21
|
-
* listApps,
|
|
22
|
-
* ListAppsSchema,
|
|
23
|
-
* createTelemetryCallback(context.eventEmission.emitMethodCalled, listApps.name),
|
|
24
|
-
* );
|
|
25
|
-
* ```
|
|
26
|
-
*
|
|
27
|
-
* @example
|
|
28
|
-
* For paginated functions, use stripPageSuffix to remove the "Page" suffix:
|
|
29
|
-
* ```typescript
|
|
30
|
-
* import { stripPageSuffix } from "./string-utils";
|
|
31
|
-
*
|
|
32
|
-
* async function listAppsPage(options: ListAppsOptions & { pageSize: number }) { ... }
|
|
33
|
-
*
|
|
34
|
-
* const methodName = stripPageSuffix(listAppsPage.name);
|
|
35
|
-
* const listAppsDefinition = createPaginatedFunction(
|
|
36
|
-
* listAppsPage,
|
|
37
|
-
* ListAppsSchema,
|
|
38
|
-
* createTelemetryCallback(context.eventEmission.emitMethodCalled, methodName),
|
|
39
|
-
* methodName,
|
|
40
|
-
* );
|
|
41
|
-
* ```
|
|
42
|
-
*/
|
|
43
|
-
export declare function createTelemetryCallback(emitMethodCalled: EventEmissionContext["eventEmission"]["emitMethodCalled"], methodName: string): TelemetryCallbacks;
|
|
44
|
-
//# sourceMappingURL=telemetry-utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"telemetry-utils.d.ts","sourceRoot":"","sources":["../../src/utils/telemetry-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAGrE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAgB,uBAAuB,CACrC,gBAAgB,EAAE,oBAAoB,CAAC,eAAe,CAAC,CAAC,kBAAkB,CAAC,EAC3E,UAAU,EAAE,MAAM,GACjB,kBAAkB,CAkBpB"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { getMethodMetadata } from "./telemetry-context";
|
|
2
|
-
/**
|
|
3
|
-
* Creates a standardized telemetry callback for SDK method invocations.
|
|
4
|
-
*
|
|
5
|
-
* This factory eliminates boilerplate by providing a consistent implementation
|
|
6
|
-
* of the onMethodCalled callback used by createFunction and createPaginatedFunction.
|
|
7
|
-
*
|
|
8
|
-
* @param emitMethodCalled - The event emission function from EventEmissionContext
|
|
9
|
-
* @param methodName - The method name to report in telemetry. Use `function.name` to derive
|
|
10
|
-
* this automatically from the function declaration, ensuring DRY principles and making
|
|
11
|
-
* refactoring easier. Function names are preserved through bundling.
|
|
12
|
-
* @returns TelemetryCallbacks object with standardized onMethodCalled implementation
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* Basic usage with createFunction:
|
|
16
|
-
* ```typescript
|
|
17
|
-
* async function listApps(options: ListAppsOptions) { ... }
|
|
18
|
-
*
|
|
19
|
-
* const listAppsDefinition = createFunction(
|
|
20
|
-
* listApps,
|
|
21
|
-
* ListAppsSchema,
|
|
22
|
-
* createTelemetryCallback(context.eventEmission.emitMethodCalled, listApps.name),
|
|
23
|
-
* );
|
|
24
|
-
* ```
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* For paginated functions, use stripPageSuffix to remove the "Page" suffix:
|
|
28
|
-
* ```typescript
|
|
29
|
-
* import { stripPageSuffix } from "./string-utils";
|
|
30
|
-
*
|
|
31
|
-
* async function listAppsPage(options: ListAppsOptions & { pageSize: number }) { ... }
|
|
32
|
-
*
|
|
33
|
-
* const methodName = stripPageSuffix(listAppsPage.name);
|
|
34
|
-
* const listAppsDefinition = createPaginatedFunction(
|
|
35
|
-
* listAppsPage,
|
|
36
|
-
* ListAppsSchema,
|
|
37
|
-
* createTelemetryCallback(context.eventEmission.emitMethodCalled, methodName),
|
|
38
|
-
* methodName,
|
|
39
|
-
* );
|
|
40
|
-
* ```
|
|
41
|
-
*/
|
|
42
|
-
export function createTelemetryCallback(emitMethodCalled, methodName) {
|
|
43
|
-
return {
|
|
44
|
-
onMethodCalled: (data) => {
|
|
45
|
-
const metadata = getMethodMetadata();
|
|
46
|
-
emitMethodCalled({
|
|
47
|
-
method_name: methodName,
|
|
48
|
-
execution_duration_ms: data.durationMs,
|
|
49
|
-
success_flag: data.success,
|
|
50
|
-
error_message: data.error?.message ?? null,
|
|
51
|
-
error_type: data.error?.constructor.name ?? null,
|
|
52
|
-
argument_count: data.argumentCount,
|
|
53
|
-
is_paginated: data.isPaginated,
|
|
54
|
-
selected_api: metadata?.selectedApi ?? null,
|
|
55
|
-
operation_type: metadata?.operationType ?? null,
|
|
56
|
-
operation_key: metadata?.operationKey ?? null,
|
|
57
|
-
});
|
|
58
|
-
},
|
|
59
|
-
};
|
|
60
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { z } from "zod";
|
|
2
|
-
export declare function createValidator<TSchema extends z.ZodSchema>(schema: TSchema): (input: unknown) => z.infer<TSchema>;
|
|
3
|
-
export declare const validateOptions: <TOptions, TSchemaOptions extends TOptions>(schema: z.ZodSchema<TSchemaOptions>, options: TOptions) => TSchemaOptions;
|
|
4
|
-
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/utils/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAgC7B,wBAAgB,eAAe,CAAC,OAAO,SAAS,CAAC,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,IAC/C,OAAO,OAAO,KAAG,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAG7D;AAED,eAAO,MAAM,eAAe,GAAI,QAAQ,EAAE,cAAc,SAAS,QAAQ,EACvE,QAAQ,CAAC,CAAC,SAAS,CAAC,cAAc,CAAC,EACnC,SAAS,QAAQ,mBAGlB,CAAC"}
|
package/dist/utils/validation.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { ZapierValidationError } from "../types/errors";
|
|
2
|
-
/**
|
|
3
|
-
* Throws clean ZapierValidationError on validation failures
|
|
4
|
-
*/
|
|
5
|
-
const validate = (schema, input) => {
|
|
6
|
-
const result = schema.safeParse(input);
|
|
7
|
-
if (!result.success) {
|
|
8
|
-
// Format Zod errors into a clean, user-friendly message
|
|
9
|
-
const errorMessages = result.error.issues.map((error) => {
|
|
10
|
-
const path = error.path.length > 0 ? error.path.join(".") : "input";
|
|
11
|
-
return `${path}: ${error.message}`;
|
|
12
|
-
});
|
|
13
|
-
const message = `Validation failed:\n ${errorMessages.join("\n ")}`;
|
|
14
|
-
throw new ZapierValidationError(message, {
|
|
15
|
-
details: {
|
|
16
|
-
zodErrors: result.error.issues,
|
|
17
|
-
input,
|
|
18
|
-
},
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
return result.data;
|
|
22
|
-
};
|
|
23
|
-
export function createValidator(schema) {
|
|
24
|
-
return function validateFn(input) {
|
|
25
|
-
return validate(schema, input);
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
export const validateOptions = (schema, options) => {
|
|
29
|
-
return validate(schema, options);
|
|
30
|
-
};
|