@hookdeck/outpost-sdk 0.1.1 → 0.3.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/FUNCTIONS.md +5 -22
- package/README.md +50 -109
- package/bin/mcp-server.js +516 -182
- package/bin/mcp-server.js.map +59 -53
- package/dist/commonjs/funcs/destinationsCreate.d.ts +3 -2
- package/dist/commonjs/funcs/destinationsCreate.d.ts.map +1 -1
- package/dist/commonjs/funcs/destinationsCreate.js +3 -1
- package/dist/commonjs/funcs/destinationsCreate.js.map +1 -1
- package/dist/commonjs/funcs/destinationsDelete.d.ts +3 -2
- package/dist/commonjs/funcs/destinationsDelete.d.ts.map +1 -1
- package/dist/commonjs/funcs/destinationsDelete.js +3 -1
- package/dist/commonjs/funcs/destinationsDelete.js.map +1 -1
- package/dist/commonjs/funcs/destinationsDisable.d.ts +3 -2
- package/dist/commonjs/funcs/destinationsDisable.d.ts.map +1 -1
- package/dist/commonjs/funcs/destinationsDisable.js +3 -1
- package/dist/commonjs/funcs/destinationsDisable.js.map +1 -1
- package/dist/commonjs/funcs/destinationsEnable.d.ts +3 -2
- package/dist/commonjs/funcs/destinationsEnable.d.ts.map +1 -1
- package/dist/commonjs/funcs/destinationsEnable.js +3 -1
- package/dist/commonjs/funcs/destinationsEnable.js.map +1 -1
- package/dist/commonjs/funcs/destinationsGet.d.ts +3 -2
- package/dist/commonjs/funcs/destinationsGet.d.ts.map +1 -1
- package/dist/commonjs/funcs/destinationsGet.js +3 -1
- package/dist/commonjs/funcs/destinationsGet.js.map +1 -1
- package/dist/commonjs/funcs/destinationsList.d.ts +3 -2
- package/dist/commonjs/funcs/destinationsList.d.ts.map +1 -1
- package/dist/commonjs/funcs/destinationsList.js +3 -1
- package/dist/commonjs/funcs/destinationsList.js.map +1 -1
- package/dist/commonjs/funcs/destinationsUpdate.d.ts +3 -2
- package/dist/commonjs/funcs/destinationsUpdate.d.ts.map +1 -1
- package/dist/commonjs/funcs/destinationsUpdate.js +3 -1
- package/dist/commonjs/funcs/destinationsUpdate.js.map +1 -1
- package/dist/commonjs/funcs/eventsGet.d.ts +3 -2
- package/dist/commonjs/funcs/eventsGet.d.ts.map +1 -1
- package/dist/commonjs/funcs/eventsGet.js +3 -1
- package/dist/commonjs/funcs/eventsGet.js.map +1 -1
- package/dist/commonjs/funcs/eventsGetByDestination.d.ts +3 -2
- package/dist/commonjs/funcs/eventsGetByDestination.d.ts.map +1 -1
- package/dist/commonjs/funcs/eventsGetByDestination.js +3 -1
- package/dist/commonjs/funcs/eventsGetByDestination.js.map +1 -1
- package/dist/commonjs/funcs/eventsList.d.ts +3 -2
- package/dist/commonjs/funcs/eventsList.d.ts.map +1 -1
- package/dist/commonjs/funcs/eventsList.js +3 -1
- package/dist/commonjs/funcs/eventsList.js.map +1 -1
- package/dist/commonjs/funcs/eventsListByDestination.d.ts +3 -2
- package/dist/commonjs/funcs/eventsListByDestination.d.ts.map +1 -1
- package/dist/commonjs/funcs/eventsListByDestination.js +3 -1
- package/dist/commonjs/funcs/eventsListByDestination.js.map +1 -1
- package/dist/commonjs/funcs/eventsListDeliveries.d.ts +3 -2
- package/dist/commonjs/funcs/eventsListDeliveries.d.ts.map +1 -1
- package/dist/commonjs/funcs/eventsListDeliveries.js +3 -1
- package/dist/commonjs/funcs/eventsListDeliveries.js.map +1 -1
- package/dist/commonjs/funcs/eventsRetry.d.ts +3 -2
- package/dist/commonjs/funcs/eventsRetry.d.ts.map +1 -1
- package/dist/commonjs/funcs/eventsRetry.js +3 -1
- package/dist/commonjs/funcs/eventsRetry.js.map +1 -1
- package/dist/commonjs/funcs/healthCheck.d.ts +3 -2
- package/dist/commonjs/funcs/healthCheck.d.ts.map +1 -1
- package/dist/commonjs/funcs/healthCheck.js +3 -1
- package/dist/commonjs/funcs/healthCheck.js.map +1 -1
- package/dist/commonjs/funcs/publishEvent.d.ts +3 -2
- package/dist/commonjs/funcs/publishEvent.d.ts.map +1 -1
- package/dist/commonjs/funcs/publishEvent.js +4 -2
- package/dist/commonjs/funcs/publishEvent.js.map +1 -1
- package/dist/commonjs/funcs/schemasGet.d.ts +3 -2
- package/dist/commonjs/funcs/schemasGet.d.ts.map +1 -1
- package/dist/commonjs/funcs/schemasGet.js +3 -1
- package/dist/commonjs/funcs/schemasGet.js.map +1 -1
- package/dist/commonjs/funcs/schemasGetDestinationTypeJwt.d.ts +3 -2
- package/dist/commonjs/funcs/schemasGetDestinationTypeJwt.d.ts.map +1 -1
- package/dist/commonjs/funcs/schemasGetDestinationTypeJwt.js +3 -1
- package/dist/commonjs/funcs/schemasGetDestinationTypeJwt.js.map +1 -1
- package/dist/commonjs/funcs/schemasListDestinationTypesJwt.d.ts +3 -2
- package/dist/commonjs/funcs/schemasListDestinationTypesJwt.d.ts.map +1 -1
- package/dist/commonjs/funcs/schemasListDestinationTypesJwt.js +3 -1
- package/dist/commonjs/funcs/schemasListDestinationTypesJwt.js.map +1 -1
- package/dist/commonjs/funcs/schemasListTenantDestinationTypes.d.ts +3 -2
- package/dist/commonjs/funcs/schemasListTenantDestinationTypes.d.ts.map +1 -1
- package/dist/commonjs/funcs/schemasListTenantDestinationTypes.js +3 -1
- package/dist/commonjs/funcs/schemasListTenantDestinationTypes.js.map +1 -1
- package/dist/commonjs/funcs/tenantsDelete.d.ts +3 -2
- package/dist/commonjs/funcs/tenantsDelete.d.ts.map +1 -1
- package/dist/commonjs/funcs/tenantsDelete.js +3 -1
- package/dist/commonjs/funcs/tenantsDelete.js.map +1 -1
- package/dist/commonjs/funcs/tenantsGet.d.ts +3 -2
- package/dist/commonjs/funcs/tenantsGet.d.ts.map +1 -1
- package/dist/commonjs/funcs/tenantsGet.js +3 -1
- package/dist/commonjs/funcs/tenantsGet.js.map +1 -1
- package/dist/commonjs/funcs/tenantsGetPortalUrl.d.ts +3 -2
- package/dist/commonjs/funcs/tenantsGetPortalUrl.d.ts.map +1 -1
- package/dist/commonjs/funcs/tenantsGetPortalUrl.js +3 -1
- package/dist/commonjs/funcs/tenantsGetPortalUrl.js.map +1 -1
- package/dist/commonjs/funcs/tenantsGetToken.d.ts +3 -2
- package/dist/commonjs/funcs/tenantsGetToken.d.ts.map +1 -1
- package/dist/commonjs/funcs/tenantsGetToken.js +3 -1
- package/dist/commonjs/funcs/tenantsGetToken.js.map +1 -1
- package/dist/commonjs/funcs/tenantsUpsert.d.ts +3 -2
- package/dist/commonjs/funcs/tenantsUpsert.d.ts.map +1 -1
- package/dist/commonjs/funcs/tenantsUpsert.js +3 -1
- package/dist/commonjs/funcs/tenantsUpsert.js.map +1 -1
- package/dist/commonjs/funcs/topicsList.d.ts +3 -2
- package/dist/commonjs/funcs/topicsList.d.ts.map +1 -1
- package/dist/commonjs/funcs/topicsList.js +3 -1
- package/dist/commonjs/funcs/topicsList.js.map +1 -1
- package/dist/commonjs/funcs/topicsListJwt.d.ts +3 -2
- package/dist/commonjs/funcs/topicsListJwt.d.ts.map +1 -1
- package/dist/commonjs/funcs/topicsListJwt.js +3 -1
- package/dist/commonjs/funcs/topicsListJwt.js.map +1 -1
- package/dist/commonjs/hooks/types.d.ts +2 -0
- package/dist/commonjs/hooks/types.d.ts.map +1 -1
- package/dist/commonjs/index.d.ts +2 -0
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +3 -1
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +7 -3
- package/dist/commonjs/lib/config.d.ts.map +1 -1
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/lib/config.js.map +1 -1
- package/dist/commonjs/lib/files.d.ts +5 -0
- package/dist/commonjs/lib/files.d.ts.map +1 -1
- package/dist/commonjs/lib/files.js +41 -0
- package/dist/commonjs/lib/files.js.map +1 -1
- package/dist/commonjs/lib/matchers.d.ts +3 -10
- package/dist/commonjs/lib/matchers.d.ts.map +1 -1
- package/dist/commonjs/lib/matchers.js +33 -31
- package/dist/commonjs/lib/matchers.js.map +1 -1
- package/dist/commonjs/lib/sdks.d.ts +1 -0
- package/dist/commonjs/lib/sdks.d.ts.map +1 -1
- package/dist/commonjs/lib/sdks.js +3 -3
- package/dist/commonjs/lib/sdks.js.map +1 -1
- package/dist/commonjs/lib/security.d.ts +2 -2
- package/dist/commonjs/lib/security.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/cli/start/command.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/cli/start/command.js +0 -12
- package/dist/commonjs/mcp-server/cli/start/command.js.map +1 -1
- package/dist/commonjs/mcp-server/cli/start/impl.d.ts +0 -2
- package/dist/commonjs/mcp-server/cli/start/impl.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/cli/start/impl.js +4 -6
- package/dist/commonjs/mcp-server/cli/start/impl.js.map +1 -1
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/server.js +1 -1
- package/dist/commonjs/mcp-server/tools/publishEvent.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/tools/publishEvent.js +2 -1
- package/dist/commonjs/mcp-server/tools/publishEvent.js.map +1 -1
- package/dist/commonjs/models/components/azureservicebusconfig.d.ts +32 -0
- package/dist/commonjs/models/components/azureservicebusconfig.d.ts.map +1 -0
- package/dist/commonjs/models/components/azureservicebusconfig.js +69 -0
- package/dist/commonjs/models/components/azureservicebusconfig.js.map +1 -0
- package/dist/commonjs/models/components/azureservicebuscredentials.d.ts +32 -0
- package/dist/commonjs/models/components/azureservicebuscredentials.d.ts.map +1 -0
- package/dist/commonjs/models/components/azureservicebuscredentials.js +78 -0
- package/dist/commonjs/models/components/azureservicebuscredentials.js.map +1 -0
- package/dist/commonjs/models/components/destination.d.ts +9 -4
- package/dist/commonjs/models/components/destination.d.ts.map +1 -1
- package/dist/commonjs/models/components/destination.js +11 -4
- package/dist/commonjs/models/components/destination.js.map +1 -1
- package/dist/commonjs/models/components/destinationazureservicebus.d.ts +98 -0
- package/dist/commonjs/models/components/destinationazureservicebus.d.ts.map +1 -0
- package/dist/commonjs/models/components/destinationazureservicebus.js +122 -0
- package/dist/commonjs/models/components/destinationazureservicebus.js.map +1 -0
- package/dist/commonjs/models/components/destinationcreate.d.ts +15 -10
- package/dist/commonjs/models/components/destinationcreate.d.ts.map +1 -1
- package/dist/commonjs/models/components/destinationcreate.js +17 -10
- package/dist/commonjs/models/components/destinationcreate.js.map +1 -1
- package/dist/commonjs/models/components/destinationcreateazureservicebus.d.ts +78 -0
- package/dist/commonjs/models/components/destinationcreateazureservicebus.d.ts.map +1 -0
- package/dist/commonjs/models/components/destinationcreateazureservicebus.js +101 -0
- package/dist/commonjs/models/components/destinationcreateazureservicebus.js.map +1 -0
- package/dist/commonjs/models/components/index.d.ts +5 -0
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +5 -0
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/components/publishrequest.d.ts +12 -7
- package/dist/commonjs/models/components/publishrequest.d.ts.map +1 -1
- package/dist/commonjs/models/components/publishrequest.js +8 -6
- package/dist/commonjs/models/components/publishrequest.js.map +1 -1
- package/dist/commonjs/models/components/publishresponse.d.ts +32 -0
- package/dist/commonjs/models/components/publishresponse.d.ts.map +1 -0
- package/dist/commonjs/models/components/publishresponse.js +69 -0
- package/dist/commonjs/models/components/publishresponse.js.map +1 -0
- package/dist/commonjs/models/errors/apierror.d.ts +8 -6
- package/dist/commonjs/models/errors/apierror.d.ts.map +1 -1
- package/dist/commonjs/models/errors/apierror.js +23 -10
- package/dist/commonjs/models/errors/apierror.js.map +1 -1
- package/dist/commonjs/models/errors/badrequesterror.d.ts +7 -2
- package/dist/commonjs/models/errors/badrequesterror.d.ts.map +1 -1
- package/dist/commonjs/models/errors/badrequesterror.js +13 -7
- package/dist/commonjs/models/errors/badrequesterror.js.map +1 -1
- package/dist/commonjs/models/errors/index.d.ts +1 -0
- package/dist/commonjs/models/errors/index.d.ts.map +1 -1
- package/dist/commonjs/models/errors/index.js +1 -0
- package/dist/commonjs/models/errors/index.js.map +1 -1
- package/dist/commonjs/models/errors/internalservererror.d.ts +7 -2
- package/dist/commonjs/models/errors/internalservererror.d.ts.map +1 -1
- package/dist/commonjs/models/errors/internalservererror.js +13 -7
- package/dist/commonjs/models/errors/internalservererror.js.map +1 -1
- package/dist/commonjs/models/errors/notfounderror.d.ts +7 -2
- package/dist/commonjs/models/errors/notfounderror.d.ts.map +1 -1
- package/dist/commonjs/models/errors/notfounderror.js +13 -7
- package/dist/commonjs/models/errors/notfounderror.js.map +1 -1
- package/dist/commonjs/models/errors/outposterror.d.ts +19 -0
- package/dist/commonjs/models/errors/outposterror.d.ts.map +1 -0
- package/dist/commonjs/models/errors/outposterror.js +20 -0
- package/dist/commonjs/models/errors/outposterror.js.map +1 -0
- package/dist/commonjs/models/errors/ratelimitederror.d.ts +7 -2
- package/dist/commonjs/models/errors/ratelimitederror.d.ts.map +1 -1
- package/dist/commonjs/models/errors/ratelimitederror.js +13 -7
- package/dist/commonjs/models/errors/ratelimitederror.js.map +1 -1
- package/dist/commonjs/models/errors/responsevalidationerror.d.ts +26 -0
- package/dist/commonjs/models/errors/responsevalidationerror.d.ts.map +1 -0
- package/dist/commonjs/models/errors/responsevalidationerror.js +66 -0
- package/dist/commonjs/models/errors/responsevalidationerror.js.map +1 -0
- package/dist/commonjs/models/errors/sdkvalidationerror.d.ts +1 -0
- package/dist/commonjs/models/errors/sdkvalidationerror.d.ts.map +1 -1
- package/dist/commonjs/models/errors/sdkvalidationerror.js +14 -0
- package/dist/commonjs/models/errors/sdkvalidationerror.js.map +1 -1
- package/dist/commonjs/models/errors/timeouterror.d.ts +7 -2
- package/dist/commonjs/models/errors/timeouterror.d.ts.map +1 -1
- package/dist/commonjs/models/errors/timeouterror.js +13 -7
- package/dist/commonjs/models/errors/timeouterror.js.map +1 -1
- package/dist/commonjs/models/errors/unauthorizederror.d.ts +7 -2
- package/dist/commonjs/models/errors/unauthorizederror.d.ts.map +1 -1
- package/dist/commonjs/models/errors/unauthorizederror.js +13 -7
- package/dist/commonjs/models/errors/unauthorizederror.js.map +1 -1
- package/dist/commonjs/sdk/publish.d.ts +1 -1
- package/dist/commonjs/sdk/publish.d.ts.map +1 -1
- package/dist/commonjs/types/constdatetime.js +1 -1
- package/dist/esm/funcs/destinationsCreate.d.ts +3 -2
- package/dist/esm/funcs/destinationsCreate.d.ts.map +1 -1
- package/dist/esm/funcs/destinationsCreate.js +3 -1
- package/dist/esm/funcs/destinationsCreate.js.map +1 -1
- package/dist/esm/funcs/destinationsDelete.d.ts +3 -2
- package/dist/esm/funcs/destinationsDelete.d.ts.map +1 -1
- package/dist/esm/funcs/destinationsDelete.js +3 -1
- package/dist/esm/funcs/destinationsDelete.js.map +1 -1
- package/dist/esm/funcs/destinationsDisable.d.ts +3 -2
- package/dist/esm/funcs/destinationsDisable.d.ts.map +1 -1
- package/dist/esm/funcs/destinationsDisable.js +3 -1
- package/dist/esm/funcs/destinationsDisable.js.map +1 -1
- package/dist/esm/funcs/destinationsEnable.d.ts +3 -2
- package/dist/esm/funcs/destinationsEnable.d.ts.map +1 -1
- package/dist/esm/funcs/destinationsEnable.js +3 -1
- package/dist/esm/funcs/destinationsEnable.js.map +1 -1
- package/dist/esm/funcs/destinationsGet.d.ts +3 -2
- package/dist/esm/funcs/destinationsGet.d.ts.map +1 -1
- package/dist/esm/funcs/destinationsGet.js +3 -1
- package/dist/esm/funcs/destinationsGet.js.map +1 -1
- package/dist/esm/funcs/destinationsList.d.ts +3 -2
- package/dist/esm/funcs/destinationsList.d.ts.map +1 -1
- package/dist/esm/funcs/destinationsList.js +3 -1
- package/dist/esm/funcs/destinationsList.js.map +1 -1
- package/dist/esm/funcs/destinationsUpdate.d.ts +3 -2
- package/dist/esm/funcs/destinationsUpdate.d.ts.map +1 -1
- package/dist/esm/funcs/destinationsUpdate.js +3 -1
- package/dist/esm/funcs/destinationsUpdate.js.map +1 -1
- package/dist/esm/funcs/eventsGet.d.ts +3 -2
- package/dist/esm/funcs/eventsGet.d.ts.map +1 -1
- package/dist/esm/funcs/eventsGet.js +3 -1
- package/dist/esm/funcs/eventsGet.js.map +1 -1
- package/dist/esm/funcs/eventsGetByDestination.d.ts +3 -2
- package/dist/esm/funcs/eventsGetByDestination.d.ts.map +1 -1
- package/dist/esm/funcs/eventsGetByDestination.js +3 -1
- package/dist/esm/funcs/eventsGetByDestination.js.map +1 -1
- package/dist/esm/funcs/eventsList.d.ts +3 -2
- package/dist/esm/funcs/eventsList.d.ts.map +1 -1
- package/dist/esm/funcs/eventsList.js +3 -1
- package/dist/esm/funcs/eventsList.js.map +1 -1
- package/dist/esm/funcs/eventsListByDestination.d.ts +3 -2
- package/dist/esm/funcs/eventsListByDestination.d.ts.map +1 -1
- package/dist/esm/funcs/eventsListByDestination.js +3 -1
- package/dist/esm/funcs/eventsListByDestination.js.map +1 -1
- package/dist/esm/funcs/eventsListDeliveries.d.ts +3 -2
- package/dist/esm/funcs/eventsListDeliveries.d.ts.map +1 -1
- package/dist/esm/funcs/eventsListDeliveries.js +3 -1
- package/dist/esm/funcs/eventsListDeliveries.js.map +1 -1
- package/dist/esm/funcs/eventsRetry.d.ts +3 -2
- package/dist/esm/funcs/eventsRetry.d.ts.map +1 -1
- package/dist/esm/funcs/eventsRetry.js +3 -1
- package/dist/esm/funcs/eventsRetry.js.map +1 -1
- package/dist/esm/funcs/healthCheck.d.ts +3 -2
- package/dist/esm/funcs/healthCheck.d.ts.map +1 -1
- package/dist/esm/funcs/healthCheck.js +3 -1
- package/dist/esm/funcs/healthCheck.js.map +1 -1
- package/dist/esm/funcs/publishEvent.d.ts +3 -2
- package/dist/esm/funcs/publishEvent.d.ts.map +1 -1
- package/dist/esm/funcs/publishEvent.js +4 -2
- package/dist/esm/funcs/publishEvent.js.map +1 -1
- package/dist/esm/funcs/schemasGet.d.ts +3 -2
- package/dist/esm/funcs/schemasGet.d.ts.map +1 -1
- package/dist/esm/funcs/schemasGet.js +3 -1
- package/dist/esm/funcs/schemasGet.js.map +1 -1
- package/dist/esm/funcs/schemasGetDestinationTypeJwt.d.ts +3 -2
- package/dist/esm/funcs/schemasGetDestinationTypeJwt.d.ts.map +1 -1
- package/dist/esm/funcs/schemasGetDestinationTypeJwt.js +3 -1
- package/dist/esm/funcs/schemasGetDestinationTypeJwt.js.map +1 -1
- package/dist/esm/funcs/schemasListDestinationTypesJwt.d.ts +3 -2
- package/dist/esm/funcs/schemasListDestinationTypesJwt.d.ts.map +1 -1
- package/dist/esm/funcs/schemasListDestinationTypesJwt.js +3 -1
- package/dist/esm/funcs/schemasListDestinationTypesJwt.js.map +1 -1
- package/dist/esm/funcs/schemasListTenantDestinationTypes.d.ts +3 -2
- package/dist/esm/funcs/schemasListTenantDestinationTypes.d.ts.map +1 -1
- package/dist/esm/funcs/schemasListTenantDestinationTypes.js +3 -1
- package/dist/esm/funcs/schemasListTenantDestinationTypes.js.map +1 -1
- package/dist/esm/funcs/tenantsDelete.d.ts +3 -2
- package/dist/esm/funcs/tenantsDelete.d.ts.map +1 -1
- package/dist/esm/funcs/tenantsDelete.js +3 -1
- package/dist/esm/funcs/tenantsDelete.js.map +1 -1
- package/dist/esm/funcs/tenantsGet.d.ts +3 -2
- package/dist/esm/funcs/tenantsGet.d.ts.map +1 -1
- package/dist/esm/funcs/tenantsGet.js +3 -1
- package/dist/esm/funcs/tenantsGet.js.map +1 -1
- package/dist/esm/funcs/tenantsGetPortalUrl.d.ts +3 -2
- package/dist/esm/funcs/tenantsGetPortalUrl.d.ts.map +1 -1
- package/dist/esm/funcs/tenantsGetPortalUrl.js +3 -1
- package/dist/esm/funcs/tenantsGetPortalUrl.js.map +1 -1
- package/dist/esm/funcs/tenantsGetToken.d.ts +3 -2
- package/dist/esm/funcs/tenantsGetToken.d.ts.map +1 -1
- package/dist/esm/funcs/tenantsGetToken.js +3 -1
- package/dist/esm/funcs/tenantsGetToken.js.map +1 -1
- package/dist/esm/funcs/tenantsUpsert.d.ts +3 -2
- package/dist/esm/funcs/tenantsUpsert.d.ts.map +1 -1
- package/dist/esm/funcs/tenantsUpsert.js +3 -1
- package/dist/esm/funcs/tenantsUpsert.js.map +1 -1
- package/dist/esm/funcs/topicsList.d.ts +3 -2
- package/dist/esm/funcs/topicsList.d.ts.map +1 -1
- package/dist/esm/funcs/topicsList.js +3 -1
- package/dist/esm/funcs/topicsList.js.map +1 -1
- package/dist/esm/funcs/topicsListJwt.d.ts +3 -2
- package/dist/esm/funcs/topicsListJwt.d.ts.map +1 -1
- package/dist/esm/funcs/topicsListJwt.js +3 -1
- package/dist/esm/funcs/topicsListJwt.js.map +1 -1
- package/dist/esm/hooks/types.d.ts +2 -0
- package/dist/esm/hooks/types.d.ts.map +1 -1
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/config.d.ts +7 -3
- package/dist/esm/lib/config.d.ts.map +1 -1
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/lib/config.js.map +1 -1
- package/dist/esm/lib/files.d.ts +5 -0
- package/dist/esm/lib/files.d.ts.map +1 -1
- package/dist/esm/lib/files.js +40 -0
- package/dist/esm/lib/files.js.map +1 -1
- package/dist/esm/lib/matchers.d.ts +3 -10
- package/dist/esm/lib/matchers.d.ts.map +1 -1
- package/dist/esm/lib/matchers.js +33 -30
- package/dist/esm/lib/matchers.js.map +1 -1
- package/dist/esm/lib/sdks.d.ts +1 -0
- package/dist/esm/lib/sdks.d.ts.map +1 -1
- package/dist/esm/lib/sdks.js +3 -3
- package/dist/esm/lib/sdks.js.map +1 -1
- package/dist/esm/lib/security.d.ts +2 -2
- package/dist/esm/lib/security.d.ts.map +1 -1
- package/dist/esm/mcp-server/cli/start/command.d.ts.map +1 -1
- package/dist/esm/mcp-server/cli/start/command.js +0 -12
- package/dist/esm/mcp-server/cli/start/command.js.map +1 -1
- package/dist/esm/mcp-server/cli/start/impl.d.ts +0 -2
- package/dist/esm/mcp-server/cli/start/impl.d.ts.map +1 -1
- package/dist/esm/mcp-server/cli/start/impl.js +4 -6
- package/dist/esm/mcp-server/cli/start/impl.js.map +1 -1
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/server.js +1 -1
- package/dist/esm/mcp-server/tools/publishEvent.d.ts.map +1 -1
- package/dist/esm/mcp-server/tools/publishEvent.js +2 -1
- package/dist/esm/mcp-server/tools/publishEvent.js.map +1 -1
- package/dist/esm/models/components/azureservicebusconfig.d.ts +32 -0
- package/dist/esm/models/components/azureservicebusconfig.d.ts.map +1 -0
- package/dist/esm/models/components/azureservicebusconfig.js +31 -0
- package/dist/esm/models/components/azureservicebusconfig.js.map +1 -0
- package/dist/esm/models/components/azureservicebuscredentials.d.ts +32 -0
- package/dist/esm/models/components/azureservicebuscredentials.d.ts.map +1 -0
- package/dist/esm/models/components/azureservicebuscredentials.js +40 -0
- package/dist/esm/models/components/azureservicebuscredentials.js.map +1 -0
- package/dist/esm/models/components/destination.d.ts +9 -4
- package/dist/esm/models/components/destination.d.ts.map +1 -1
- package/dist/esm/models/components/destination.js +11 -4
- package/dist/esm/models/components/destination.js.map +1 -1
- package/dist/esm/models/components/destinationazureservicebus.d.ts +98 -0
- package/dist/esm/models/components/destinationazureservicebus.d.ts.map +1 -0
- package/dist/esm/models/components/destinationazureservicebus.js +84 -0
- package/dist/esm/models/components/destinationazureservicebus.js.map +1 -0
- package/dist/esm/models/components/destinationcreate.d.ts +15 -10
- package/dist/esm/models/components/destinationcreate.d.ts.map +1 -1
- package/dist/esm/models/components/destinationcreate.js +17 -10
- package/dist/esm/models/components/destinationcreate.js.map +1 -1
- package/dist/esm/models/components/destinationcreateazureservicebus.d.ts +78 -0
- package/dist/esm/models/components/destinationcreateazureservicebus.d.ts.map +1 -0
- package/dist/esm/models/components/destinationcreateazureservicebus.js +63 -0
- package/dist/esm/models/components/destinationcreateazureservicebus.js.map +1 -0
- package/dist/esm/models/components/index.d.ts +5 -0
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +5 -0
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/components/publishrequest.d.ts +12 -7
- package/dist/esm/models/components/publishrequest.d.ts.map +1 -1
- package/dist/esm/models/components/publishrequest.js +8 -6
- package/dist/esm/models/components/publishrequest.js.map +1 -1
- package/dist/esm/models/components/publishresponse.d.ts +32 -0
- package/dist/esm/models/components/publishresponse.d.ts.map +1 -0
- package/dist/esm/models/components/publishresponse.js +31 -0
- package/dist/esm/models/components/publishresponse.js.map +1 -0
- package/dist/esm/models/errors/apierror.d.ts +8 -6
- package/dist/esm/models/errors/apierror.d.ts.map +1 -1
- package/dist/esm/models/errors/apierror.js +23 -10
- package/dist/esm/models/errors/apierror.js.map +1 -1
- package/dist/esm/models/errors/badrequesterror.d.ts +7 -2
- package/dist/esm/models/errors/badrequesterror.d.ts.map +1 -1
- package/dist/esm/models/errors/badrequesterror.js +13 -7
- package/dist/esm/models/errors/badrequesterror.js.map +1 -1
- package/dist/esm/models/errors/index.d.ts +1 -0
- package/dist/esm/models/errors/index.d.ts.map +1 -1
- package/dist/esm/models/errors/index.js +1 -0
- package/dist/esm/models/errors/index.js.map +1 -1
- package/dist/esm/models/errors/internalservererror.d.ts +7 -2
- package/dist/esm/models/errors/internalservererror.d.ts.map +1 -1
- package/dist/esm/models/errors/internalservererror.js +13 -7
- package/dist/esm/models/errors/internalservererror.js.map +1 -1
- package/dist/esm/models/errors/notfounderror.d.ts +7 -2
- package/dist/esm/models/errors/notfounderror.d.ts.map +1 -1
- package/dist/esm/models/errors/notfounderror.js +13 -7
- package/dist/esm/models/errors/notfounderror.js.map +1 -1
- package/dist/esm/models/errors/outposterror.d.ts +19 -0
- package/dist/esm/models/errors/outposterror.d.ts.map +1 -0
- package/dist/esm/models/errors/outposterror.js +16 -0
- package/dist/esm/models/errors/outposterror.js.map +1 -0
- package/dist/esm/models/errors/ratelimitederror.d.ts +7 -2
- package/dist/esm/models/errors/ratelimitederror.d.ts.map +1 -1
- package/dist/esm/models/errors/ratelimitederror.js +13 -7
- package/dist/esm/models/errors/ratelimitederror.js.map +1 -1
- package/dist/esm/models/errors/responsevalidationerror.d.ts +26 -0
- package/dist/esm/models/errors/responsevalidationerror.d.ts.map +1 -0
- package/dist/esm/models/errors/responsevalidationerror.js +29 -0
- package/dist/esm/models/errors/responsevalidationerror.js.map +1 -0
- package/dist/esm/models/errors/sdkvalidationerror.d.ts +1 -0
- package/dist/esm/models/errors/sdkvalidationerror.d.ts.map +1 -1
- package/dist/esm/models/errors/sdkvalidationerror.js +14 -0
- package/dist/esm/models/errors/sdkvalidationerror.js.map +1 -1
- package/dist/esm/models/errors/timeouterror.d.ts +7 -2
- package/dist/esm/models/errors/timeouterror.d.ts.map +1 -1
- package/dist/esm/models/errors/timeouterror.js +13 -7
- package/dist/esm/models/errors/timeouterror.js.map +1 -1
- package/dist/esm/models/errors/unauthorizederror.d.ts +7 -2
- package/dist/esm/models/errors/unauthorizederror.d.ts.map +1 -1
- package/dist/esm/models/errors/unauthorizederror.js +13 -7
- package/dist/esm/models/errors/unauthorizederror.js.map +1 -1
- package/dist/esm/sdk/publish.d.ts +1 -1
- package/dist/esm/sdk/publish.d.ts.map +1 -1
- package/dist/esm/types/constdatetime.js +1 -1
- package/docs/sdks/destinations/README.md +68 -95
- package/docs/sdks/events/README.md +50 -68
- package/docs/sdks/health/README.md +6 -9
- package/docs/sdks/publish/README.md +11 -12
- package/docs/sdks/schemas/README.md +32 -46
- package/docs/sdks/tenants/README.md +50 -75
- package/docs/sdks/topics/README.md +16 -24
- package/examples/README.md +31 -0
- package/examples/healthCheck.example.ts +24 -0
- package/examples/package-lock.json +628 -0
- package/examples/package.json +18 -0
- package/jsr.json +1 -1
- package/package.json +13 -8
- package/src/funcs/destinationsCreate.ts +23 -26
- package/src/funcs/destinationsDelete.ts +23 -26
- package/src/funcs/destinationsDisable.ts +23 -26
- package/src/funcs/destinationsEnable.ts +23 -26
- package/src/funcs/destinationsGet.ts +23 -26
- package/src/funcs/destinationsList.ts +23 -26
- package/src/funcs/destinationsUpdate.ts +23 -26
- package/src/funcs/eventsGet.ts +23 -26
- package/src/funcs/eventsGetByDestination.ts +23 -26
- package/src/funcs/eventsList.ts +23 -26
- package/src/funcs/eventsListByDestination.ts +23 -26
- package/src/funcs/eventsListDeliveries.ts +23 -26
- package/src/funcs/eventsRetry.ts +23 -26
- package/src/funcs/healthCheck.ts +23 -29
- package/src/funcs/publishEvent.ts +29 -35
- package/src/funcs/schemasGet.ts +23 -26
- package/src/funcs/schemasGetDestinationTypeJwt.ts +23 -26
- package/src/funcs/schemasListDestinationTypesJwt.ts +23 -29
- package/src/funcs/schemasListTenantDestinationTypes.ts +23 -26
- package/src/funcs/tenantsDelete.ts +23 -26
- package/src/funcs/tenantsGet.ts +23 -26
- package/src/funcs/tenantsGetPortalUrl.ts +23 -26
- package/src/funcs/tenantsGetToken.ts +23 -26
- package/src/funcs/tenantsUpsert.ts +24 -30
- package/src/funcs/topicsList.ts +23 -26
- package/src/funcs/topicsListJwt.ts +23 -29
- package/src/hooks/types.ts +2 -0
- package/src/index.ts +2 -0
- package/src/lib/config.ts +7 -3
- package/src/lib/files.ts +42 -0
- package/src/lib/matchers.ts +44 -41
- package/src/lib/sdks.ts +10 -4
- package/src/lib/security.ts +2 -2
- package/src/mcp-server/cli/start/command.ts +0 -13
- package/src/mcp-server/cli/start/impl.ts +4 -8
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
- package/src/mcp-server/tools/publishEvent.ts +3 -1
- package/src/models/components/azureservicebusconfig.ts +69 -0
- package/src/models/components/azureservicebuscredentials.ts +78 -0
- package/src/models/components/destination.ts +30 -12
- package/src/models/components/destinationazureservicebus.ts +187 -0
- package/src/models/components/destinationcreate.ts +42 -24
- package/src/models/components/destinationcreateazureservicebus.ts +149 -0
- package/src/models/components/index.ts +5 -0
- package/src/models/components/publishrequest.ts +20 -13
- package/src/models/components/publishresponse.ts +67 -0
- package/src/models/errors/apierror.ts +29 -16
- package/src/models/errors/badrequesterror.ts +16 -8
- package/src/models/errors/index.ts +1 -0
- package/src/models/errors/internalservererror.ts +16 -8
- package/src/models/errors/notfounderror.ts +16 -8
- package/src/models/errors/outposterror.ts +35 -0
- package/src/models/errors/ratelimitederror.ts +16 -8
- package/src/models/errors/responsevalidationerror.ts +50 -0
- package/src/models/errors/sdkvalidationerror.ts +12 -0
- package/src/models/errors/timeouterror.ts +16 -8
- package/src/models/errors/unauthorizederror.ts +16 -8
- package/src/sdk/publish.ts +1 -1
- package/src/types/constdatetime.ts +1 -1
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
9
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
import {
|
|
12
|
+
AzureServiceBusConfig,
|
|
13
|
+
AzureServiceBusConfig$inboundSchema,
|
|
14
|
+
AzureServiceBusConfig$Outbound,
|
|
15
|
+
AzureServiceBusConfig$outboundSchema,
|
|
16
|
+
} from "./azureservicebusconfig.js";
|
|
17
|
+
import {
|
|
18
|
+
AzureServiceBusCredentials,
|
|
19
|
+
AzureServiceBusCredentials$inboundSchema,
|
|
20
|
+
AzureServiceBusCredentials$Outbound,
|
|
21
|
+
AzureServiceBusCredentials$outboundSchema,
|
|
22
|
+
} from "./azureservicebuscredentials.js";
|
|
23
|
+
import {
|
|
24
|
+
Topics,
|
|
25
|
+
Topics$inboundSchema,
|
|
26
|
+
Topics$Outbound,
|
|
27
|
+
Topics$outboundSchema,
|
|
28
|
+
} from "./topics.js";
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Type of the destination.
|
|
32
|
+
*/
|
|
33
|
+
export const DestinationAzureServiceBusType = {
|
|
34
|
+
AzureServicebus: "azure_servicebus",
|
|
35
|
+
} as const;
|
|
36
|
+
/**
|
|
37
|
+
* Type of the destination.
|
|
38
|
+
*/
|
|
39
|
+
export type DestinationAzureServiceBusType = ClosedEnum<
|
|
40
|
+
typeof DestinationAzureServiceBusType
|
|
41
|
+
>;
|
|
42
|
+
|
|
43
|
+
export type DestinationAzureServiceBus = {
|
|
44
|
+
/**
|
|
45
|
+
* Control plane generated ID or user provided ID for the destination.
|
|
46
|
+
*/
|
|
47
|
+
id: string;
|
|
48
|
+
/**
|
|
49
|
+
* Type of the destination.
|
|
50
|
+
*/
|
|
51
|
+
type: DestinationAzureServiceBusType;
|
|
52
|
+
/**
|
|
53
|
+
* "*" or an array of enabled topics.
|
|
54
|
+
*/
|
|
55
|
+
topics: Topics;
|
|
56
|
+
/**
|
|
57
|
+
* ISO Date when the destination was disabled, or null if enabled.
|
|
58
|
+
*/
|
|
59
|
+
disabledAt: Date | null;
|
|
60
|
+
/**
|
|
61
|
+
* ISO Date when the destination was created.
|
|
62
|
+
*/
|
|
63
|
+
createdAt: Date;
|
|
64
|
+
config: AzureServiceBusConfig;
|
|
65
|
+
credentials: AzureServiceBusCredentials;
|
|
66
|
+
/**
|
|
67
|
+
* A human-readable representation of the destination target (Azure Service Bus queue/topic name). Read-only.
|
|
68
|
+
*/
|
|
69
|
+
target?: string | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* A URL link to the destination target (Azure Portal link to the Service Bus). Read-only.
|
|
72
|
+
*/
|
|
73
|
+
targetUrl?: string | null | undefined;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
/** @internal */
|
|
77
|
+
export const DestinationAzureServiceBusType$inboundSchema: z.ZodNativeEnum<
|
|
78
|
+
typeof DestinationAzureServiceBusType
|
|
79
|
+
> = z.nativeEnum(DestinationAzureServiceBusType);
|
|
80
|
+
|
|
81
|
+
/** @internal */
|
|
82
|
+
export const DestinationAzureServiceBusType$outboundSchema: z.ZodNativeEnum<
|
|
83
|
+
typeof DestinationAzureServiceBusType
|
|
84
|
+
> = DestinationAzureServiceBusType$inboundSchema;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* @internal
|
|
88
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
89
|
+
*/
|
|
90
|
+
export namespace DestinationAzureServiceBusType$ {
|
|
91
|
+
/** @deprecated use `DestinationAzureServiceBusType$inboundSchema` instead. */
|
|
92
|
+
export const inboundSchema = DestinationAzureServiceBusType$inboundSchema;
|
|
93
|
+
/** @deprecated use `DestinationAzureServiceBusType$outboundSchema` instead. */
|
|
94
|
+
export const outboundSchema = DestinationAzureServiceBusType$outboundSchema;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/** @internal */
|
|
98
|
+
export const DestinationAzureServiceBus$inboundSchema: z.ZodType<
|
|
99
|
+
DestinationAzureServiceBus,
|
|
100
|
+
z.ZodTypeDef,
|
|
101
|
+
unknown
|
|
102
|
+
> = z.object({
|
|
103
|
+
id: z.string(),
|
|
104
|
+
type: DestinationAzureServiceBusType$inboundSchema,
|
|
105
|
+
topics: Topics$inboundSchema,
|
|
106
|
+
disabled_at: z.nullable(
|
|
107
|
+
z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
108
|
+
),
|
|
109
|
+
created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
110
|
+
config: AzureServiceBusConfig$inboundSchema,
|
|
111
|
+
credentials: AzureServiceBusCredentials$inboundSchema,
|
|
112
|
+
target: z.string().optional(),
|
|
113
|
+
target_url: z.nullable(z.string()).optional(),
|
|
114
|
+
}).transform((v) => {
|
|
115
|
+
return remap$(v, {
|
|
116
|
+
"disabled_at": "disabledAt",
|
|
117
|
+
"created_at": "createdAt",
|
|
118
|
+
"target_url": "targetUrl",
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
/** @internal */
|
|
123
|
+
export type DestinationAzureServiceBus$Outbound = {
|
|
124
|
+
id: string;
|
|
125
|
+
type: string;
|
|
126
|
+
topics: Topics$Outbound;
|
|
127
|
+
disabled_at: string | null;
|
|
128
|
+
created_at: string;
|
|
129
|
+
config: AzureServiceBusConfig$Outbound;
|
|
130
|
+
credentials: AzureServiceBusCredentials$Outbound;
|
|
131
|
+
target?: string | undefined;
|
|
132
|
+
target_url?: string | null | undefined;
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
/** @internal */
|
|
136
|
+
export const DestinationAzureServiceBus$outboundSchema: z.ZodType<
|
|
137
|
+
DestinationAzureServiceBus$Outbound,
|
|
138
|
+
z.ZodTypeDef,
|
|
139
|
+
DestinationAzureServiceBus
|
|
140
|
+
> = z.object({
|
|
141
|
+
id: z.string(),
|
|
142
|
+
type: DestinationAzureServiceBusType$outboundSchema,
|
|
143
|
+
topics: Topics$outboundSchema,
|
|
144
|
+
disabledAt: z.nullable(z.date().transform(v => v.toISOString())),
|
|
145
|
+
createdAt: z.date().transform(v => v.toISOString()),
|
|
146
|
+
config: AzureServiceBusConfig$outboundSchema,
|
|
147
|
+
credentials: AzureServiceBusCredentials$outboundSchema,
|
|
148
|
+
target: z.string().optional(),
|
|
149
|
+
targetUrl: z.nullable(z.string()).optional(),
|
|
150
|
+
}).transform((v) => {
|
|
151
|
+
return remap$(v, {
|
|
152
|
+
disabledAt: "disabled_at",
|
|
153
|
+
createdAt: "created_at",
|
|
154
|
+
targetUrl: "target_url",
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* @internal
|
|
160
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
161
|
+
*/
|
|
162
|
+
export namespace DestinationAzureServiceBus$ {
|
|
163
|
+
/** @deprecated use `DestinationAzureServiceBus$inboundSchema` instead. */
|
|
164
|
+
export const inboundSchema = DestinationAzureServiceBus$inboundSchema;
|
|
165
|
+
/** @deprecated use `DestinationAzureServiceBus$outboundSchema` instead. */
|
|
166
|
+
export const outboundSchema = DestinationAzureServiceBus$outboundSchema;
|
|
167
|
+
/** @deprecated use `DestinationAzureServiceBus$Outbound` instead. */
|
|
168
|
+
export type Outbound = DestinationAzureServiceBus$Outbound;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export function destinationAzureServiceBusToJSON(
|
|
172
|
+
destinationAzureServiceBus: DestinationAzureServiceBus,
|
|
173
|
+
): string {
|
|
174
|
+
return JSON.stringify(
|
|
175
|
+
DestinationAzureServiceBus$outboundSchema.parse(destinationAzureServiceBus),
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export function destinationAzureServiceBusFromJSON(
|
|
180
|
+
jsonString: string,
|
|
181
|
+
): SafeParseResult<DestinationAzureServiceBus, SDKValidationError> {
|
|
182
|
+
return safeParse(
|
|
183
|
+
jsonString,
|
|
184
|
+
(x) => DestinationAzureServiceBus$inboundSchema.parse(JSON.parse(x)),
|
|
185
|
+
`Failed to parse 'DestinationAzureServiceBus' from JSON`,
|
|
186
|
+
);
|
|
187
|
+
}
|
|
@@ -18,6 +18,12 @@ import {
|
|
|
18
18
|
DestinationCreateAWSSQS$Outbound,
|
|
19
19
|
DestinationCreateAWSSQS$outboundSchema,
|
|
20
20
|
} from "./destinationcreateawssqs.js";
|
|
21
|
+
import {
|
|
22
|
+
DestinationCreateAzureServiceBus,
|
|
23
|
+
DestinationCreateAzureServiceBus$inboundSchema,
|
|
24
|
+
DestinationCreateAzureServiceBus$Outbound,
|
|
25
|
+
DestinationCreateAzureServiceBus$outboundSchema,
|
|
26
|
+
} from "./destinationcreateazureservicebus.js";
|
|
21
27
|
import {
|
|
22
28
|
DestinationCreateHookdeck,
|
|
23
29
|
DestinationCreateHookdeck$inboundSchema,
|
|
@@ -38,11 +44,12 @@ import {
|
|
|
38
44
|
} from "./destinationcreatewebhook.js";
|
|
39
45
|
|
|
40
46
|
export type DestinationCreate =
|
|
41
|
-
| (DestinationCreateWebhook & { type: "webhook" })
|
|
42
47
|
| (DestinationCreateAWSSQS & { type: "aws_sqs" })
|
|
43
48
|
| (DestinationCreateRabbitMQ & { type: "rabbitmq" })
|
|
44
|
-
| (
|
|
45
|
-
| (
|
|
49
|
+
| (DestinationCreateAWSKinesis & { type: "aws_kinesis" })
|
|
50
|
+
| (DestinationCreateAzureServiceBus & { type: "azure_servicebus" })
|
|
51
|
+
| (DestinationCreateWebhook & { type: "webhook" })
|
|
52
|
+
| (DestinationCreateHookdeck & { type: "hookdeck" });
|
|
46
53
|
|
|
47
54
|
/** @internal */
|
|
48
55
|
export const DestinationCreate$inboundSchema: z.ZodType<
|
|
@@ -50,11 +57,6 @@ export const DestinationCreate$inboundSchema: z.ZodType<
|
|
|
50
57
|
z.ZodTypeDef,
|
|
51
58
|
unknown
|
|
52
59
|
> = z.union([
|
|
53
|
-
DestinationCreateWebhook$inboundSchema.and(
|
|
54
|
-
z.object({ type: z.literal("webhook") }).transform((v) => ({
|
|
55
|
-
type: v.type,
|
|
56
|
-
})),
|
|
57
|
-
),
|
|
58
60
|
DestinationCreateAWSSQS$inboundSchema.and(
|
|
59
61
|
z.object({ type: z.literal("aws_sqs") }).transform((v) => ({
|
|
60
62
|
type: v.type,
|
|
@@ -65,13 +67,23 @@ export const DestinationCreate$inboundSchema: z.ZodType<
|
|
|
65
67
|
type: v.type,
|
|
66
68
|
})),
|
|
67
69
|
),
|
|
68
|
-
|
|
69
|
-
z.object({ type: z.literal("
|
|
70
|
+
DestinationCreateAWSKinesis$inboundSchema.and(
|
|
71
|
+
z.object({ type: z.literal("aws_kinesis") }).transform((v) => ({
|
|
70
72
|
type: v.type,
|
|
71
73
|
})),
|
|
72
74
|
),
|
|
73
|
-
|
|
74
|
-
z.object({ type: z.literal("
|
|
75
|
+
DestinationCreateAzureServiceBus$inboundSchema.and(
|
|
76
|
+
z.object({ type: z.literal("azure_servicebus") }).transform((v) => ({
|
|
77
|
+
type: v.type,
|
|
78
|
+
})),
|
|
79
|
+
),
|
|
80
|
+
DestinationCreateWebhook$inboundSchema.and(
|
|
81
|
+
z.object({ type: z.literal("webhook") }).transform((v) => ({
|
|
82
|
+
type: v.type,
|
|
83
|
+
})),
|
|
84
|
+
),
|
|
85
|
+
DestinationCreateHookdeck$inboundSchema.and(
|
|
86
|
+
z.object({ type: z.literal("hookdeck") }).transform((v) => ({
|
|
75
87
|
type: v.type,
|
|
76
88
|
})),
|
|
77
89
|
),
|
|
@@ -79,11 +91,12 @@ export const DestinationCreate$inboundSchema: z.ZodType<
|
|
|
79
91
|
|
|
80
92
|
/** @internal */
|
|
81
93
|
export type DestinationCreate$Outbound =
|
|
82
|
-
| (DestinationCreateWebhook$Outbound & { type: "webhook" })
|
|
83
94
|
| (DestinationCreateAWSSQS$Outbound & { type: "aws_sqs" })
|
|
84
95
|
| (DestinationCreateRabbitMQ$Outbound & { type: "rabbitmq" })
|
|
85
|
-
| (
|
|
86
|
-
| (
|
|
96
|
+
| (DestinationCreateAWSKinesis$Outbound & { type: "aws_kinesis" })
|
|
97
|
+
| (DestinationCreateAzureServiceBus$Outbound & { type: "azure_servicebus" })
|
|
98
|
+
| (DestinationCreateWebhook$Outbound & { type: "webhook" })
|
|
99
|
+
| (DestinationCreateHookdeck$Outbound & { type: "hookdeck" });
|
|
87
100
|
|
|
88
101
|
/** @internal */
|
|
89
102
|
export const DestinationCreate$outboundSchema: z.ZodType<
|
|
@@ -91,11 +104,6 @@ export const DestinationCreate$outboundSchema: z.ZodType<
|
|
|
91
104
|
z.ZodTypeDef,
|
|
92
105
|
DestinationCreate
|
|
93
106
|
> = z.union([
|
|
94
|
-
DestinationCreateWebhook$outboundSchema.and(
|
|
95
|
-
z.object({ type: z.literal("webhook") }).transform((v) => ({
|
|
96
|
-
type: v.type,
|
|
97
|
-
})),
|
|
98
|
-
),
|
|
99
107
|
DestinationCreateAWSSQS$outboundSchema.and(
|
|
100
108
|
z.object({ type: z.literal("aws_sqs") }).transform((v) => ({
|
|
101
109
|
type: v.type,
|
|
@@ -106,13 +114,23 @@ export const DestinationCreate$outboundSchema: z.ZodType<
|
|
|
106
114
|
type: v.type,
|
|
107
115
|
})),
|
|
108
116
|
),
|
|
109
|
-
|
|
110
|
-
z.object({ type: z.literal("
|
|
117
|
+
DestinationCreateAWSKinesis$outboundSchema.and(
|
|
118
|
+
z.object({ type: z.literal("aws_kinesis") }).transform((v) => ({
|
|
111
119
|
type: v.type,
|
|
112
120
|
})),
|
|
113
121
|
),
|
|
114
|
-
|
|
115
|
-
z.object({ type: z.literal("
|
|
122
|
+
DestinationCreateAzureServiceBus$outboundSchema.and(
|
|
123
|
+
z.object({ type: z.literal("azure_servicebus") }).transform((v) => ({
|
|
124
|
+
type: v.type,
|
|
125
|
+
})),
|
|
126
|
+
),
|
|
127
|
+
DestinationCreateWebhook$outboundSchema.and(
|
|
128
|
+
z.object({ type: z.literal("webhook") }).transform((v) => ({
|
|
129
|
+
type: v.type,
|
|
130
|
+
})),
|
|
131
|
+
),
|
|
132
|
+
DestinationCreateHookdeck$outboundSchema.and(
|
|
133
|
+
z.object({ type: z.literal("hookdeck") }).transform((v) => ({
|
|
116
134
|
type: v.type,
|
|
117
135
|
})),
|
|
118
136
|
),
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
import {
|
|
11
|
+
AzureServiceBusConfig,
|
|
12
|
+
AzureServiceBusConfig$inboundSchema,
|
|
13
|
+
AzureServiceBusConfig$Outbound,
|
|
14
|
+
AzureServiceBusConfig$outboundSchema,
|
|
15
|
+
} from "./azureservicebusconfig.js";
|
|
16
|
+
import {
|
|
17
|
+
AzureServiceBusCredentials,
|
|
18
|
+
AzureServiceBusCredentials$inboundSchema,
|
|
19
|
+
AzureServiceBusCredentials$Outbound,
|
|
20
|
+
AzureServiceBusCredentials$outboundSchema,
|
|
21
|
+
} from "./azureservicebuscredentials.js";
|
|
22
|
+
import {
|
|
23
|
+
Topics,
|
|
24
|
+
Topics$inboundSchema,
|
|
25
|
+
Topics$Outbound,
|
|
26
|
+
Topics$outboundSchema,
|
|
27
|
+
} from "./topics.js";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Type of the destination. Must be 'azure_servicebus'.
|
|
31
|
+
*/
|
|
32
|
+
export const DestinationCreateAzureServiceBusType = {
|
|
33
|
+
AzureServicebus: "azure_servicebus",
|
|
34
|
+
} as const;
|
|
35
|
+
/**
|
|
36
|
+
* Type of the destination. Must be 'azure_servicebus'.
|
|
37
|
+
*/
|
|
38
|
+
export type DestinationCreateAzureServiceBusType = ClosedEnum<
|
|
39
|
+
typeof DestinationCreateAzureServiceBusType
|
|
40
|
+
>;
|
|
41
|
+
|
|
42
|
+
export type DestinationCreateAzureServiceBus = {
|
|
43
|
+
/**
|
|
44
|
+
* Optional user-provided ID. A UUID will be generated if empty.
|
|
45
|
+
*/
|
|
46
|
+
id?: string | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* Type of the destination. Must be 'azure_servicebus'.
|
|
49
|
+
*/
|
|
50
|
+
type: DestinationCreateAzureServiceBusType;
|
|
51
|
+
/**
|
|
52
|
+
* "*" or an array of enabled topics.
|
|
53
|
+
*/
|
|
54
|
+
topics: Topics;
|
|
55
|
+
config: AzureServiceBusConfig;
|
|
56
|
+
credentials: AzureServiceBusCredentials;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/** @internal */
|
|
60
|
+
export const DestinationCreateAzureServiceBusType$inboundSchema:
|
|
61
|
+
z.ZodNativeEnum<typeof DestinationCreateAzureServiceBusType> = z.nativeEnum(
|
|
62
|
+
DestinationCreateAzureServiceBusType,
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
/** @internal */
|
|
66
|
+
export const DestinationCreateAzureServiceBusType$outboundSchema:
|
|
67
|
+
z.ZodNativeEnum<typeof DestinationCreateAzureServiceBusType> =
|
|
68
|
+
DestinationCreateAzureServiceBusType$inboundSchema;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* @internal
|
|
72
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
73
|
+
*/
|
|
74
|
+
export namespace DestinationCreateAzureServiceBusType$ {
|
|
75
|
+
/** @deprecated use `DestinationCreateAzureServiceBusType$inboundSchema` instead. */
|
|
76
|
+
export const inboundSchema =
|
|
77
|
+
DestinationCreateAzureServiceBusType$inboundSchema;
|
|
78
|
+
/** @deprecated use `DestinationCreateAzureServiceBusType$outboundSchema` instead. */
|
|
79
|
+
export const outboundSchema =
|
|
80
|
+
DestinationCreateAzureServiceBusType$outboundSchema;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** @internal */
|
|
84
|
+
export const DestinationCreateAzureServiceBus$inboundSchema: z.ZodType<
|
|
85
|
+
DestinationCreateAzureServiceBus,
|
|
86
|
+
z.ZodTypeDef,
|
|
87
|
+
unknown
|
|
88
|
+
> = z.object({
|
|
89
|
+
id: z.string().optional(),
|
|
90
|
+
type: DestinationCreateAzureServiceBusType$inboundSchema,
|
|
91
|
+
topics: Topics$inboundSchema,
|
|
92
|
+
config: AzureServiceBusConfig$inboundSchema,
|
|
93
|
+
credentials: AzureServiceBusCredentials$inboundSchema,
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
/** @internal */
|
|
97
|
+
export type DestinationCreateAzureServiceBus$Outbound = {
|
|
98
|
+
id?: string | undefined;
|
|
99
|
+
type: string;
|
|
100
|
+
topics: Topics$Outbound;
|
|
101
|
+
config: AzureServiceBusConfig$Outbound;
|
|
102
|
+
credentials: AzureServiceBusCredentials$Outbound;
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
/** @internal */
|
|
106
|
+
export const DestinationCreateAzureServiceBus$outboundSchema: z.ZodType<
|
|
107
|
+
DestinationCreateAzureServiceBus$Outbound,
|
|
108
|
+
z.ZodTypeDef,
|
|
109
|
+
DestinationCreateAzureServiceBus
|
|
110
|
+
> = z.object({
|
|
111
|
+
id: z.string().optional(),
|
|
112
|
+
type: DestinationCreateAzureServiceBusType$outboundSchema,
|
|
113
|
+
topics: Topics$outboundSchema,
|
|
114
|
+
config: AzureServiceBusConfig$outboundSchema,
|
|
115
|
+
credentials: AzureServiceBusCredentials$outboundSchema,
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* @internal
|
|
120
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
121
|
+
*/
|
|
122
|
+
export namespace DestinationCreateAzureServiceBus$ {
|
|
123
|
+
/** @deprecated use `DestinationCreateAzureServiceBus$inboundSchema` instead. */
|
|
124
|
+
export const inboundSchema = DestinationCreateAzureServiceBus$inboundSchema;
|
|
125
|
+
/** @deprecated use `DestinationCreateAzureServiceBus$outboundSchema` instead. */
|
|
126
|
+
export const outboundSchema = DestinationCreateAzureServiceBus$outboundSchema;
|
|
127
|
+
/** @deprecated use `DestinationCreateAzureServiceBus$Outbound` instead. */
|
|
128
|
+
export type Outbound = DestinationCreateAzureServiceBus$Outbound;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export function destinationCreateAzureServiceBusToJSON(
|
|
132
|
+
destinationCreateAzureServiceBus: DestinationCreateAzureServiceBus,
|
|
133
|
+
): string {
|
|
134
|
+
return JSON.stringify(
|
|
135
|
+
DestinationCreateAzureServiceBus$outboundSchema.parse(
|
|
136
|
+
destinationCreateAzureServiceBus,
|
|
137
|
+
),
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export function destinationCreateAzureServiceBusFromJSON(
|
|
142
|
+
jsonString: string,
|
|
143
|
+
): SafeParseResult<DestinationCreateAzureServiceBus, SDKValidationError> {
|
|
144
|
+
return safeParse(
|
|
145
|
+
jsonString,
|
|
146
|
+
(x) => DestinationCreateAzureServiceBus$inboundSchema.parse(JSON.parse(x)),
|
|
147
|
+
`Failed to parse 'DestinationCreateAzureServiceBus' from JSON`,
|
|
148
|
+
);
|
|
149
|
+
}
|
|
@@ -6,13 +6,17 @@ export * from "./awskinesisconfig.js";
|
|
|
6
6
|
export * from "./awskinesiscredentials.js";
|
|
7
7
|
export * from "./awssqsconfig.js";
|
|
8
8
|
export * from "./awssqscredentials.js";
|
|
9
|
+
export * from "./azureservicebusconfig.js";
|
|
10
|
+
export * from "./azureservicebuscredentials.js";
|
|
9
11
|
export * from "./deliveryattempt.js";
|
|
10
12
|
export * from "./destination.js";
|
|
11
13
|
export * from "./destinationawskinesis.js";
|
|
12
14
|
export * from "./destinationawssqs.js";
|
|
15
|
+
export * from "./destinationazureservicebus.js";
|
|
13
16
|
export * from "./destinationcreate.js";
|
|
14
17
|
export * from "./destinationcreateawskinesis.js";
|
|
15
18
|
export * from "./destinationcreateawssqs.js";
|
|
19
|
+
export * from "./destinationcreateazureservicebus.js";
|
|
16
20
|
export * from "./destinationcreatehookdeck.js";
|
|
17
21
|
export * from "./destinationcreaterabbitmq.js";
|
|
18
22
|
export * from "./destinationcreatewebhook.js";
|
|
@@ -31,6 +35,7 @@ export * from "./event.js";
|
|
|
31
35
|
export * from "./hookdeckcredentials.js";
|
|
32
36
|
export * from "./portalredirect.js";
|
|
33
37
|
export * from "./publishrequest.js";
|
|
38
|
+
export * from "./publishresponse.js";
|
|
34
39
|
export * from "./rabbitmqconfig.js";
|
|
35
40
|
export * from "./rabbitmqcredentials.js";
|
|
36
41
|
export * from "./security.js";
|
|
@@ -9,22 +9,26 @@ import { Result as SafeParseResult } from "../../types/fp.js";
|
|
|
9
9
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
10
|
|
|
11
11
|
export type PublishRequest = {
|
|
12
|
+
/**
|
|
13
|
+
* Optional. A unique identifier for the event. If not provided, a UUID will be generated.
|
|
14
|
+
*/
|
|
15
|
+
id?: string | undefined;
|
|
12
16
|
/**
|
|
13
17
|
* The ID of the tenant to publish for.
|
|
14
18
|
*/
|
|
15
|
-
tenantId
|
|
19
|
+
tenantId?: string | undefined;
|
|
16
20
|
/**
|
|
17
21
|
* Optional. Route event to a specific destination.
|
|
18
22
|
*/
|
|
19
23
|
destinationId?: string | undefined;
|
|
20
24
|
/**
|
|
21
|
-
* Topic name for the event.
|
|
25
|
+
* Topic name for the event. Required if Outpost has been configured with topics.
|
|
22
26
|
*/
|
|
23
|
-
topic
|
|
27
|
+
topic?: string | undefined;
|
|
24
28
|
/**
|
|
25
29
|
* Should event delivery be retried on failure.
|
|
26
30
|
*/
|
|
27
|
-
eligibleForRetry
|
|
31
|
+
eligibleForRetry?: boolean | undefined;
|
|
28
32
|
/**
|
|
29
33
|
* Any key-value string pairs for metadata.
|
|
30
34
|
*/
|
|
@@ -41,10 +45,11 @@ export const PublishRequest$inboundSchema: z.ZodType<
|
|
|
41
45
|
z.ZodTypeDef,
|
|
42
46
|
unknown
|
|
43
47
|
> = z.object({
|
|
44
|
-
|
|
48
|
+
id: z.string().optional(),
|
|
49
|
+
tenant_id: z.string().optional(),
|
|
45
50
|
destination_id: z.string().optional(),
|
|
46
|
-
topic: z.string(),
|
|
47
|
-
eligible_for_retry: z.boolean(),
|
|
51
|
+
topic: z.string().optional(),
|
|
52
|
+
eligible_for_retry: z.boolean().optional(),
|
|
48
53
|
metadata: z.record(z.string()).optional(),
|
|
49
54
|
data: z.record(z.any()),
|
|
50
55
|
}).transform((v) => {
|
|
@@ -57,10 +62,11 @@ export const PublishRequest$inboundSchema: z.ZodType<
|
|
|
57
62
|
|
|
58
63
|
/** @internal */
|
|
59
64
|
export type PublishRequest$Outbound = {
|
|
60
|
-
|
|
65
|
+
id?: string | undefined;
|
|
66
|
+
tenant_id?: string | undefined;
|
|
61
67
|
destination_id?: string | undefined;
|
|
62
|
-
topic
|
|
63
|
-
eligible_for_retry
|
|
68
|
+
topic?: string | undefined;
|
|
69
|
+
eligible_for_retry?: boolean | undefined;
|
|
64
70
|
metadata?: { [k: string]: string } | undefined;
|
|
65
71
|
data: { [k: string]: any };
|
|
66
72
|
};
|
|
@@ -71,10 +77,11 @@ export const PublishRequest$outboundSchema: z.ZodType<
|
|
|
71
77
|
z.ZodTypeDef,
|
|
72
78
|
PublishRequest
|
|
73
79
|
> = z.object({
|
|
74
|
-
|
|
80
|
+
id: z.string().optional(),
|
|
81
|
+
tenantId: z.string().optional(),
|
|
75
82
|
destinationId: z.string().optional(),
|
|
76
|
-
topic: z.string(),
|
|
77
|
-
eligibleForRetry: z.boolean(),
|
|
83
|
+
topic: z.string().optional(),
|
|
84
|
+
eligibleForRetry: z.boolean().optional(),
|
|
78
85
|
metadata: z.record(z.string()).optional(),
|
|
79
86
|
data: z.record(z.any()),
|
|
80
87
|
}).transform((v) => {
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
|
|
10
|
+
export type PublishResponse = {
|
|
11
|
+
/**
|
|
12
|
+
* The ID of the event that was accepted for publishing. This will be the ID provided in the request's `id` field if present, otherwise it's a server-generated UUID.
|
|
13
|
+
*/
|
|
14
|
+
id: string;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/** @internal */
|
|
18
|
+
export const PublishResponse$inboundSchema: z.ZodType<
|
|
19
|
+
PublishResponse,
|
|
20
|
+
z.ZodTypeDef,
|
|
21
|
+
unknown
|
|
22
|
+
> = z.object({
|
|
23
|
+
id: z.string(),
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
/** @internal */
|
|
27
|
+
export type PublishResponse$Outbound = {
|
|
28
|
+
id: string;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/** @internal */
|
|
32
|
+
export const PublishResponse$outboundSchema: z.ZodType<
|
|
33
|
+
PublishResponse$Outbound,
|
|
34
|
+
z.ZodTypeDef,
|
|
35
|
+
PublishResponse
|
|
36
|
+
> = z.object({
|
|
37
|
+
id: z.string(),
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @internal
|
|
42
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
43
|
+
*/
|
|
44
|
+
export namespace PublishResponse$ {
|
|
45
|
+
/** @deprecated use `PublishResponse$inboundSchema` instead. */
|
|
46
|
+
export const inboundSchema = PublishResponse$inboundSchema;
|
|
47
|
+
/** @deprecated use `PublishResponse$outboundSchema` instead. */
|
|
48
|
+
export const outboundSchema = PublishResponse$outboundSchema;
|
|
49
|
+
/** @deprecated use `PublishResponse$Outbound` instead. */
|
|
50
|
+
export type Outbound = PublishResponse$Outbound;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function publishResponseToJSON(
|
|
54
|
+
publishResponse: PublishResponse,
|
|
55
|
+
): string {
|
|
56
|
+
return JSON.stringify(PublishResponse$outboundSchema.parse(publishResponse));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function publishResponseFromJSON(
|
|
60
|
+
jsonString: string,
|
|
61
|
+
): SafeParseResult<PublishResponse, SDKValidationError> {
|
|
62
|
+
return safeParse(
|
|
63
|
+
jsonString,
|
|
64
|
+
(x) => PublishResponse$inboundSchema.parse(JSON.parse(x)),
|
|
65
|
+
`Failed to parse 'PublishResponse' from JSON`,
|
|
66
|
+
);
|
|
67
|
+
}
|
|
@@ -2,26 +2,39 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
public readonly statusCode: number;
|
|
7
|
-
public readonly contentType: string;
|
|
5
|
+
import { OutpostError } from "./outposterror.js";
|
|
8
6
|
|
|
7
|
+
/** The fallback error class if no more specific error class is matched */
|
|
8
|
+
export class APIError extends OutpostError {
|
|
9
9
|
constructor(
|
|
10
10
|
message: string,
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
httpMeta: {
|
|
12
|
+
response: Response;
|
|
13
|
+
request: Request;
|
|
14
|
+
body: string;
|
|
15
|
+
},
|
|
13
16
|
) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
if (message) {
|
|
18
|
+
message += `: `;
|
|
19
|
+
}
|
|
20
|
+
message += `Status ${httpMeta.response.status}`;
|
|
21
|
+
const contentType = httpMeta.response.headers.get("content-type") || `""`;
|
|
22
|
+
if (contentType !== "application/json") {
|
|
23
|
+
message += ` Content-Type ${
|
|
24
|
+
contentType.includes(" ") ? `"${contentType}"` : contentType
|
|
25
|
+
}`;
|
|
26
|
+
}
|
|
27
|
+
const body = httpMeta.body || `""`;
|
|
28
|
+
message += body.length > 100 ? "\n" : ". ";
|
|
29
|
+
let bodyDisplay = body;
|
|
30
|
+
if (body.length > 10000) {
|
|
31
|
+
const truncated = body.substring(0, 10000);
|
|
32
|
+
const remaining = body.length - 10000;
|
|
33
|
+
bodyDisplay = `${truncated}...and ${remaining} more chars`;
|
|
34
|
+
}
|
|
35
|
+
message += `Body: ${bodyDisplay}`;
|
|
36
|
+
message = message.trim();
|
|
37
|
+
super(message, httpMeta);
|
|
25
38
|
this.name = "APIError";
|
|
26
39
|
}
|
|
27
40
|
}
|