@zapier/zapier-sdk 0.18.3 → 0.19.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 +44 -32
- package/dist/index.cjs +658 -693
- package/dist/index.d.mts +272 -138
- package/dist/index.d.ts +2541 -40
- package/dist/index.mjs +638 -692
- package/package.json +14 -13
- package/dist/api/auth.d.ts +0 -19
- package/dist/api/auth.d.ts.map +0 -1
- package/dist/api/auth.js +0 -70
- package/dist/api/auth.test.d.ts +0 -2
- package/dist/api/auth.test.d.ts.map +0 -1
- package/dist/api/auth.test.js +0 -220
- package/dist/api/client.d.ts +0 -9
- package/dist/api/client.d.ts.map +0 -1
- package/dist/api/client.integration.test.d.ts +0 -5
- package/dist/api/client.integration.test.d.ts.map +0 -1
- package/dist/api/client.integration.test.js +0 -318
- package/dist/api/client.js +0 -374
- package/dist/api/client.methods.test.d.ts +0 -2
- package/dist/api/client.methods.test.d.ts.map +0 -1
- package/dist/api/client.methods.test.js +0 -158
- package/dist/api/client.test.d.ts +0 -2
- package/dist/api/client.test.d.ts.map +0 -1
- package/dist/api/client.test.js +0 -96
- package/dist/api/debug.d.ts +0 -14
- package/dist/api/debug.d.ts.map +0 -1
- package/dist/api/debug.js +0 -131
- package/dist/api/debug.test.d.ts +0 -2
- package/dist/api/debug.test.d.ts.map +0 -1
- package/dist/api/debug.test.js +0 -59
- package/dist/api/index.d.ts +0 -30
- package/dist/api/index.d.ts.map +0 -1
- package/dist/api/index.js +0 -43
- package/dist/api/polling.d.ts +0 -46
- package/dist/api/polling.d.ts.map +0 -1
- package/dist/api/polling.js +0 -139
- package/dist/api/polling.test.d.ts +0 -2
- package/dist/api/polling.test.d.ts.map +0 -1
- package/dist/api/polling.test.js +0 -318
- package/dist/api/router.d.ts +0 -16
- package/dist/api/router.d.ts.map +0 -1
- package/dist/api/router.js +0 -31
- package/dist/api/router.test.d.ts +0 -2
- package/dist/api/router.test.d.ts.map +0 -1
- package/dist/api/router.test.js +0 -103
- package/dist/api/schemas.d.ts +0 -531
- package/dist/api/schemas.d.ts.map +0 -1
- package/dist/api/schemas.js +0 -389
- package/dist/api/types.d.ts +0 -82
- package/dist/api/types.d.ts.map +0 -1
- package/dist/api/types.js +0 -1
- package/dist/auth.d.ts +0 -52
- package/dist/auth.d.ts.map +0 -1
- package/dist/auth.js +0 -72
- package/dist/auth.test.d.ts +0 -2
- package/dist/auth.test.d.ts.map +0 -1
- package/dist/auth.test.js +0 -102
- package/dist/constants.d.ts +0 -14
- package/dist/constants.d.ts.map +0 -1
- package/dist/constants.js +0 -13
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -42
- package/dist/plugins/api/index.d.ts +0 -12
- package/dist/plugins/api/index.d.ts.map +0 -1
- package/dist/plugins/api/index.js +0 -24
- package/dist/plugins/apps/index.d.ts +0 -15
- package/dist/plugins/apps/index.d.ts.map +0 -1
- package/dist/plugins/apps/index.js +0 -112
- package/dist/plugins/apps/schemas.d.ts +0 -42
- package/dist/plugins/apps/schemas.d.ts.map +0 -1
- package/dist/plugins/apps/schemas.js +0 -14
- package/dist/plugins/eventEmission/builders.d.ts +0 -14
- package/dist/plugins/eventEmission/builders.d.ts.map +0 -1
- package/dist/plugins/eventEmission/builders.js +0 -109
- package/dist/plugins/eventEmission/index.d.ts +0 -38
- package/dist/plugins/eventEmission/index.d.ts.map +0 -1
- package/dist/plugins/eventEmission/index.js +0 -336
- package/dist/plugins/eventEmission/index.test.d.ts +0 -5
- package/dist/plugins/eventEmission/index.test.d.ts.map +0 -1
- package/dist/plugins/eventEmission/index.test.js +0 -581
- package/dist/plugins/eventEmission/transport.d.ts +0 -27
- package/dist/plugins/eventEmission/transport.d.ts.map +0 -1
- package/dist/plugins/eventEmission/transport.js +0 -104
- package/dist/plugins/eventEmission/transport.test.d.ts +0 -5
- package/dist/plugins/eventEmission/transport.test.d.ts.map +0 -1
- package/dist/plugins/eventEmission/transport.test.js +0 -164
- package/dist/plugins/eventEmission/types.d.ts +0 -63
- package/dist/plugins/eventEmission/types.d.ts.map +0 -1
- package/dist/plugins/eventEmission/types.js +0 -1
- package/dist/plugins/eventEmission/utils.d.ts +0 -45
- package/dist/plugins/eventEmission/utils.d.ts.map +0 -1
- package/dist/plugins/eventEmission/utils.js +0 -114
- package/dist/plugins/fetch/index.d.ts +0 -36
- package/dist/plugins/fetch/index.d.ts.map +0 -1
- package/dist/plugins/fetch/index.js +0 -62
- package/dist/plugins/fetch/schemas.d.ts +0 -19
- package/dist/plugins/fetch/schemas.d.ts.map +0 -1
- package/dist/plugins/fetch/schemas.js +0 -31
- package/dist/plugins/findFirstAuthentication/index.d.ts +0 -21
- package/dist/plugins/findFirstAuthentication/index.d.ts.map +0 -1
- package/dist/plugins/findFirstAuthentication/index.js +0 -36
- package/dist/plugins/findFirstAuthentication/index.test.d.ts +0 -2
- package/dist/plugins/findFirstAuthentication/index.test.d.ts.map +0 -1
- package/dist/plugins/findFirstAuthentication/index.test.js +0 -177
- package/dist/plugins/findFirstAuthentication/schemas.d.ts +0 -20
- package/dist/plugins/findFirstAuthentication/schemas.d.ts.map +0 -1
- package/dist/plugins/findFirstAuthentication/schemas.js +0 -18
- package/dist/plugins/findUniqueAuthentication/index.d.ts +0 -21
- package/dist/plugins/findUniqueAuthentication/index.d.ts.map +0 -1
- package/dist/plugins/findUniqueAuthentication/index.js +0 -39
- package/dist/plugins/findUniqueAuthentication/index.test.d.ts +0 -2
- package/dist/plugins/findUniqueAuthentication/index.test.d.ts.map +0 -1
- package/dist/plugins/findUniqueAuthentication/index.test.js +0 -159
- package/dist/plugins/findUniqueAuthentication/schemas.d.ts +0 -20
- package/dist/plugins/findUniqueAuthentication/schemas.d.ts.map +0 -1
- package/dist/plugins/findUniqueAuthentication/schemas.js +0 -18
- package/dist/plugins/getAction/index.d.ts +0 -25
- package/dist/plugins/getAction/index.d.ts.map +0 -1
- package/dist/plugins/getAction/index.js +0 -42
- package/dist/plugins/getAction/index.test.d.ts +0 -2
- package/dist/plugins/getAction/index.test.d.ts.map +0 -1
- package/dist/plugins/getAction/index.test.js +0 -211
- package/dist/plugins/getAction/schemas.d.ts +0 -30
- package/dist/plugins/getAction/schemas.d.ts.map +0 -1
- package/dist/plugins/getAction/schemas.js +0 -12
- package/dist/plugins/getApp/index.d.ts +0 -21
- package/dist/plugins/getApp/index.d.ts.map +0 -1
- package/dist/plugins/getApp/index.js +0 -44
- package/dist/plugins/getApp/index.test.d.ts +0 -2
- package/dist/plugins/getApp/index.test.d.ts.map +0 -1
- package/dist/plugins/getApp/index.test.js +0 -157
- package/dist/plugins/getApp/schemas.d.ts +0 -16
- package/dist/plugins/getApp/schemas.d.ts.map +0 -1
- package/dist/plugins/getApp/schemas.js +0 -8
- package/dist/plugins/getAuthentication/index.d.ts +0 -21
- package/dist/plugins/getAuthentication/index.d.ts.map +0 -1
- package/dist/plugins/getAuthentication/index.js +0 -29
- package/dist/plugins/getAuthentication/index.test.d.ts +0 -2
- package/dist/plugins/getAuthentication/index.test.d.ts.map +0 -1
- package/dist/plugins/getAuthentication/index.test.js +0 -106
- package/dist/plugins/getAuthentication/schemas.d.ts +0 -7
- package/dist/plugins/getAuthentication/schemas.d.ts.map +0 -1
- package/dist/plugins/getAuthentication/schemas.js +0 -1
- package/dist/plugins/getInputFieldsSchema/index.d.ts +0 -23
- package/dist/plugins/getInputFieldsSchema/index.d.ts.map +0 -1
- package/dist/plugins/getInputFieldsSchema/index.js +0 -53
- package/dist/plugins/getInputFieldsSchema/index.test.d.ts +0 -2
- package/dist/plugins/getInputFieldsSchema/index.test.d.ts.map +0 -1
- package/dist/plugins/getInputFieldsSchema/index.test.js +0 -291
- package/dist/plugins/getInputFieldsSchema/schemas.d.ts +0 -28
- package/dist/plugins/getInputFieldsSchema/schemas.d.ts.map +0 -1
- package/dist/plugins/getInputFieldsSchema/schemas.js +0 -13
- package/dist/plugins/getProfile/index.d.ts +0 -25
- package/dist/plugins/getProfile/index.d.ts.map +0 -1
- package/dist/plugins/getProfile/index.js +0 -39
- package/dist/plugins/getProfile/schemas.d.ts +0 -13
- package/dist/plugins/getProfile/schemas.d.ts.map +0 -1
- package/dist/plugins/getProfile/schemas.js +0 -6
- package/dist/plugins/listActions/index.d.ts +0 -30
- package/dist/plugins/listActions/index.d.ts.map +0 -1
- package/dist/plugins/listActions/index.js +0 -75
- package/dist/plugins/listActions/index.test.d.ts +0 -2
- package/dist/plugins/listActions/index.test.d.ts.map +0 -1
- package/dist/plugins/listActions/index.test.js +0 -453
- package/dist/plugins/listActions/schemas.d.ts +0 -35
- package/dist/plugins/listActions/schemas.d.ts.map +0 -1
- package/dist/plugins/listActions/schemas.js +0 -22
- package/dist/plugins/listApps/index.d.ts +0 -25
- package/dist/plugins/listApps/index.d.ts.map +0 -1
- package/dist/plugins/listApps/index.js +0 -69
- package/dist/plugins/listApps/index.test.d.ts +0 -2
- package/dist/plugins/listApps/index.test.d.ts.map +0 -1
- package/dist/plugins/listApps/index.test.js +0 -141
- package/dist/plugins/listApps/schemas.d.ts +0 -26
- package/dist/plugins/listApps/schemas.d.ts.map +0 -1
- package/dist/plugins/listApps/schemas.js +0 -19
- package/dist/plugins/listAuthentications/index.d.ts +0 -24
- package/dist/plugins/listAuthentications/index.d.ts.map +0 -1
- package/dist/plugins/listAuthentications/index.js +0 -77
- package/dist/plugins/listAuthentications/index.test.d.ts +0 -2
- package/dist/plugins/listAuthentications/index.test.d.ts.map +0 -1
- package/dist/plugins/listAuthentications/index.test.js +0 -832
- package/dist/plugins/listAuthentications/schemas.d.ts +0 -30
- package/dist/plugins/listAuthentications/schemas.d.ts.map +0 -1
- package/dist/plugins/listAuthentications/schemas.js +0 -32
- package/dist/plugins/listInputFieldChoices/index.d.ts +0 -33
- package/dist/plugins/listInputFieldChoices/index.d.ts.map +0 -1
- package/dist/plugins/listInputFieldChoices/index.js +0 -115
- package/dist/plugins/listInputFieldChoices/index.test.d.ts +0 -2
- package/dist/plugins/listInputFieldChoices/index.test.d.ts.map +0 -1
- package/dist/plugins/listInputFieldChoices/index.test.js +0 -717
- package/dist/plugins/listInputFieldChoices/schemas.d.ts +0 -43
- package/dist/plugins/listInputFieldChoices/schemas.d.ts.map +0 -1
- package/dist/plugins/listInputFieldChoices/schemas.js +0 -65
- package/dist/plugins/listInputFields/index.d.ts +0 -34
- package/dist/plugins/listInputFields/index.d.ts.map +0 -1
- package/dist/plugins/listInputFields/index.js +0 -204
- package/dist/plugins/listInputFields/index.test.d.ts +0 -2
- package/dist/plugins/listInputFields/index.test.d.ts.map +0 -1
- package/dist/plugins/listInputFields/index.test.js +0 -359
- package/dist/plugins/listInputFields/schemas.d.ts +0 -35
- package/dist/plugins/listInputFields/schemas.d.ts.map +0 -1
- package/dist/plugins/listInputFields/schemas.js +0 -23
- package/dist/plugins/manifest/index.d.ts +0 -85
- package/dist/plugins/manifest/index.d.ts.map +0 -1
- package/dist/plugins/manifest/index.js +0 -376
- package/dist/plugins/manifest/index.test.d.ts +0 -2
- package/dist/plugins/manifest/index.test.d.ts.map +0 -1
- package/dist/plugins/manifest/index.test.js +0 -1139
- package/dist/plugins/manifest/schemas.d.ts +0 -57
- package/dist/plugins/manifest/schemas.d.ts.map +0 -1
- package/dist/plugins/manifest/schemas.js +0 -50
- package/dist/plugins/registry/index.d.ts +0 -21
- package/dist/plugins/registry/index.d.ts.map +0 -1
- package/dist/plugins/registry/index.js +0 -117
- package/dist/plugins/request/index.d.ts +0 -21
- package/dist/plugins/request/index.d.ts.map +0 -1
- package/dist/plugins/request/index.js +0 -76
- package/dist/plugins/request/index.test.d.ts +0 -2
- package/dist/plugins/request/index.test.d.ts.map +0 -1
- package/dist/plugins/request/index.test.js +0 -337
- package/dist/plugins/request/schemas.d.ts +0 -54
- package/dist/plugins/request/schemas.d.ts.map +0 -1
- package/dist/plugins/request/schemas.js +0 -41
- package/dist/plugins/runAction/index.d.ts +0 -33
- package/dist/plugins/runAction/index.d.ts.map +0 -1
- package/dist/plugins/runAction/index.js +0 -108
- package/dist/plugins/runAction/index.test.d.ts +0 -2
- package/dist/plugins/runAction/index.test.d.ts.map +0 -1
- package/dist/plugins/runAction/index.test.js +0 -333
- package/dist/plugins/runAction/schemas.d.ts +0 -34
- package/dist/plugins/runAction/schemas.d.ts.map +0 -1
- package/dist/plugins/runAction/schemas.js +0 -23
- package/dist/resolvers/actionKey.d.ts +0 -15
- package/dist/resolvers/actionKey.d.ts.map +0 -1
- package/dist/resolvers/actionKey.js +0 -19
- package/dist/resolvers/actionType.d.ts +0 -10
- package/dist/resolvers/actionType.d.ts.map +0 -1
- package/dist/resolvers/actionType.js +0 -21
- package/dist/resolvers/appKey.d.ts +0 -3
- package/dist/resolvers/appKey.d.ts.map +0 -1
- package/dist/resolvers/appKey.js +0 -5
- package/dist/resolvers/authenticationId.d.ts +0 -9
- package/dist/resolvers/authenticationId.d.ts.map +0 -1
- package/dist/resolvers/authenticationId.js +0 -42
- package/dist/resolvers/index.d.ts +0 -8
- package/dist/resolvers/index.d.ts.map +0 -1
- package/dist/resolvers/index.js +0 -8
- package/dist/resolvers/inputFieldKey.d.ts +0 -11
- package/dist/resolvers/inputFieldKey.d.ts.map +0 -1
- package/dist/resolvers/inputFieldKey.js +0 -47
- package/dist/resolvers/inputs.d.ts +0 -17
- package/dist/resolvers/inputs.d.ts.map +0 -1
- package/dist/resolvers/inputs.js +0 -50
- package/dist/schemas/Action.d.ts +0 -24
- package/dist/schemas/Action.d.ts.map +0 -1
- package/dist/schemas/Action.js +0 -40
- package/dist/schemas/App.d.ts +0 -57
- package/dist/schemas/App.d.ts.map +0 -1
- package/dist/schemas/App.js +0 -31
- package/dist/schemas/Auth.d.ts +0 -55
- package/dist/schemas/Auth.d.ts.map +0 -1
- package/dist/schemas/Auth.js +0 -33
- package/dist/schemas/Field.d.ts +0 -61
- package/dist/schemas/Field.d.ts.map +0 -1
- package/dist/schemas/Field.js +0 -116
- package/dist/schemas/Run.d.ts +0 -3
- package/dist/schemas/Run.d.ts.map +0 -1
- package/dist/schemas/Run.js +0 -31
- package/dist/schemas/UserProfile.d.ts +0 -13
- package/dist/schemas/UserProfile.d.ts.map +0 -1
- package/dist/schemas/UserProfile.js +0 -32
- package/dist/sdk.d.ts +0 -146
- package/dist/sdk.d.ts.map +0 -1
- package/dist/sdk.js +0 -112
- package/dist/sdk.test.d.ts +0 -2
- package/dist/sdk.test.d.ts.map +0 -1
- package/dist/sdk.test.js +0 -255
- package/dist/services/implementations.d.ts +0 -63
- package/dist/services/implementations.d.ts.map +0 -1
- package/dist/services/implementations.js +0 -80
- package/dist/temporary-internal-core/handlers/listApps.d.ts +0 -67
- package/dist/temporary-internal-core/handlers/listApps.d.ts.map +0 -1
- package/dist/temporary-internal-core/handlers/listApps.js +0 -134
- package/dist/temporary-internal-core/handlers/listApps.test.d.ts +0 -2
- package/dist/temporary-internal-core/handlers/listApps.test.d.ts.map +0 -1
- package/dist/temporary-internal-core/handlers/listApps.test.js +0 -367
- package/dist/temporary-internal-core/index.d.ts +0 -18
- package/dist/temporary-internal-core/index.d.ts.map +0 -1
- package/dist/temporary-internal-core/index.js +0 -18
- package/dist/temporary-internal-core/schemas/apps/index.d.ts +0 -175
- package/dist/temporary-internal-core/schemas/apps/index.d.ts.map +0 -1
- package/dist/temporary-internal-core/schemas/apps/index.js +0 -97
- package/dist/temporary-internal-core/schemas/errors/index.d.ts +0 -139
- package/dist/temporary-internal-core/schemas/errors/index.d.ts.map +0 -1
- package/dist/temporary-internal-core/schemas/errors/index.js +0 -129
- package/dist/temporary-internal-core/schemas/implementations/index.d.ts +0 -127
- package/dist/temporary-internal-core/schemas/implementations/index.d.ts.map +0 -1
- package/dist/temporary-internal-core/schemas/implementations/index.js +0 -79
- package/dist/temporary-internal-core/types/handler.d.ts +0 -51
- package/dist/temporary-internal-core/types/handler.d.ts.map +0 -1
- package/dist/temporary-internal-core/types/handler.js +0 -8
- package/dist/temporary-internal-core/types/index.d.ts +0 -5
- package/dist/temporary-internal-core/types/index.d.ts.map +0 -1
- package/dist/temporary-internal-core/types/index.js +0 -4
- package/dist/temporary-internal-core/utils/app-locators.d.ts +0 -34
- package/dist/temporary-internal-core/utils/app-locators.d.ts.map +0 -1
- package/dist/temporary-internal-core/utils/app-locators.js +0 -39
- package/dist/temporary-internal-core/utils/string-utils.d.ts +0 -28
- package/dist/temporary-internal-core/utils/string-utils.d.ts.map +0 -1
- package/dist/temporary-internal-core/utils/string-utils.js +0 -52
- package/dist/temporary-internal-core/utils/transformations.d.ts +0 -18
- package/dist/temporary-internal-core/utils/transformations.d.ts.map +0 -1
- package/dist/temporary-internal-core/utils/transformations.js +0 -36
- package/dist/types/domain.d.ts +0 -52
- package/dist/types/domain.d.ts.map +0 -1
- package/dist/types/domain.js +0 -1
- package/dist/types/domain.test.d.ts +0 -2
- package/dist/types/domain.test.d.ts.map +0 -1
- package/dist/types/domain.test.js +0 -39
- package/dist/types/errors.d.ts +0 -143
- package/dist/types/errors.d.ts.map +0 -1
- package/dist/types/errors.js +0 -187
- package/dist/types/events.d.ts +0 -38
- package/dist/types/events.d.ts.map +0 -1
- package/dist/types/events.js +0 -7
- package/dist/types/functions.d.ts +0 -27
- package/dist/types/functions.d.ts.map +0 -1
- package/dist/types/functions.js +0 -1
- package/dist/types/plugin.d.ts +0 -75
- package/dist/types/plugin.d.ts.map +0 -1
- package/dist/types/plugin.js +0 -9
- package/dist/types/properties.d.ts +0 -33
- package/dist/types/properties.d.ts.map +0 -1
- package/dist/types/properties.js +0 -52
- package/dist/types/sdk.d.ts +0 -69
- package/dist/types/sdk.d.ts.map +0 -1
- package/dist/types/sdk.js +0 -4
- package/dist/types/telemetry-events.d.ts +0 -105
- package/dist/types/telemetry-events.d.ts.map +0 -1
- package/dist/types/telemetry-events.js +0 -8
- package/dist/utils/array-utils.d.ts +0 -31
- package/dist/utils/array-utils.d.ts.map +0 -1
- package/dist/utils/array-utils.js +0 -36
- package/dist/utils/array-utils.test.d.ts +0 -2
- package/dist/utils/array-utils.test.d.ts.map +0 -1
- package/dist/utils/array-utils.test.js +0 -107
- package/dist/utils/batch-utils.d.ts +0 -72
- package/dist/utils/batch-utils.d.ts.map +0 -1
- package/dist/utils/batch-utils.js +0 -162
- package/dist/utils/batch-utils.test.d.ts +0 -2
- package/dist/utils/batch-utils.test.d.ts.map +0 -1
- package/dist/utils/batch-utils.test.js +0 -476
- package/dist/utils/domain-utils.d.ts +0 -66
- package/dist/utils/domain-utils.d.ts.map +0 -1
- package/dist/utils/domain-utils.js +0 -164
- package/dist/utils/domain-utils.test.d.ts +0 -2
- package/dist/utils/domain-utils.test.d.ts.map +0 -1
- package/dist/utils/domain-utils.test.js +0 -346
- package/dist/utils/file-utils.d.ts +0 -4
- package/dist/utils/file-utils.d.ts.map +0 -1
- package/dist/utils/file-utils.js +0 -74
- package/dist/utils/file-utils.test.d.ts +0 -2
- package/dist/utils/file-utils.test.d.ts.map +0 -1
- package/dist/utils/file-utils.test.js +0 -51
- package/dist/utils/function-utils.d.ts +0 -73
- package/dist/utils/function-utils.d.ts.map +0 -1
- package/dist/utils/function-utils.js +0 -245
- package/dist/utils/function-utils.test.d.ts +0 -2
- package/dist/utils/function-utils.test.d.ts.map +0 -1
- package/dist/utils/function-utils.test.js +0 -110
- package/dist/utils/id-utils.d.ts +0 -13
- package/dist/utils/id-utils.d.ts.map +0 -1
- package/dist/utils/id-utils.js +0 -22
- package/dist/utils/id-utils.test.d.ts +0 -2
- package/dist/utils/id-utils.test.d.ts.map +0 -1
- package/dist/utils/id-utils.test.js +0 -22
- package/dist/utils/pagination-utils.d.ts +0 -37
- package/dist/utils/pagination-utils.d.ts.map +0 -1
- package/dist/utils/pagination-utils.js +0 -165
- package/dist/utils/pagination-utils.test.d.ts +0 -17
- package/dist/utils/pagination-utils.test.d.ts.map +0 -1
- package/dist/utils/pagination-utils.test.js +0 -461
- package/dist/utils/retry-utils.d.ts +0 -45
- package/dist/utils/retry-utils.d.ts.map +0 -1
- package/dist/utils/retry-utils.js +0 -51
- package/dist/utils/retry-utils.test.d.ts +0 -2
- package/dist/utils/retry-utils.test.d.ts.map +0 -1
- package/dist/utils/retry-utils.test.js +0 -90
- package/dist/utils/schema-utils.d.ts +0 -69
- 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/string-utils.test.d.ts +0 -2
- package/dist/utils/string-utils.test.d.ts.map +0 -1
- package/dist/utils/string-utils.test.js +0 -59
- 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 -55
- package/dist/utils/telemetry-utils.test.d.ts +0 -2
- package/dist/utils/telemetry-utils.test.d.ts.map +0 -1
- package/dist/utils/telemetry-utils.test.js +0 -94
- package/dist/utils/url-utils.d.ts +0 -19
- package/dist/utils/url-utils.d.ts.map +0 -1
- package/dist/utils/url-utils.js +0 -62
- package/dist/utils/url-utils.test.d.ts +0 -2
- package/dist/utils/url-utils.test.d.ts.map +0 -1
- package/dist/utils/url-utils.test.js +0 -103
- package/dist/utils/validation.d.ts +0 -4
- package/dist/utils/validation.d.ts.map +0 -1
- package/dist/utils/validation.js +0 -30
- package/dist/utils/validation.test.d.ts +0 -2
- package/dist/utils/validation.test.d.ts.map +0 -1
- package/dist/utils/validation.test.js +0 -44
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Transport abstraction layer for event emission
|
|
3
|
-
*
|
|
4
|
-
* Provides configurable transport mechanisms for emitting telemetry events.
|
|
5
|
-
* All transports implement silent failure to prevent SDK disruption.
|
|
6
|
-
*/
|
|
7
|
-
// Constants for transport configuration
|
|
8
|
-
const DEFAULT_RETRY_ATTEMPTS = 2;
|
|
9
|
-
const DEFAULT_RETRY_DELAY_MS = 300;
|
|
10
|
-
// HTTP Transport - sends events to remote endpoint
|
|
11
|
-
export function createHttpTransport(config) {
|
|
12
|
-
const delay = async (ms) => {
|
|
13
|
-
return new Promise((resolve) => {
|
|
14
|
-
const timer = setTimeout(resolve, ms);
|
|
15
|
-
if (typeof timer.unref === "function") {
|
|
16
|
-
timer.unref();
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
};
|
|
20
|
-
const emitWithRetry = async (subject, event, attemptsLeft) => {
|
|
21
|
-
try {
|
|
22
|
-
const payload = {
|
|
23
|
-
subject,
|
|
24
|
-
properties: event,
|
|
25
|
-
};
|
|
26
|
-
const response = await fetch(config.endpoint, {
|
|
27
|
-
method: "POST",
|
|
28
|
-
headers: {
|
|
29
|
-
"Content-Type": "application/json",
|
|
30
|
-
...config.headers,
|
|
31
|
-
},
|
|
32
|
-
body: JSON.stringify(payload),
|
|
33
|
-
});
|
|
34
|
-
if (!response.ok && attemptsLeft > 1) {
|
|
35
|
-
await delay(config.retryDelayMs || DEFAULT_RETRY_DELAY_MS);
|
|
36
|
-
return emitWithRetry(subject, event, attemptsLeft - 1);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
catch (error) {
|
|
40
|
-
if (attemptsLeft > 1) {
|
|
41
|
-
await delay(config.retryDelayMs || DEFAULT_RETRY_DELAY_MS);
|
|
42
|
-
return emitWithRetry(subject, event, attemptsLeft - 1);
|
|
43
|
-
}
|
|
44
|
-
throw error;
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
return {
|
|
48
|
-
async emit(subject, event) {
|
|
49
|
-
try {
|
|
50
|
-
await emitWithRetry(subject, event, config.retryAttempts || DEFAULT_RETRY_ATTEMPTS);
|
|
51
|
-
}
|
|
52
|
-
catch {
|
|
53
|
-
// Silent failure - never throw
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
// Console Transport - logs events to console (for development)
|
|
59
|
-
export function createConsoleTransport() {
|
|
60
|
-
return {
|
|
61
|
-
async emit(subject, event) {
|
|
62
|
-
try {
|
|
63
|
-
console.log("[SDK Telemetry]", JSON.stringify({ subject, properties: event }, null, 2));
|
|
64
|
-
}
|
|
65
|
-
catch {
|
|
66
|
-
// Silent failure - never throw
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
// No-op Transport - discards all events (for testing/disabled state)
|
|
72
|
-
export function createNoopTransport() {
|
|
73
|
-
return {
|
|
74
|
-
async emit(_subject, _event) {
|
|
75
|
-
// Intentionally do nothing
|
|
76
|
-
},
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
// Transport factory
|
|
80
|
-
export function createTransport(config) {
|
|
81
|
-
try {
|
|
82
|
-
switch (config.type) {
|
|
83
|
-
case "http":
|
|
84
|
-
if (!config.endpoint) {
|
|
85
|
-
throw new Error("HTTP transport requires endpoint");
|
|
86
|
-
}
|
|
87
|
-
return createHttpTransport({
|
|
88
|
-
endpoint: config.endpoint,
|
|
89
|
-
headers: config.headers,
|
|
90
|
-
retryAttempts: config.retryAttempts,
|
|
91
|
-
retryDelayMs: config.retryDelayMs,
|
|
92
|
-
});
|
|
93
|
-
case "console":
|
|
94
|
-
return createConsoleTransport();
|
|
95
|
-
case "noop":
|
|
96
|
-
default:
|
|
97
|
-
return createNoopTransport();
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
catch {
|
|
101
|
-
// If transport creation fails, return noop to maintain silent operation
|
|
102
|
-
return createNoopTransport();
|
|
103
|
-
}
|
|
104
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transport.test.d.ts","sourceRoot":"","sources":["../../../src/plugins/eventEmission/transport.test.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tests for Event Transport Layer
|
|
3
|
-
*/
|
|
4
|
-
import { describe, it, expect, vi, beforeEach } from "vitest";
|
|
5
|
-
import { createHttpTransport, createConsoleTransport, createNoopTransport, createTransport, } from "./transport";
|
|
6
|
-
// Mock fetch globally
|
|
7
|
-
const mockFetch = vi.fn();
|
|
8
|
-
global.fetch = mockFetch;
|
|
9
|
-
// Mock console.log
|
|
10
|
-
const mockConsoleLog = vi.spyOn(console, "log").mockImplementation(() => { });
|
|
11
|
-
describe("Transport Layer", () => {
|
|
12
|
-
const sampleEvent = {
|
|
13
|
-
event_id: "test-123",
|
|
14
|
-
timestamp_ms: Date.now(),
|
|
15
|
-
release_id: "test-release",
|
|
16
|
-
error_message: "Test error",
|
|
17
|
-
is_user_facing: false,
|
|
18
|
-
};
|
|
19
|
-
const sampleSubject = "platform.sdk.ErrorOccurredEvent";
|
|
20
|
-
beforeEach(() => {
|
|
21
|
-
vi.clearAllMocks();
|
|
22
|
-
});
|
|
23
|
-
describe("createHttpTransport", () => {
|
|
24
|
-
it("should emit events via HTTP successfully", async () => {
|
|
25
|
-
mockFetch.mockResolvedValueOnce({
|
|
26
|
-
ok: true,
|
|
27
|
-
status: 200,
|
|
28
|
-
});
|
|
29
|
-
const transport = createHttpTransport({
|
|
30
|
-
endpoint: "https://telemetry.example.com/events",
|
|
31
|
-
headers: { "x-api-key": "test-key" },
|
|
32
|
-
});
|
|
33
|
-
await transport.emit(sampleSubject, sampleEvent);
|
|
34
|
-
expect(mockFetch).toHaveBeenCalledWith("https://telemetry.example.com/events", {
|
|
35
|
-
method: "POST",
|
|
36
|
-
headers: {
|
|
37
|
-
"Content-Type": "application/json",
|
|
38
|
-
"x-api-key": "test-key",
|
|
39
|
-
},
|
|
40
|
-
body: JSON.stringify({
|
|
41
|
-
subject: sampleSubject,
|
|
42
|
-
properties: sampleEvent,
|
|
43
|
-
}),
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
it("should retry on HTTP failures", async () => {
|
|
47
|
-
// Fail twice, then succeed
|
|
48
|
-
mockFetch
|
|
49
|
-
.mockResolvedValueOnce({ ok: false, status: 500 })
|
|
50
|
-
.mockResolvedValueOnce({ ok: false, status: 500 })
|
|
51
|
-
.mockResolvedValueOnce({ ok: true, status: 200 });
|
|
52
|
-
const transport = createHttpTransport({
|
|
53
|
-
endpoint: "https://telemetry.example.com/events",
|
|
54
|
-
retryAttempts: 3,
|
|
55
|
-
retryDelayMs: 10, // Short delay for testing
|
|
56
|
-
});
|
|
57
|
-
await transport.emit(sampleSubject, sampleEvent);
|
|
58
|
-
expect(mockFetch).toHaveBeenCalledTimes(3);
|
|
59
|
-
});
|
|
60
|
-
it("should handle network errors silently", async () => {
|
|
61
|
-
mockFetch.mockRejectedValue(new Error("Network error"));
|
|
62
|
-
const transport = createHttpTransport({
|
|
63
|
-
endpoint: "https://telemetry.example.com/events",
|
|
64
|
-
retryAttempts: 1,
|
|
65
|
-
retryDelayMs: 1,
|
|
66
|
-
});
|
|
67
|
-
// Should not throw despite network error
|
|
68
|
-
await expect(transport.emit(sampleSubject, sampleEvent)).resolves.toBeUndefined();
|
|
69
|
-
});
|
|
70
|
-
it("should stop retrying after max attempts", async () => {
|
|
71
|
-
mockFetch.mockResolvedValue({ ok: false, status: 500 });
|
|
72
|
-
const transport = createHttpTransport({
|
|
73
|
-
endpoint: "https://telemetry.example.com/events",
|
|
74
|
-
retryAttempts: 2,
|
|
75
|
-
retryDelayMs: 1,
|
|
76
|
-
});
|
|
77
|
-
await transport.emit(sampleSubject, sampleEvent);
|
|
78
|
-
expect(mockFetch).toHaveBeenCalledTimes(2);
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
describe("createConsoleTransport", () => {
|
|
82
|
-
it("should log events to console", async () => {
|
|
83
|
-
const transport = createConsoleTransport();
|
|
84
|
-
await transport.emit(sampleSubject, sampleEvent);
|
|
85
|
-
expect(mockConsoleLog).toHaveBeenCalledWith("[SDK Telemetry]", JSON.stringify({ subject: sampleSubject, properties: sampleEvent }, null, 2));
|
|
86
|
-
});
|
|
87
|
-
it("should handle console errors silently", async () => {
|
|
88
|
-
mockConsoleLog.mockImplementation(() => {
|
|
89
|
-
throw new Error("Console error");
|
|
90
|
-
});
|
|
91
|
-
const transport = createConsoleTransport();
|
|
92
|
-
// Should not throw despite console error
|
|
93
|
-
await expect(transport.emit(sampleSubject, sampleEvent)).resolves.toBeUndefined();
|
|
94
|
-
});
|
|
95
|
-
});
|
|
96
|
-
describe("createNoopTransport", () => {
|
|
97
|
-
it("should do nothing when emitting events", async () => {
|
|
98
|
-
const transport = createNoopTransport();
|
|
99
|
-
await transport.emit(sampleSubject, sampleEvent);
|
|
100
|
-
// Verify no side effects
|
|
101
|
-
expect(mockFetch).not.toHaveBeenCalled();
|
|
102
|
-
expect(mockConsoleLog).not.toHaveBeenCalled();
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
describe("createTransport", () => {
|
|
106
|
-
it("should create HTTP transport with valid config", async () => {
|
|
107
|
-
mockFetch.mockResolvedValueOnce({ ok: true, status: 200 });
|
|
108
|
-
const transport = createTransport({
|
|
109
|
-
type: "http",
|
|
110
|
-
endpoint: "https://example.com",
|
|
111
|
-
headers: { "x-key": "value" },
|
|
112
|
-
retryAttempts: 5,
|
|
113
|
-
retryDelayMs: 2000,
|
|
114
|
-
});
|
|
115
|
-
expect(transport.emit).toBeTypeOf("function");
|
|
116
|
-
await transport.emit(sampleSubject, sampleEvent);
|
|
117
|
-
expect(mockFetch).toHaveBeenCalledWith("https://example.com", expect.any(Object));
|
|
118
|
-
});
|
|
119
|
-
it("should create console transport", async () => {
|
|
120
|
-
const transport = createTransport({
|
|
121
|
-
type: "console",
|
|
122
|
-
});
|
|
123
|
-
expect(transport.emit).toBeTypeOf("function");
|
|
124
|
-
await transport.emit(sampleSubject, sampleEvent);
|
|
125
|
-
expect(mockConsoleLog).toHaveBeenCalled();
|
|
126
|
-
});
|
|
127
|
-
it("should create noop transport by default", async () => {
|
|
128
|
-
const transport = createTransport({
|
|
129
|
-
type: "noop",
|
|
130
|
-
});
|
|
131
|
-
expect(transport.emit).toBeTypeOf("function");
|
|
132
|
-
await transport.emit(sampleSubject, sampleEvent);
|
|
133
|
-
expect(mockFetch).not.toHaveBeenCalled();
|
|
134
|
-
expect(mockConsoleLog).not.toHaveBeenCalled();
|
|
135
|
-
});
|
|
136
|
-
it("should fallback to noop transport on invalid HTTP config", async () => {
|
|
137
|
-
const transport = createTransport({
|
|
138
|
-
type: "http",
|
|
139
|
-
// Missing endpoint
|
|
140
|
-
});
|
|
141
|
-
expect(transport.emit).toBeTypeOf("function");
|
|
142
|
-
await transport.emit(sampleSubject, sampleEvent);
|
|
143
|
-
expect(mockFetch).not.toHaveBeenCalled();
|
|
144
|
-
});
|
|
145
|
-
it("should fallback to noop transport on unknown type", async () => {
|
|
146
|
-
const transport = createTransport({
|
|
147
|
-
type: "unknown",
|
|
148
|
-
});
|
|
149
|
-
expect(transport.emit).toBeTypeOf("function");
|
|
150
|
-
await transport.emit(sampleSubject, sampleEvent);
|
|
151
|
-
expect(mockFetch).not.toHaveBeenCalled();
|
|
152
|
-
expect(mockConsoleLog).not.toHaveBeenCalled();
|
|
153
|
-
});
|
|
154
|
-
it("should handle transport creation errors gracefully", async () => {
|
|
155
|
-
expect(() => {
|
|
156
|
-
const transport = createTransport({
|
|
157
|
-
type: "http",
|
|
158
|
-
// Missing required endpoint - should fallback to noop
|
|
159
|
-
});
|
|
160
|
-
expect(transport.emit).toBeTypeOf("function");
|
|
161
|
-
}).not.toThrow();
|
|
162
|
-
});
|
|
163
|
-
});
|
|
164
|
-
});
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
export interface EventContext {
|
|
2
|
-
customuser_id?: number | null;
|
|
3
|
-
account_id?: number | null;
|
|
4
|
-
identity_id?: number | null;
|
|
5
|
-
visitor_id?: string | null;
|
|
6
|
-
correlation_id?: string | null;
|
|
7
|
-
selected_api?: string | null;
|
|
8
|
-
app_id?: number | null;
|
|
9
|
-
app_version_id?: number | null;
|
|
10
|
-
zap_id?: number | null;
|
|
11
|
-
node_id?: number | null;
|
|
12
|
-
environment?: string | null;
|
|
13
|
-
sdk_version?: string | null;
|
|
14
|
-
operation_type?: string | null;
|
|
15
|
-
}
|
|
16
|
-
export interface ErrorEventData {
|
|
17
|
-
error_message: string;
|
|
18
|
-
is_user_facing: boolean;
|
|
19
|
-
error_type?: string | null;
|
|
20
|
-
error_status_code?: number | null;
|
|
21
|
-
error_stack_trace?: string | null;
|
|
22
|
-
error_source_method?: string | null;
|
|
23
|
-
error_source_file?: string | null;
|
|
24
|
-
error_line_number?: number | null;
|
|
25
|
-
operation_type?: string | null;
|
|
26
|
-
operation_key?: string | null;
|
|
27
|
-
error_severity?: string | null;
|
|
28
|
-
is_recoverable?: boolean | null;
|
|
29
|
-
error_metadata?: Record<string, string | null> | null;
|
|
30
|
-
parent_error_id?: string | null;
|
|
31
|
-
error_occurred_timestamp_ms?: number | null;
|
|
32
|
-
error_code?: string | null;
|
|
33
|
-
recovery_attempted?: boolean | null;
|
|
34
|
-
recovery_action?: string | null;
|
|
35
|
-
recovery_successful?: boolean | null;
|
|
36
|
-
execution_time_before_error_ms?: number | null;
|
|
37
|
-
}
|
|
38
|
-
export interface EnhancedErrorEventData extends ErrorEventData {
|
|
39
|
-
execution_start_time?: number | null;
|
|
40
|
-
}
|
|
41
|
-
export interface ApplicationLifecycleEventData {
|
|
42
|
-
lifecycle_event_type: "startup" | "exit" | "signal_termination";
|
|
43
|
-
exit_code?: number | null;
|
|
44
|
-
signal_name?: string | null;
|
|
45
|
-
uptime_ms?: number | null;
|
|
46
|
-
is_graceful_shutdown?: boolean | null;
|
|
47
|
-
shutdown_duration_ms?: number | null;
|
|
48
|
-
memory_usage_bytes?: number | null;
|
|
49
|
-
peak_memory_usage_bytes?: number | null;
|
|
50
|
-
cpu_time_ms?: number | null;
|
|
51
|
-
active_requests_count?: number | null;
|
|
52
|
-
}
|
|
53
|
-
export interface MethodCalledEventData {
|
|
54
|
-
method_name: string;
|
|
55
|
-
method_module?: string | null;
|
|
56
|
-
execution_duration_ms: number;
|
|
57
|
-
success_flag: boolean;
|
|
58
|
-
error_message?: string | null;
|
|
59
|
-
error_type?: string | null;
|
|
60
|
-
argument_count: number;
|
|
61
|
-
is_paginated?: boolean;
|
|
62
|
-
}
|
|
63
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/plugins/eventEmission/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Simple utility functions for event emission
|
|
3
|
-
* These are pure functions that can be used to populate common event fields
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Generate a unique event ID
|
|
7
|
-
*/
|
|
8
|
-
export declare function generateEventId(): string;
|
|
9
|
-
/**
|
|
10
|
-
* Get current timestamp in milliseconds since epoch
|
|
11
|
-
*/
|
|
12
|
-
export declare function getCurrentTimestamp(): number;
|
|
13
|
-
/**
|
|
14
|
-
* Get release ID (git SHA) - in production this would come from build process
|
|
15
|
-
*/
|
|
16
|
-
export declare function getReleaseId(): string;
|
|
17
|
-
/**
|
|
18
|
-
* Get operating system information
|
|
19
|
-
*/
|
|
20
|
-
export declare function getOsInfo(): {
|
|
21
|
-
platform: string | null;
|
|
22
|
-
release: string | null;
|
|
23
|
-
architecture: string | null;
|
|
24
|
-
};
|
|
25
|
-
/**
|
|
26
|
-
* Get platform versions (Node.js, npm, etc.)
|
|
27
|
-
*/
|
|
28
|
-
export declare function getPlatformVersions(): Record<string, string | null>;
|
|
29
|
-
/**
|
|
30
|
-
* Check if running in CI environment
|
|
31
|
-
*/
|
|
32
|
-
export declare function isCi(): boolean;
|
|
33
|
-
/**
|
|
34
|
-
* Get CI platform name if running in CI
|
|
35
|
-
*/
|
|
36
|
-
export declare function getCiPlatform(): string | null;
|
|
37
|
-
/**
|
|
38
|
-
* Get memory usage in bytes
|
|
39
|
-
*/
|
|
40
|
-
export declare function getMemoryUsage(): number | null;
|
|
41
|
-
/**
|
|
42
|
-
* Get CPU time in milliseconds
|
|
43
|
-
*/
|
|
44
|
-
export declare function getCpuTime(): number | null;
|
|
45
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/plugins/eventEmission/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;GAEG;AACH,wBAAgB,eAAe,IAAI,MAAM,CAExC;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAErC;AAED;;GAEG;AACH,wBAAgB,SAAS,IAAI;IAC3B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B,CAeA;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAQnE;AAED;;GAEG;AACH,wBAAgB,IAAI,IAAI,OAAO,CAa9B;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,MAAM,GAAG,IAAI,CAY7C;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,MAAM,GAAG,IAAI,CAM9C;AAED;;GAEG;AACH,wBAAgB,UAAU,IAAI,MAAM,GAAG,IAAI,CAM1C"}
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Simple utility functions for event emission
|
|
3
|
-
* These are pure functions that can be used to populate common event fields
|
|
4
|
-
*/
|
|
5
|
-
import * as os from "os";
|
|
6
|
-
/**
|
|
7
|
-
* Generate a unique event ID
|
|
8
|
-
*/
|
|
9
|
-
export function generateEventId() {
|
|
10
|
-
return crypto.randomUUID();
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Get current timestamp in milliseconds since epoch
|
|
14
|
-
*/
|
|
15
|
-
export function getCurrentTimestamp() {
|
|
16
|
-
return Date.now();
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Get release ID (git SHA) - in production this would come from build process
|
|
20
|
-
*/
|
|
21
|
-
export function getReleaseId() {
|
|
22
|
-
return process?.env?.SDK_RELEASE_ID || "development";
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Get operating system information
|
|
26
|
-
*/
|
|
27
|
-
export function getOsInfo() {
|
|
28
|
-
try {
|
|
29
|
-
return {
|
|
30
|
-
platform: os.platform() || null,
|
|
31
|
-
release: os.release() || null,
|
|
32
|
-
architecture: os.arch() || null,
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
catch {
|
|
36
|
-
// Browser environment - os module not available
|
|
37
|
-
return {
|
|
38
|
-
platform: null,
|
|
39
|
-
release: null,
|
|
40
|
-
architecture: null,
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Get platform versions (Node.js, npm, etc.)
|
|
46
|
-
*/
|
|
47
|
-
export function getPlatformVersions() {
|
|
48
|
-
const versions = {};
|
|
49
|
-
if (typeof process?.versions === "object") {
|
|
50
|
-
for (const [key, value] of Object.entries(process.versions)) {
|
|
51
|
-
versions[key] = value || null;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return versions;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Check if running in CI environment
|
|
58
|
-
*/
|
|
59
|
-
export function isCi() {
|
|
60
|
-
return !!(process?.env?.CI ||
|
|
61
|
-
process?.env?.CONTINUOUS_INTEGRATION ||
|
|
62
|
-
process?.env?.GITHUB_ACTIONS ||
|
|
63
|
-
process?.env?.JENKINS_URL ||
|
|
64
|
-
process?.env?.GITLAB_CI ||
|
|
65
|
-
process?.env?.CIRCLECI ||
|
|
66
|
-
process?.env?.TRAVIS ||
|
|
67
|
-
process?.env?.BUILDKITE ||
|
|
68
|
-
process?.env?.DRONE ||
|
|
69
|
-
process?.env?.BITBUCKET_PIPELINES_UUID);
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Get CI platform name if running in CI
|
|
73
|
-
*/
|
|
74
|
-
export function getCiPlatform() {
|
|
75
|
-
if (process?.env?.GITHUB_ACTIONS)
|
|
76
|
-
return "github-actions";
|
|
77
|
-
if (process?.env?.JENKINS_URL)
|
|
78
|
-
return "jenkins";
|
|
79
|
-
if (process?.env?.GITLAB_CI)
|
|
80
|
-
return "gitlab-ci";
|
|
81
|
-
if (process?.env?.CIRCLECI)
|
|
82
|
-
return "circleci";
|
|
83
|
-
if (process?.env?.TRAVIS)
|
|
84
|
-
return "travis";
|
|
85
|
-
if (process?.env?.BUILDKITE)
|
|
86
|
-
return "buildkite";
|
|
87
|
-
if (process?.env?.DRONE)
|
|
88
|
-
return "drone";
|
|
89
|
-
if (process?.env?.BITBUCKET_PIPELINES_UUID)
|
|
90
|
-
return "bitbucket-pipelines";
|
|
91
|
-
if (process?.env?.CI || process?.env?.CONTINUOUS_INTEGRATION)
|
|
92
|
-
return "unknown-ci";
|
|
93
|
-
return null;
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Get memory usage in bytes
|
|
97
|
-
*/
|
|
98
|
-
export function getMemoryUsage() {
|
|
99
|
-
if (process?.memoryUsage) {
|
|
100
|
-
const usage = process.memoryUsage();
|
|
101
|
-
return usage.rss || null; // Resident Set Size
|
|
102
|
-
}
|
|
103
|
-
return null;
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* Get CPU time in milliseconds
|
|
107
|
-
*/
|
|
108
|
-
export function getCpuTime() {
|
|
109
|
-
if (process?.cpuUsage) {
|
|
110
|
-
const usage = process.cpuUsage();
|
|
111
|
-
return Math.round((usage.user + usage.system) / 1000); // Convert to milliseconds
|
|
112
|
-
}
|
|
113
|
-
return null;
|
|
114
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { Plugin, GetSdkType } from "../../types/plugin";
|
|
2
|
-
import type { RequestPluginProvides } from "../request";
|
|
3
|
-
import type { z } from "zod";
|
|
4
|
-
import type { EventEmissionContext } from "../eventEmission";
|
|
5
|
-
export interface FetchPluginProvides {
|
|
6
|
-
fetch: (url: string | URL, init?: RequestInit & {
|
|
7
|
-
authenticationId?: string | number;
|
|
8
|
-
callbackUrl?: string;
|
|
9
|
-
authenticationTemplate?: string;
|
|
10
|
-
}) => Promise<Response>;
|
|
11
|
-
context: {
|
|
12
|
-
meta: {
|
|
13
|
-
fetch: {
|
|
14
|
-
packages: string[];
|
|
15
|
-
categories: string[];
|
|
16
|
-
returnType: string;
|
|
17
|
-
inputParameters: Array<{
|
|
18
|
-
name: string;
|
|
19
|
-
schema: z.ZodSchema;
|
|
20
|
-
}>;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Direct plugin function - takes options + sdk + context in one object
|
|
27
|
-
*/
|
|
28
|
-
export declare const fetchPlugin: Plugin<GetSdkType<RequestPluginProvides>, // requires request in SDK
|
|
29
|
-
EventEmissionContext, // requires eventEmission context for telemetry
|
|
30
|
-
FetchPluginProvides>;
|
|
31
|
-
export type ZapierFetchInitOptions = RequestInit & {
|
|
32
|
-
authenticationId?: string | number;
|
|
33
|
-
callbackUrl?: string;
|
|
34
|
-
authenticationTemplate?: string;
|
|
35
|
-
};
|
|
36
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/fetch/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAExD,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAE7D,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,CACL,GAAG,EAAE,MAAM,GAAG,GAAG,EACjB,IAAI,CAAC,EAAE,WAAW,GAAG;QACnB,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QACnC,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,sBAAsB,CAAC,EAAE,MAAM,CAAC;KACjC,KACE,OAAO,CAAC,QAAQ,CAAC,CAAC;IACvB,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,KAAK,EAAE;gBACL,QAAQ,EAAE,MAAM,EAAE,CAAC;gBACnB,UAAU,EAAE,MAAM,EAAE,CAAC;gBACrB,UAAU,EAAE,MAAM,CAAC;gBACnB,eAAe,EAAE,KAAK,CAAC;oBAAE,IAAI,EAAE,MAAM,CAAC;oBAAC,MAAM,EAAE,CAAC,CAAC,SAAS,CAAA;iBAAE,CAAC,CAAC;aAC/D,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,MAAM,CAC9B,UAAU,CAAC,qBAAqB,CAAC,EAAE,0BAA0B;AAC7D,oBAAoB,EAAE,+CAA+C;AACrE,mBAAmB,CA2EpB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,WAAW,GAAG;IACjD,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC,CAAC"}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { FetchUrlSchema, FetchInitSchema } from "./schemas";
|
|
2
|
-
/**
|
|
3
|
-
* Direct plugin function - takes options + sdk + context in one object
|
|
4
|
-
*/
|
|
5
|
-
export const fetchPlugin = ({ sdk, context }) => {
|
|
6
|
-
// Return flat structure - fetch goes directly to SDK
|
|
7
|
-
return {
|
|
8
|
-
fetch: async function fetch(url, init) {
|
|
9
|
-
const startTime = Date.now();
|
|
10
|
-
try {
|
|
11
|
-
const { authenticationId, callbackUrl, authenticationTemplate, ...fetchInit } = init || {};
|
|
12
|
-
const result = await sdk.request({
|
|
13
|
-
url: url.toString(),
|
|
14
|
-
method: fetchInit.method,
|
|
15
|
-
body: fetchInit.body,
|
|
16
|
-
headers: fetchInit.headers,
|
|
17
|
-
authenticationId,
|
|
18
|
-
callbackUrl,
|
|
19
|
-
authenticationTemplate,
|
|
20
|
-
_telemetry: { isNested: true },
|
|
21
|
-
});
|
|
22
|
-
// Emit success telemetry
|
|
23
|
-
context.eventEmission.emitMethodCalled({
|
|
24
|
-
method_name: "fetch",
|
|
25
|
-
execution_duration_ms: Date.now() - startTime,
|
|
26
|
-
success_flag: true,
|
|
27
|
-
error_message: null,
|
|
28
|
-
error_type: null,
|
|
29
|
-
argument_count: init ? 2 : 1,
|
|
30
|
-
is_paginated: false,
|
|
31
|
-
});
|
|
32
|
-
return result;
|
|
33
|
-
}
|
|
34
|
-
catch (error) {
|
|
35
|
-
// Emit failure telemetry
|
|
36
|
-
context.eventEmission.emitMethodCalled({
|
|
37
|
-
method_name: "fetch",
|
|
38
|
-
execution_duration_ms: Date.now() - startTime,
|
|
39
|
-
success_flag: false,
|
|
40
|
-
error_message: error instanceof Error ? error.message : String(error),
|
|
41
|
-
error_type: error instanceof Error ? error.constructor.name : "Unknown",
|
|
42
|
-
argument_count: init ? 2 : 1,
|
|
43
|
-
is_paginated: false,
|
|
44
|
-
});
|
|
45
|
-
throw error;
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
context: {
|
|
49
|
-
meta: {
|
|
50
|
-
fetch: {
|
|
51
|
-
packages: ["sdk"],
|
|
52
|
-
categories: ["http"],
|
|
53
|
-
returnType: "Response",
|
|
54
|
-
inputParameters: [
|
|
55
|
-
{ name: "url", schema: FetchUrlSchema },
|
|
56
|
-
{ name: "init", schema: FetchInitSchema },
|
|
57
|
-
],
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
};
|
|
62
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const FetchUrlSchema: z.ZodUnion<readonly [z.ZodString, z.ZodCustom<URL, URL>]>;
|
|
3
|
-
export declare const FetchInitSchema: z.ZodOptional<z.ZodObject<{
|
|
4
|
-
method: z.ZodOptional<z.ZodEnum<{
|
|
5
|
-
POST: "POST";
|
|
6
|
-
GET: "GET";
|
|
7
|
-
PUT: "PUT";
|
|
8
|
-
DELETE: "DELETE";
|
|
9
|
-
PATCH: "PATCH";
|
|
10
|
-
HEAD: "HEAD";
|
|
11
|
-
OPTIONS: "OPTIONS";
|
|
12
|
-
}>>;
|
|
13
|
-
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
14
|
-
body: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodCustom<FormData, FormData>, z.ZodCustom<URLSearchParams, URLSearchParams>]>>;
|
|
15
|
-
authenticationId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
16
|
-
callbackUrl: z.ZodOptional<z.ZodString>;
|
|
17
|
-
authenticationTemplate: z.ZodOptional<z.ZodString>;
|
|
18
|
-
}, z.core.$strip>>;
|
|
19
|
-
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/fetch/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,cAAc,2DAEI,CAAC;AAEhC,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;kBA0ByB,CAAC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { AuthenticationIdPropertySchema } from "../../types/properties";
|
|
3
|
-
// Schemas for fetch function parameters
|
|
4
|
-
export const FetchUrlSchema = z
|
|
5
|
-
.union([z.string(), z.instanceof(URL)])
|
|
6
|
-
.describe("The URL to fetch");
|
|
7
|
-
export const FetchInitSchema = z
|
|
8
|
-
.object({
|
|
9
|
-
method: z
|
|
10
|
-
.enum(["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"])
|
|
11
|
-
.optional(),
|
|
12
|
-
headers: z.record(z.string(), z.string()).optional(),
|
|
13
|
-
body: z
|
|
14
|
-
.union([
|
|
15
|
-
z.string(),
|
|
16
|
-
z.instanceof(FormData),
|
|
17
|
-
z.instanceof(URLSearchParams),
|
|
18
|
-
])
|
|
19
|
-
.optional(),
|
|
20
|
-
authenticationId: AuthenticationIdPropertySchema.optional(),
|
|
21
|
-
callbackUrl: z
|
|
22
|
-
.string()
|
|
23
|
-
.optional()
|
|
24
|
-
.describe("URL to send async response to (makes request async)"),
|
|
25
|
-
authenticationTemplate: z
|
|
26
|
-
.string()
|
|
27
|
-
.optional()
|
|
28
|
-
.describe("Optional JSON string authentication template to bypass Notary lookup"),
|
|
29
|
-
})
|
|
30
|
-
.optional()
|
|
31
|
-
.describe("Fetch options including authentication");
|