diff --git a/.gitignore b/.gitignore index cc2681a5..3dea90f1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,9 @@ +/funcs +/core.* +/esm +/dist +/.tshy +/.tshy-* /models /models/errors /types diff --git a/.npmignore b/.npmignore index 709e6847..3ef05d12 100644 --- a/.npmignore +++ b/.npmignore @@ -5,3 +5,5 @@ /.eslintrc.js /cjs +/.tshy +/.tshy-* diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 8b928bc2..9859d70f 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,40 +1,125 @@ lockVersion: 2.0.0 id: f50499c4-d106-4975-983f-ead3a386ec53 management: - docChecksum: 1eadec3f5478d02504091b0e2b5b2ee0 + docChecksum: 354d2525ed35586556a73e611be4287c docVersion: "1.0" - speakeasyVersion: 1.322.3 - generationVersion: 2.354.2 - releaseVersion: 0.0.1-alpha.9 - configChecksum: 29fb899ef19d96629eaf20333f0647b0 - repoURL: https://github.com/novuhq/novu-node.git - installationURL: https://github.com/novuhq/novu-node + speakeasyVersion: 1.386.0 + generationVersion: 2.407.2 + releaseVersion: 0.0.1-alpha.10 + configChecksum: 6c89568ad5bb1893767117b0a04ea113 + repoURL: https://github.com/novuhq/novu-ts.git + installationURL: https://github.com/novuhq/novu-ts published: true features: typescript: additionalDependencies: 0.1.0 - constsAndDefaults: 0.1.5 - core: 3.10.2 + constsAndDefaults: 0.1.11 + core: 3.14.2 + defaultEnabledRetries: 0.1.0 deprecations: 2.81.1 + envVarSecurityUsage: 0.1.1 examples: 2.81.4 flattening: 2.81.1 - globalSecurity: 2.82.9 + globalSecurity: 2.82.11 globalSecurityCallbacks: 0.1.0 globalSecurityFlattening: 0.1.0 globalServerURLs: 2.82.4 groups: 2.81.2 nameOverrides: 2.81.2 nullables: 0.1.0 - pagination: 2.82.2 + pagination: 2.82.6 responseFormat: 0.2.3 retries: 2.83.0 sdkHooks: 0.1.0 - unions: 2.85.5 + unions: 2.85.7 generatedFiles: + - src/funcs/cancel.ts + - src/funcs/trigger.ts + - src/funcs/triggerBroadcast.ts + - src/funcs/triggerBulk.ts + - src/funcs/changesApply.ts + - src/funcs/changesApplyBulk.ts + - src/funcs/changesCount.ts + - src/funcs/changesRetrieve.ts + - src/funcs/environmentsList.ts + - src/funcs/environmentsRetrieve.ts + - src/funcs/executionDetailsRetrieve.ts + - src/funcs/feedsCreate.ts + - src/funcs/feedsDelete.ts + - src/funcs/feedsRetrieve.ts + - src/funcs/integrationsCreate.ts + - src/funcs/integrationsDelete.ts + - src/funcs/integrationsList.ts + - src/funcs/integrationsListActive.ts + - src/funcs/integrationsSetAsPrimary.ts + - src/funcs/integrationsUpdate.ts + - src/funcs/layoutsCreate.ts + - src/funcs/layoutsDelete.ts + - src/funcs/layoutsList.ts + - src/funcs/layoutsRetrieve.ts + - src/funcs/layoutsSetAsDefault.ts + - src/funcs/layoutsUpdate.ts + - src/funcs/messagesDelete.ts + - src/funcs/messagesDeleteByTransactionId.ts + - src/funcs/messagesRetrieve.ts + - src/funcs/workflowGroupsCreate.ts + - src/funcs/workflowGroupsDelete.ts + - src/funcs/workflowGroupsList.ts + - src/funcs/workflowGroupsRetrieve.ts + - src/funcs/workflowGroupsUpdate.ts + - src/funcs/notificationsList.ts + - src/funcs/notificationsRetrieve.ts + - src/funcs/organizationsEEOrganizationControllerRenameOrganization.ts + - src/funcs/organizationsRetrieve.ts + - src/funcs/organizationsUpdate.ts + - src/funcs/subscribersCreate.ts + - src/funcs/subscribersCreateBulk.ts + - src/funcs/subscribersDelete.ts + - src/funcs/subscribersList.ts + - src/funcs/subscribersRetrieve.ts + - src/funcs/subscribersUpdate.ts + - src/funcs/tenantsCreate.ts + - src/funcs/tenantsDelete.ts + - src/funcs/tenantsList.ts + - src/funcs/tenantsRetrieve.ts + - src/funcs/tenantsUpdate.ts + - src/funcs/topicsCreate.ts + - src/funcs/topicsDelete.ts + - src/funcs/topicsList.ts + - src/funcs/topicsRename.ts + - src/funcs/topicsRetrieve.ts + - src/funcs/workflowsCreate.ts + - src/funcs/workflowsDelete.ts + - src/funcs/workflowsList.ts + - src/funcs/workflowsRetrieve.ts + - src/funcs/workflowsUpdate.ts + - src/funcs/environmentsApiKeysList.ts + - src/funcs/integrationsWebhooksRetrieve.ts + - src/funcs/notificationsStatsGraph.ts + - src/funcs/notificationsStatsRetrieve.ts + - src/funcs/subscribersCredentialsAppend.ts + - src/funcs/subscribersCredentialsDelete.ts + - src/funcs/subscribersCredentialsUpdate.ts + - src/funcs/subscribersAuthenticationChatAccessOauth.ts + - src/funcs/subscribersAuthenticationChatAccessOauthCallBack.ts + - src/funcs/subscribersMessagesMarkAll.ts + - src/funcs/subscribersMessagesMarkAllAs.ts + - src/funcs/subscribersMessagesUpdateAsSeen.ts + - src/funcs/subscribersNotificationsRetrieve.ts + - src/funcs/subscribersNotificationsUnseenCount.ts + - src/funcs/subscribersPropertiesUpdateOnlineFlag.ts + - src/funcs/subscribersPreferencesList.ts + - src/funcs/subscribersPreferencesRetrieveByLevel.ts + - src/funcs/subscribersPreferencesUpdate.ts + - src/funcs/subscribersPreferencesUpdateGlobal.ts + - src/funcs/topicsSubscribersAssign.ts + - src/funcs/topicsSubscribersDelete.ts + - src/funcs/topicsSubscribersRetrieve.ts + - src/funcs/workflowsVariablesRetrieve.ts + - src/funcs/workflowsStatusUpdate.ts - src/sdk/changes.ts - src/sdk/apikeys.ts - src/sdk/environments.ts - - src/sdk/events.ts - src/sdk/executiondetails.ts - src/sdk/feeds.ts - src/sdk/webhooks.ts @@ -44,8 +129,6 @@ generatedFiles: - src/sdk/workflowgroups.ts - src/sdk/stats.ts - src/sdk/notifications.ts - - src/sdk/branding.ts - - src/sdk/members.ts - src/sdk/organizations.ts - src/sdk/credentials.ts - src/sdk/authentication.ts @@ -63,15 +146,20 @@ generatedFiles: - src/sdk/sdk.ts - .eslintrc.cjs - .npmignore + - FUNCTIONS.md - RUNTIMES.md - jsr.json - package.json + - src/core.ts - src/index.ts - src/lib/base64.ts - src/lib/config.ts + - src/lib/dlv.ts - src/lib/encodings.ts - src/lib/http.ts - src/lib/is-plain-object.ts + - src/lib/logger.ts + - src/lib/matchers.ts - src/lib/primitives.ts - src/lib/retries.ts - src/lib/schemas.ts @@ -79,30 +167,31 @@ generatedFiles: - src/lib/security.ts - src/lib/url.ts - src/sdk/index.ts + - src/models/errors/httpclienterrors.ts - src/models/errors/sdkerror.ts - src/models/errors/sdkvalidationerror.ts - src/types/blobs.ts + - src/types/constdatetime.ts - src/types/enums.ts + - src/types/fp.ts - src/types/index.ts - src/types/operations.ts - src/types/rfcdate.ts - tsconfig.json + - src/models/components/databooleandto.ts - src/models/components/triggereventresponsedto.ts - src/models/components/triggereventrequestdto.ts - src/models/components/subscriberpayloaddto.ts - - src/models/components/subscriberchanneldto.ts - - src/models/components/channelcredentialsdto.ts - src/models/components/topicpayloaddto.ts - src/models/components/tenantpayloaddto.ts + - src/models/components/triggereventtoallrequestdto.ts + - src/models/components/bulktriggereventdto.ts - src/models/components/changeresponsedto.ts - src/models/components/bulkapplychangedto.ts - src/models/components/datanumberdto.ts - src/models/components/changesresponsedto.ts - src/models/components/environmentresponsedto.ts - src/models/components/apikey.ts - - src/models/components/databooleandto.ts - - src/models/components/triggereventtoallrequestdto.ts - - src/models/components/bulktriggereventdto.ts - src/models/components/executiondetailsresponsedto.ts - src/models/components/feedresponsedto.ts - src/models/components/createfeedrequestdto.ts @@ -118,29 +207,18 @@ generatedFiles: - src/models/components/updatelayoutrequestdto.ts - src/models/components/deletemessageresponsedto.ts - src/models/components/activitiesresponsedto.ts - - src/models/components/activitynotificationresponsedto.ts - - src/models/components/activitynotificationtemplateresponsedto.ts - - src/models/components/notificationtrigger.ts - - src/models/components/notificationtriggervariable.ts - - src/models/components/activitynotificationsubscriberresponsedto.ts - - src/models/components/activitynotificationjobresponsedto.ts - - src/models/components/activitynotificationstepresponsedto.ts - - src/models/components/messagetemplatedto.ts - - src/models/components/activitynotificationexecutiondetailresponsedto.ts - src/models/components/notificationgroupresponsedto.ts - src/models/components/createnotificationgrouprequestdto.ts - src/models/components/deletenotificationgroupresponsedto.ts + - src/models/components/activitynotificationresponsedto.ts + - src/models/components/activitynotificationtemplateresponsedto.ts + - src/models/components/activitynotificationsubscriberresponsedto.ts - src/models/components/activitygraphstatesresponse.ts - src/models/components/activitystatsresponsedto.ts + - src/models/components/renameorganizationdto.ts - src/models/components/organizationresponsedto.ts - - src/models/components/ipartnerconfigurationresponsedto.ts - src/models/components/organizationbrandingresponsedto.ts - - src/models/components/createorganizationdto.ts - - src/models/components/renameorganizationdto.ts - src/models/components/updatebrandingdetailsdto.ts - - src/models/components/memberresponsedto.ts - - src/models/components/memberuserdto.ts - - src/models/components/memberinvitedto.ts - src/models/components/subscriberresponsedto.ts - src/models/components/channelsettings.ts - src/models/components/channelcredentials.ts @@ -154,6 +232,8 @@ generatedFiles: - src/models/components/messagemarkasrequestdto.ts - src/models/components/messageresponsedto.ts - src/models/components/workflowresponse.ts + - src/models/components/notificationtrigger.ts + - src/models/components/notificationtriggervariable.ts - src/models/components/notificationstep.ts - src/models/components/notificationstepvariant.ts - src/models/components/messagetemplate.ts @@ -202,9 +282,9 @@ generatedFiles: - src/models/components/variablesresponsedto.ts - src/models/components/changeworkflowstatusrequestdto.ts - src/models/components/security.ts + - src/models/operations/eventscontrollercancel.ts - src/models/operations/changescontrollerapplydiff.ts - src/models/operations/changescontrollergetchanges.ts - - src/models/operations/eventscontrollercancel.ts - src/models/operations/executiondetailscontrollergetexecutiondetailsfornotification.ts - src/models/operations/feedscontrollerdeletefeedbyid.ts - src/models/operations/integrationscontrollerremoveintegration.ts @@ -225,7 +305,6 @@ generatedFiles: - src/models/operations/notificationscontrollerlistnotifications.ts - src/models/operations/notificationscontrollergetnotification.ts - src/models/operations/notificationscontrollergetactivitygraphstats.ts - - src/models/operations/organizationcontrollerremove.ts - src/models/operations/subscriberscontrollerremovesubscriber.ts - src/models/operations/subscriberscontrollerlistsubscribers.ts - src/models/operations/subscriberscontrollergetsubscriber.ts @@ -264,9 +343,11 @@ generatedFiles: - src/models/errors/index.ts - src/models/components/index.ts - src/models/operations/index.ts + - docs/models/components/databooleandto.md - docs/models/components/triggereventresponsedtostatus.md - docs/models/components/triggereventresponsedto.md - docs/models/components/actor.md + - docs/models/components/controls.md - docs/models/components/triggereventrequestdtooverrides.md - docs/models/components/triggereventrequestdtopayload.md - docs/models/components/tenant.md @@ -274,31 +355,26 @@ generatedFiles: - docs/models/components/triggereventrequestdto.md - docs/models/components/subscriberpayloaddtodata.md - docs/models/components/subscriberpayloaddto.md - - docs/models/components/subscriberchanneldtoproviderid.md - - docs/models/components/subscriberchanneldto.md - - docs/models/components/channelcredentialsdto.md - docs/models/components/topicpayloaddtotype.md - docs/models/components/topicpayloaddto.md - docs/models/components/tenantpayloaddtodata.md - docs/models/components/tenantpayloaddto.md + - docs/models/components/triggereventtoallrequestdtoactor.md + - docs/models/components/triggereventtoallrequestdtooverrides.md + - docs/models/components/triggereventtoallrequestdtopayload.md + - docs/models/components/triggereventtoallrequestdtotenant.md + - docs/models/components/triggereventtoallrequestdto.md + - docs/models/components/bulktriggereventdto.md - docs/models/components/change.md - docs/models/components/type.md - docs/models/components/changeresponsedto.md - docs/models/components/bulkapplychangedto.md - docs/models/components/datanumberdto.md - docs/models/components/changesresponsedto.md - - docs/models/components/apikeys.md - docs/models/components/environmentresponsedto.md - docs/models/components/apikey.md - - docs/models/components/databooleandto.md - - docs/models/components/triggereventtoallrequestdtoactor.md - - docs/models/components/triggereventtoallrequestdtooverrides.md - - docs/models/components/triggereventtoallrequestdtopayload.md - - docs/models/components/triggereventtoallrequestdtotenant.md - - docs/models/components/triggereventtoallrequestdto.md - - docs/models/components/bulktriggereventdto.md - docs/models/components/executiondetailsresponsedtochannel.md - - docs/models/components/executiondetailsresponsedtosource.md + - docs/models/components/source.md - docs/models/components/executiondetailsresponsedtostatus.md - docs/models/components/executiondetailsresponsedto.md - docs/models/components/feedresponsedto.md @@ -318,57 +394,31 @@ generatedFiles: - docs/models/components/updateintegrationrequestdto.md - docs/models/components/createlayoutresponsedto.md - docs/models/components/getlayoutresponsedtochannel.md - - docs/models/components/variables.md - docs/models/components/getlayoutresponsedto.md - docs/models/components/updatelayoutresponsedtochannel.md - - docs/models/components/updatelayoutresponsedtovariables.md - docs/models/components/updatelayoutresponsedto.md - - docs/models/components/updatelayoutrequestdtovariables.md + - docs/models/components/variables.md - docs/models/components/updatelayoutrequestdto.md - - docs/models/components/deletemessageresponsedtostatus.md + - docs/models/components/status.md - docs/models/components/deletemessageresponsedto.md - docs/models/components/activitiesresponsedto.md - - docs/models/components/activitynotificationresponsedtochannels.md - - docs/models/components/activitynotificationresponsedto.md - - docs/models/components/activitynotificationtemplateresponsedto.md - - docs/models/components/notificationtriggertype.md - - docs/models/components/notificationtrigger.md - - docs/models/components/notificationtriggervariable.md - - docs/models/components/activitynotificationsubscriberresponsedto.md - - docs/models/components/digest.md - - docs/models/components/payload.md - - docs/models/components/activitynotificationjobresponsedtoproviderid.md - - docs/models/components/activitynotificationjobresponsedto.md - - docs/models/components/activitynotificationstepresponsedto.md - - docs/models/components/messagetemplatedto.md - - docs/models/components/providerid.md - - docs/models/components/source.md - - docs/models/components/status.md - - docs/models/components/activitynotificationexecutiondetailresponsedto.md - docs/models/components/notificationgroupresponsedto.md - docs/models/components/createnotificationgrouprequestdto.md - docs/models/components/deletenotificationgroupresponsedtostatus.md - docs/models/components/deletenotificationgroupresponsedto.md + - docs/models/components/activitynotificationresponsedtochannels.md + - docs/models/components/activitynotificationresponsedto.md + - docs/models/components/activitynotificationtemplateresponsedto.md + - docs/models/components/activitynotificationsubscriberresponsedto.md - docs/models/components/channels.md - docs/models/components/activitygraphstatesresponse.md - docs/models/components/activitystatsresponsedto.md + - docs/models/components/renameorganizationdto.md - docs/models/components/organizationresponsedto.md - - docs/models/components/partnertype.md - - docs/models/components/ipartnerconfigurationresponsedto.md - docs/models/components/direction.md - docs/models/components/organizationbrandingresponsedto.md - - docs/models/components/jobtitle.md - - docs/models/components/productusecases.md - - docs/models/components/createorganizationdto.md - - docs/models/components/renameorganizationdto.md - docs/models/components/updatebrandingdetailsdto.md - - docs/models/components/memberstatus.md - - docs/models/components/roles.md - - docs/models/components/memberresponsedto.md - - docs/models/components/memberuserdto.md - - docs/models/components/memberinvitedto.md - docs/models/components/subscriberresponsedto.md - - docs/models/components/channelsettingsproviderid.md - docs/models/components/channelsettings.md - docs/models/components/channelcredentials.md - docs/models/components/data.md @@ -378,7 +428,6 @@ generatedFiles: - docs/models/components/deletesubscriberresponsedto.md - docs/models/components/updatesubscriberrequestdtodata.md - docs/models/components/updatesubscriberrequestdto.md - - docs/models/components/updatesubscriberchannelrequestdtoproviderid.md - docs/models/components/updatesubscriberchannelrequestdto.md - docs/models/components/feedidentifier.md - docs/models/components/markas.md @@ -387,6 +436,7 @@ generatedFiles: - docs/models/components/messagemarkasrequestdtomarkas.md - docs/models/components/messageid.md - docs/models/components/messagemarkasrequestdto.md + - docs/models/components/feedid.md - docs/models/components/messageresponsedtochannel.md - docs/models/components/content.md - docs/models/components/overrides.md @@ -396,6 +446,9 @@ generatedFiles: - docs/models/components/workflowresponsedata.md - docs/models/components/workflowintegrationstatus.md - docs/models/components/workflowresponse.md + - docs/models/components/notificationtriggertype.md + - docs/models/components/notificationtrigger.md + - docs/models/components/notificationtriggervariable.md - docs/models/components/parentid.md - docs/models/components/metadata.md - docs/models/components/replycallback.md @@ -438,7 +491,7 @@ generatedFiles: - docs/models/components/emailblock.md - docs/models/components/textalign.md - docs/models/components/emailblockstyles.md - - docs/models/components/markmessageactionasseendtopayload.md + - docs/models/components/payload.md - docs/models/components/markmessageactionasseendtostatus.md - docs/models/components/markmessageactionasseendto.md - docs/models/components/unseencountresponse.md @@ -482,9 +535,9 @@ generatedFiles: - docs/models/components/variablesresponsedto.md - docs/models/components/changeworkflowstatusrequestdto.md - docs/models/components/security.md + - docs/models/operations/eventscontrollercancelrequest.md - docs/models/operations/changescontrollerapplydiffrequest.md - docs/models/operations/changescontrollergetchangesrequest.md - - docs/models/operations/eventscontrollercancelrequest.md - docs/models/operations/executiondetailscontrollergetexecutiondetailsfornotificationrequest.md - docs/models/operations/feedscontrollerdeletefeedbyidrequest.md - docs/models/operations/integrationscontrollerremoveintegrationrequest.md @@ -509,7 +562,6 @@ generatedFiles: - docs/models/operations/notificationscontrollerlistnotificationsrequest.md - docs/models/operations/notificationscontrollergetnotificationrequest.md - docs/models/operations/notificationscontrollergetactivitygraphstatsrequest.md - - docs/models/operations/organizationcontrollerremoverequest.md - docs/models/operations/subscriberscontrollerremovesubscriberrequest.md - docs/models/operations/subscriberscontrollerlistsubscribersrequest.md - docs/models/operations/subscriberscontrollerlistsubscribersresponsebody.md @@ -557,7 +609,6 @@ generatedFiles: - docs/sdks/changes/README.md - docs/sdks/environments/README.md - docs/sdks/apikeys/README.md - - docs/sdks/events/README.md - docs/sdks/executiondetails/README.md - docs/sdks/feeds/README.md - docs/sdks/integrations/README.md @@ -568,8 +619,6 @@ generatedFiles: - docs/sdks/notifications/README.md - docs/sdks/stats/README.md - docs/sdks/organizations/README.md - - docs/sdks/branding/README.md - - docs/sdks/members/README.md - docs/sdks/subscribers/README.md - docs/sdks/credentials/README.md - docs/sdks/authentication/README.md @@ -588,3 +637,4 @@ generatedFiles: - src/hooks/hooks.ts - src/hooks/types.ts - src/hooks/index.ts + - CONTRIBUTING.md diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 5526b198..335afd26 100755 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -11,7 +11,7 @@ generation: auth: oAuth2ClientCredentialsEnabled: false typescript: - version: 0.0.1-alpha.9 + version: 0.0.1-alpha.10 additionalDependencies: dependencies: {} devDependencies: {} @@ -32,6 +32,7 @@ typescript: inputModelSuffix: input maxMethodParams: 2 methodArguments: require-security-and-request + moduleFormat: commonjs outputModelSuffix: output packageName: '@novu/api' responseFormat: flat diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index b73e1b1a..1c02396d 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,9 +1,9 @@ -speakeasyVersion: 1.322.3 +speakeasyVersion: 1.386.0 sources: json-development: sourceNamespace: json-development - sourceRevisionDigest: sha256:9aaa2cefb426a15cee5a49a925f699de098a471674151d8e4ff677c3c9ce0da3 - sourceBlobDigest: sha256:be824c6647996617fb6fd7ea6b234c66f101d67d28a79402f53258bbd957c404 + sourceRevisionDigest: sha256:6bd29dd911f0d002ed01f7e6c2f88aaa3fff6eea08e8b6b9f66a888a6dc340e4 + sourceBlobDigest: sha256:02d801ab167023e73aeda8504c864217ba40f5f0f52f04ce3696f9034664a819 tags: - latest - main @@ -11,10 +11,10 @@ targets: my-first-target: source: json-development sourceNamespace: json-development - sourceRevisionDigest: sha256:9aaa2cefb426a15cee5a49a925f699de098a471674151d8e4ff677c3c9ce0da3 - sourceBlobDigest: sha256:be824c6647996617fb6fd7ea6b234c66f101d67d28a79402f53258bbd957c404 + sourceRevisionDigest: sha256:6bd29dd911f0d002ed01f7e6c2f88aaa3fff6eea08e8b6b9f66a888a6dc340e4 + sourceBlobDigest: sha256:02d801ab167023e73aeda8504c864217ba40f5f0f52f04ce3696f9034664a819 codeSamplesNamespace: code-samples-typescript - codeSamplesRevisionDigest: sha256:33324b9421a6105c75147afd9d70c354c7a6ad0f5e48327905d8171c613522a8 + codeSamplesRevisionDigest: sha256:d6206d9d099c5ec737dacbf0c1f20ff93bb60a9df7f4b86e2d8a68e7f205b671 outLocation: /github/workspace/repo workflow: workflowVersion: 1.0.0 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..d585717f --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,26 @@ +# Contributing to This Repository + +Thank you for your interest in contributing to this repository. Please note that this repository contains generated code. As such, we do not accept direct changes or pull requests. Instead, we encourage you to follow the guidelines below to report issues and suggest improvements. + +## How to Report Issues + +If you encounter any bugs or have suggestions for improvements, please open an issue on GitHub. When reporting an issue, please provide as much detail as possible to help us reproduce the problem. This includes: + +- A clear and descriptive title +- Steps to reproduce the issue +- Expected and actual behavior +- Any relevant logs, screenshots, or error messages +- Information about your environment (e.g., operating system, software versions) + - For example can be collected using the `npx envinfo` command from your terminal if you have Node.js installed + +## Issue Triage and Upstream Fixes + +We will review and triage issues as quickly as possible. Our goal is to address bugs and incorporate improvements in the upstream source code. Fixes will be included in the next generation of the generated code. + +## Contact + +If you have any questions or need further assistance, please feel free to reach out by opening an issue. + +Thank you for your understanding and cooperation! + +The Maintainers diff --git a/FUNCTIONS.md b/FUNCTIONS.md new file mode 100644 index 00000000..24c670de --- /dev/null +++ b/FUNCTIONS.md @@ -0,0 +1,104 @@ +# Standalone Functions + +> [!NOTE] +> This section is useful if you are using a bundler and targetting browsers and +> runtimes where the size of an application affects performance and load times. + +Every method in this SDK is also available as a standalone function. This +alternative API is suitable when targetting the browser or serverless runtimes +and using a bundler to build your application since all unused functionality +will be tree-shaken away. This includes code for unused methods, Zod schemas, +encoding helpers and response handlers. The result is dramatically smaller +impact on the application's final bundle size which grows very slowly as you use +more and more functionality from this SDK. + +Calling methods through the main SDK class remains a valid and generally more +more ergonomic option. Standalone functions represent an optimisation for a +specific category of applications. + +## Example + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { cancel } from "@novu/api/funcs/cancel.js"; +import { SDKValidationError } from "@novu/api/models/errors/sdkvalidationerror.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await cancel(novu, ""); + + switch (true) { + case res.ok: + // The success case will be handled outside of the switch block + break; + case res.error instanceof SDKValidationError: + // Pretty-print validation errors. + return console.log(res.error.pretty()); + case res.error instanceof Error: + return console.log(res.error); + default: + // TypeScript's type checking will fail on the following line if the above + // cases were not exhaustive. + res.error satisfies never; + throw new Error("Assertion failed: expected error checks to be exhaustive: " + res.error); + } + + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + +## Result types + +Standalone functions differ from SDK methods in that they return a +`Result` type to capture _known errors_ and document them using +the type system. By avoiding throwing errors, application code maintains clear +control flow and error-handling become part of the regular flow of application +code. + +> We use the term "known errors" because standalone functions, and JavaScript +> code in general, can still throw unexpected errors such as `TypeError`s, +> `RangeError`s and `DOMException`s. Exhaustively catching all errors may be +> something this SDK addresses in the future. Nevertheless, there is still a lot +> of benefit from capturing most errors and turning them into values. + +The second reason for this style of programming is because these functions will +typically be used in front-end applications where exception throwing is +sometimes discouraged or considered unidiomatic. React and similar ecosystems +and libraries tend to promote this style of programming so that components +render useful content under all states (loading, success, error and so on). + +The general pattern when calling standalone functions looks like this: + +```typescript +import { Core } from ""; +import { fetchSomething } from "/funcs/fetchSomething.js"; + +const client = new Core(); + +async function run() { + const result = await fetchSomething(client, { id: "123" }); + if (!result.ok) { + // You can throw the error or handle it. It's your choice now. + throw result.error; + } + + console.log(result.value); +} + +run(); +``` + +Notably, `result.error` above will have an explicit type compared to a try-catch +variation where the error in the catch block can only be of type `unknown` (or +`any` depending on your TypeScript settings). \ No newline at end of file diff --git a/README.md b/README.md index 559e6a51..57660538 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,36 @@ + +## Summary + +Novu API: Novu REST API. Please see https://docs.novu.co/api-reference for more details. + +For more information about the API: [Novu Documentation](https://docs.novu.co) + + + +## Table of Contents + +* [SDK Installation](#sdk-installation) +* [Requirements](#requirements) +* [SDK Example Usage](#sdk-example-usage) +* [Available Resources and Operations](#available-resources-and-operations) +* [Standalone functions](#standalone-functions) +* [Pagination](#pagination) +* [Retries](#retries) +* [Error Handling](#error-handling) +* [Server Selection](#server-selection) +* [Custom HTTP Client](#custom-http-client) +* [Authentication](#authentication) +* [Debugging](#debugging) + + ## SDK Installation +The SDK can be installed with either [npm](https://www.npmjs.com/), [pnpm](https://pnpm.io/), [bun](https://bun.sh/) or [yarn](https://classic.yarnpkg.com/en/) package managers. + ### NPM ```bash @@ -46,6 +73,26 @@ For supported JavaScript runtimes, please consult [RUNTIMES.md](RUNTIMES.md). ## SDK Example Usage +### Cancel Triggered Event + +```typescript +import { Novu } from "@novu/api"; + +const novu = new Novu({ + apiKey: "", +}); + +async function run() { + const result = await novu.cancel(""); + + // Handle the result + console.log(result); +} + +run(); + +``` + ### Trigger Notification Event ```typescript @@ -62,7 +109,7 @@ async function run() { payload: {}, to: [ { - topicKey: "topic_key", + topicKey: "", type: "Topic", }, ], @@ -74,6 +121,52 @@ async function run() { run(); +``` + +### Broadcast Event to All + +```typescript +import { Novu } from "@novu/api"; + +const novu = new Novu({ + apiKey: "", +}); + +async function run() { + const result = await novu.triggerBroadcast({ + name: "", + overrides: {}, + payload: {}, + }); + + // Handle the result + console.log(result); +} + +run(); + +``` + +### Trigger Notification Events in Bulk + +```typescript +import { Novu } from "@novu/api"; + +const novu = new Novu({ + apiKey: "", +}); + +async function run() { + const result = await novu.triggerBulk({ + events: [], + }); + + // Handle the result + console.log(result); +} + +run(); + ``` @@ -82,7 +175,10 @@ run(); ### [Novu SDK](docs/sdks/novu/README.md) +* [cancel](docs/sdks/novu/README.md#cancel) - Cancel triggered event * [trigger](docs/sdks/novu/README.md#trigger) - Trigger event +* [triggerBroadcast](docs/sdks/novu/README.md#triggerbroadcast) - Broadcast event to all +* [triggerBulk](docs/sdks/novu/README.md#triggerbulk) - Bulk trigger event ### [changes](docs/sdks/changes/README.md) @@ -99,13 +195,6 @@ run(); ### [environments.apiKeys](docs/sdks/apikeys/README.md) * [list](docs/sdks/apikeys/README.md#list) - Get api keys -* [regenerate](docs/sdks/apikeys/README.md#regenerate) - Regenerate api keys - -### [events](docs/sdks/events/README.md) - -* [cancel](docs/sdks/events/README.md#cancel) - Cancel triggered event -* [triggerBroadcast](docs/sdks/events/README.md#triggerbroadcast) - Broadcast event to all -* [triggerBulk](docs/sdks/events/README.md#triggerbulk) - Bulk trigger event ### [executionDetails](docs/sdks/executiondetails/README.md) @@ -165,19 +254,9 @@ run(); ### [organizations](docs/sdks/organizations/README.md) -* [create](docs/sdks/organizations/README.md#create) - Create an organization -* [list](docs/sdks/organizations/README.md#list) - Fetch all organizations -* [rename](docs/sdks/organizations/README.md#rename) - Rename organization name +* [eeOrganizationControllerRenameOrganization](docs/sdks/organizations/README.md#eeorganizationcontrollerrenameorganization) - Rename organization name * [retrieve](docs/sdks/organizations/README.md#retrieve) - Fetch current organization details - -### [organizations.branding](docs/sdks/branding/README.md) - -* [update](docs/sdks/branding/README.md#update) - Update organization branding details - -### [organizations.members](docs/sdks/members/README.md) - -* [delete](docs/sdks/members/README.md#delete) - Remove a member from organization using memberId -* [list](docs/sdks/members/README.md#list) - Fetch all members of current organizations +* [update](docs/sdks/organizations/README.md#update) - Update organization branding details ### [subscribers](docs/sdks/subscribers/README.md) @@ -260,6 +339,110 @@ run(); * [update](docs/sdks/status/README.md#update) - Update workflow status + +## Standalone functions + +All the methods listed above are available as standalone functions. These +functions are ideal for use in applications running in the browser, serverless +runtimes or other environments where application bundle size is a primary +concern. When using a bundler to build your application, all unused +functionality will be either excluded from the final bundle or tree-shaken away. + +To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md). + +
+ +Available standalone functions + +- [cancel](docs/sdks/novu/README.md#cancel) +- [changesApplyBulk](docs/sdks/changes/README.md#applybulk) +- [changesApply](docs/sdks/changes/README.md#apply) +- [changesCount](docs/sdks/changes/README.md#count) +- [changesRetrieve](docs/sdks/changes/README.md#retrieve) +- [environmentsApiKeysList](docs/sdks/apikeys/README.md#list) +- [environmentsList](docs/sdks/environments/README.md#list) +- [environmentsRetrieve](docs/sdks/environments/README.md#retrieve) +- [executionDetailsRetrieve](docs/sdks/executiondetails/README.md#retrieve) +- [feedsCreate](docs/sdks/feeds/README.md#create) +- [feedsDelete](docs/sdks/feeds/README.md#delete) +- [feedsRetrieve](docs/sdks/feeds/README.md#retrieve) +- [integrationsCreate](docs/sdks/integrations/README.md#create) +- [integrationsDelete](docs/sdks/integrations/README.md#delete) +- [integrationsListActive](docs/sdks/integrations/README.md#listactive) +- [integrationsList](docs/sdks/integrations/README.md#list) +- [integrationsSetAsPrimary](docs/sdks/integrations/README.md#setasprimary) +- [integrationsUpdate](docs/sdks/integrations/README.md#update) +- [integrationsWebhooksRetrieve](docs/sdks/webhooks/README.md#retrieve) +- [layoutsCreate](docs/sdks/layouts/README.md#create) +- [layoutsDelete](docs/sdks/layouts/README.md#delete) +- [layoutsList](docs/sdks/layouts/README.md#list) +- [layoutsRetrieve](docs/sdks/layouts/README.md#retrieve) +- [layoutsSetAsDefault](docs/sdks/layouts/README.md#setasdefault) +- [layoutsUpdate](docs/sdks/layouts/README.md#update) +- [messagesDeleteByTransactionId](docs/sdks/messages/README.md#deletebytransactionid) +- [messagesDelete](docs/sdks/messages/README.md#delete) +- [messagesRetrieve](docs/sdks/messages/README.md#retrieve) +- [notificationsList](docs/sdks/notifications/README.md#list) +- [notificationsRetrieve](docs/sdks/notifications/README.md#retrieve) +- [notificationsStatsGraph](docs/sdks/stats/README.md#graph) +- [notificationsStatsRetrieve](docs/sdks/stats/README.md#retrieve) +- [organizationsEEOrganizationControllerRenameOrganization](docs/sdks/organizations/README.md#eeorganizationcontrollerrenameorganization) +- [organizationsRetrieve](docs/sdks/organizations/README.md#retrieve) +- [organizationsUpdate](docs/sdks/organizations/README.md#update) +- [subscribersAuthenticationChatAccessOauthCallBack](docs/sdks/authentication/README.md#chataccessoauthcallback) +- [subscribersAuthenticationChatAccessOauth](docs/sdks/authentication/README.md#chataccessoauth) +- [subscribersCreateBulk](docs/sdks/subscribers/README.md#createbulk) +- [subscribersCreate](docs/sdks/subscribers/README.md#create) +- [subscribersCredentialsAppend](docs/sdks/credentials/README.md#append) +- [subscribersCredentialsDelete](docs/sdks/credentials/README.md#delete) +- [subscribersCredentialsUpdate](docs/sdks/credentials/README.md#update) +- [subscribersDelete](docs/sdks/subscribers/README.md#delete) +- [subscribersList](docs/sdks/subscribers/README.md#list) +- [subscribersMessagesMarkAllAs](docs/sdks/novumessages/README.md#markallas) +- [subscribersMessagesMarkAll](docs/sdks/novumessages/README.md#markall) +- [subscribersMessagesUpdateAsSeen](docs/sdks/novumessages/README.md#updateasseen) +- [subscribersNotificationsRetrieve](docs/sdks/novunotifications/README.md#retrieve) +- [subscribersNotificationsUnseenCount](docs/sdks/novunotifications/README.md#unseencount) +- [subscribersPreferencesList](docs/sdks/preferences/README.md#list) +- [subscribersPreferencesRetrieveByLevel](docs/sdks/preferences/README.md#retrievebylevel) +- [subscribersPreferencesUpdateGlobal](docs/sdks/preferences/README.md#updateglobal) +- [subscribersPreferencesUpdate](docs/sdks/preferences/README.md#update) +- [subscribersPropertiesUpdateOnlineFlag](docs/sdks/properties/README.md#updateonlineflag) +- [subscribersRetrieve](docs/sdks/subscribers/README.md#retrieve) +- [subscribersUpdate](docs/sdks/subscribers/README.md#update) +- [tenantsCreate](docs/sdks/tenants/README.md#create) +- [tenantsDelete](docs/sdks/tenants/README.md#delete) +- [tenantsList](docs/sdks/tenants/README.md#list) +- [tenantsRetrieve](docs/sdks/tenants/README.md#retrieve) +- [tenantsUpdate](docs/sdks/tenants/README.md#update) +- [topicsCreate](docs/sdks/topics/README.md#create) +- [topicsDelete](docs/sdks/topics/README.md#delete) +- [topicsList](docs/sdks/topics/README.md#list) +- [topicsRename](docs/sdks/topics/README.md#rename) +- [topicsRetrieve](docs/sdks/topics/README.md#retrieve) +- [topicsSubscribersAssign](docs/sdks/novusubscribers/README.md#assign) +- [topicsSubscribersDelete](docs/sdks/novusubscribers/README.md#delete) +- [topicsSubscribersRetrieve](docs/sdks/novusubscribers/README.md#retrieve) +- [triggerBroadcast](docs/sdks/novu/README.md#triggerbroadcast) +- [triggerBulk](docs/sdks/novu/README.md#triggerbulk) +- [trigger](docs/sdks/novu/README.md#trigger) +- [workflowGroupsCreate](docs/sdks/workflowgroups/README.md#create) +- [workflowGroupsDelete](docs/sdks/workflowgroups/README.md#delete) +- [workflowGroupsList](docs/sdks/workflowgroups/README.md#list) +- [workflowGroupsRetrieve](docs/sdks/workflowgroups/README.md#retrieve) +- [workflowGroupsUpdate](docs/sdks/workflowgroups/README.md#update) +- [workflowsCreate](docs/sdks/workflows/README.md#create) +- [workflowsDelete](docs/sdks/workflows/README.md#delete) +- [workflowsList](docs/sdks/workflows/README.md#list) +- [workflowsRetrieve](docs/sdks/workflows/README.md#retrieve) +- [workflowsStatusUpdate](docs/sdks/status/README.md#update) +- [workflowsUpdate](docs/sdks/workflows/README.md#update) +- [workflowsVariablesRetrieve](docs/sdks/variables/README.md#retrieve) + + +
+ + ## Pagination @@ -280,10 +463,11 @@ const novu = new Novu({ }); async function run() { - const result = await novu.subscribers.list(7685.78, 10); + const result = await novu.subscribers.list(); for await (const page of result) { - // handle page + // Handle the page + console.log(page); } } @@ -315,17 +499,7 @@ const novu = new Novu({ async function run() { let result; try { - result = await novu.trigger({ - name: "workflow_identifier", - overrides: {}, - payload: {}, - to: [ - { - topicKey: "topic_key", - type: "Topic", - }, - ], - }); + result = await novu.cancel(""); } catch (err) { switch (true) { case err instanceof SDKValidationError: { @@ -371,17 +545,7 @@ const novu = new Novu({ }); async function run() { - const result = await novu.trigger({ - name: "workflow_identifier", - overrides: {}, - payload: {}, - to: [ - { - topicKey: "topic_key", - type: "Topic", - }, - ], - }); + const result = await novu.cancel(""); // Handle the result console.log(result); @@ -405,17 +569,7 @@ const novu = new Novu({ }); async function run() { - const result = await novu.trigger({ - name: "workflow_identifier", - overrides: {}, - payload: {}, - to: [ - { - topicKey: "topic_key", - type: "Topic", - }, - ], - }); + const result = await novu.cancel(""); // Handle the result console.log(result); @@ -495,17 +649,7 @@ const novu = new Novu({ }); async function run() { - const result = await novu.trigger({ - name: "workflow_identifier", - overrides: {}, - payload: {}, - to: [ - { - topicKey: "topic_key", - type: "Topic", - }, - ], - }); + const result = await novu.cancel(""); // Handle the result console.log(result); @@ -530,31 +674,18 @@ const novu = new Novu({ }); async function run() { - const result = await novu.trigger( - { - name: "workflow_identifier", - overrides: {}, - payload: {}, - to: [ - { - topicKey: "topic_key", - type: "Topic", - }, - ], - }, - { - retries: { - strategy: "backoff", - backoff: { - initialInterval: 1, - maxInterval: 50, - exponent: 1.1, - maxElapsedTime: 100, - }, - retryConnectionErrors: false, + const result = await novu.cancel("", { + retries: { + strategy: "backoff", + backoff: { + initialInterval: 1, + maxInterval: 50, + exponent: 1.1, + maxElapsedTime: 100, }, - } - ); + retryConnectionErrors: false, + }, + }); // Handle the result console.log(result); @@ -583,17 +714,7 @@ const novu = new Novu({ }); async function run() { - const result = await novu.trigger({ - name: "workflow_identifier", - overrides: {}, - payload: {}, - to: [ - { - topicKey: "topic_key", - type: "Topic", - }, - ], - }); + const result = await novu.cancel(""); // Handle the result console.log(result); @@ -604,6 +725,23 @@ run(); ``` + +## Debugging + +You can setup your SDK to emit debug logs for SDK requests and responses. + +You can pass a logger that matches `console`'s interface as an SDK option. + +> [!WARNING] +> Beware that debug logging will reveal secrets, like API tokens in headers, in log messages printed to a console or files. It's recommended to use this feature only during local development and not in production. + +```typescript +import { Novu } from "@novu/api"; + +const sdk = new Novu({ debugLogger: console }); +``` + + # Development diff --git a/RELEASES.md b/RELEASES.md index 17770b01..c46bfa1d 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -28,4 +28,14 @@ Based on: ### Generated - [typescript v0.0.1-alpha.9] . ### Releases -- [NPM v0.0.1-alpha.9] https://www.npmjs.com/package/@novu/api/v/0.0.1-alpha.9 - . \ No newline at end of file +- [NPM v0.0.1-alpha.9] https://www.npmjs.com/package/@novu/api/v/0.0.1-alpha.9 - . + +## 2024-09-03 00:15:43 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.386.0 (2.407.2) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v0.0.1-alpha.10] . +### Releases +- [NPM v0.0.1-alpha.10] https://www.npmjs.com/package/@novu/api/v/0.0.1-alpha.10 - . \ No newline at end of file diff --git a/RUNTIMES.md b/RUNTIMES.md index 71fa3dae..d08a0c07 100644 --- a/RUNTIMES.md +++ b/RUNTIMES.md @@ -3,7 +3,7 @@ This SDK is intended to be used in JavaScript runtimes that support the following features: * [Web Fetch API][web-fetch] -* [Web Streams API](web-streams) and in particular `ReadableStream` +* [Web Streams API][web-streams] and in particular `ReadableStream` * [Async iterables][async-iter] using `Symbol.asyncIterator` [web-fetch]: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API diff --git a/USAGE.md b/USAGE.md index bc37b89a..4f44a179 100644 --- a/USAGE.md +++ b/USAGE.md @@ -1,4 +1,24 @@ +### Cancel Triggered Event + +```typescript +import { Novu } from "@novu/api"; + +const novu = new Novu({ + apiKey: "", +}); + +async function run() { + const result = await novu.cancel(""); + + // Handle the result + console.log(result); +} + +run(); + +``` + ### Trigger Notification Event ```typescript @@ -15,7 +35,7 @@ async function run() { payload: {}, to: [ { - topicKey: "topic_key", + topicKey: "", type: "Topic", }, ], @@ -27,5 +47,51 @@ async function run() { run(); +``` + +### Broadcast Event to All + +```typescript +import { Novu } from "@novu/api"; + +const novu = new Novu({ + apiKey: "", +}); + +async function run() { + const result = await novu.triggerBroadcast({ + name: "", + overrides: {}, + payload: {}, + }); + + // Handle the result + console.log(result); +} + +run(); + +``` + +### Trigger Notification Events in Bulk + +```typescript +import { Novu } from "@novu/api"; + +const novu = new Novu({ + apiKey: "", +}); + +async function run() { + const result = await novu.triggerBulk({ + events: [], + }); + + // Handle the result + console.log(result); +} + +run(); + ``` \ No newline at end of file diff --git a/docs/models/components/activitiesresponsedto.md b/docs/models/components/activitiesresponsedto.md index 6869d885..0027f15c 100644 --- a/docs/models/components/activitiesresponsedto.md +++ b/docs/models/components/activitiesresponsedto.md @@ -1,11 +1,23 @@ # ActivitiesResponseDto +## Example Usage + +```typescript +import { ActivitiesResponseDto } from "@novu/api/models/components"; + +let value: ActivitiesResponseDto = { + data: [""], + hasMore: false, + page: 9786.19, + pageSize: 4736.08, +}; +``` ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | -| `data` | [components.ActivityNotificationResponseDto](../../models/components/activitynotificationresponsedto.md)[] | :heavy_check_mark: | N/A | -| `hasMore` | *boolean* | :heavy_check_mark: | N/A | -| `page` | *number* | :heavy_check_mark: | N/A | -| `pageSize` | *number* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `data` | *string*[] | :heavy_check_mark: | N/A | +| `hasMore` | *boolean* | :heavy_check_mark: | N/A | +| `page` | *number* | :heavy_check_mark: | N/A | +| `pageSize` | *number* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/activitygraphstatesresponse.md b/docs/models/components/activitygraphstatesresponse.md index 93669149..a842fa0e 100644 --- a/docs/models/components/activitygraphstatesresponse.md +++ b/docs/models/components/activitygraphstatesresponse.md @@ -1,5 +1,17 @@ # ActivityGraphStatesResponse +## Example Usage + +```typescript +import { ActivityGraphStatesResponse } from "@novu/api/models/components"; + +let value: ActivityGraphStatesResponse = { + id: "", + channels: ["sms"], + count: 5204.78, + templates: [""], +}; +``` ## Fields diff --git a/docs/models/components/activitynotificationexecutiondetailresponsedto.md b/docs/models/components/activitynotificationexecutiondetailresponsedto.md deleted file mode 100644 index 6446a8d7..00000000 --- a/docs/models/components/activitynotificationexecutiondetailresponsedto.md +++ /dev/null @@ -1,16 +0,0 @@ -# ActivityNotificationExecutionDetailResponseDto - - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | N/A | -| `jobId` | *string* | :heavy_check_mark: | N/A | -| `detail` | *string* | :heavy_check_mark: | N/A | -| `isRetry` | *boolean* | :heavy_check_mark: | N/A | -| `isTest` | *boolean* | :heavy_check_mark: | N/A | -| `providerId` | [components.ProviderId](../../models/components/providerid.md) | :heavy_check_mark: | N/A | -| `raw` | *string* | :heavy_minus_sign: | N/A | -| `source` | [components.Source](../../models/components/source.md) | :heavy_check_mark: | N/A | -| `status` | [components.Status](../../models/components/status.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/activitynotificationjobresponsedto.md b/docs/models/components/activitynotificationjobresponsedto.md deleted file mode 100644 index 26acb2eb..00000000 --- a/docs/models/components/activitynotificationjobresponsedto.md +++ /dev/null @@ -1,15 +0,0 @@ -# ActivityNotificationJobResponseDto - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | N/A | -| `digest` | [components.Digest](../../models/components/digest.md) | :heavy_minus_sign: | N/A | -| `executionDetails` | [components.ActivityNotificationExecutionDetailResponseDto](../../models/components/activitynotificationexecutiondetailresponsedto.md)[] | :heavy_check_mark: | N/A | -| `payload` | [components.Payload](../../models/components/payload.md) | :heavy_minus_sign: | N/A | -| `providerId` | [components.ActivityNotificationJobResponseDtoProviderId](../../models/components/activitynotificationjobresponsedtoproviderid.md) | :heavy_check_mark: | N/A | -| `status` | *string* | :heavy_check_mark: | N/A | -| `step` | [components.ActivityNotificationStepResponseDto](../../models/components/activitynotificationstepresponsedto.md) | :heavy_check_mark: | N/A | -| `type` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/activitynotificationjobresponsedtoproviderid.md b/docs/models/components/activitynotificationjobresponsedtoproviderid.md deleted file mode 100644 index ed7929ce..00000000 --- a/docs/models/components/activitynotificationjobresponsedtoproviderid.md +++ /dev/null @@ -1,7 +0,0 @@ -# ActivityNotificationJobResponseDtoProviderId - - -## Fields - -| Field | Type | Required | Description | -| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/components/activitynotificationresponsedto.md b/docs/models/components/activitynotificationresponsedto.md index 7451041d..cf30930e 100644 --- a/docs/models/components/activitynotificationresponsedto.md +++ b/docs/models/components/activitynotificationresponsedto.md @@ -1,5 +1,16 @@ # ActivityNotificationResponseDto +## Example Usage + +```typescript +import { ActivityNotificationResponseDto } from "@novu/api/models/components"; + +let value: ActivityNotificationResponseDto = { + environmentId: "", + organizationId: "", + transactionId: "", +}; +``` ## Fields @@ -10,7 +21,7 @@ | `organizationId` | *string* | :heavy_check_mark: | N/A | | `channels` | [components.ActivityNotificationResponseDtoChannels](../../models/components/activitynotificationresponsedtochannels.md) | :heavy_minus_sign: | N/A | | `createdAt` | *string* | :heavy_minus_sign: | N/A | -| `jobs` | [components.ActivityNotificationJobResponseDto](../../models/components/activitynotificationjobresponsedto.md)[] | :heavy_minus_sign: | N/A | +| `jobs` | *string*[] | :heavy_minus_sign: | N/A | | `subscriber` | [components.ActivityNotificationSubscriberResponseDto](../../models/components/activitynotificationsubscriberresponsedto.md) | :heavy_minus_sign: | N/A | | `template` | [components.ActivityNotificationTemplateResponseDto](../../models/components/activitynotificationtemplateresponsedto.md) | :heavy_minus_sign: | N/A | | `transactionId` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/activitynotificationresponsedtochannels.md b/docs/models/components/activitynotificationresponsedtochannels.md index 5e58a38b..b14c69e3 100644 --- a/docs/models/components/activitynotificationresponsedtochannels.md +++ b/docs/models/components/activitynotificationresponsedtochannels.md @@ -1,16 +1,15 @@ # ActivityNotificationResponseDtoChannels +## Example Usage + +```typescript +import { ActivityNotificationResponseDtoChannels } from "@novu/api/models/components"; + +let value: ActivityNotificationResponseDtoChannels = "delay"; +``` ## Values -| Name | Value | -| --------- | --------- | -| `InApp` | in_app | -| `Email` | email | -| `Sms` | sms | -| `Chat` | chat | -| `Push` | push | -| `Digest` | digest | -| `Trigger` | trigger | -| `Delay` | delay | -| `Custom` | custom | \ No newline at end of file +```typescript +"in_app" | "email" | "sms" | "chat" | "push" | "digest" | "trigger" | "delay" | "custom" +``` \ No newline at end of file diff --git a/docs/models/components/activitynotificationstepresponsedto.md b/docs/models/components/activitynotificationstepresponsedto.md deleted file mode 100644 index f2ce5f8c..00000000 --- a/docs/models/components/activitynotificationstepresponsedto.md +++ /dev/null @@ -1,11 +0,0 @@ -# ActivityNotificationStepResponseDto - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | -| `id` | *string* | :heavy_check_mark: | N/A | -| `active` | *boolean* | :heavy_check_mark: | N/A | -| `filters` | [components.StepFilter](../../models/components/stepfilter.md) | :heavy_check_mark: | N/A | -| `template` | [components.MessageTemplateDto](../../models/components/messagetemplatedto.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/activitynotificationsubscriberresponsedto.md b/docs/models/components/activitynotificationsubscriberresponsedto.md index 4fd5323e..5684735b 100644 --- a/docs/models/components/activitynotificationsubscriberresponsedto.md +++ b/docs/models/components/activitynotificationsubscriberresponsedto.md @@ -1,5 +1,14 @@ # ActivityNotificationSubscriberResponseDto +## Example Usage + +```typescript +import { ActivityNotificationSubscriberResponseDto } from "@novu/api/models/components"; + +let value: ActivityNotificationSubscriberResponseDto = { + id: "", +}; +``` ## Fields diff --git a/docs/models/components/activitynotificationtemplateresponsedto.md b/docs/models/components/activitynotificationtemplateresponsedto.md index 684b50bd..e19627c0 100644 --- a/docs/models/components/activitynotificationtemplateresponsedto.md +++ b/docs/models/components/activitynotificationtemplateresponsedto.md @@ -1,10 +1,20 @@ # ActivityNotificationTemplateResponseDto +## Example Usage + +```typescript +import { ActivityNotificationTemplateResponseDto } from "@novu/api/models/components"; + +let value: ActivityNotificationTemplateResponseDto = { + name: "", + triggers: [""], +}; +``` ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_minus_sign: | N/A | -| `name` | *string* | :heavy_check_mark: | N/A | -| `triggers` | [components.NotificationTrigger](../../models/components/notificationtrigger.md)[] | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `id` | *string* | :heavy_minus_sign: | N/A | +| `name` | *string* | :heavy_check_mark: | N/A | +| `triggers` | *string*[] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/activitystatsresponsedto.md b/docs/models/components/activitystatsresponsedto.md index 234c47bc..e9c31fd5 100644 --- a/docs/models/components/activitystatsresponsedto.md +++ b/docs/models/components/activitystatsresponsedto.md @@ -1,5 +1,15 @@ # ActivityStatsResponseDto +## Example Usage + +```typescript +import { ActivityStatsResponseDto } from "@novu/api/models/components"; + +let value: ActivityStatsResponseDto = { + monthlySent: 7805.29, + weeklySent: 6788.8, +}; +``` ## Fields diff --git a/docs/models/components/actor.md b/docs/models/components/actor.md index e235aeec..3258ef27 100644 --- a/docs/models/components/actor.md +++ b/docs/models/components/actor.md @@ -4,6 +4,15 @@ It is used to display the Avatar of the provided actor's subscriber id or actor If a new actor object is provided, we will create a new subscriber in our system +## Example Usage + +```typescript +import { Actor } from "@novu/api/models/components"; + +let value: Actor = { + subscriberId: "", +}; +``` ## Supported Types diff --git a/docs/models/components/addsubscribersrequestdto.md b/docs/models/components/addsubscribersrequestdto.md index e17a5bc1..b85168b6 100644 --- a/docs/models/components/addsubscribersrequestdto.md +++ b/docs/models/components/addsubscribersrequestdto.md @@ -1,5 +1,14 @@ # AddSubscribersRequestDto +## Example Usage + +```typescript +import { AddSubscribersRequestDto } from "@novu/api/models/components"; + +let value: AddSubscribersRequestDto = { + subscribers: [""], +}; +``` ## Fields diff --git a/docs/models/components/apikey.md b/docs/models/components/apikey.md index cb6ad09e..91ae26ed 100644 --- a/docs/models/components/apikey.md +++ b/docs/models/components/apikey.md @@ -1,5 +1,15 @@ # ApiKey +## Example Usage + +```typescript +import { ApiKey } from "@novu/api/models/components"; + +let value: ApiKey = { + userId: "", + key: "", +}; +``` ## Fields diff --git a/docs/models/components/apikeys.md b/docs/models/components/apikeys.md deleted file mode 100644 index 05805dcf..00000000 --- a/docs/models/components/apikeys.md +++ /dev/null @@ -1,7 +0,0 @@ -# ApiKeys - - -## Fields - -| Field | Type | Required | Description | -| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/components/backoffunit.md b/docs/models/components/backoffunit.md index cf5fcc00..797a4899 100644 --- a/docs/models/components/backoffunit.md +++ b/docs/models/components/backoffunit.md @@ -1,13 +1,15 @@ # BackoffUnit +## Example Usage + +```typescript +import { BackoffUnit } from "@novu/api/models/components"; + +let value: BackoffUnit = "hours"; +``` ## Values -| Name | Value | -| --------- | --------- | -| `Seconds` | seconds | -| `Minutes` | minutes | -| `Hours` | hours | -| `Days` | days | -| `Weeks` | weeks | -| `Months` | months | \ No newline at end of file +```typescript +"seconds" | "minutes" | "hours" | "days" | "weeks" | "months" +``` \ No newline at end of file diff --git a/docs/models/components/bulkapplychangedto.md b/docs/models/components/bulkapplychangedto.md index 2c6589df..daac17c6 100644 --- a/docs/models/components/bulkapplychangedto.md +++ b/docs/models/components/bulkapplychangedto.md @@ -1,5 +1,14 @@ # BulkApplyChangeDto +## Example Usage + +```typescript +import { BulkApplyChangeDto } from "@novu/api/models/components"; + +let value: BulkApplyChangeDto = { + changeIds: [""], +}; +``` ## Fields diff --git a/docs/models/components/bulksubscribercreatedto.md b/docs/models/components/bulksubscribercreatedto.md index b723bd3f..f81d7a67 100644 --- a/docs/models/components/bulksubscribercreatedto.md +++ b/docs/models/components/bulksubscribercreatedto.md @@ -1,8 +1,17 @@ # BulkSubscriberCreateDto +## Example Usage + +```typescript +import { BulkSubscriberCreateDto } from "@novu/api/models/components"; + +let value: BulkSubscriberCreateDto = { + subscribers: [""], +}; +``` ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | -| `subscribers` | [components.CreateSubscriberRequestDto](../../models/components/createsubscriberrequestdto.md)[] | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `subscribers` | *string*[] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/bulktriggereventdto.md b/docs/models/components/bulktriggereventdto.md index 3368c6e6..6e85b1d2 100644 --- a/docs/models/components/bulktriggereventdto.md +++ b/docs/models/components/bulktriggereventdto.md @@ -1,5 +1,14 @@ # BulkTriggerEventDto +## Example Usage + +```typescript +import { BulkTriggerEventDto } from "@novu/api/models/components"; + +let value: BulkTriggerEventDto = { + events: [], +}; +``` ## Fields diff --git a/docs/models/components/change.md b/docs/models/components/change.md index aeee20b2..63d57454 100644 --- a/docs/models/components/change.md +++ b/docs/models/components/change.md @@ -1,5 +1,12 @@ # Change +## Example Usage + +```typescript +import { Change } from "@novu/api/models/components"; + +let value: Change = {}; +``` ## Fields diff --git a/docs/models/components/changeresponsedto.md b/docs/models/components/changeresponsedto.md index 95ee3d48..232964e5 100644 --- a/docs/models/components/changeresponsedto.md +++ b/docs/models/components/changeresponsedto.md @@ -1,5 +1,21 @@ # ChangeResponseDto +## Example Usage + +```typescript +import { ChangeResponseDto } from "@novu/api/models/components"; + +let value: ChangeResponseDto = { + creatorId: "", + entityId: "", + environmentId: "", + organizationId: "", + change: {}, + createdAt: "", + enabled: false, + type: "NotificationTemplate", +}; +``` ## Fields diff --git a/docs/models/components/changesresponsedto.md b/docs/models/components/changesresponsedto.md index 5cd9e350..87ca8a6c 100644 --- a/docs/models/components/changesresponsedto.md +++ b/docs/models/components/changesresponsedto.md @@ -1,11 +1,23 @@ # ChangesResponseDto +## Example Usage + +```typescript +import { ChangesResponseDto } from "@novu/api/models/components"; + +let value: ChangesResponseDto = { + data: [""], + page: 3843.82, + pageSize: 4375.87, + totalCount: 2975.34, +}; +``` ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | -| `data` | [components.ChangeResponseDto](../../models/components/changeresponsedto.md)[] | :heavy_check_mark: | N/A | -| `page` | *number* | :heavy_check_mark: | N/A | -| `pageSize` | *number* | :heavy_check_mark: | N/A | -| `totalCount` | *number* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `data` | *string*[] | :heavy_check_mark: | N/A | +| `page` | *number* | :heavy_check_mark: | N/A | +| `pageSize` | *number* | :heavy_check_mark: | N/A | +| `totalCount` | *number* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/changeworkflowstatusrequestdto.md b/docs/models/components/changeworkflowstatusrequestdto.md index b2664c84..9d768905 100644 --- a/docs/models/components/changeworkflowstatusrequestdto.md +++ b/docs/models/components/changeworkflowstatusrequestdto.md @@ -1,5 +1,14 @@ # ChangeWorkflowStatusRequestDto +## Example Usage + +```typescript +import { ChangeWorkflowStatusRequestDto } from "@novu/api/models/components"; + +let value: ChangeWorkflowStatusRequestDto = { + active: false, +}; +``` ## Fields diff --git a/docs/models/components/channel.md b/docs/models/components/channel.md index e94defd2..317e9115 100644 --- a/docs/models/components/channel.md +++ b/docs/models/components/channel.md @@ -1,12 +1,15 @@ # Channel +## Example Usage + +```typescript +import { Channel } from "@novu/api/models/components"; + +let value: Channel = "push"; +``` ## Values -| Name | Value | -| ------- | ------- | -| `InApp` | in_app | -| `Email` | email | -| `Sms` | sms | -| `Chat` | chat | -| `Push` | push | \ No newline at end of file +```typescript +"in_app" | "email" | "sms" | "chat" | "push" +``` \ No newline at end of file diff --git a/docs/models/components/channelcredentials.md b/docs/models/components/channelcredentials.md index 179a9bc5..58e9432d 100644 --- a/docs/models/components/channelcredentials.md +++ b/docs/models/components/channelcredentials.md @@ -1,5 +1,14 @@ # ChannelCredentials +## Example Usage + +```typescript +import { ChannelCredentials } from "@novu/api/models/components"; + +let value: ChannelCredentials = { + webhookUrl: "", +}; +``` ## Fields diff --git a/docs/models/components/channelcredentialsdto.md b/docs/models/components/channelcredentialsdto.md deleted file mode 100644 index c4592324..00000000 --- a/docs/models/components/channelcredentialsdto.md +++ /dev/null @@ -1,9 +0,0 @@ -# ChannelCredentialsDto - - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `deviceTokens` | *string*[] | :heavy_minus_sign: | N/A | -| `webhookUrl` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/channelpreference.md b/docs/models/components/channelpreference.md index cd367447..e2585e30 100644 --- a/docs/models/components/channelpreference.md +++ b/docs/models/components/channelpreference.md @@ -1,5 +1,15 @@ # ChannelPreference +## Example Usage + +```typescript +import { ChannelPreference } from "@novu/api/models/components"; + +let value: ChannelPreference = { + enabled: false, + type: "chat", +}; +``` ## Fields diff --git a/docs/models/components/channelpreferencetype.md b/docs/models/components/channelpreferencetype.md index d3b76a1d..47790754 100644 --- a/docs/models/components/channelpreferencetype.md +++ b/docs/models/components/channelpreferencetype.md @@ -2,13 +2,16 @@ The type of channel that is enabled or not +## Example Usage + +```typescript +import { ChannelPreferenceType } from "@novu/api/models/components"; + +let value: ChannelPreferenceType = "email"; +``` ## Values -| Name | Value | -| ------- | ------- | -| `InApp` | in_app | -| `Email` | email | -| `Sms` | sms | -| `Chat` | chat | -| `Push` | push | \ No newline at end of file +```typescript +"in_app" | "email" | "sms" | "chat" | "push" +``` \ No newline at end of file diff --git a/docs/models/components/channels.md b/docs/models/components/channels.md index 12ae99d1..37b84013 100644 --- a/docs/models/components/channels.md +++ b/docs/models/components/channels.md @@ -1,12 +1,15 @@ # Channels +## Example Usage + +```typescript +import { Channels } from "@novu/api/models/components"; + +let value: Channels = "push"; +``` ## Values -| Name | Value | -| ------- | ------- | -| `InApp` | in_app | -| `Email` | email | -| `Sms` | sms | -| `Chat` | chat | -| `Push` | push | \ No newline at end of file +```typescript +"in_app" | "email" | "sms" | "chat" | "push" +``` \ No newline at end of file diff --git a/docs/models/components/channelsettings.md b/docs/models/components/channelsettings.md index e425e364..43d239f9 100644 --- a/docs/models/components/channelsettings.md +++ b/docs/models/components/channelsettings.md @@ -1,11 +1,24 @@ # ChannelSettings +## Example Usage + +```typescript +import { ChannelSettings } from "@novu/api/models/components"; + +let value: ChannelSettings = { + integrationId: "", + credentials: { + webhookUrl: "", + }, + providerId: 1433.53, +}; +``` ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -| `integrationId` | *string* | :heavy_check_mark: | Id of the integration that is used for this channel | -| `credentials` | [components.ChannelCredentials](../../models/components/channelcredentials.md) | :heavy_check_mark: | Credentials payload for the specified provider | -| `integrationIdentifier` | *string* | :heavy_minus_sign: | The integration identifier | -| `providerId` | [components.ChannelSettingsProviderId](../../models/components/channelsettingsproviderid.md) | :heavy_check_mark: | The provider identifier for the credentials | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `integrationId` | *string* | :heavy_check_mark: | Id of the integration that is used for this channel | +| `credentials` | [components.ChannelCredentials](../../models/components/channelcredentials.md) | :heavy_check_mark: | Credentials payload for the specified provider | +| `integrationIdentifier` | *string* | :heavy_minus_sign: | The integration identifier | +| `providerId` | *number* | :heavy_check_mark: | The provider identifier for the credentials | \ No newline at end of file diff --git a/docs/models/components/channelsettingsproviderid.md b/docs/models/components/channelsettingsproviderid.md deleted file mode 100644 index 65d1d74b..00000000 --- a/docs/models/components/channelsettingsproviderid.md +++ /dev/null @@ -1,26 +0,0 @@ -# ChannelSettingsProviderId - -The provider identifier for the credentials - - -## Values - -| Name | Value | -| ------------------ | ------------------ | -| `Slack` | slack | -| `Discord` | discord | -| `Msteams` | msteams | -| `Mattermost` | mattermost | -| `Ryver` | ryver | -| `Zulip` | zulip | -| `GrafanaOnCall` | grafana-on-call | -| `Getstream` | getstream | -| `RocketChat` | rocket-chat | -| `WhatsappBusiness` | whatsapp-business | -| `Fcm` | fcm | -| `Apns` | apns | -| `Expo` | expo | -| `OneSignal` | one-signal | -| `Pushpad` | pushpad | -| `PushWebhook` | push-webhook | -| `PusherBeams` | pusher-beams | \ No newline at end of file diff --git a/docs/models/components/content.md b/docs/models/components/content.md index 81854917..68c3b013 100644 --- a/docs/models/components/content.md +++ b/docs/models/components/content.md @@ -1,5 +1,12 @@ # Content +## Example Usage + +```typescript +import { Content } from "@novu/api/models/components"; + +let value: Content = ""; +``` ## Supported Types diff --git a/docs/models/components/controls.md b/docs/models/components/controls.md new file mode 100644 index 00000000..94e492f7 --- /dev/null +++ b/docs/models/components/controls.md @@ -0,0 +1,14 @@ +# Controls + +## Example Usage + +```typescript +import { Controls } from "@novu/api/models/components"; + +let value: Controls = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/components/createfeedrequestdto.md b/docs/models/components/createfeedrequestdto.md index d8596d95..3546b4c5 100644 --- a/docs/models/components/createfeedrequestdto.md +++ b/docs/models/components/createfeedrequestdto.md @@ -1,5 +1,14 @@ # CreateFeedRequestDto +## Example Usage + +```typescript +import { CreateFeedRequestDto } from "@novu/api/models/components"; + +let value: CreateFeedRequestDto = { + name: "", +}; +``` ## Fields diff --git a/docs/models/components/createintegrationrequestdto.md b/docs/models/components/createintegrationrequestdto.md index aefdae29..e574200d 100644 --- a/docs/models/components/createintegrationrequestdto.md +++ b/docs/models/components/createintegrationrequestdto.md @@ -1,5 +1,15 @@ # CreateIntegrationRequestDto +## Example Usage + +```typescript +import { CreateIntegrationRequestDto } from "@novu/api/models/components"; + +let value: CreateIntegrationRequestDto = { + channel: "push", + providerId: "", +}; +``` ## Fields diff --git a/docs/models/components/createlayoutresponsedto.md b/docs/models/components/createlayoutresponsedto.md index 8494022e..66fe58d1 100644 --- a/docs/models/components/createlayoutresponsedto.md +++ b/docs/models/components/createlayoutresponsedto.md @@ -1,8 +1,17 @@ # CreateLayoutResponseDto +## Example Usage + +```typescript +import { CreateLayoutResponseDto } from "@novu/api/models/components"; + +let value: CreateLayoutResponseDto = { + id: "", +}; +``` ## Fields -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `id` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The unique identifier for the Layout created. | \ No newline at end of file diff --git a/docs/models/components/createnotificationgrouprequestdto.md b/docs/models/components/createnotificationgrouprequestdto.md index a3d4c9a1..d4d8218c 100644 --- a/docs/models/components/createnotificationgrouprequestdto.md +++ b/docs/models/components/createnotificationgrouprequestdto.md @@ -1,5 +1,14 @@ # CreateNotificationGroupRequestDto +## Example Usage + +```typescript +import { CreateNotificationGroupRequestDto } from "@novu/api/models/components"; + +let value: CreateNotificationGroupRequestDto = { + name: "", +}; +``` ## Fields diff --git a/docs/models/components/createorganizationdto.md b/docs/models/components/createorganizationdto.md deleted file mode 100644 index a65933c0..00000000 --- a/docs/models/components/createorganizationdto.md +++ /dev/null @@ -1,12 +0,0 @@ -# CreateOrganizationDto - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | -| `domain` | *string* | :heavy_minus_sign: | N/A | -| `jobTitle` | [components.JobTitle](../../models/components/jobtitle.md) | :heavy_minus_sign: | N/A | -| `logo` | *string* | :heavy_minus_sign: | N/A | -| `name` | *string* | :heavy_check_mark: | N/A | -| `productUseCases` | [components.ProductUseCases](../../models/components/productusecases.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/createsubscriberrequestdto.md b/docs/models/components/createsubscriberrequestdto.md index ddcec351..16c0f41a 100644 --- a/docs/models/components/createsubscriberrequestdto.md +++ b/docs/models/components/createsubscriberrequestdto.md @@ -1,12 +1,21 @@ # CreateSubscriberRequestDto +## Example Usage + +```typescript +import { CreateSubscriberRequestDto } from "@novu/api/models/components"; + +let value: CreateSubscriberRequestDto = { + subscriberId: "", +}; +``` ## Fields | Field | Type | Required | Description | | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | | `avatar` | *string* | :heavy_minus_sign: | An http url to the profile image of your subscriber | -| `channels` | [components.SubscriberChannelDto](../../models/components/subscriberchanneldto.md)[] | :heavy_minus_sign: | N/A | +| `channels` | *string*[] | :heavy_minus_sign: | N/A | | `data` | [components.Data](../../models/components/data.md) | :heavy_minus_sign: | N/A | | `email` | *string* | :heavy_minus_sign: | N/A | | `firstName` | *string* | :heavy_minus_sign: | N/A | diff --git a/docs/models/components/createtenantrequestdto.md b/docs/models/components/createtenantrequestdto.md index 4a380e27..42bb4464 100644 --- a/docs/models/components/createtenantrequestdto.md +++ b/docs/models/components/createtenantrequestdto.md @@ -1,5 +1,15 @@ # CreateTenantRequestDto +## Example Usage + +```typescript +import { CreateTenantRequestDto } from "@novu/api/models/components"; + +let value: CreateTenantRequestDto = { + identifier: "", + name: "", +}; +``` ## Fields diff --git a/docs/models/components/createtenantrequestdtodata.md b/docs/models/components/createtenantrequestdtodata.md index 44065a3e..031368cd 100644 --- a/docs/models/components/createtenantrequestdtodata.md +++ b/docs/models/components/createtenantrequestdtodata.md @@ -1,5 +1,12 @@ # CreateTenantRequestDtoData +## Example Usage + +```typescript +import { CreateTenantRequestDtoData } from "@novu/api/models/components"; + +let value: CreateTenantRequestDtoData = {}; +``` ## Fields diff --git a/docs/models/components/createtenantresponsedto.md b/docs/models/components/createtenantresponsedto.md index 8932f4fb..c6431e85 100644 --- a/docs/models/components/createtenantresponsedto.md +++ b/docs/models/components/createtenantresponsedto.md @@ -1,5 +1,18 @@ # CreateTenantResponseDto +## Example Usage + +```typescript +import { CreateTenantResponseDto } from "@novu/api/models/components"; + +let value: CreateTenantResponseDto = { + environmentId: "", + id: "", + createdAt: "", + identifier: "", + updatedAt: "", +}; +``` ## Fields diff --git a/docs/models/components/createtenantresponsedtodata.md b/docs/models/components/createtenantresponsedtodata.md index 21942f4a..045f176f 100644 --- a/docs/models/components/createtenantresponsedtodata.md +++ b/docs/models/components/createtenantresponsedtodata.md @@ -1,5 +1,12 @@ # CreateTenantResponseDtoData +## Example Usage + +```typescript +import { CreateTenantResponseDtoData } from "@novu/api/models/components"; + +let value: CreateTenantResponseDtoData = {}; +``` ## Fields diff --git a/docs/models/components/createtopicrequestdto.md b/docs/models/components/createtopicrequestdto.md index 0c2f874d..be049174 100644 --- a/docs/models/components/createtopicrequestdto.md +++ b/docs/models/components/createtopicrequestdto.md @@ -1,5 +1,15 @@ # CreateTopicRequestDto +## Example Usage + +```typescript +import { CreateTopicRequestDto } from "@novu/api/models/components"; + +let value: CreateTopicRequestDto = { + key: "", + name: "", +}; +``` ## Fields diff --git a/docs/models/components/createtopicresponsedto.md b/docs/models/components/createtopicresponsedto.md index 005fe8f9..cc4cb755 100644 --- a/docs/models/components/createtopicresponsedto.md +++ b/docs/models/components/createtopicresponsedto.md @@ -1,7 +1,18 @@ # CreateTopicResponseDto +## Example Usage + +```typescript +import { CreateTopicResponseDto } from "@novu/api/models/components"; + +let value: CreateTopicResponseDto = { + key: "", +}; +``` ## Fields -| Field | Type | Required | Description | -| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_minus_sign: | The unique identifier for the Topic created. | +| `key` | *string* | :heavy_check_mark: | User defined custom key and provided by the user that will be an unique identifier for the Topic created. | \ No newline at end of file diff --git a/docs/models/components/createworkflowrequestdto.md b/docs/models/components/createworkflowrequestdto.md index 67f8db5d..84de0573 100644 --- a/docs/models/components/createworkflowrequestdto.md +++ b/docs/models/components/createworkflowrequestdto.md @@ -1,5 +1,16 @@ # CreateWorkflowRequestDto +## Example Usage + +```typescript +import { CreateWorkflowRequestDto } from "@novu/api/models/components"; + +let value: CreateWorkflowRequestDto = { + name: "", + notificationGroupId: "", + steps: [], +}; +``` ## Fields diff --git a/docs/models/components/createworkflowrequestdtodata.md b/docs/models/components/createworkflowrequestdtodata.md index c448ad70..63865de6 100644 --- a/docs/models/components/createworkflowrequestdtodata.md +++ b/docs/models/components/createworkflowrequestdtodata.md @@ -1,5 +1,12 @@ # CreateWorkflowRequestDtoData +## Example Usage + +```typescript +import { CreateWorkflowRequestDtoData } from "@novu/api/models/components"; + +let value: CreateWorkflowRequestDtoData = {}; +``` ## Fields diff --git a/docs/models/components/createworkflowrequestdtonotificationgroup.md b/docs/models/components/createworkflowrequestdtonotificationgroup.md index b59c9b68..50bd4b8c 100644 --- a/docs/models/components/createworkflowrequestdtonotificationgroup.md +++ b/docs/models/components/createworkflowrequestdtonotificationgroup.md @@ -1,5 +1,12 @@ # CreateWorkflowRequestDtoNotificationGroup +## Example Usage + +```typescript +import { CreateWorkflowRequestDtoNotificationGroup } from "@novu/api/models/components"; + +let value: CreateWorkflowRequestDtoNotificationGroup = {}; +``` ## Fields diff --git a/docs/models/components/credentialsdto.md b/docs/models/components/credentialsdto.md index ad7749d9..15d93e79 100644 --- a/docs/models/components/credentialsdto.md +++ b/docs/models/components/credentialsdto.md @@ -1,10 +1,18 @@ # CredentialsDto +## Example Usage + +```typescript +import { CredentialsDto } from "@novu/api/models/components"; + +let value: CredentialsDto = {}; +``` ## Fields | Field | Type | Required | Description | | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `accessKey` | *string* | :heavy_minus_sign: | N/A | | `accountSid` | *string* | :heavy_minus_sign: | N/A | | `alertUid` | *string* | :heavy_minus_sign: | N/A | | `apiKey` | *string* | :heavy_minus_sign: | N/A | diff --git a/docs/models/components/data.md b/docs/models/components/data.md index 5f132f03..936dce25 100644 --- a/docs/models/components/data.md +++ b/docs/models/components/data.md @@ -1,5 +1,12 @@ # Data +## Example Usage + +```typescript +import { Data } from "@novu/api/models/components"; + +let value: Data = {}; +``` ## Fields diff --git a/docs/models/components/databooleandto.md b/docs/models/components/databooleandto.md index d303c61e..88fb1927 100644 --- a/docs/models/components/databooleandto.md +++ b/docs/models/components/databooleandto.md @@ -1,5 +1,14 @@ # DataBooleanDto +## Example Usage + +```typescript +import { DataBooleanDto } from "@novu/api/models/components"; + +let value: DataBooleanDto = { + data: false, +}; +``` ## Fields diff --git a/docs/models/components/datanumberdto.md b/docs/models/components/datanumberdto.md index 33752122..c912e1e8 100644 --- a/docs/models/components/datanumberdto.md +++ b/docs/models/components/datanumberdto.md @@ -1,5 +1,14 @@ # DataNumberDto +## Example Usage + +```typescript +import { DataNumberDto } from "@novu/api/models/components"; + +let value: DataNumberDto = { + data: 6458.94, +}; +``` ## Fields diff --git a/docs/models/components/delayregularmetadata.md b/docs/models/components/delayregularmetadata.md index e945d036..470edfb4 100644 --- a/docs/models/components/delayregularmetadata.md +++ b/docs/models/components/delayregularmetadata.md @@ -1,5 +1,14 @@ # DelayRegularMetadata +## Example Usage + +```typescript +import { DelayRegularMetadata } from "@novu/api/models/components"; + +let value: DelayRegularMetadata = { + type: "regular", +}; +``` ## Fields diff --git a/docs/models/components/delayregularmetadatatype.md b/docs/models/components/delayregularmetadatatype.md index a620c477..52666530 100644 --- a/docs/models/components/delayregularmetadatatype.md +++ b/docs/models/components/delayregularmetadatatype.md @@ -1,8 +1,15 @@ # DelayRegularMetadataType +## Example Usage + +```typescript +import { DelayRegularMetadataType } from "@novu/api/models/components"; + +let value: DelayRegularMetadataType = "regular"; +``` ## Values -| Name | Value | -| --------- | --------- | -| `Regular` | regular | \ No newline at end of file +```typescript +"regular" +``` \ No newline at end of file diff --git a/docs/models/components/delayscheduledmetadata.md b/docs/models/components/delayscheduledmetadata.md index 04fbe134..640c0375 100644 --- a/docs/models/components/delayscheduledmetadata.md +++ b/docs/models/components/delayscheduledmetadata.md @@ -1,5 +1,15 @@ # DelayScheduledMetadata +## Example Usage + +```typescript +import { DelayScheduledMetadata } from "@novu/api/models/components"; + +let value: DelayScheduledMetadata = { + delayPath: "", + type: "scheduled", +}; +``` ## Fields diff --git a/docs/models/components/delayscheduledmetadatatype.md b/docs/models/components/delayscheduledmetadatatype.md index 26aa5b3b..adfbf2db 100644 --- a/docs/models/components/delayscheduledmetadatatype.md +++ b/docs/models/components/delayscheduledmetadatatype.md @@ -1,8 +1,15 @@ # DelayScheduledMetadataType +## Example Usage + +```typescript +import { DelayScheduledMetadataType } from "@novu/api/models/components"; + +let value: DelayScheduledMetadataType = "scheduled"; +``` ## Values -| Name | Value | -| ----------- | ----------- | -| `Scheduled` | scheduled | \ No newline at end of file +```typescript +"scheduled" +``` \ No newline at end of file diff --git a/docs/models/components/deletemessageresponsedto.md b/docs/models/components/deletemessageresponsedto.md index 6efc8eea..cf881ab6 100644 --- a/docs/models/components/deletemessageresponsedto.md +++ b/docs/models/components/deletemessageresponsedto.md @@ -1,9 +1,19 @@ # DeleteMessageResponseDto +## Example Usage + +```typescript +import { DeleteMessageResponseDto } from "@novu/api/models/components"; + +let value: DeleteMessageResponseDto = { + acknowledged: false, + status: "deleted", +}; +``` ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | -| `acknowledged` | *boolean* | :heavy_check_mark: | A boolean stating the success of the action | -| `status` | [components.DeleteMessageResponseDtoStatus](../../models/components/deletemessageresponsedtostatus.md) | :heavy_check_mark: | The status enum for the performed action | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `acknowledged` | *boolean* | :heavy_check_mark: | A boolean stating the success of the action | +| `status` | [components.Status](../../models/components/status.md) | :heavy_check_mark: | The status enum for the performed action | \ No newline at end of file diff --git a/docs/models/components/deletemessageresponsedtostatus.md b/docs/models/components/deletemessageresponsedtostatus.md deleted file mode 100644 index 9ed9e324..00000000 --- a/docs/models/components/deletemessageresponsedtostatus.md +++ /dev/null @@ -1,10 +0,0 @@ -# DeleteMessageResponseDtoStatus - -The status enum for the performed action - - -## Values - -| Name | Value | -| --------- | --------- | -| `Deleted` | deleted | \ No newline at end of file diff --git a/docs/models/components/deletenotificationgroupresponsedto.md b/docs/models/components/deletenotificationgroupresponsedto.md index 9a682695..17b5fdd2 100644 --- a/docs/models/components/deletenotificationgroupresponsedto.md +++ b/docs/models/components/deletenotificationgroupresponsedto.md @@ -1,5 +1,15 @@ # DeleteNotificationGroupResponseDto +## Example Usage + +```typescript +import { DeleteNotificationGroupResponseDto } from "@novu/api/models/components"; + +let value: DeleteNotificationGroupResponseDto = { + acknowledged: false, + status: "deleted", +}; +``` ## Fields diff --git a/docs/models/components/deletenotificationgroupresponsedtostatus.md b/docs/models/components/deletenotificationgroupresponsedtostatus.md index 4a19db1f..97ae3ee1 100644 --- a/docs/models/components/deletenotificationgroupresponsedtostatus.md +++ b/docs/models/components/deletenotificationgroupresponsedtostatus.md @@ -2,9 +2,16 @@ The status enum for the performed action +## Example Usage + +```typescript +import { DeleteNotificationGroupResponseDtoStatus } from "@novu/api/models/components"; + +let value: DeleteNotificationGroupResponseDtoStatus = "deleted"; +``` ## Values -| Name | Value | -| --------- | --------- | -| `Deleted` | deleted | \ No newline at end of file +```typescript +"deleted" +``` \ No newline at end of file diff --git a/docs/models/components/deletesubscriberresponsedto.md b/docs/models/components/deletesubscriberresponsedto.md index 2466797f..924cb4f2 100644 --- a/docs/models/components/deletesubscriberresponsedto.md +++ b/docs/models/components/deletesubscriberresponsedto.md @@ -1,5 +1,15 @@ # DeleteSubscriberResponseDto +## Example Usage + +```typescript +import { DeleteSubscriberResponseDto } from "@novu/api/models/components"; + +let value: DeleteSubscriberResponseDto = { + acknowledged: false, + status: "deleted", +}; +``` ## Fields diff --git a/docs/models/components/deletesubscriberresponsedtostatus.md b/docs/models/components/deletesubscriberresponsedtostatus.md index b8ba425a..80e97b35 100644 --- a/docs/models/components/deletesubscriberresponsedtostatus.md +++ b/docs/models/components/deletesubscriberresponsedtostatus.md @@ -2,9 +2,16 @@ The status enum for the performed action +## Example Usage + +```typescript +import { DeleteSubscriberResponseDtoStatus } from "@novu/api/models/components"; + +let value: DeleteSubscriberResponseDtoStatus = "deleted"; +``` ## Values -| Name | Value | -| --------- | --------- | -| `Deleted` | deleted | \ No newline at end of file +```typescript +"deleted" +``` \ No newline at end of file diff --git a/docs/models/components/digest.md b/docs/models/components/digest.md deleted file mode 100644 index ed20d16a..00000000 --- a/docs/models/components/digest.md +++ /dev/null @@ -1,7 +0,0 @@ -# Digest - - -## Fields - -| Field | Type | Required | Description | -| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/components/digestregularmetadata.md b/docs/models/components/digestregularmetadata.md index 8372f432..ded27209 100644 --- a/docs/models/components/digestregularmetadata.md +++ b/docs/models/components/digestregularmetadata.md @@ -1,5 +1,14 @@ # DigestRegularMetadata +## Example Usage + +```typescript +import { DigestRegularMetadata } from "@novu/api/models/components"; + +let value: DigestRegularMetadata = { + type: "backoff", +}; +``` ## Fields diff --git a/docs/models/components/digestregularmetadatatype.md b/docs/models/components/digestregularmetadatatype.md index 41f918a6..6830975b 100644 --- a/docs/models/components/digestregularmetadatatype.md +++ b/docs/models/components/digestregularmetadatatype.md @@ -1,9 +1,15 @@ # DigestRegularMetadataType +## Example Usage + +```typescript +import { DigestRegularMetadataType } from "@novu/api/models/components"; + +let value: DigestRegularMetadataType = "backoff"; +``` ## Values -| Name | Value | -| --------- | --------- | -| `Regular` | regular | -| `Backoff` | backoff | \ No newline at end of file +```typescript +"regular" | "backoff" +``` \ No newline at end of file diff --git a/docs/models/components/digestregularmetadataunit.md b/docs/models/components/digestregularmetadataunit.md index 63b32cdd..f0387535 100644 --- a/docs/models/components/digestregularmetadataunit.md +++ b/docs/models/components/digestregularmetadataunit.md @@ -1,13 +1,15 @@ # DigestRegularMetadataUnit +## Example Usage + +```typescript +import { DigestRegularMetadataUnit } from "@novu/api/models/components"; + +let value: DigestRegularMetadataUnit = "months"; +``` ## Values -| Name | Value | -| --------- | --------- | -| `Seconds` | seconds | -| `Minutes` | minutes | -| `Hours` | hours | -| `Days` | days | -| `Weeks` | weeks | -| `Months` | months | \ No newline at end of file +```typescript +"seconds" | "minutes" | "hours" | "days" | "weeks" | "months" +``` \ No newline at end of file diff --git a/docs/models/components/digesttimedmetadata.md b/docs/models/components/digesttimedmetadata.md index 6c9b4127..40cf77d0 100644 --- a/docs/models/components/digesttimedmetadata.md +++ b/docs/models/components/digesttimedmetadata.md @@ -1,5 +1,14 @@ # DigestTimedMetadata +## Example Usage + +```typescript +import { DigestTimedMetadata } from "@novu/api/models/components"; + +let value: DigestTimedMetadata = { + type: "timed", +}; +``` ## Fields diff --git a/docs/models/components/digesttimedmetadatatype.md b/docs/models/components/digesttimedmetadatatype.md index cf2b1a41..a1b443b3 100644 --- a/docs/models/components/digesttimedmetadatatype.md +++ b/docs/models/components/digesttimedmetadatatype.md @@ -1,8 +1,15 @@ # DigestTimedMetadataType +## Example Usage + +```typescript +import { DigestTimedMetadataType } from "@novu/api/models/components"; + +let value: DigestTimedMetadataType = "timed"; +``` ## Values -| Name | Value | -| ------- | ------- | -| `Timed` | timed | \ No newline at end of file +```typescript +"timed" +``` \ No newline at end of file diff --git a/docs/models/components/digesttimedmetadataunit.md b/docs/models/components/digesttimedmetadataunit.md index 359ed736..6f392cc4 100644 --- a/docs/models/components/digesttimedmetadataunit.md +++ b/docs/models/components/digesttimedmetadataunit.md @@ -1,13 +1,15 @@ # DigestTimedMetadataUnit +## Example Usage + +```typescript +import { DigestTimedMetadataUnit } from "@novu/api/models/components"; + +let value: DigestTimedMetadataUnit = "hours"; +``` ## Values -| Name | Value | -| --------- | --------- | -| `Seconds` | seconds | -| `Minutes` | minutes | -| `Hours` | hours | -| `Days` | days | -| `Weeks` | weeks | -| `Months` | months | \ No newline at end of file +```typescript +"seconds" | "minutes" | "hours" | "days" | "weeks" | "months" +``` \ No newline at end of file diff --git a/docs/models/components/direction.md b/docs/models/components/direction.md index 0df4477a..624b7435 100644 --- a/docs/models/components/direction.md +++ b/docs/models/components/direction.md @@ -1,9 +1,15 @@ # Direction +## Example Usage + +```typescript +import { Direction } from "@novu/api/models/components"; + +let value: Direction = "trl"; +``` ## Values -| Name | Value | -| ----- | ----- | -| `Ltr` | ltr | -| `Trl` | trl | \ No newline at end of file +```typescript +"ltr" | "trl" +``` \ No newline at end of file diff --git a/docs/models/components/emailblock.md b/docs/models/components/emailblock.md index 9ee36a41..64f80d76 100644 --- a/docs/models/components/emailblock.md +++ b/docs/models/components/emailblock.md @@ -1,5 +1,15 @@ # EmailBlock +## Example Usage + +```typescript +import { EmailBlock } from "@novu/api/models/components"; + +let value: EmailBlock = { + content: "", + type: "text", +}; +``` ## Fields diff --git a/docs/models/components/emailblockstyles.md b/docs/models/components/emailblockstyles.md index 6fb52d70..ecbe93b1 100644 --- a/docs/models/components/emailblockstyles.md +++ b/docs/models/components/emailblockstyles.md @@ -1,8 +1,17 @@ # EmailBlockStyles +## Example Usage + +```typescript +import { EmailBlockStyles } from "@novu/api/models/components"; + +let value: EmailBlockStyles = { + textAlign: "center", +}; +``` ## Fields | Field | Type | Required | Description | | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `textAlign` | [components.TextAlign](../../models/components/textalign.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `textAlign` | [components.TextAlign](../../models/components/textalign.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/emailblocktype.md b/docs/models/components/emailblocktype.md index 5f636160..63e25e19 100644 --- a/docs/models/components/emailblocktype.md +++ b/docs/models/components/emailblocktype.md @@ -1,9 +1,15 @@ # EmailBlockType +## Example Usage + +```typescript +import { EmailBlockType } from "@novu/api/models/components"; + +let value: EmailBlockType = "text"; +``` ## Values -| Name | Value | -| -------- | -------- | -| `Text` | text | -| `Button` | button | \ No newline at end of file +```typescript +"button" | "text" +``` \ No newline at end of file diff --git a/docs/models/components/environmentresponsedto.md b/docs/models/components/environmentresponsedto.md index fe591792..b330416c 100644 --- a/docs/models/components/environmentresponsedto.md +++ b/docs/models/components/environmentresponsedto.md @@ -1,13 +1,25 @@ # EnvironmentResponseDto +## Example Usage + +```typescript +import { EnvironmentResponseDto } from "@novu/api/models/components"; + +let value: EnvironmentResponseDto = { + organizationId: "", + parentId: "", + identifier: "", + name: "", +}; +``` ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | -| `id` | *string* | :heavy_minus_sign: | N/A | -| `organizationId` | *string* | :heavy_check_mark: | N/A | -| `parentId` | *string* | :heavy_check_mark: | N/A | -| `apiKeys` | [components.ApiKeys](../../models/components/apikeys.md)[] | :heavy_minus_sign: | N/A | -| `identifier` | *string* | :heavy_check_mark: | N/A | -| `name` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `id` | *string* | :heavy_minus_sign: | N/A | +| `organizationId` | *string* | :heavy_check_mark: | N/A | +| `parentId` | *string* | :heavy_check_mark: | N/A | +| `apiKeys` | *string*[] | :heavy_minus_sign: | N/A | +| `identifier` | *string* | :heavy_check_mark: | N/A | +| `name` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/executiondetailsresponsedto.md b/docs/models/components/executiondetailsresponsedto.md index 3e6021bc..70860606 100644 --- a/docs/models/components/executiondetailsresponsedto.md +++ b/docs/models/components/executiondetailsresponsedto.md @@ -1,5 +1,26 @@ # ExecutionDetailsResponseDto +## Example Usage + +```typescript +import { ExecutionDetailsResponseDto } from "@novu/api/models/components"; + +let value: ExecutionDetailsResponseDto = { + environmentId: "", + jobId: "", + notificationId: "", + notificationTemplateId: "", + organizationId: "", + subscriberId: "", + channel: "sms", + detail: "", + isRetry: false, + isTest: false, + source: "Internal", + status: "Failed", + transactionId: "", +}; +``` ## Fields @@ -19,6 +40,6 @@ | `isRetry` | *boolean* | :heavy_check_mark: | N/A | | `isTest` | *boolean* | :heavy_check_mark: | N/A | | `providerId` | *string* | :heavy_minus_sign: | N/A | -| `source` | [components.ExecutionDetailsResponseDtoSource](../../models/components/executiondetailsresponsedtosource.md) | :heavy_check_mark: | N/A | +| `source` | [components.Source](../../models/components/source.md) | :heavy_check_mark: | N/A | | `status` | [components.ExecutionDetailsResponseDtoStatus](../../models/components/executiondetailsresponsedtostatus.md) | :heavy_check_mark: | N/A | | `transactionId` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/executiondetailsresponsedtochannel.md b/docs/models/components/executiondetailsresponsedtochannel.md index cd7c5f8e..aa40f980 100644 --- a/docs/models/components/executiondetailsresponsedtochannel.md +++ b/docs/models/components/executiondetailsresponsedtochannel.md @@ -1,16 +1,15 @@ # ExecutionDetailsResponseDtoChannel +## Example Usage + +```typescript +import { ExecutionDetailsResponseDtoChannel } from "@novu/api/models/components"; + +let value: ExecutionDetailsResponseDtoChannel = "custom"; +``` ## Values -| Name | Value | -| --------- | --------- | -| `InApp` | in_app | -| `Email` | email | -| `Sms` | sms | -| `Chat` | chat | -| `Push` | push | -| `Digest` | digest | -| `Trigger` | trigger | -| `Delay` | delay | -| `Custom` | custom | \ No newline at end of file +```typescript +"in_app" | "email" | "sms" | "chat" | "push" | "digest" | "trigger" | "delay" | "custom" +``` \ No newline at end of file diff --git a/docs/models/components/executiondetailsresponsedtosource.md b/docs/models/components/executiondetailsresponsedtosource.md deleted file mode 100644 index ad9c00b0..00000000 --- a/docs/models/components/executiondetailsresponsedtosource.md +++ /dev/null @@ -1,11 +0,0 @@ -# ExecutionDetailsResponseDtoSource - - -## Values - -| Name | Value | -| ------------- | ------------- | -| `Credentials` | Credentials | -| `Internal` | Internal | -| `Payload` | Payload | -| `Webhook` | Webhook | \ No newline at end of file diff --git a/docs/models/components/executiondetailsresponsedtostatus.md b/docs/models/components/executiondetailsresponsedtostatus.md index 88306bef..169e8d8a 100644 --- a/docs/models/components/executiondetailsresponsedtostatus.md +++ b/docs/models/components/executiondetailsresponsedtostatus.md @@ -1,13 +1,15 @@ # ExecutionDetailsResponseDtoStatus +## Example Usage + +```typescript +import { ExecutionDetailsResponseDtoStatus } from "@novu/api/models/components"; + +let value: ExecutionDetailsResponseDtoStatus = "ReadConfirmation"; +``` ## Values -| Name | Value | -| ------------------ | ------------------ | -| `Success` | Success | -| `Warning` | Warning | -| `Failed` | Failed | -| `Pending` | Pending | -| `Queued` | Queued | -| `ReadConfirmation` | ReadConfirmation | \ No newline at end of file +```typescript +"Success" | "Warning" | "Failed" | "Pending" | "Queued" | "ReadConfirmation" +``` \ No newline at end of file diff --git a/docs/models/components/markmessageactionasseendtopayload.md b/docs/models/components/feedid.md similarity index 51% rename from docs/models/components/markmessageactionasseendtopayload.md rename to docs/models/components/feedid.md index d829e4c8..1b186e15 100644 --- a/docs/models/components/markmessageactionasseendtopayload.md +++ b/docs/models/components/feedid.md @@ -1,7 +1,12 @@ -# MarkMessageActionAsSeenDtoPayload +# FeedId -Message action payload +## Example Usage +```typescript +import { FeedId } from "@novu/api/models/components"; + +let value: FeedId = {}; +``` ## Fields diff --git a/docs/models/components/feedidentifier.md b/docs/models/components/feedidentifier.md index 5bc7749f..42f5f9a7 100644 --- a/docs/models/components/feedidentifier.md +++ b/docs/models/components/feedidentifier.md @@ -2,6 +2,13 @@ Optional feed identifier or array of feed identifiers +## Example Usage + +```typescript +import { FeedIdentifier } from "@novu/api/models/components"; + +let value: FeedIdentifier = [""]; +``` ## Supported Types diff --git a/docs/models/components/feedresponsedto.md b/docs/models/components/feedresponsedto.md index 99bf08a9..db709507 100644 --- a/docs/models/components/feedresponsedto.md +++ b/docs/models/components/feedresponsedto.md @@ -1,12 +1,24 @@ # FeedResponseDto +## Example Usage + +```typescript +import { FeedResponseDto } from "@novu/api/models/components"; + +let value: FeedResponseDto = { + data: [""], + hasMore: false, + page: 7917.25, + pageSize: 8121.69, +}; +``` ## Fields | Field | Type | Required | Description | | ------------------ | ------------------ | ------------------ | ------------------ | -| `environmentId` | *string* | :heavy_check_mark: | N/A | -| `id` | *string* | :heavy_minus_sign: | N/A | -| `organizationId` | *string* | :heavy_check_mark: | N/A | -| `identifier` | *string* | :heavy_check_mark: | N/A | -| `name` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file +| `data` | *string*[] | :heavy_check_mark: | N/A | +| `hasMore` | *boolean* | :heavy_check_mark: | N/A | +| `page` | *number* | :heavy_check_mark: | N/A | +| `pageSize` | *number* | :heavy_check_mark: | N/A | +| `totalCount` | *number* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/fieldfilterpart.md b/docs/models/components/fieldfilterpart.md index 16e003ed..0047dfd5 100644 --- a/docs/models/components/fieldfilterpart.md +++ b/docs/models/components/fieldfilterpart.md @@ -1,5 +1,17 @@ # FieldFilterPart +## Example Usage + +```typescript +import { FieldFilterPart } from "@novu/api/models/components"; + +let value: FieldFilterPart = { + field: "", + on: "subscriber", + operator: "NOT_EQUAL", + value: "", +}; +``` ## Fields diff --git a/docs/models/components/filtertopicsresponsedto.md b/docs/models/components/filtertopicsresponsedto.md index 238db92b..4c71176d 100644 --- a/docs/models/components/filtertopicsresponsedto.md +++ b/docs/models/components/filtertopicsresponsedto.md @@ -1,5 +1,25 @@ # FilterTopicsResponseDto +## Example Usage + +```typescript +import { FilterTopicsResponseDto } from "@novu/api/models/components"; + +let value: FilterTopicsResponseDto = { + data: [ + { + environmentId: "", + organizationId: "", + key: "", + name: "", + subscribers: [""], + }, + ], + page: 3637.11, + pageSize: 3250.47, + totalCount: 5701.97, +}; +``` ## Fields diff --git a/docs/models/components/getlayoutresponsedto.md b/docs/models/components/getlayoutresponsedto.md index cdb1708f..8dd35140 100644 --- a/docs/models/components/getlayoutresponsedto.md +++ b/docs/models/components/getlayoutresponsedto.md @@ -1,5 +1,23 @@ # GetLayoutResponseDto +## Example Usage + +```typescript +import { GetLayoutResponseDto } from "@novu/api/models/components"; + +let value: GetLayoutResponseDto = { + creatorId: "", + environmentId: "", + organizationId: "", + channel: "in_app", + content: "", + contentType: "", + identifier: "", + isDefault: false, + isDeleted: false, + name: "", +}; +``` ## Fields @@ -20,4 +38,4 @@ | `isDeleted` | *boolean* | :heavy_check_mark: | N/A | | `name` | *string* | :heavy_check_mark: | N/A | | `updatedAt` | *string* | :heavy_minus_sign: | N/A | -| `variables` | [components.Variables](../../models/components/variables.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file +| `variables` | *string*[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/getlayoutresponsedtochannel.md b/docs/models/components/getlayoutresponsedtochannel.md index 99ef0dd4..9cd9fe20 100644 --- a/docs/models/components/getlayoutresponsedtochannel.md +++ b/docs/models/components/getlayoutresponsedtochannel.md @@ -1,12 +1,15 @@ # GetLayoutResponseDtoChannel +## Example Usage + +```typescript +import { GetLayoutResponseDtoChannel } from "@novu/api/models/components"; + +let value: GetLayoutResponseDtoChannel = "chat"; +``` ## Values -| Name | Value | -| ------- | ------- | -| `InApp` | in_app | -| `Email` | email | -| `Sms` | sms | -| `Chat` | chat | -| `Push` | push | \ No newline at end of file +```typescript +"in_app" | "email" | "sms" | "chat" | "push" +``` \ No newline at end of file diff --git a/docs/models/components/getsubscriberpreferencesresponsedto.md b/docs/models/components/getsubscriberpreferencesresponsedto.md index 43f2a598..aadfdf03 100644 --- a/docs/models/components/getsubscriberpreferencesresponsedto.md +++ b/docs/models/components/getsubscriberpreferencesresponsedto.md @@ -1,5 +1,17 @@ # GetSubscriberPreferencesResponseDto +## Example Usage + +```typescript +import { GetSubscriberPreferencesResponseDto } from "@novu/api/models/components"; + +let value: GetSubscriberPreferencesResponseDto = { + preference: { + channels: {}, + enabled: false, + }, +}; +``` ## Fields diff --git a/docs/models/components/gettenantresponsedto.md b/docs/models/components/gettenantresponsedto.md index d8cf585b..ce12b52f 100644 --- a/docs/models/components/gettenantresponsedto.md +++ b/docs/models/components/gettenantresponsedto.md @@ -1,5 +1,18 @@ # GetTenantResponseDto +## Example Usage + +```typescript +import { GetTenantResponseDto } from "@novu/api/models/components"; + +let value: GetTenantResponseDto = { + environmentId: "", + id: "", + createdAt: "", + identifier: "", + updatedAt: "", +}; +``` ## Fields diff --git a/docs/models/components/gettenantresponsedtodata.md b/docs/models/components/gettenantresponsedtodata.md index e3e996bf..4f7d93b8 100644 --- a/docs/models/components/gettenantresponsedtodata.md +++ b/docs/models/components/gettenantresponsedtodata.md @@ -1,5 +1,12 @@ # GetTenantResponseDtoData +## Example Usage + +```typescript +import { GetTenantResponseDtoData } from "@novu/api/models/components"; + +let value: GetTenantResponseDtoData = {}; +``` ## Fields diff --git a/docs/models/components/gettopicresponsedto.md b/docs/models/components/gettopicresponsedto.md index 5d55ce17..f536618d 100644 --- a/docs/models/components/gettopicresponsedto.md +++ b/docs/models/components/gettopicresponsedto.md @@ -1,5 +1,18 @@ # GetTopicResponseDto +## Example Usage + +```typescript +import { GetTopicResponseDto } from "@novu/api/models/components"; + +let value: GetTopicResponseDto = { + environmentId: "", + organizationId: "", + key: "", + name: "", + subscribers: [""], +}; +``` ## Fields diff --git a/docs/models/components/integrationresponsedto.md b/docs/models/components/integrationresponsedto.md index 793ed471..243f395f 100644 --- a/docs/models/components/integrationresponsedto.md +++ b/docs/models/components/integrationresponsedto.md @@ -1,5 +1,25 @@ # IntegrationResponseDto +## Example Usage + +```typescript +import { IntegrationResponseDto } from "@novu/api/models/components"; + +let value: IntegrationResponseDto = { + environmentId: "", + organizationId: "", + active: false, + channel: "sms", + credentials: {}, + deleted: false, + deletedAt: "", + deletedBy: "", + identifier: "", + name: "", + primary: false, + providerId: "", +}; +``` ## Fields diff --git a/docs/models/components/integrationresponsedtochannel.md b/docs/models/components/integrationresponsedtochannel.md index 71c3fbec..d25ca805 100644 --- a/docs/models/components/integrationresponsedtochannel.md +++ b/docs/models/components/integrationresponsedtochannel.md @@ -1,12 +1,15 @@ # IntegrationResponseDtoChannel +## Example Usage + +```typescript +import { IntegrationResponseDtoChannel } from "@novu/api/models/components"; + +let value: IntegrationResponseDtoChannel = "sms"; +``` ## Values -| Name | Value | -| ------- | ------- | -| `InApp` | in_app | -| `Email` | email | -| `Sms` | sms | -| `Chat` | chat | -| `Push` | push | \ No newline at end of file +```typescript +"in_app" | "email" | "sms" | "chat" | "push" +``` \ No newline at end of file diff --git a/docs/models/components/ipartnerconfigurationresponsedto.md b/docs/models/components/ipartnerconfigurationresponsedto.md deleted file mode 100644 index ca7e27b4..00000000 --- a/docs/models/components/ipartnerconfigurationresponsedto.md +++ /dev/null @@ -1,12 +0,0 @@ -# IPartnerConfigurationResponseDto - - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | -| `accessToken` | *string* | :heavy_check_mark: | N/A | -| `configurationId` | *string* | :heavy_check_mark: | N/A | -| `partnerType` | [components.PartnerType](../../models/components/partnertype.md) | :heavy_check_mark: | Partner Type Enum | -| `projectIds` | *string*[] | :heavy_minus_sign: | N/A | -| `teamId` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/jobtitle.md b/docs/models/components/jobtitle.md deleted file mode 100644 index d3f052d8..00000000 --- a/docs/models/components/jobtitle.md +++ /dev/null @@ -1,15 +0,0 @@ -# JobTitle - - -## Values - -| Name | Value | -| -------------------- | -------------------- | -| `Engineer` | engineer | -| `EngineeringManager` | engineering_manager | -| `Architect` | architect | -| `ProductManager` | product_manager | -| `Designer` | designer | -| `CxoFounder` | cxo_founder | -| `MarketingManager` | marketing_manager | -| `Other` | other | \ No newline at end of file diff --git a/docs/models/components/markallmessageasrequestdto.md b/docs/models/components/markallmessageasrequestdto.md index de25411c..fc1783c9 100644 --- a/docs/models/components/markallmessageasrequestdto.md +++ b/docs/models/components/markallmessageasrequestdto.md @@ -1,5 +1,14 @@ # MarkAllMessageAsRequestDto +## Example Usage + +```typescript +import { MarkAllMessageAsRequestDto } from "@novu/api/models/components"; + +let value: MarkAllMessageAsRequestDto = { + markAs: "unread", +}; +``` ## Fields diff --git a/docs/models/components/markas.md b/docs/models/components/markas.md index 2797ca96..ba69869f 100644 --- a/docs/models/components/markas.md +++ b/docs/models/components/markas.md @@ -2,12 +2,16 @@ Mark all subscriber messages as read, unread, seen or unseen +## Example Usage + +```typescript +import { MarkAs } from "@novu/api/models/components"; + +let value: MarkAs = "unseen"; +``` ## Values -| Name | Value | -| -------- | -------- | -| `Read` | read | -| `Seen` | seen | -| `Unread` | unread | -| `Unseen` | unseen | \ No newline at end of file +```typescript +"read" | "seen" | "unread" | "unseen" +``` \ No newline at end of file diff --git a/docs/models/components/markmessageactionasseendto.md b/docs/models/components/markmessageactionasseendto.md index 15a5475e..4dc30ab8 100644 --- a/docs/models/components/markmessageactionasseendto.md +++ b/docs/models/components/markmessageactionasseendto.md @@ -1,9 +1,18 @@ # MarkMessageActionAsSeenDto +## Example Usage + +```typescript +import { MarkMessageActionAsSeenDto } from "@novu/api/models/components"; + +let value: MarkMessageActionAsSeenDto = { + status: "pending", +}; +``` ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `payload` | [components.MarkMessageActionAsSeenDtoPayload](../../models/components/markmessageactionasseendtopayload.md) | :heavy_minus_sign: | Message action payload | -| `status` | [components.MarkMessageActionAsSeenDtoStatus](../../models/components/markmessageactionasseendtostatus.md) | :heavy_check_mark: | Message action status | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `payload` | [components.Payload](../../models/components/payload.md) | :heavy_minus_sign: | Message action payload | +| `status` | [components.MarkMessageActionAsSeenDtoStatus](../../models/components/markmessageactionasseendtostatus.md) | :heavy_check_mark: | Message action status | \ No newline at end of file diff --git a/docs/models/components/markmessageactionasseendtostatus.md b/docs/models/components/markmessageactionasseendtostatus.md index e35a3da7..10687933 100644 --- a/docs/models/components/markmessageactionasseendtostatus.md +++ b/docs/models/components/markmessageactionasseendtostatus.md @@ -2,10 +2,16 @@ Message action status +## Example Usage + +```typescript +import { MarkMessageActionAsSeenDtoStatus } from "@novu/api/models/components"; + +let value: MarkMessageActionAsSeenDtoStatus = "pending"; +``` ## Values -| Name | Value | -| --------- | --------- | -| `Pending` | pending | -| `Done` | done | \ No newline at end of file +```typescript +"pending" | "done" +``` \ No newline at end of file diff --git a/docs/models/components/memberinvitedto.md b/docs/models/components/memberinvitedto.md deleted file mode 100644 index f70bcdf8..00000000 --- a/docs/models/components/memberinvitedto.md +++ /dev/null @@ -1,12 +0,0 @@ -# MemberInviteDTO - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `inviterId` | *string* | :heavy_check_mark: | N/A | -| `answerDate` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | N/A | -| `email` | *string* | :heavy_check_mark: | N/A | -| `invitationDate` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | N/A | -| `token` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/memberresponsedto.md b/docs/models/components/memberresponsedto.md deleted file mode 100644 index 01efd9c8..00000000 --- a/docs/models/components/memberresponsedto.md +++ /dev/null @@ -1,14 +0,0 @@ -# MemberResponseDto - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | -| `id` | *string* | :heavy_check_mark: | N/A | -| `organizationId` | *string* | :heavy_check_mark: | N/A | -| `userId` | *string* | :heavy_check_mark: | N/A | -| `invite` | [components.MemberInviteDTO](../../models/components/memberinvitedto.md) | :heavy_minus_sign: | N/A | -| `memberStatus` | [components.MemberStatus](../../models/components/memberstatus.md) | :heavy_minus_sign: | N/A | -| `roles` | [components.Roles](../../models/components/roles.md) | :heavy_minus_sign: | N/A | -| `user` | [components.MemberUserDto](../../models/components/memberuserdto.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/memberstatus.md b/docs/models/components/memberstatus.md deleted file mode 100644 index 1497b641..00000000 --- a/docs/models/components/memberstatus.md +++ /dev/null @@ -1,10 +0,0 @@ -# MemberStatus - - -## Values - -| Name | Value | -| --------- | --------- | -| `New` | new | -| `Active` | active | -| `Invited` | invited | \ No newline at end of file diff --git a/docs/models/components/memberuserdto.md b/docs/models/components/memberuserdto.md deleted file mode 100644 index 661d1b63..00000000 --- a/docs/models/components/memberuserdto.md +++ /dev/null @@ -1,11 +0,0 @@ -# MemberUserDto - - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `id` | *string* | :heavy_check_mark: | N/A | -| `email` | *string* | :heavy_check_mark: | N/A | -| `firstName` | *string* | :heavy_check_mark: | N/A | -| `lastName` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/messageaction.md b/docs/models/components/messageaction.md index 2dea05e2..7c40fbe8 100644 --- a/docs/models/components/messageaction.md +++ b/docs/models/components/messageaction.md @@ -1,5 +1,12 @@ # MessageAction +## Example Usage + +```typescript +import { MessageAction } from "@novu/api/models/components"; + +let value: MessageAction = {}; +``` ## Fields diff --git a/docs/models/components/messageactionresult.md b/docs/models/components/messageactionresult.md index 04cf6ebd..bf928d87 100644 --- a/docs/models/components/messageactionresult.md +++ b/docs/models/components/messageactionresult.md @@ -1,5 +1,12 @@ # MessageActionResult +## Example Usage + +```typescript +import { MessageActionResult } from "@novu/api/models/components"; + +let value: MessageActionResult = {}; +``` ## Fields diff --git a/docs/models/components/messageactionresultpayload.md b/docs/models/components/messageactionresultpayload.md index 11f47012..bbac45e2 100644 --- a/docs/models/components/messageactionresultpayload.md +++ b/docs/models/components/messageactionresultpayload.md @@ -1,5 +1,12 @@ # MessageActionResultPayload +## Example Usage + +```typescript +import { MessageActionResultPayload } from "@novu/api/models/components"; + +let value: MessageActionResultPayload = {}; +``` ## Fields diff --git a/docs/models/components/messageactionresulttype.md b/docs/models/components/messageactionresulttype.md index 785a8632..7b4520f3 100644 --- a/docs/models/components/messageactionresulttype.md +++ b/docs/models/components/messageactionresulttype.md @@ -1,9 +1,15 @@ # MessageActionResultType +## Example Usage + +```typescript +import { MessageActionResultType } from "@novu/api/models/components"; + +let value: MessageActionResultType = "primary"; +``` ## Values -| Name | Value | -| ----------- | ----------- | -| `Primary` | primary | -| `Secondary` | secondary | \ No newline at end of file +```typescript +"primary" | "secondary" +``` \ No newline at end of file diff --git a/docs/models/components/messageactionstatus.md b/docs/models/components/messageactionstatus.md index e0b24233..c039a55b 100644 --- a/docs/models/components/messageactionstatus.md +++ b/docs/models/components/messageactionstatus.md @@ -1,9 +1,15 @@ # MessageActionStatus +## Example Usage + +```typescript +import { MessageActionStatus } from "@novu/api/models/components"; + +let value: MessageActionStatus = "pending"; +``` ## Values -| Name | Value | -| --------- | --------- | -| `Pending` | pending | -| `Done` | done | \ No newline at end of file +```typescript +"pending" | "done" +``` \ No newline at end of file diff --git a/docs/models/components/messagebutton.md b/docs/models/components/messagebutton.md index 01d79911..91379d89 100644 --- a/docs/models/components/messagebutton.md +++ b/docs/models/components/messagebutton.md @@ -1,5 +1,15 @@ # MessageButton +## Example Usage + +```typescript +import { MessageButton } from "@novu/api/models/components"; + +let value: MessageButton = { + content: "", + type: "secondary", +}; +``` ## Fields diff --git a/docs/models/components/messagebuttontype.md b/docs/models/components/messagebuttontype.md index 39499411..b06cb585 100644 --- a/docs/models/components/messagebuttontype.md +++ b/docs/models/components/messagebuttontype.md @@ -1,9 +1,15 @@ # MessageButtonType +## Example Usage + +```typescript +import { MessageButtonType } from "@novu/api/models/components"; + +let value: MessageButtonType = "secondary"; +``` ## Values -| Name | Value | -| ----------- | ----------- | -| `Primary` | primary | -| `Secondary` | secondary | \ No newline at end of file +```typescript +"primary" | "secondary" +``` \ No newline at end of file diff --git a/docs/models/components/messagecta.md b/docs/models/components/messagecta.md index 746d77de..516cdf9f 100644 --- a/docs/models/components/messagecta.md +++ b/docs/models/components/messagecta.md @@ -1,5 +1,14 @@ # MessageCTA +## Example Usage + +```typescript +import { MessageCTA } from "@novu/api/models/components"; + +let value: MessageCTA = { + data: {}, +}; +``` ## Fields diff --git a/docs/models/components/messagectadata.md b/docs/models/components/messagectadata.md index 31ccbe17..6256b50c 100644 --- a/docs/models/components/messagectadata.md +++ b/docs/models/components/messagectadata.md @@ -1,5 +1,12 @@ # MessageCTAData +## Example Usage + +```typescript +import { MessageCTAData } from "@novu/api/models/components"; + +let value: MessageCTAData = {}; +``` ## Fields diff --git a/docs/models/components/messagectatype.md b/docs/models/components/messagectatype.md index c47a65d1..297b495e 100644 --- a/docs/models/components/messagectatype.md +++ b/docs/models/components/messagectatype.md @@ -1,8 +1,15 @@ # MessageCTAType +## Example Usage + +```typescript +import { MessageCTAType } from "@novu/api/models/components"; + +let value: MessageCTAType = "redirect"; +``` ## Values -| Name | Value | -| ---------- | ---------- | -| `Redirect` | redirect | \ No newline at end of file +```typescript +"redirect" +``` \ No newline at end of file diff --git a/docs/models/components/messageentity.md b/docs/models/components/messageentity.md index 21227ee8..6e91c47a 100644 --- a/docs/models/components/messageentity.md +++ b/docs/models/components/messageentity.md @@ -1,5 +1,12 @@ # MessageEntity +## Example Usage + +```typescript +import { MessageEntity } from "@novu/api/models/components"; + +let value: MessageEntity = {}; +``` ## Fields diff --git a/docs/models/components/messageid.md b/docs/models/components/messageid.md index 47077cb8..69188376 100644 --- a/docs/models/components/messageid.md +++ b/docs/models/components/messageid.md @@ -1,5 +1,12 @@ # MessageId +## Example Usage + +```typescript +import { MessageId } from "@novu/api/models/components"; + +let value: MessageId = ""; +``` ## Supported Types diff --git a/docs/models/components/messagemarkasrequestdto.md b/docs/models/components/messagemarkasrequestdto.md index c8c0d43a..1f846fbe 100644 --- a/docs/models/components/messagemarkasrequestdto.md +++ b/docs/models/components/messagemarkasrequestdto.md @@ -1,5 +1,15 @@ # MessageMarkAsRequestDto +## Example Usage + +```typescript +import { MessageMarkAsRequestDto } from "@novu/api/models/components"; + +let value: MessageMarkAsRequestDto = { + markAs: "seen", + messageId: "", +}; +``` ## Fields diff --git a/docs/models/components/messagemarkasrequestdtomarkas.md b/docs/models/components/messagemarkasrequestdtomarkas.md index 067ecbe5..9bdd3edb 100644 --- a/docs/models/components/messagemarkasrequestdtomarkas.md +++ b/docs/models/components/messagemarkasrequestdtomarkas.md @@ -1,11 +1,15 @@ # MessageMarkAsRequestDtoMarkAs +## Example Usage + +```typescript +import { MessageMarkAsRequestDtoMarkAs } from "@novu/api/models/components"; + +let value: MessageMarkAsRequestDtoMarkAs = "read"; +``` ## Values -| Name | Value | -| -------- | -------- | -| `Read` | read | -| `Seen` | seen | -| `Unread` | unread | -| `Unseen` | unseen | \ No newline at end of file +```typescript +"read" | "seen" | "unread" | "unseen" +``` \ No newline at end of file diff --git a/docs/models/components/messageresponsedto.md b/docs/models/components/messageresponsedto.md index 42f3adb0..d51c8050 100644 --- a/docs/models/components/messageresponsedto.md +++ b/docs/models/components/messageresponsedto.md @@ -1,12 +1,43 @@ # MessageResponseDto +## Example Usage + +```typescript +import { MessageResponseDto } from "@novu/api/models/components"; + +let value: MessageResponseDto = { + environmentId: "", + messageTemplateId: "", + notificationId: "", + organizationId: "", + subscriberId: "", + templateId: "", + channel: "sms", + content: { + content: "", + type: "text", + }, + createdAt: "", + cta: { + data: {}, + }, + errorId: "", + errorText: "", + overrides: {}, + payload: {}, + read: false, + seen: false, + status: "sent", + transactionId: "", +}; +``` ## Fields | Field | Type | Required | Description | | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | | `environmentId` | *string* | :heavy_check_mark: | N/A | -| `feedId` | *string* | :heavy_minus_sign: | N/A | +| `feedId` | [components.FeedId](../../models/components/feedid.md) | :heavy_minus_sign: | N/A | | `id` | *string* | :heavy_minus_sign: | N/A | | `messageTemplateId` | *string* | :heavy_check_mark: | N/A | | `notificationId` | *string* | :heavy_check_mark: | N/A | diff --git a/docs/models/components/messageresponsedtochannel.md b/docs/models/components/messageresponsedtochannel.md index 9f2e01f4..4d80ce7c 100644 --- a/docs/models/components/messageresponsedtochannel.md +++ b/docs/models/components/messageresponsedtochannel.md @@ -1,12 +1,15 @@ # MessageResponseDtoChannel +## Example Usage + +```typescript +import { MessageResponseDtoChannel } from "@novu/api/models/components"; + +let value: MessageResponseDtoChannel = "in_app"; +``` ## Values -| Name | Value | -| ------- | ------- | -| `InApp` | in_app | -| `Email` | email | -| `Sms` | sms | -| `Chat` | chat | -| `Push` | push | \ No newline at end of file +```typescript +"in_app" | "email" | "sms" | "chat" | "push" +``` \ No newline at end of file diff --git a/docs/models/components/messageresponsedtopayload.md b/docs/models/components/messageresponsedtopayload.md index 9e8f637a..cee9625c 100644 --- a/docs/models/components/messageresponsedtopayload.md +++ b/docs/models/components/messageresponsedtopayload.md @@ -2,6 +2,13 @@ The payload that was used to send the notification trigger +## Example Usage + +```typescript +import { MessageResponseDtoPayload } from "@novu/api/models/components"; + +let value: MessageResponseDtoPayload = {}; +``` ## Fields diff --git a/docs/models/components/messageresponsedtostatus.md b/docs/models/components/messageresponsedtostatus.md index 1aaf2833..d2a8d2eb 100644 --- a/docs/models/components/messageresponsedtostatus.md +++ b/docs/models/components/messageresponsedtostatus.md @@ -1,10 +1,15 @@ # MessageResponseDtoStatus +## Example Usage + +```typescript +import { MessageResponseDtoStatus } from "@novu/api/models/components"; + +let value: MessageResponseDtoStatus = "warning"; +``` ## Values -| Name | Value | -| --------- | --------- | -| `Sent` | sent | -| `Error` | error | -| `Warning` | warning | \ No newline at end of file +```typescript +"sent" | "error" | "warning" +``` \ No newline at end of file diff --git a/docs/models/components/messagetemplate.md b/docs/models/components/messagetemplate.md index 95aebc24..cb701122 100644 --- a/docs/models/components/messagetemplate.md +++ b/docs/models/components/messagetemplate.md @@ -1,5 +1,12 @@ # MessageTemplate +## Example Usage + +```typescript +import { MessageTemplate } from "@novu/api/models/components"; + +let value: MessageTemplate = {}; +``` ## Fields diff --git a/docs/models/components/messagetemplatedto.md b/docs/models/components/messagetemplatedto.md deleted file mode 100644 index 26cdcf8e..00000000 --- a/docs/models/components/messagetemplatedto.md +++ /dev/null @@ -1,7 +0,0 @@ -# MessageTemplateDto - - -## Fields - -| Field | Type | Required | Description | -| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/components/metadata.md b/docs/models/components/metadata.md index 5ea34778..9aac87ac 100644 --- a/docs/models/components/metadata.md +++ b/docs/models/components/metadata.md @@ -1,5 +1,14 @@ # Metadata +## Example Usage + +```typescript +import { Metadata } from "@novu/api/models/components"; + +let value: Metadata = { + type: "backoff", +}; +``` ## Supported Types diff --git a/docs/models/components/monthlytype.md b/docs/models/components/monthlytype.md index c413ed05..3113ba7f 100644 --- a/docs/models/components/monthlytype.md +++ b/docs/models/components/monthlytype.md @@ -1,9 +1,15 @@ # MonthlyType +## Example Usage + +```typescript +import { MonthlyType } from "@novu/api/models/components"; + +let value: MonthlyType = "each"; +``` ## Values -| Name | Value | -| ------ | ------ | -| `Each` | each | -| `On` | on | \ No newline at end of file +```typescript +"each" | "on" +``` \ No newline at end of file diff --git a/docs/models/components/notificationgroup.md b/docs/models/components/notificationgroup.md index bb1586c1..0dd29f97 100644 --- a/docs/models/components/notificationgroup.md +++ b/docs/models/components/notificationgroup.md @@ -1,5 +1,16 @@ # NotificationGroup +## Example Usage + +```typescript +import { NotificationGroup } from "@novu/api/models/components"; + +let value: NotificationGroup = { + environmentId: "", + organizationId: "", + name: "", +}; +``` ## Fields diff --git a/docs/models/components/notificationgroupresponsedto.md b/docs/models/components/notificationgroupresponsedto.md index cbb1588c..82d4ec5a 100644 --- a/docs/models/components/notificationgroupresponsedto.md +++ b/docs/models/components/notificationgroupresponsedto.md @@ -1,5 +1,16 @@ # NotificationGroupResponseDto +## Example Usage + +```typescript +import { NotificationGroupResponseDto } from "@novu/api/models/components"; + +let value: NotificationGroupResponseDto = { + environmentId: "", + organizationId: "", + name: "", +}; +``` ## Fields diff --git a/docs/models/components/notificationstep.md b/docs/models/components/notificationstep.md index 9f0c36a5..a176ef65 100644 --- a/docs/models/components/notificationstep.md +++ b/docs/models/components/notificationstep.md @@ -1,5 +1,12 @@ # NotificationStep +## Example Usage + +```typescript +import { NotificationStep } from "@novu/api/models/components"; + +let value: NotificationStep = {}; +``` ## Fields diff --git a/docs/models/components/notificationstepvariant.md b/docs/models/components/notificationstepvariant.md index 6e9f5dbd..dac12272 100644 --- a/docs/models/components/notificationstepvariant.md +++ b/docs/models/components/notificationstepvariant.md @@ -1,5 +1,12 @@ # NotificationStepVariant +## Example Usage + +```typescript +import { NotificationStepVariant } from "@novu/api/models/components"; + +let value: NotificationStepVariant = {}; +``` ## Fields diff --git a/docs/models/components/notificationstepvariantmetadata.md b/docs/models/components/notificationstepvariantmetadata.md index 8ae69ea4..8820b121 100644 --- a/docs/models/components/notificationstepvariantmetadata.md +++ b/docs/models/components/notificationstepvariantmetadata.md @@ -1,5 +1,14 @@ # NotificationStepVariantMetadata +## Example Usage + +```typescript +import { NotificationStepVariantMetadata } from "@novu/api/models/components"; + +let value: NotificationStepVariantMetadata = { + type: "backoff", +}; +``` ## Supported Types diff --git a/docs/models/components/notificationstepvariantparentid.md b/docs/models/components/notificationstepvariantparentid.md index 1a3d1e0b..9a182149 100644 --- a/docs/models/components/notificationstepvariantparentid.md +++ b/docs/models/components/notificationstepvariantparentid.md @@ -1,5 +1,12 @@ # NotificationStepVariantParentId +## Example Usage + +```typescript +import { NotificationStepVariantParentId } from "@novu/api/models/components"; + +let value: NotificationStepVariantParentId = {}; +``` ## Fields diff --git a/docs/models/components/notificationstepvariantreplycallback.md b/docs/models/components/notificationstepvariantreplycallback.md index 74566baa..8ab047a7 100644 --- a/docs/models/components/notificationstepvariantreplycallback.md +++ b/docs/models/components/notificationstepvariantreplycallback.md @@ -1,5 +1,12 @@ # NotificationStepVariantReplyCallback +## Example Usage + +```typescript +import { NotificationStepVariantReplyCallback } from "@novu/api/models/components"; + +let value: NotificationStepVariantReplyCallback = {}; +``` ## Fields diff --git a/docs/models/components/notificationtrigger.md b/docs/models/components/notificationtrigger.md index 7f4ef0b5..b605b899 100644 --- a/docs/models/components/notificationtrigger.md +++ b/docs/models/components/notificationtrigger.md @@ -1,5 +1,20 @@ # NotificationTrigger +## Example Usage + +```typescript +import { NotificationTrigger } from "@novu/api/models/components"; + +let value: NotificationTrigger = { + identifier: "", + type: "event", + variables: [ + { + name: "", + }, + ], +}; +``` ## Fields diff --git a/docs/models/components/notificationtriggertype.md b/docs/models/components/notificationtriggertype.md index e4c714b7..e8715b58 100644 --- a/docs/models/components/notificationtriggertype.md +++ b/docs/models/components/notificationtriggertype.md @@ -1,8 +1,15 @@ # NotificationTriggerType +## Example Usage + +```typescript +import { NotificationTriggerType } from "@novu/api/models/components"; + +let value: NotificationTriggerType = "event"; +``` ## Values -| Name | Value | -| ------- | ------- | -| `Event` | event | \ No newline at end of file +```typescript +"event" +``` \ No newline at end of file diff --git a/docs/models/components/notificationtriggervariable.md b/docs/models/components/notificationtriggervariable.md index 23b3f5c6..02aa5aee 100644 --- a/docs/models/components/notificationtriggervariable.md +++ b/docs/models/components/notificationtriggervariable.md @@ -1,5 +1,14 @@ # NotificationTriggerVariable +## Example Usage + +```typescript +import { NotificationTriggerVariable } from "@novu/api/models/components"; + +let value: NotificationTriggerVariable = { + name: "", +}; +``` ## Fields diff --git a/docs/models/components/on.md b/docs/models/components/on.md index 7e05cd61..26cb236e 100644 --- a/docs/models/components/on.md +++ b/docs/models/components/on.md @@ -1,9 +1,15 @@ # On +## Example Usage + +```typescript +import { On } from "@novu/api/models/components"; + +let value: On = "subscriber"; +``` ## Values -| Name | Value | -| ------------ | ------------ | -| `Subscriber` | subscriber | -| `Payload` | payload | \ No newline at end of file +```typescript +"subscriber" | "payload" +``` \ No newline at end of file diff --git a/docs/models/components/operator.md b/docs/models/components/operator.md index ace65a6c..52245c05 100644 --- a/docs/models/components/operator.md +++ b/docs/models/components/operator.md @@ -1,21 +1,15 @@ # Operator +## Example Usage + +```typescript +import { Operator } from "@novu/api/models/components"; + +let value: Operator = "BETWEEN"; +``` ## Values -| Name | Value | -| -------------- | -------------- | -| `Larger` | LARGER | -| `Smaller` | SMALLER | -| `LargerEqual` | LARGER_EQUAL | -| `SmallerEqual` | SMALLER_EQUAL | -| `Equal` | EQUAL | -| `NotEqual` | NOT_EQUAL | -| `AllIn` | ALL_IN | -| `AnyIn` | ANY_IN | -| `NotIn` | NOT_IN | -| `Between` | BETWEEN | -| `NotBetween` | NOT_BETWEEN | -| `Like` | LIKE | -| `NotLike` | NOT_LIKE | -| `In` | IN | \ No newline at end of file +```typescript +"LARGER" | "SMALLER" | "LARGER_EQUAL" | "SMALLER_EQUAL" | "EQUAL" | "NOT_EQUAL" | "ALL_IN" | "ANY_IN" | "NOT_IN" | "BETWEEN" | "NOT_BETWEEN" | "LIKE" | "NOT_LIKE" | "IN" +``` \ No newline at end of file diff --git a/docs/models/components/ordinal.md b/docs/models/components/ordinal.md index fee404a5..e09e7bd5 100644 --- a/docs/models/components/ordinal.md +++ b/docs/models/components/ordinal.md @@ -1,13 +1,15 @@ # Ordinal +## Example Usage + +```typescript +import { Ordinal } from "@novu/api/models/components"; + +let value: Ordinal = "4"; +``` ## Values -| Name | Value | -| ------- | ------- | -| `One` | 1 | -| `Two` | 2 | -| `Three` | 3 | -| `Four` | 4 | -| `Five` | 5 | -| `Last` | last | \ No newline at end of file +```typescript +"1" | "2" | "3" | "4" | "5" | "last" +``` \ No newline at end of file diff --git a/docs/models/components/ordinalvalue.md b/docs/models/components/ordinalvalue.md index 63dddaa1..1d189ed0 100644 --- a/docs/models/components/ordinalvalue.md +++ b/docs/models/components/ordinalvalue.md @@ -1,17 +1,15 @@ # OrdinalValue +## Example Usage + +```typescript +import { OrdinalValue } from "@novu/api/models/components"; + +let value: OrdinalValue = "monday"; +``` ## Values -| Name | Value | -| ----------- | ----------- | -| `Day` | day | -| `Weekday` | weekday | -| `Weekend` | weekend | -| `Sunday` | sunday | -| `Monday` | monday | -| `Tuesday` | tuesday | -| `Wednesday` | wednesday | -| `Thursday` | thursday | -| `Friday` | friday | -| `Saturday` | saturday | \ No newline at end of file +```typescript +"day" | "weekday" | "weekend" | "sunday" | "monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday" +``` \ No newline at end of file diff --git a/docs/models/components/organizationbrandingresponsedto.md b/docs/models/components/organizationbrandingresponsedto.md index e8742d2f..e4203223 100644 --- a/docs/models/components/organizationbrandingresponsedto.md +++ b/docs/models/components/organizationbrandingresponsedto.md @@ -1,5 +1,17 @@ # OrganizationBrandingResponseDto +## Example Usage + +```typescript +import { OrganizationBrandingResponseDto } from "@novu/api/models/components"; + +let value: OrganizationBrandingResponseDto = { + color: "orchid", + contentBackground: "", + fontColor: "", + logo: "", +}; +``` ## Fields diff --git a/docs/models/components/organizationresponsedto.md b/docs/models/components/organizationresponsedto.md index 0e8be077..b3311b8a 100644 --- a/docs/models/components/organizationresponsedto.md +++ b/docs/models/components/organizationresponsedto.md @@ -1,11 +1,26 @@ # OrganizationResponseDto +## Example Usage + +```typescript +import { OrganizationResponseDto } from "@novu/api/models/components"; + +let value: OrganizationResponseDto = { + branding: { + color: "yellow", + contentBackground: "", + fontColor: "", + logo: "", + }, + name: "", +}; +``` ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `branding` | [components.OrganizationBrandingResponseDto](../../models/components/organizationbrandingresponsedto.md) | :heavy_check_mark: | N/A | -| `logo` | *string* | :heavy_minus_sign: | N/A | -| `name` | *string* | :heavy_check_mark: | N/A | -| `partnerConfigurations` | [components.IPartnerConfigurationResponseDto](../../models/components/ipartnerconfigurationresponsedto.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| `branding` | [components.OrganizationBrandingResponseDto](../../models/components/organizationbrandingresponsedto.md) | :heavy_check_mark: | N/A | +| `logo` | *string* | :heavy_minus_sign: | N/A | +| `name` | *string* | :heavy_check_mark: | N/A | +| `partnerConfigurations` | *string*[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/overrides.md b/docs/models/components/overrides.md index 2456f98e..cafd1649 100644 --- a/docs/models/components/overrides.md +++ b/docs/models/components/overrides.md @@ -2,6 +2,13 @@ Provider specific overrides used when triggering the notification +## Example Usage + +```typescript +import { Overrides } from "@novu/api/models/components"; + +let value: Overrides = {}; +``` ## Fields diff --git a/docs/models/components/parentid.md b/docs/models/components/parentid.md index 4f615b63..8c641363 100644 --- a/docs/models/components/parentid.md +++ b/docs/models/components/parentid.md @@ -1,5 +1,12 @@ # ParentId +## Example Usage + +```typescript +import { ParentId } from "@novu/api/models/components"; + +let value: ParentId = {}; +``` ## Fields diff --git a/docs/models/components/partnertype.md b/docs/models/components/partnertype.md deleted file mode 100644 index ae809ee2..00000000 --- a/docs/models/components/partnertype.md +++ /dev/null @@ -1,10 +0,0 @@ -# PartnerType - -Partner Type Enum - - -## Values - -| Name | Value | -| -------- | -------- | -| `Vercel` | vercel | \ No newline at end of file diff --git a/docs/models/components/payload.md b/docs/models/components/payload.md index 803eba50..02241ce7 100644 --- a/docs/models/components/payload.md +++ b/docs/models/components/payload.md @@ -1,5 +1,14 @@ # Payload +Message action payload + +## Example Usage + +```typescript +import { Payload } from "@novu/api/models/components"; + +let value: Payload = {}; +``` ## Fields diff --git a/docs/models/components/preference.md b/docs/models/components/preference.md index 0a39e266..c8733df2 100644 --- a/docs/models/components/preference.md +++ b/docs/models/components/preference.md @@ -1,5 +1,15 @@ # Preference +## Example Usage + +```typescript +import { Preference } from "@novu/api/models/components"; + +let value: Preference = { + channels: {}, + enabled: false, +}; +``` ## Fields diff --git a/docs/models/components/preferencechannels.md b/docs/models/components/preferencechannels.md index 2d975dbf..17ab2010 100644 --- a/docs/models/components/preferencechannels.md +++ b/docs/models/components/preferencechannels.md @@ -1,5 +1,12 @@ # PreferenceChannels +## Example Usage + +```typescript +import { PreferenceChannels } from "@novu/api/models/components"; + +let value: PreferenceChannels = {}; +``` ## Fields diff --git a/docs/models/components/productusecases.md b/docs/models/components/productusecases.md deleted file mode 100644 index 30465169..00000000 --- a/docs/models/components/productusecases.md +++ /dev/null @@ -1,7 +0,0 @@ -# ProductUseCases - - -## Fields - -| Field | Type | Required | Description | -| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/components/providerid.md b/docs/models/components/providerid.md deleted file mode 100644 index 250ba448..00000000 --- a/docs/models/components/providerid.md +++ /dev/null @@ -1,7 +0,0 @@ -# ProviderId - - -## Fields - -| Field | Type | Required | Description | -| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/components/removesubscribersrequestdto.md b/docs/models/components/removesubscribersrequestdto.md index 88a98f38..e8397440 100644 --- a/docs/models/components/removesubscribersrequestdto.md +++ b/docs/models/components/removesubscribersrequestdto.md @@ -1,5 +1,14 @@ # RemoveSubscribersRequestDto +## Example Usage + +```typescript +import { RemoveSubscribersRequestDto } from "@novu/api/models/components"; + +let value: RemoveSubscribersRequestDto = { + subscribers: [""], +}; +``` ## Fields diff --git a/docs/models/components/renameorganizationdto.md b/docs/models/components/renameorganizationdto.md index 8c313686..f91595cd 100644 --- a/docs/models/components/renameorganizationdto.md +++ b/docs/models/components/renameorganizationdto.md @@ -1,5 +1,14 @@ # RenameOrganizationDto +## Example Usage + +```typescript +import { RenameOrganizationDto } from "@novu/api/models/components"; + +let value: RenameOrganizationDto = { + name: "", +}; +``` ## Fields diff --git a/docs/models/components/renametopicrequestdto.md b/docs/models/components/renametopicrequestdto.md index dc9e174e..454a4cbf 100644 --- a/docs/models/components/renametopicrequestdto.md +++ b/docs/models/components/renametopicrequestdto.md @@ -1,5 +1,14 @@ # RenameTopicRequestDto +## Example Usage + +```typescript +import { RenameTopicRequestDto } from "@novu/api/models/components"; + +let value: RenameTopicRequestDto = { + name: "", +}; +``` ## Fields diff --git a/docs/models/components/renametopicresponsedto.md b/docs/models/components/renametopicresponsedto.md index 254e4923..4b89f7d9 100644 --- a/docs/models/components/renametopicresponsedto.md +++ b/docs/models/components/renametopicresponsedto.md @@ -1,5 +1,18 @@ # RenameTopicResponseDto +## Example Usage + +```typescript +import { RenameTopicResponseDto } from "@novu/api/models/components"; + +let value: RenameTopicResponseDto = { + environmentId: "", + organizationId: "", + key: "", + name: "", + subscribers: [""], +}; +``` ## Fields diff --git a/docs/models/components/replycallback.md b/docs/models/components/replycallback.md index 86a6810a..e23aabc6 100644 --- a/docs/models/components/replycallback.md +++ b/docs/models/components/replycallback.md @@ -1,5 +1,12 @@ # ReplyCallback +## Example Usage + +```typescript +import { ReplyCallback } from "@novu/api/models/components"; + +let value: ReplyCallback = {}; +``` ## Fields diff --git a/docs/models/components/roles.md b/docs/models/components/roles.md deleted file mode 100644 index f5d8c2b4..00000000 --- a/docs/models/components/roles.md +++ /dev/null @@ -1,9 +0,0 @@ -# Roles - - -## Values - -| Name | Value | -| -------- | -------- | -| `Admin` | admin | -| `Member` | member | \ No newline at end of file diff --git a/docs/models/components/security.md b/docs/models/components/security.md index 217b33bc..8d41653f 100644 --- a/docs/models/components/security.md +++ b/docs/models/components/security.md @@ -1,8 +1,17 @@ # Security +## Example Usage + +```typescript +import { Security } from "@novu/api/models/components"; + +let value: Security = { + apiKey: "", +}; +``` ## Fields | Field | Type | Required | Description | | ------------------ | ------------------ | ------------------ | ------------------ | -| `apiKey` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file +| `apiKey` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/source.md b/docs/models/components/source.md index 3c3f8f87..cc43d1f7 100644 --- a/docs/models/components/source.md +++ b/docs/models/components/source.md @@ -1,11 +1,15 @@ # Source +## Example Usage + +```typescript +import { Source } from "@novu/api/models/components"; + +let value: Source = "Credentials"; +``` ## Values -| Name | Value | -| ------------- | ------------- | -| `Credentials` | Credentials | -| `Internal` | Internal | -| `Payload` | Payload | -| `Webhook` | Webhook | \ No newline at end of file +```typescript +"Credentials" | "Internal" | "Payload" | "Webhook" +``` \ No newline at end of file diff --git a/docs/models/components/status.md b/docs/models/components/status.md index 4ce1d74d..09ea6e27 100644 --- a/docs/models/components/status.md +++ b/docs/models/components/status.md @@ -1,13 +1,17 @@ # Status +The status enum for the performed action + +## Example Usage + +```typescript +import { Status } from "@novu/api/models/components"; + +let value: Status = "deleted"; +``` ## Values -| Name | Value | -| ------------------ | ------------------ | -| `Success` | Success | -| `Warning` | Warning | -| `Failed` | Failed | -| `Pending` | Pending | -| `Queued` | Queued | -| `ReadConfirmation` | ReadConfirmation | \ No newline at end of file +```typescript +"deleted" +``` \ No newline at end of file diff --git a/docs/models/components/stepfilter.md b/docs/models/components/stepfilter.md index 31739507..33ae8ae4 100644 --- a/docs/models/components/stepfilter.md +++ b/docs/models/components/stepfilter.md @@ -1,5 +1,24 @@ # StepFilter +## Example Usage + +```typescript +import { StepFilter } from "@novu/api/models/components"; + +let value: StepFilter = { + children: [ + { + field: "", + on: "payload", + operator: "LIKE", + value: "", + }, + ], + isNegated: false, + type: "BOOLEAN", + value: "AND", +}; +``` ## Fields diff --git a/docs/models/components/stepfiltertype.md b/docs/models/components/stepfiltertype.md index fa8a7db0..f8bc6288 100644 --- a/docs/models/components/stepfiltertype.md +++ b/docs/models/components/stepfiltertype.md @@ -1,15 +1,15 @@ # StepFilterType +## Example Usage + +```typescript +import { StepFilterType } from "@novu/api/models/components"; + +let value: StepFilterType = "STATEMENT"; +``` ## Values -| Name | Value | -| ----------- | ----------- | -| `Boolean` | BOOLEAN | -| `Text` | TEXT | -| `Date` | DATE | -| `Number` | NUMBER | -| `Statement` | STATEMENT | -| `List` | LIST | -| `MultiList` | MULTI_LIST | -| `Group` | GROUP | \ No newline at end of file +```typescript +"BOOLEAN" | "TEXT" | "DATE" | "NUMBER" | "STATEMENT" | "LIST" | "MULTI_LIST" | "GROUP" +``` \ No newline at end of file diff --git a/docs/models/components/subscriberchanneldto.md b/docs/models/components/subscriberchanneldto.md deleted file mode 100644 index 54c8066f..00000000 --- a/docs/models/components/subscriberchanneldto.md +++ /dev/null @@ -1,10 +0,0 @@ -# SubscriberChannelDto - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | -| `credentials` | [components.ChannelCredentialsDto](../../models/components/channelcredentialsdto.md) | :heavy_check_mark: | N/A | -| `integrationIdentifier` | *string* | :heavy_minus_sign: | N/A | -| `providerId` | [components.SubscriberChannelDtoProviderId](../../models/components/subscriberchanneldtoproviderid.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/subscriberchanneldtoproviderid.md b/docs/models/components/subscriberchanneldtoproviderid.md deleted file mode 100644 index d84ed898..00000000 --- a/docs/models/components/subscriberchanneldtoproviderid.md +++ /dev/null @@ -1,7 +0,0 @@ -# SubscriberChannelDtoProviderId - - -## Fields - -| Field | Type | Required | Description | -| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/components/subscriberpayloaddto.md b/docs/models/components/subscriberpayloaddto.md index 5c83af2e..7eb560fb 100644 --- a/docs/models/components/subscriberpayloaddto.md +++ b/docs/models/components/subscriberpayloaddto.md @@ -1,12 +1,21 @@ # SubscriberPayloadDto +## Example Usage + +```typescript +import { SubscriberPayloadDto } from "@novu/api/models/components"; + +let value: SubscriberPayloadDto = { + subscriberId: "", +}; +``` ## Fields | Field | Type | Required | Description | | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | | `avatar` | *string* | :heavy_minus_sign: | An http url to the profile image of your subscriber | -| `channels` | [components.SubscriberChannelDto](../../models/components/subscriberchanneldto.md)[] | :heavy_minus_sign: | N/A | +| `channels` | *string*[] | :heavy_minus_sign: | N/A | | `data` | [components.SubscriberPayloadDtoData](../../models/components/subscriberpayloaddtodata.md) | :heavy_minus_sign: | N/A | | `email` | *string* | :heavy_minus_sign: | N/A | | `firstName` | *string* | :heavy_minus_sign: | N/A | diff --git a/docs/models/components/subscriberpayloaddtodata.md b/docs/models/components/subscriberpayloaddtodata.md index 34985c99..ccfe7896 100644 --- a/docs/models/components/subscriberpayloaddtodata.md +++ b/docs/models/components/subscriberpayloaddtodata.md @@ -1,5 +1,12 @@ # SubscriberPayloadDtoData +## Example Usage + +```typescript +import { SubscriberPayloadDtoData } from "@novu/api/models/components"; + +let value: SubscriberPayloadDtoData = {}; +``` ## Fields diff --git a/docs/models/components/subscriberresponsedto.md b/docs/models/components/subscriberresponsedto.md index 1d342ccf..27af339b 100644 --- a/docs/models/components/subscriberresponsedto.md +++ b/docs/models/components/subscriberresponsedto.md @@ -1,5 +1,19 @@ # SubscriberResponseDto +## Example Usage + +```typescript +import { SubscriberResponseDto } from "@novu/api/models/components"; + +let value: SubscriberResponseDto = { + environmentId: "", + organizationId: "", + createdAt: "", + deleted: false, + subscriberId: "", + updatedAt: "", +}; +``` ## Fields diff --git a/docs/models/components/system.md b/docs/models/components/system.md index cf83600e..dfc5ec71 100644 --- a/docs/models/components/system.md +++ b/docs/models/components/system.md @@ -1,5 +1,12 @@ # System +## Example Usage + +```typescript +import { System } from "@novu/api/models/components"; + +let value: System = {}; +``` ## Fields diff --git a/docs/models/components/templateresponse.md b/docs/models/components/templateresponse.md index fee285e6..a23f8c18 100644 --- a/docs/models/components/templateresponse.md +++ b/docs/models/components/templateresponse.md @@ -1,5 +1,17 @@ # TemplateResponse +## Example Usage + +```typescript +import { TemplateResponse } from "@novu/api/models/components"; + +let value: TemplateResponse = { + id: "", + critical: false, + name: "", + triggers: [""], +}; +``` ## Fields diff --git a/docs/models/components/tenant.md b/docs/models/components/tenant.md index b03dcbd7..5d4ea854 100644 --- a/docs/models/components/tenant.md +++ b/docs/models/components/tenant.md @@ -4,6 +4,13 @@ It is used to specify a tenant context during trigger event. Existing tenants will be updated with the provided details. +## Example Usage + +```typescript +import { Tenant } from "@novu/api/models/components"; + +let value: Tenant = {}; +``` ## Supported Types diff --git a/docs/models/components/tenantpayloaddto.md b/docs/models/components/tenantpayloaddto.md index fe6a6a86..41a3fbb3 100644 --- a/docs/models/components/tenantpayloaddto.md +++ b/docs/models/components/tenantpayloaddto.md @@ -1,5 +1,12 @@ # TenantPayloadDto +## Example Usage + +```typescript +import { TenantPayloadDto } from "@novu/api/models/components"; + +let value: TenantPayloadDto = {}; +``` ## Fields diff --git a/docs/models/components/tenantpayloaddtodata.md b/docs/models/components/tenantpayloaddtodata.md index 944dd45a..04522a7e 100644 --- a/docs/models/components/tenantpayloaddtodata.md +++ b/docs/models/components/tenantpayloaddtodata.md @@ -1,5 +1,12 @@ # TenantPayloadDtoData +## Example Usage + +```typescript +import { TenantPayloadDtoData } from "@novu/api/models/components"; + +let value: TenantPayloadDtoData = {}; +``` ## Fields diff --git a/docs/models/components/textalign.md b/docs/models/components/textalign.md index d183e059..aa50769d 100644 --- a/docs/models/components/textalign.md +++ b/docs/models/components/textalign.md @@ -1,10 +1,15 @@ # TextAlign +## Example Usage + +```typescript +import { TextAlign } from "@novu/api/models/components"; + +let value: TextAlign = "center"; +``` ## Values -| Name | Value | -| -------- | -------- | -| `Left` | left | -| `Right` | right | -| `Center` | center | \ No newline at end of file +```typescript +"center" | "left" | "right" +``` \ No newline at end of file diff --git a/docs/models/components/timedconfig.md b/docs/models/components/timedconfig.md index 7dca0907..c2882edb 100644 --- a/docs/models/components/timedconfig.md +++ b/docs/models/components/timedconfig.md @@ -1,5 +1,12 @@ # TimedConfig +## Example Usage + +```typescript +import { TimedConfig } from "@novu/api/models/components"; + +let value: TimedConfig = {}; +``` ## Fields diff --git a/docs/models/components/tlsoptions.md b/docs/models/components/tlsoptions.md index fdc79383..a0471566 100644 --- a/docs/models/components/tlsoptions.md +++ b/docs/models/components/tlsoptions.md @@ -1,5 +1,12 @@ # TlsOptions +## Example Usage + +```typescript +import { TlsOptions } from "@novu/api/models/components"; + +let value: TlsOptions = {}; +``` ## Fields diff --git a/docs/models/components/to.md b/docs/models/components/to.md index 3bee95d8..7dfeee10 100644 --- a/docs/models/components/to.md +++ b/docs/models/components/to.md @@ -1,5 +1,12 @@ # To +## Example Usage + +```typescript +import { To } from "@novu/api/models/components"; + +let value: To = "SUBSCRIBER_ID"; +``` ## Supported Types diff --git a/docs/models/components/topicdto.md b/docs/models/components/topicdto.md index 8e8f3ae4..b505f5c9 100644 --- a/docs/models/components/topicdto.md +++ b/docs/models/components/topicdto.md @@ -1,5 +1,18 @@ # TopicDto +## Example Usage + +```typescript +import { TopicDto } from "@novu/api/models/components"; + +let value: TopicDto = { + environmentId: "", + organizationId: "", + key: "", + name: "", + subscribers: [""], +}; +``` ## Fields diff --git a/docs/models/components/topicpayloaddto.md b/docs/models/components/topicpayloaddto.md index 48b79183..03e4b942 100644 --- a/docs/models/components/topicpayloaddto.md +++ b/docs/models/components/topicpayloaddto.md @@ -1,9 +1,19 @@ # TopicPayloadDto +## Example Usage + +```typescript +import { TopicPayloadDto } from "@novu/api/models/components"; + +let value: TopicPayloadDto = { + topicKey: "", + type: "Topic", +}; +``` ## Fields | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -| `topicKey` | *string* | :heavy_check_mark: | N/A | topic_key | +| `topicKey` | *string* | :heavy_check_mark: | N/A | | | `type` | [components.TopicPayloadDtoType](../../models/components/topicpayloaddtotype.md) | :heavy_check_mark: | N/A | Topic | \ No newline at end of file diff --git a/docs/models/components/topicpayloaddtotype.md b/docs/models/components/topicpayloaddtotype.md index f27e6c55..ab949005 100644 --- a/docs/models/components/topicpayloaddtotype.md +++ b/docs/models/components/topicpayloaddtotype.md @@ -1,9 +1,15 @@ # TopicPayloadDtoType +## Example Usage + +```typescript +import { TopicPayloadDtoType } from "@novu/api/models/components"; + +let value: TopicPayloadDtoType = "Topic"; +``` ## Values -| Name | Value | -| ------------ | ------------ | -| `Subscriber` | Subscriber | -| `Topic` | Topic | \ No newline at end of file +```typescript +"Subscriber" | "Topic" +``` \ No newline at end of file diff --git a/docs/models/components/topicsubscriberdto.md b/docs/models/components/topicsubscriberdto.md index 3d2b1aab..b34a017f 100644 --- a/docs/models/components/topicsubscriberdto.md +++ b/docs/models/components/topicsubscriberdto.md @@ -1,5 +1,19 @@ # TopicSubscriberDto +## Example Usage + +```typescript +import { TopicSubscriberDto } from "@novu/api/models/components"; + +let value: TopicSubscriberDto = { + environmentId: "", + organizationId: "", + subscriberId: "", + topicId: "", + externalSubscriberId: "", + topicKey: "", +}; +``` ## Fields diff --git a/docs/models/components/translations.md b/docs/models/components/translations.md index 831faf43..21622673 100644 --- a/docs/models/components/translations.md +++ b/docs/models/components/translations.md @@ -1,5 +1,12 @@ # Translations +## Example Usage + +```typescript +import { Translations } from "@novu/api/models/components"; + +let value: Translations = {}; +``` ## Fields diff --git a/docs/models/components/triggereventrequestdto.md b/docs/models/components/triggereventrequestdto.md index 76da1d5a..db6803e4 100644 --- a/docs/models/components/triggereventrequestdto.md +++ b/docs/models/components/triggereventrequestdto.md @@ -1,11 +1,30 @@ # TriggerEventRequestDto +## Example Usage + +```typescript +import { TriggerEventRequestDto } from "@novu/api/models/components"; + +let value: TriggerEventRequestDto = { + name: "workflow_identifier", + overrides: {}, + payload: {}, + to: [ + { + topicKey: "", + type: "Topic", + }, + ], +}; +``` ## Fields | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `actor` | *components.Actor* | :heavy_minus_sign: | It is used to display the Avatar of the provided actor's subscriber id or actor object.
If a new actor object is provided, we will create a new subscriber in our system
| | +| `bridgeUrl` | *string* | :heavy_minus_sign: | N/A | | +| `controls` | [components.Controls](../../models/components/controls.md) | :heavy_minus_sign: | N/A | | | `name` | *string* | :heavy_check_mark: | The trigger identifier of the workflow you wish to send. This identifier can be found on the workflow page. | workflow_identifier | | `overrides` | [components.TriggerEventRequestDtoOverrides](../../models/components/triggereventrequestdtooverrides.md) | :heavy_minus_sign: | This could be used to override provider specific configurations | {
"fcm": {
"data": {
"key": "value"
}
}
} | | `payload` | [components.TriggerEventRequestDtoPayload](../../models/components/triggereventrequestdtopayload.md) | :heavy_minus_sign: | The payload object is used to pass additional custom information that could be used to render the workflow, or perform routing rules based on it.
This data will also be available when fetching the notifications feed from the API to display certain parts of the UI. | {
"comment_id": "string",
"post": {
"text": "string"
}
} | diff --git a/docs/models/components/triggereventrequestdtooverrides.md b/docs/models/components/triggereventrequestdtooverrides.md index 09854e08..73f84a08 100644 --- a/docs/models/components/triggereventrequestdtooverrides.md +++ b/docs/models/components/triggereventrequestdtooverrides.md @@ -2,6 +2,13 @@ This could be used to override provider specific configurations +## Example Usage + +```typescript +import { TriggerEventRequestDtoOverrides } from "@novu/api/models/components"; + +let value: TriggerEventRequestDtoOverrides = {}; +``` ## Fields diff --git a/docs/models/components/triggereventrequestdtopayload.md b/docs/models/components/triggereventrequestdtopayload.md index e7affed1..8a1b98ca 100644 --- a/docs/models/components/triggereventrequestdtopayload.md +++ b/docs/models/components/triggereventrequestdtopayload.md @@ -3,6 +3,13 @@ The payload object is used to pass additional custom information that could be used to render the workflow, or perform routing rules based on it. This data will also be available when fetching the notifications feed from the API to display certain parts of the UI. +## Example Usage + +```typescript +import { TriggerEventRequestDtoPayload } from "@novu/api/models/components"; + +let value: TriggerEventRequestDtoPayload = {}; +``` ## Fields diff --git a/docs/models/components/triggereventresponsedto.md b/docs/models/components/triggereventresponsedto.md index 449a85dd..2641d722 100644 --- a/docs/models/components/triggereventresponsedto.md +++ b/docs/models/components/triggereventresponsedto.md @@ -1,5 +1,15 @@ # TriggerEventResponseDto +## Example Usage + +```typescript +import { TriggerEventResponseDto } from "@novu/api/models/components"; + +let value: TriggerEventResponseDto = { + acknowledged: false, + status: "processed", +}; +``` ## Fields diff --git a/docs/models/components/triggereventresponsedtostatus.md b/docs/models/components/triggereventresponsedtostatus.md index 2b336d71..77d749b0 100644 --- a/docs/models/components/triggereventresponsedtostatus.md +++ b/docs/models/components/triggereventresponsedtostatus.md @@ -2,15 +2,16 @@ Status for trigger +## Example Usage + +```typescript +import { TriggerEventResponseDtoStatus } from "@novu/api/models/components"; + +let value: TriggerEventResponseDtoStatus = "no_workflow_steps_defined"; +``` ## Values -| Name | Value | -| -------------------------------- | -------------------------------- | -| `Error` | error | -| `TriggerNotActive` | trigger_not_active | -| `NoWorkflowActiveStepsDefined` | no_workflow_active_steps_defined | -| `NoWorkflowStepsDefined` | no_workflow_steps_defined | -| `Processed` | processed | -| `SubscriberIdMissing` | subscriber_id_missing | -| `NoTenantFound` | no_tenant_found | \ No newline at end of file +```typescript +"error" | "trigger_not_active" | "no_workflow_active_steps_defined" | "no_workflow_steps_defined" | "processed" | "subscriber_id_missing" | "no_tenant_found" +``` \ No newline at end of file diff --git a/docs/models/components/triggereventtoallrequestdto.md b/docs/models/components/triggereventtoallrequestdto.md index 7e3fdab9..fffaf0c6 100644 --- a/docs/models/components/triggereventtoallrequestdto.md +++ b/docs/models/components/triggereventtoallrequestdto.md @@ -1,5 +1,16 @@ # TriggerEventToAllRequestDto +## Example Usage + +```typescript +import { TriggerEventToAllRequestDto } from "@novu/api/models/components"; + +let value: TriggerEventToAllRequestDto = { + name: "", + overrides: {}, + payload: {}, +}; +``` ## Fields diff --git a/docs/models/components/triggereventtoallrequestdtoactor.md b/docs/models/components/triggereventtoallrequestdtoactor.md index c4d2f867..6b7425ed 100644 --- a/docs/models/components/triggereventtoallrequestdtoactor.md +++ b/docs/models/components/triggereventtoallrequestdtoactor.md @@ -4,6 +4,15 @@ It is used to display the Avatar of the provided actor's subscriber id or actor If a new actor object is provided, we will create a new subscriber in our system +## Example Usage + +```typescript +import { TriggerEventToAllRequestDtoActor } from "@novu/api/models/components"; + +let value: TriggerEventToAllRequestDtoActor = { + subscriberId: "", +}; +``` ## Supported Types diff --git a/docs/models/components/triggereventtoallrequestdtooverrides.md b/docs/models/components/triggereventtoallrequestdtooverrides.md index 1e19e257..89918b67 100644 --- a/docs/models/components/triggereventtoallrequestdtooverrides.md +++ b/docs/models/components/triggereventtoallrequestdtooverrides.md @@ -2,6 +2,13 @@ This could be used to override provider specific configurations +## Example Usage + +```typescript +import { TriggerEventToAllRequestDtoOverrides } from "@novu/api/models/components"; + +let value: TriggerEventToAllRequestDtoOverrides = {}; +``` ## Fields diff --git a/docs/models/components/triggereventtoallrequestdtopayload.md b/docs/models/components/triggereventtoallrequestdtopayload.md index ad51bb8e..70baab8a 100644 --- a/docs/models/components/triggereventtoallrequestdtopayload.md +++ b/docs/models/components/triggereventtoallrequestdtopayload.md @@ -3,6 +3,13 @@ The payload object is used to pass additional custom information that could be used to render the template, or perform routing rules based on it. This data will also be available when fetching the notifications feed from the API to display certain parts of the UI. +## Example Usage + +```typescript +import { TriggerEventToAllRequestDtoPayload } from "@novu/api/models/components"; + +let value: TriggerEventToAllRequestDtoPayload = {}; +``` ## Fields diff --git a/docs/models/components/triggereventtoallrequestdtotenant.md b/docs/models/components/triggereventtoallrequestdtotenant.md index b34db26f..ec8b0b47 100644 --- a/docs/models/components/triggereventtoallrequestdtotenant.md +++ b/docs/models/components/triggereventtoallrequestdtotenant.md @@ -4,6 +4,13 @@ It is used to specify a tenant context during trigger event. If a new tenant object is provided, we will create a new tenant. +## Example Usage + +```typescript +import { TriggerEventToAllRequestDtoTenant } from "@novu/api/models/components"; + +let value: TriggerEventToAllRequestDtoTenant = {}; +``` ## Supported Types diff --git a/docs/models/components/type.md b/docs/models/components/type.md index 38f42197..d80a2295 100644 --- a/docs/models/components/type.md +++ b/docs/models/components/type.md @@ -1,15 +1,15 @@ # Type +## Example Usage + +```typescript +import { Type } from "@novu/api/models/components"; + +let value: Type = "DefaultLayout"; +``` ## Values -| Name | Value | -| ---------------------- | ---------------------- | -| `Feed` | Feed | -| `MessageTemplate` | MessageTemplate | -| `Layout` | Layout | -| `DefaultLayout` | DefaultLayout | -| `NotificationTemplate` | NotificationTemplate | -| `NotificationGroup` | NotificationGroup | -| `TranslationGroup` | TranslationGroup | -| `Translation` | Translation | \ No newline at end of file +```typescript +"Feed" | "MessageTemplate" | "Layout" | "DefaultLayout" | "NotificationTemplate" | "NotificationGroup" | "TranslationGroup" | "Translation" +``` \ No newline at end of file diff --git a/docs/models/components/unit.md b/docs/models/components/unit.md index 5182b972..c493c406 100644 --- a/docs/models/components/unit.md +++ b/docs/models/components/unit.md @@ -1,13 +1,15 @@ # Unit +## Example Usage + +```typescript +import { Unit } from "@novu/api/models/components"; + +let value: Unit = "weeks"; +``` ## Values -| Name | Value | -| --------- | --------- | -| `Seconds` | seconds | -| `Minutes` | minutes | -| `Hours` | hours | -| `Days` | days | -| `Weeks` | weeks | -| `Months` | months | \ No newline at end of file +```typescript +"seconds" | "minutes" | "hours" | "days" | "weeks" | "months" +``` \ No newline at end of file diff --git a/docs/models/components/unseencountresponse.md b/docs/models/components/unseencountresponse.md index 3a5d08d6..ead33729 100644 --- a/docs/models/components/unseencountresponse.md +++ b/docs/models/components/unseencountresponse.md @@ -1,5 +1,14 @@ # UnseenCountResponse +## Example Usage + +```typescript +import { UnseenCountResponse } from "@novu/api/models/components"; + +let value: UnseenCountResponse = { + count: 7506.86, +}; +``` ## Fields diff --git a/docs/models/components/updatebrandingdetailsdto.md b/docs/models/components/updatebrandingdetailsdto.md index f9ead1bc..12143f90 100644 --- a/docs/models/components/updatebrandingdetailsdto.md +++ b/docs/models/components/updatebrandingdetailsdto.md @@ -1,5 +1,17 @@ # UpdateBrandingDetailsDto +## Example Usage + +```typescript +import { UpdateBrandingDetailsDto } from "@novu/api/models/components"; + +let value: UpdateBrandingDetailsDto = { + color: "plum", + contentBackground: "", + fontColor: "", + logo: "", +}; +``` ## Fields diff --git a/docs/models/components/updateintegrationrequestdto.md b/docs/models/components/updateintegrationrequestdto.md index 78493d90..2e0584ec 100644 --- a/docs/models/components/updateintegrationrequestdto.md +++ b/docs/models/components/updateintegrationrequestdto.md @@ -1,5 +1,12 @@ # UpdateIntegrationRequestDto +## Example Usage + +```typescript +import { UpdateIntegrationRequestDto } from "@novu/api/models/components"; + +let value: UpdateIntegrationRequestDto = {}; +``` ## Fields diff --git a/docs/models/components/updatelayoutrequestdto.md b/docs/models/components/updatelayoutrequestdto.md index 6b9c1dc2..7bf7d176 100644 --- a/docs/models/components/updatelayoutrequestdto.md +++ b/docs/models/components/updatelayoutrequestdto.md @@ -1,13 +1,22 @@ # UpdateLayoutRequestDto +## Example Usage + +```typescript +import { UpdateLayoutRequestDto } from "@novu/api/models/components"; + +let value: UpdateLayoutRequestDto = { + identifier: "", +}; +``` ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | -| `content` | *string* | :heavy_minus_sign: | User defined content for the layout. | -| `description` | *string* | :heavy_minus_sign: | User defined description of the layout | -| `identifier` | *string* | :heavy_check_mark: | User defined custom key that will be a unique identifier for the Layout updated. | -| `isDefault` | *boolean* | :heavy_minus_sign: | Variable that defines if the layout is chosen as default when creating a layout. | -| `name` | *string* | :heavy_minus_sign: | User defined custom name and provided by the user that will name the Layout updated. | -| `variables` | [components.UpdateLayoutRequestDtoVariables](../../models/components/updatelayoutrequestdtovariables.md)[] | :heavy_minus_sign: | User defined variables to render in the layout placeholders. | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `content` | *string* | :heavy_minus_sign: | User defined content for the layout. | +| `description` | *string* | :heavy_minus_sign: | User defined description of the layout | +| `identifier` | *string* | :heavy_check_mark: | User defined custom key that will be a unique identifier for the Layout updated. | +| `isDefault` | *boolean* | :heavy_minus_sign: | Variable that defines if the layout is chosen as default when creating a layout. | +| `name` | *string* | :heavy_minus_sign: | User defined custom name and provided by the user that will name the Layout updated. | +| `variables` | [components.Variables](../../models/components/variables.md) | :heavy_minus_sign: | User defined variables to render in the layout placeholders. | \ No newline at end of file diff --git a/docs/models/components/updatelayoutrequestdtovariables.md b/docs/models/components/updatelayoutrequestdtovariables.md deleted file mode 100644 index cf42f71d..00000000 --- a/docs/models/components/updatelayoutrequestdtovariables.md +++ /dev/null @@ -1,7 +0,0 @@ -# UpdateLayoutRequestDtoVariables - - -## Fields - -| Field | Type | Required | Description | -| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/components/updatelayoutresponsedto.md b/docs/models/components/updatelayoutresponsedto.md index 8ba0ec6a..c08c9e9a 100644 --- a/docs/models/components/updatelayoutresponsedto.md +++ b/docs/models/components/updatelayoutresponsedto.md @@ -1,23 +1,41 @@ # UpdateLayoutResponseDto +## Example Usage + +```typescript +import { UpdateLayoutResponseDto } from "@novu/api/models/components"; + +let value: UpdateLayoutResponseDto = { + creatorId: "", + environmentId: "", + organizationId: "", + channel: "push", + content: "", + contentType: "", + identifier: "", + isDefault: false, + isDeleted: false, + name: "", +}; +``` ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `creatorId` | *string* | :heavy_check_mark: | N/A | -| `environmentId` | *string* | :heavy_check_mark: | N/A | -| `id` | *string* | :heavy_minus_sign: | N/A | -| `organizationId` | *string* | :heavy_check_mark: | N/A | -| `parentId` | *string* | :heavy_minus_sign: | N/A | -| `channel` | [components.UpdateLayoutResponseDtoChannel](../../models/components/updatelayoutresponsedtochannel.md) | :heavy_check_mark: | N/A | -| `content` | *string* | :heavy_check_mark: | N/A | -| `contentType` | *string* | :heavy_check_mark: | N/A | -| `createdAt` | *string* | :heavy_minus_sign: | N/A | -| `description` | *string* | :heavy_minus_sign: | N/A | -| `identifier` | *string* | :heavy_check_mark: | N/A | -| `isDefault` | *boolean* | :heavy_check_mark: | N/A | -| `isDeleted` | *boolean* | :heavy_check_mark: | N/A | -| `name` | *string* | :heavy_check_mark: | N/A | -| `updatedAt` | *string* | :heavy_minus_sign: | N/A | -| `variables` | [components.UpdateLayoutResponseDtoVariables](../../models/components/updatelayoutresponsedtovariables.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | +| `creatorId` | *string* | :heavy_check_mark: | N/A | +| `environmentId` | *string* | :heavy_check_mark: | N/A | +| `id` | *string* | :heavy_minus_sign: | N/A | +| `organizationId` | *string* | :heavy_check_mark: | N/A | +| `parentId` | *string* | :heavy_minus_sign: | N/A | +| `channel` | [components.UpdateLayoutResponseDtoChannel](../../models/components/updatelayoutresponsedtochannel.md) | :heavy_check_mark: | N/A | +| `content` | *string* | :heavy_check_mark: | N/A | +| `contentType` | *string* | :heavy_check_mark: | N/A | +| `createdAt` | *string* | :heavy_minus_sign: | N/A | +| `description` | *string* | :heavy_minus_sign: | N/A | +| `identifier` | *string* | :heavy_check_mark: | N/A | +| `isDefault` | *boolean* | :heavy_check_mark: | N/A | +| `isDeleted` | *boolean* | :heavy_check_mark: | N/A | +| `name` | *string* | :heavy_check_mark: | N/A | +| `updatedAt` | *string* | :heavy_minus_sign: | N/A | +| `variables` | *string*[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/updatelayoutresponsedtochannel.md b/docs/models/components/updatelayoutresponsedtochannel.md index c3d04f88..e4c37839 100644 --- a/docs/models/components/updatelayoutresponsedtochannel.md +++ b/docs/models/components/updatelayoutresponsedtochannel.md @@ -1,12 +1,15 @@ # UpdateLayoutResponseDtoChannel +## Example Usage + +```typescript +import { UpdateLayoutResponseDtoChannel } from "@novu/api/models/components"; + +let value: UpdateLayoutResponseDtoChannel = "push"; +``` ## Values -| Name | Value | -| ------- | ------- | -| `InApp` | in_app | -| `Email` | email | -| `Sms` | sms | -| `Chat` | chat | -| `Push` | push | \ No newline at end of file +```typescript +"in_app" | "email" | "sms" | "chat" | "push" +``` \ No newline at end of file diff --git a/docs/models/components/updatelayoutresponsedtovariables.md b/docs/models/components/updatelayoutresponsedtovariables.md deleted file mode 100644 index e7cf253e..00000000 --- a/docs/models/components/updatelayoutresponsedtovariables.md +++ /dev/null @@ -1,7 +0,0 @@ -# UpdateLayoutResponseDtoVariables - - -## Fields - -| Field | Type | Required | Description | -| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/components/updatesubscriberchannelrequestdto.md b/docs/models/components/updatesubscriberchannelrequestdto.md index 0bdf07bc..87223667 100644 --- a/docs/models/components/updatesubscriberchannelrequestdto.md +++ b/docs/models/components/updatesubscriberchannelrequestdto.md @@ -1,10 +1,22 @@ # UpdateSubscriberChannelRequestDto +## Example Usage + +```typescript +import { UpdateSubscriberChannelRequestDto } from "@novu/api/models/components"; + +let value: UpdateSubscriberChannelRequestDto = { + credentials: { + webhookUrl: "", + }, + providerId: 5373.73, +}; +``` ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -| `credentials` | [components.ChannelCredentials](../../models/components/channelcredentials.md) | :heavy_check_mark: | Credentials payload for the specified provider | -| `integrationIdentifier` | *string* | :heavy_minus_sign: | The integration identifier | -| `providerId` | [components.UpdateSubscriberChannelRequestDtoProviderId](../../models/components/updatesubscriberchannelrequestdtoproviderid.md) | :heavy_check_mark: | The provider identifier for the credentials | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `credentials` | [components.ChannelCredentials](../../models/components/channelcredentials.md) | :heavy_check_mark: | Credentials payload for the specified provider | +| `integrationIdentifier` | *string* | :heavy_minus_sign: | The integration identifier | +| `providerId` | *number* | :heavy_check_mark: | The provider identifier for the credentials | \ No newline at end of file diff --git a/docs/models/components/updatesubscriberchannelrequestdtoproviderid.md b/docs/models/components/updatesubscriberchannelrequestdtoproviderid.md deleted file mode 100644 index f0a15d43..00000000 --- a/docs/models/components/updatesubscriberchannelrequestdtoproviderid.md +++ /dev/null @@ -1,26 +0,0 @@ -# UpdateSubscriberChannelRequestDtoProviderId - -The provider identifier for the credentials - - -## Values - -| Name | Value | -| ------------------ | ------------------ | -| `Slack` | slack | -| `Discord` | discord | -| `Msteams` | msteams | -| `Mattermost` | mattermost | -| `Ryver` | ryver | -| `Zulip` | zulip | -| `GrafanaOnCall` | grafana-on-call | -| `Getstream` | getstream | -| `RocketChat` | rocket-chat | -| `WhatsappBusiness` | whatsapp-business | -| `Fcm` | fcm | -| `Apns` | apns | -| `Expo` | expo | -| `OneSignal` | one-signal | -| `Pushpad` | pushpad | -| `PushWebhook` | push-webhook | -| `PusherBeams` | pusher-beams | \ No newline at end of file diff --git a/docs/models/components/updatesubscriberglobalpreferencesrequestdto.md b/docs/models/components/updatesubscriberglobalpreferencesrequestdto.md index d82fa9ec..3f65c6d8 100644 --- a/docs/models/components/updatesubscriberglobalpreferencesrequestdto.md +++ b/docs/models/components/updatesubscriberglobalpreferencesrequestdto.md @@ -1,5 +1,12 @@ # UpdateSubscriberGlobalPreferencesRequestDto +## Example Usage + +```typescript +import { UpdateSubscriberGlobalPreferencesRequestDto } from "@novu/api/models/components"; + +let value: UpdateSubscriberGlobalPreferencesRequestDto = {}; +``` ## Fields diff --git a/docs/models/components/updatesubscriberonlineflagrequestdto.md b/docs/models/components/updatesubscriberonlineflagrequestdto.md index 86419f9a..9aaeb45e 100644 --- a/docs/models/components/updatesubscriberonlineflagrequestdto.md +++ b/docs/models/components/updatesubscriberonlineflagrequestdto.md @@ -1,5 +1,14 @@ # UpdateSubscriberOnlineFlagRequestDto +## Example Usage + +```typescript +import { UpdateSubscriberOnlineFlagRequestDto } from "@novu/api/models/components"; + +let value: UpdateSubscriberOnlineFlagRequestDto = { + isOnline: false, +}; +``` ## Fields diff --git a/docs/models/components/updatesubscriberpreferencerequestdto.md b/docs/models/components/updatesubscriberpreferencerequestdto.md index 06914378..ab38c659 100644 --- a/docs/models/components/updatesubscriberpreferencerequestdto.md +++ b/docs/models/components/updatesubscriberpreferencerequestdto.md @@ -1,5 +1,12 @@ # UpdateSubscriberPreferenceRequestDto +## Example Usage + +```typescript +import { UpdateSubscriberPreferenceRequestDto } from "@novu/api/models/components"; + +let value: UpdateSubscriberPreferenceRequestDto = {}; +``` ## Fields diff --git a/docs/models/components/updatesubscriberpreferenceresponsedto.md b/docs/models/components/updatesubscriberpreferenceresponsedto.md index 5241aea4..2c27ec2d 100644 --- a/docs/models/components/updatesubscriberpreferenceresponsedto.md +++ b/docs/models/components/updatesubscriberpreferenceresponsedto.md @@ -1,5 +1,23 @@ # UpdateSubscriberPreferenceResponseDto +## Example Usage + +```typescript +import { UpdateSubscriberPreferenceResponseDto } from "@novu/api/models/components"; + +let value: UpdateSubscriberPreferenceResponseDto = { + preference: { + channels: {}, + enabled: false, + }, + template: { + id: "", + critical: false, + name: "", + triggers: [""], + }, +}; +``` ## Fields diff --git a/docs/models/components/updatesubscriberrequestdto.md b/docs/models/components/updatesubscriberrequestdto.md index 950ffb51..e50179cf 100644 --- a/docs/models/components/updatesubscriberrequestdto.md +++ b/docs/models/components/updatesubscriberrequestdto.md @@ -1,5 +1,12 @@ # UpdateSubscriberRequestDto +## Example Usage + +```typescript +import { UpdateSubscriberRequestDto } from "@novu/api/models/components"; + +let value: UpdateSubscriberRequestDto = {}; +``` ## Fields diff --git a/docs/models/components/updatesubscriberrequestdtodata.md b/docs/models/components/updatesubscriberrequestdtodata.md index 6be30391..71cb8daa 100644 --- a/docs/models/components/updatesubscriberrequestdtodata.md +++ b/docs/models/components/updatesubscriberrequestdtodata.md @@ -1,5 +1,12 @@ # UpdateSubscriberRequestDtoData +## Example Usage + +```typescript +import { UpdateSubscriberRequestDtoData } from "@novu/api/models/components"; + +let value: UpdateSubscriberRequestDtoData = {}; +``` ## Fields diff --git a/docs/models/components/updatetenantrequestdto.md b/docs/models/components/updatetenantrequestdto.md index 19f63a8d..ac3be0e2 100644 --- a/docs/models/components/updatetenantrequestdto.md +++ b/docs/models/components/updatetenantrequestdto.md @@ -1,5 +1,12 @@ # UpdateTenantRequestDto +## Example Usage + +```typescript +import { UpdateTenantRequestDto } from "@novu/api/models/components"; + +let value: UpdateTenantRequestDto = {}; +``` ## Fields diff --git a/docs/models/components/updatetenantrequestdtodata.md b/docs/models/components/updatetenantrequestdtodata.md index 50556e3f..c9468b09 100644 --- a/docs/models/components/updatetenantrequestdtodata.md +++ b/docs/models/components/updatetenantrequestdtodata.md @@ -1,5 +1,12 @@ # UpdateTenantRequestDtoData +## Example Usage + +```typescript +import { UpdateTenantRequestDtoData } from "@novu/api/models/components"; + +let value: UpdateTenantRequestDtoData = {}; +``` ## Fields diff --git a/docs/models/components/updatetenantresponsedto.md b/docs/models/components/updatetenantresponsedto.md index 5f054415..07d7cf06 100644 --- a/docs/models/components/updatetenantresponsedto.md +++ b/docs/models/components/updatetenantresponsedto.md @@ -1,5 +1,18 @@ # UpdateTenantResponseDto +## Example Usage + +```typescript +import { UpdateTenantResponseDto } from "@novu/api/models/components"; + +let value: UpdateTenantResponseDto = { + environmentId: "", + id: "", + createdAt: "", + identifier: "", + updatedAt: "", +}; +``` ## Fields diff --git a/docs/models/components/updatetenantresponsedtodata.md b/docs/models/components/updatetenantresponsedtodata.md index d32d8d3c..bd961272 100644 --- a/docs/models/components/updatetenantresponsedtodata.md +++ b/docs/models/components/updatetenantresponsedtodata.md @@ -1,5 +1,12 @@ # UpdateTenantResponseDtoData +## Example Usage + +```typescript +import { UpdateTenantResponseDtoData } from "@novu/api/models/components"; + +let value: UpdateTenantResponseDtoData = {}; +``` ## Fields diff --git a/docs/models/components/updateworkflowrequestdto.md b/docs/models/components/updateworkflowrequestdto.md index 6b4e37f4..2d1af828 100644 --- a/docs/models/components/updateworkflowrequestdto.md +++ b/docs/models/components/updateworkflowrequestdto.md @@ -1,5 +1,15 @@ # UpdateWorkflowRequestDto +## Example Usage + +```typescript +import { UpdateWorkflowRequestDto } from "@novu/api/models/components"; + +let value: UpdateWorkflowRequestDto = { + name: "", + notificationGroupId: "", +}; +``` ## Fields @@ -12,5 +22,5 @@ | `name` | *string* | :heavy_check_mark: | N/A | | `notificationGroupId` | *string* | :heavy_check_mark: | N/A | | `preferenceSettings` | [components.PreferenceChannels](../../models/components/preferencechannels.md) | :heavy_minus_sign: | N/A | -| `steps` | [components.NotificationStep](../../models/components/notificationstep.md)[] | :heavy_minus_sign: | N/A | +| `steps` | *string*[] | :heavy_minus_sign: | N/A | | `tags` | *string*[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/updateworkflowrequestdtodata.md b/docs/models/components/updateworkflowrequestdtodata.md index fddb6d32..0ea57b03 100644 --- a/docs/models/components/updateworkflowrequestdtodata.md +++ b/docs/models/components/updateworkflowrequestdtodata.md @@ -1,5 +1,12 @@ # UpdateWorkflowRequestDtoData +## Example Usage + +```typescript +import { UpdateWorkflowRequestDtoData } from "@novu/api/models/components"; + +let value: UpdateWorkflowRequestDtoData = {}; +``` ## Fields diff --git a/docs/models/components/value.md b/docs/models/components/value.md index f01456fe..b49c292d 100644 --- a/docs/models/components/value.md +++ b/docs/models/components/value.md @@ -1,9 +1,15 @@ # Value +## Example Usage + +```typescript +import { Value } from "@novu/api/models/components"; + +let value: Value = "AND"; +``` ## Values -| Name | Value | -| ----- | ----- | -| `And` | AND | -| `Or` | OR | \ No newline at end of file +```typescript +"AND" | "OR" +``` \ No newline at end of file diff --git a/docs/models/components/variables.md b/docs/models/components/variables.md index 0da9d367..2f3af845 100644 --- a/docs/models/components/variables.md +++ b/docs/models/components/variables.md @@ -1,5 +1,14 @@ # Variables +User defined variables to render in the layout placeholders. + +## Example Usage + +```typescript +import { Variables } from "@novu/api/models/components"; + +let value: Variables = {}; +``` ## Fields diff --git a/docs/models/components/variablesresponsedto.md b/docs/models/components/variablesresponsedto.md index 034ffa8c..cf0d068c 100644 --- a/docs/models/components/variablesresponsedto.md +++ b/docs/models/components/variablesresponsedto.md @@ -1,5 +1,15 @@ # VariablesResponseDto +## Example Usage + +```typescript +import { VariablesResponseDto } from "@novu/api/models/components"; + +let value: VariablesResponseDto = { + system: {}, + translations: {}, +}; +``` ## Fields diff --git a/docs/models/components/weekdays.md b/docs/models/components/weekdays.md index 3a38a5f1..91b6e4d9 100644 --- a/docs/models/components/weekdays.md +++ b/docs/models/components/weekdays.md @@ -1,14 +1,15 @@ # WeekDays +## Example Usage + +```typescript +import { WeekDays } from "@novu/api/models/components"; + +let value: WeekDays = "sunday"; +``` ## Values -| Name | Value | -| ----------- | ----------- | -| `Monday` | monday | -| `Tuesday` | tuesday | -| `Wednesday` | wednesday | -| `Thursday` | thursday | -| `Friday` | friday | -| `Saturday` | saturday | -| `Sunday` | sunday | \ No newline at end of file +```typescript +"monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday" | "sunday" +``` \ No newline at end of file diff --git a/docs/models/components/workflowintegrationstatus.md b/docs/models/components/workflowintegrationstatus.md index 72a4af75..e7915938 100644 --- a/docs/models/components/workflowintegrationstatus.md +++ b/docs/models/components/workflowintegrationstatus.md @@ -1,5 +1,12 @@ # WorkflowIntegrationStatus +## Example Usage + +```typescript +import { WorkflowIntegrationStatus } from "@novu/api/models/components"; + +let value: WorkflowIntegrationStatus = {}; +``` ## Fields diff --git a/docs/models/components/workflowresponse.md b/docs/models/components/workflowresponse.md index eac54f88..e5924db1 100644 --- a/docs/models/components/workflowresponse.md +++ b/docs/models/components/workflowresponse.md @@ -1,5 +1,29 @@ # WorkflowResponse +## Example Usage + +```typescript +import { WorkflowResponse } from "@novu/api/models/components"; + +let value: WorkflowResponse = { + creatorId: "", + environmentId: "", + notificationGroupId: "", + organizationId: "", + active: false, + critical: false, + deleted: false, + deletedAt: "", + deletedBy: "", + description: "Advanced eco-centric middleware", + draft: false, + name: "", + preferenceSettings: {}, + steps: [], + tags: [""], + triggers: [], +}; +``` ## Fields diff --git a/docs/models/components/workflowresponsedata.md b/docs/models/components/workflowresponsedata.md index d61e7133..23301dd5 100644 --- a/docs/models/components/workflowresponsedata.md +++ b/docs/models/components/workflowresponsedata.md @@ -1,5 +1,12 @@ # WorkflowResponseData +## Example Usage + +```typescript +import { WorkflowResponseData } from "@novu/api/models/components"; + +let value: WorkflowResponseData = {}; +``` ## Fields diff --git a/docs/models/components/workflowsresponsedto.md b/docs/models/components/workflowsresponsedto.md index 20842edd..16d24c6d 100644 --- a/docs/models/components/workflowsresponsedto.md +++ b/docs/models/components/workflowsresponsedto.md @@ -1,11 +1,23 @@ # WorkflowsResponseDto +## Example Usage + +```typescript +import { WorkflowsResponseDto } from "@novu/api/models/components"; + +let value: WorkflowsResponseDto = { + data: [""], + page: 384.25, + pageSize: 4386.01, + totalCount: 6342.74, +}; +``` ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| `data` | [components.WorkflowResponse](../../models/components/workflowresponse.md)[] | :heavy_check_mark: | N/A | -| `page` | *number* | :heavy_check_mark: | N/A | -| `pageSize` | *number* | :heavy_check_mark: | N/A | -| `totalCount` | *number* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `data` | *string*[] | :heavy_check_mark: | N/A | +| `page` | *number* | :heavy_check_mark: | N/A | +| `pageSize` | *number* | :heavy_check_mark: | N/A | +| `totalCount` | *number* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/changescontrollerapplydiffrequest.md b/docs/models/operations/changescontrollerapplydiffrequest.md index 06adb269..e3765197 100644 --- a/docs/models/operations/changescontrollerapplydiffrequest.md +++ b/docs/models/operations/changescontrollerapplydiffrequest.md @@ -1,5 +1,14 @@ # ChangesControllerApplyDiffRequest +## Example Usage + +```typescript +import { ChangesControllerApplyDiffRequest } from "@novu/api/models/operations"; + +let value: ChangesControllerApplyDiffRequest = { + changeId: "", +}; +``` ## Fields diff --git a/docs/models/operations/changescontrollergetchangesrequest.md b/docs/models/operations/changescontrollergetchangesrequest.md index 50dba980..31a1a883 100644 --- a/docs/models/operations/changescontrollergetchangesrequest.md +++ b/docs/models/operations/changescontrollergetchangesrequest.md @@ -1,5 +1,14 @@ # ChangesControllerGetChangesRequest +## Example Usage + +```typescript +import { ChangesControllerGetChangesRequest } from "@novu/api/models/operations"; + +let value: ChangesControllerGetChangesRequest = { + promoted: "false", +}; +``` ## Fields diff --git a/docs/models/operations/channel.md b/docs/models/operations/channel.md index 1f3bfe77..5b0da9e5 100644 --- a/docs/models/operations/channel.md +++ b/docs/models/operations/channel.md @@ -2,13 +2,16 @@ The channel of the message to be deleted +## Example Usage + +```typescript +import { Channel } from "@novu/api/models/operations"; + +let value: Channel = "push"; +``` ## Values -| Name | Value | -| ------- | ------- | -| `InApp` | in_app | -| `Email` | email | -| `Sms` | sms | -| `Chat` | chat | -| `Push` | push | \ No newline at end of file +```typescript +"in_app" | "email" | "sms" | "chat" | "push" +``` \ No newline at end of file diff --git a/docs/models/operations/channels.md b/docs/models/operations/channels.md index 12ae99d1..08b00444 100644 --- a/docs/models/operations/channels.md +++ b/docs/models/operations/channels.md @@ -1,12 +1,15 @@ # Channels +## Example Usage + +```typescript +import { Channels } from "@novu/api/models/operations"; + +let value: Channels = "chat"; +``` ## Values -| Name | Value | -| ------- | ------- | -| `InApp` | in_app | -| `Email` | email | -| `Sms` | sms | -| `Chat` | chat | -| `Push` | push | \ No newline at end of file +```typescript +"in_app" | "email" | "sms" | "chat" | "push" +``` \ No newline at end of file diff --git a/docs/models/operations/eventscontrollercancelrequest.md b/docs/models/operations/eventscontrollercancelrequest.md index 45131157..d4e452f7 100644 --- a/docs/models/operations/eventscontrollercancelrequest.md +++ b/docs/models/operations/eventscontrollercancelrequest.md @@ -1,5 +1,14 @@ # EventsControllerCancelRequest +## Example Usage + +```typescript +import { EventsControllerCancelRequest } from "@novu/api/models/operations"; + +let value: EventsControllerCancelRequest = { + transactionId: "", +}; +``` ## Fields diff --git a/docs/models/operations/executiondetailscontrollergetexecutiondetailsfornotificationrequest.md b/docs/models/operations/executiondetailscontrollergetexecutiondetailsfornotificationrequest.md index 88e197f2..eb1fd426 100644 --- a/docs/models/operations/executiondetailscontrollergetexecutiondetailsfornotificationrequest.md +++ b/docs/models/operations/executiondetailscontrollergetexecutiondetailsfornotificationrequest.md @@ -1,5 +1,15 @@ # ExecutionDetailsControllerGetExecutionDetailsForNotificationRequest +## Example Usage + +```typescript +import { ExecutionDetailsControllerGetExecutionDetailsForNotificationRequest } from "@novu/api/models/operations"; + +let value: ExecutionDetailsControllerGetExecutionDetailsForNotificationRequest = { + notificationId: "", + subscriberId: "", +}; +``` ## Fields diff --git a/docs/models/operations/feedscontrollerdeletefeedbyidrequest.md b/docs/models/operations/feedscontrollerdeletefeedbyidrequest.md index 4dad751d..44dc17fb 100644 --- a/docs/models/operations/feedscontrollerdeletefeedbyidrequest.md +++ b/docs/models/operations/feedscontrollerdeletefeedbyidrequest.md @@ -1,5 +1,14 @@ # FeedsControllerDeleteFeedByIdRequest +## Example Usage + +```typescript +import { FeedsControllerDeleteFeedByIdRequest } from "@novu/api/models/operations"; + +let value: FeedsControllerDeleteFeedByIdRequest = { + feedId: "", +}; +``` ## Fields diff --git a/docs/models/operations/integrationscontrollergetwebhooksupportstatusrequest.md b/docs/models/operations/integrationscontrollergetwebhooksupportstatusrequest.md index caacbf82..3e0b88d8 100644 --- a/docs/models/operations/integrationscontrollergetwebhooksupportstatusrequest.md +++ b/docs/models/operations/integrationscontrollergetwebhooksupportstatusrequest.md @@ -1,5 +1,14 @@ # IntegrationsControllerGetWebhookSupportStatusRequest +## Example Usage + +```typescript +import { IntegrationsControllerGetWebhookSupportStatusRequest } from "@novu/api/models/operations"; + +let value: IntegrationsControllerGetWebhookSupportStatusRequest = { + providerOrIntegrationId: "", +}; +``` ## Fields diff --git a/docs/models/operations/integrationscontrollerremoveintegrationrequest.md b/docs/models/operations/integrationscontrollerremoveintegrationrequest.md index fbe68e30..8aa58a3f 100644 --- a/docs/models/operations/integrationscontrollerremoveintegrationrequest.md +++ b/docs/models/operations/integrationscontrollerremoveintegrationrequest.md @@ -1,5 +1,14 @@ # IntegrationsControllerRemoveIntegrationRequest +## Example Usage + +```typescript +import { IntegrationsControllerRemoveIntegrationRequest } from "@novu/api/models/operations"; + +let value: IntegrationsControllerRemoveIntegrationRequest = { + integrationId: "", +}; +``` ## Fields diff --git a/docs/models/operations/integrationscontrollersetintegrationasprimaryrequest.md b/docs/models/operations/integrationscontrollersetintegrationasprimaryrequest.md index 6f53161f..ee25065a 100644 --- a/docs/models/operations/integrationscontrollersetintegrationasprimaryrequest.md +++ b/docs/models/operations/integrationscontrollersetintegrationasprimaryrequest.md @@ -1,5 +1,14 @@ # IntegrationsControllerSetIntegrationAsPrimaryRequest +## Example Usage + +```typescript +import { IntegrationsControllerSetIntegrationAsPrimaryRequest } from "@novu/api/models/operations"; + +let value: IntegrationsControllerSetIntegrationAsPrimaryRequest = { + integrationId: "", +}; +``` ## Fields diff --git a/docs/models/operations/integrationscontrollerupdateintegrationbyidrequest.md b/docs/models/operations/integrationscontrollerupdateintegrationbyidrequest.md index 5094a5d0..0f8e0f4c 100644 --- a/docs/models/operations/integrationscontrollerupdateintegrationbyidrequest.md +++ b/docs/models/operations/integrationscontrollerupdateintegrationbyidrequest.md @@ -1,5 +1,15 @@ # IntegrationsControllerUpdateIntegrationByIdRequest +## Example Usage + +```typescript +import { IntegrationsControllerUpdateIntegrationByIdRequest } from "@novu/api/models/operations"; + +let value: IntegrationsControllerUpdateIntegrationByIdRequest = { + integrationId: "", + updateIntegrationRequestDto: {}, +}; +``` ## Fields diff --git a/docs/models/operations/layoutscontrollerdeletelayoutrequest.md b/docs/models/operations/layoutscontrollerdeletelayoutrequest.md index efb09feb..5cee7b5c 100644 --- a/docs/models/operations/layoutscontrollerdeletelayoutrequest.md +++ b/docs/models/operations/layoutscontrollerdeletelayoutrequest.md @@ -1,8 +1,17 @@ # LayoutsControllerDeleteLayoutRequest +## Example Usage + +```typescript +import { LayoutsControllerDeleteLayoutRequest } from "@novu/api/models/operations"; + +let value: LayoutsControllerDeleteLayoutRequest = { + layoutId: "", +}; +``` ## Fields | Field | Type | Required | Description | | ------------------ | ------------------ | ------------------ | ------------------ | -| `layoutId` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file +| `layoutId` | *string* | :heavy_check_mark: | The layout id | \ No newline at end of file diff --git a/docs/models/operations/layoutscontrollergetlayoutrequest.md b/docs/models/operations/layoutscontrollergetlayoutrequest.md index 61a2f218..e3e999b8 100644 --- a/docs/models/operations/layoutscontrollergetlayoutrequest.md +++ b/docs/models/operations/layoutscontrollergetlayoutrequest.md @@ -1,8 +1,17 @@ # LayoutsControllerGetLayoutRequest +## Example Usage + +```typescript +import { LayoutsControllerGetLayoutRequest } from "@novu/api/models/operations"; + +let value: LayoutsControllerGetLayoutRequest = { + layoutId: "", +}; +``` ## Fields | Field | Type | Required | Description | | ------------------ | ------------------ | ------------------ | ------------------ | -| `layoutId` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file +| `layoutId` | *string* | :heavy_check_mark: | The layout id | \ No newline at end of file diff --git a/docs/models/operations/layoutscontrollerlistlayoutsrequest.md b/docs/models/operations/layoutscontrollerlistlayoutsrequest.md index f28abe8d..eca0fbff 100644 --- a/docs/models/operations/layoutscontrollerlistlayoutsrequest.md +++ b/docs/models/operations/layoutscontrollerlistlayoutsrequest.md @@ -1,5 +1,12 @@ # LayoutsControllerListLayoutsRequest +## Example Usage + +```typescript +import { LayoutsControllerListLayoutsRequest } from "@novu/api/models/operations"; + +let value: LayoutsControllerListLayoutsRequest = {}; +``` ## Fields diff --git a/docs/models/operations/layoutscontrollersetdefaultlayoutrequest.md b/docs/models/operations/layoutscontrollersetdefaultlayoutrequest.md index 23d06994..5d23ae29 100644 --- a/docs/models/operations/layoutscontrollersetdefaultlayoutrequest.md +++ b/docs/models/operations/layoutscontrollersetdefaultlayoutrequest.md @@ -1,8 +1,17 @@ # LayoutsControllerSetDefaultLayoutRequest +## Example Usage + +```typescript +import { LayoutsControllerSetDefaultLayoutRequest } from "@novu/api/models/operations"; + +let value: LayoutsControllerSetDefaultLayoutRequest = { + layoutId: "", +}; +``` ## Fields | Field | Type | Required | Description | | ------------------ | ------------------ | ------------------ | ------------------ | -| `layoutId` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file +| `layoutId` | *string* | :heavy_check_mark: | The layout id | \ No newline at end of file diff --git a/docs/models/operations/layoutscontrollerupdatelayoutrequest.md b/docs/models/operations/layoutscontrollerupdatelayoutrequest.md index 86824570..fee347f3 100644 --- a/docs/models/operations/layoutscontrollerupdatelayoutrequest.md +++ b/docs/models/operations/layoutscontrollerupdatelayoutrequest.md @@ -1,9 +1,21 @@ # LayoutsControllerUpdateLayoutRequest +## Example Usage + +```typescript +import { LayoutsControllerUpdateLayoutRequest } from "@novu/api/models/operations"; + +let value: LayoutsControllerUpdateLayoutRequest = { + layoutId: "", + updateLayoutRequestDto: { + identifier: "", + }, +}; +``` ## Fields | Field | Type | Required | Description | | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `layoutId` | *string* | :heavy_check_mark: | N/A | +| `layoutId` | *string* | :heavy_check_mark: | The layout id | | `updateLayoutRequestDto` | [components.UpdateLayoutRequestDto](../../models/components/updatelayoutrequestdto.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/messagescontrollerdeletemessagerequest.md b/docs/models/operations/messagescontrollerdeletemessagerequest.md index f42fa1ad..19945745 100644 --- a/docs/models/operations/messagescontrollerdeletemessagerequest.md +++ b/docs/models/operations/messagescontrollerdeletemessagerequest.md @@ -1,5 +1,14 @@ # MessagesControllerDeleteMessageRequest +## Example Usage + +```typescript +import { MessagesControllerDeleteMessageRequest } from "@novu/api/models/operations"; + +let value: MessagesControllerDeleteMessageRequest = { + messageId: "", +}; +``` ## Fields diff --git a/docs/models/operations/messagescontrollerdeletemessagesbytransactionidrequest.md b/docs/models/operations/messagescontrollerdeletemessagesbytransactionidrequest.md index 7dc3f11c..e6f54e31 100644 --- a/docs/models/operations/messagescontrollerdeletemessagesbytransactionidrequest.md +++ b/docs/models/operations/messagescontrollerdeletemessagesbytransactionidrequest.md @@ -1,5 +1,14 @@ # MessagesControllerDeleteMessagesByTransactionIdRequest +## Example Usage + +```typescript +import { MessagesControllerDeleteMessagesByTransactionIdRequest } from "@novu/api/models/operations"; + +let value: MessagesControllerDeleteMessagesByTransactionIdRequest = { + transactionId: "", +}; +``` ## Fields diff --git a/docs/models/operations/messagescontrollergetmessagesrequest.md b/docs/models/operations/messagescontrollergetmessagesrequest.md index 729249a6..c8242345 100644 --- a/docs/models/operations/messagescontrollergetmessagesrequest.md +++ b/docs/models/operations/messagescontrollergetmessagesrequest.md @@ -1,5 +1,12 @@ # MessagesControllerGetMessagesRequest +## Example Usage + +```typescript +import { MessagesControllerGetMessagesRequest } from "@novu/api/models/operations"; + +let value: MessagesControllerGetMessagesRequest = {}; +``` ## Fields diff --git a/docs/models/operations/notificationgroupscontrollerdeletenotificationgrouprequest.md b/docs/models/operations/notificationgroupscontrollerdeletenotificationgrouprequest.md index da3412ea..9b5e0e70 100644 --- a/docs/models/operations/notificationgroupscontrollerdeletenotificationgrouprequest.md +++ b/docs/models/operations/notificationgroupscontrollerdeletenotificationgrouprequest.md @@ -1,5 +1,14 @@ # NotificationGroupsControllerDeleteNotificationGroupRequest +## Example Usage + +```typescript +import { NotificationGroupsControllerDeleteNotificationGroupRequest } from "@novu/api/models/operations"; + +let value: NotificationGroupsControllerDeleteNotificationGroupRequest = { + id: "", +}; +``` ## Fields diff --git a/docs/models/operations/notificationgroupscontrollergetnotificationgrouprequest.md b/docs/models/operations/notificationgroupscontrollergetnotificationgrouprequest.md index 3e92258f..0f57f130 100644 --- a/docs/models/operations/notificationgroupscontrollergetnotificationgrouprequest.md +++ b/docs/models/operations/notificationgroupscontrollergetnotificationgrouprequest.md @@ -1,5 +1,14 @@ # NotificationGroupsControllerGetNotificationGroupRequest +## Example Usage + +```typescript +import { NotificationGroupsControllerGetNotificationGroupRequest } from "@novu/api/models/operations"; + +let value: NotificationGroupsControllerGetNotificationGroupRequest = { + id: "", +}; +``` ## Fields diff --git a/docs/models/operations/notificationgroupscontrollerupdatenotificationgrouprequest.md b/docs/models/operations/notificationgroupscontrollerupdatenotificationgrouprequest.md index ddbba5d4..b56403f4 100644 --- a/docs/models/operations/notificationgroupscontrollerupdatenotificationgrouprequest.md +++ b/docs/models/operations/notificationgroupscontrollerupdatenotificationgrouprequest.md @@ -1,5 +1,17 @@ # NotificationGroupsControllerUpdateNotificationGroupRequest +## Example Usage + +```typescript +import { NotificationGroupsControllerUpdateNotificationGroupRequest } from "@novu/api/models/operations"; + +let value: NotificationGroupsControllerUpdateNotificationGroupRequest = { + id: "", + createNotificationGroupRequestDto: { + name: "", + }, +}; +``` ## Fields diff --git a/docs/models/operations/notificationscontrollergetactivitygraphstatsrequest.md b/docs/models/operations/notificationscontrollergetactivitygraphstatsrequest.md index 83e52695..a846d6c7 100644 --- a/docs/models/operations/notificationscontrollergetactivitygraphstatsrequest.md +++ b/docs/models/operations/notificationscontrollergetactivitygraphstatsrequest.md @@ -1,5 +1,12 @@ # NotificationsControllerGetActivityGraphStatsRequest +## Example Usage + +```typescript +import { NotificationsControllerGetActivityGraphStatsRequest } from "@novu/api/models/operations"; + +let value: NotificationsControllerGetActivityGraphStatsRequest = {}; +``` ## Fields diff --git a/docs/models/operations/notificationscontrollergetnotificationrequest.md b/docs/models/operations/notificationscontrollergetnotificationrequest.md index 7c20f6b8..b8fadc69 100644 --- a/docs/models/operations/notificationscontrollergetnotificationrequest.md +++ b/docs/models/operations/notificationscontrollergetnotificationrequest.md @@ -1,5 +1,14 @@ # NotificationsControllerGetNotificationRequest +## Example Usage + +```typescript +import { NotificationsControllerGetNotificationRequest } from "@novu/api/models/operations"; + +let value: NotificationsControllerGetNotificationRequest = { + notificationId: "", +}; +``` ## Fields diff --git a/docs/models/operations/notificationscontrollerlistnotificationsrequest.md b/docs/models/operations/notificationscontrollerlistnotificationsrequest.md index a4bffb92..1e41be84 100644 --- a/docs/models/operations/notificationscontrollerlistnotificationsrequest.md +++ b/docs/models/operations/notificationscontrollerlistnotificationsrequest.md @@ -1,5 +1,18 @@ # NotificationsControllerListNotificationsRequest +## Example Usage + +```typescript +import { NotificationsControllerListNotificationsRequest } from "@novu/api/models/operations"; + +let value: NotificationsControllerListNotificationsRequest = { + channels: ["email"], + templates: [""], + emails: [""], + search: "", + subscriberIds: [""], +}; +``` ## Fields diff --git a/docs/models/operations/orderby.md b/docs/models/operations/orderby.md index 248d6715..2b380e52 100644 --- a/docs/models/operations/orderby.md +++ b/docs/models/operations/orderby.md @@ -2,10 +2,16 @@ Direction of the sorting query param +## Example Usage + +```typescript +import { OrderBy } from "@novu/api/models/operations"; + +let value: OrderBy = "DESC"; +``` ## Values -| Name | Value | -| ------ | ------ | -| `Asc` | ASC | -| `Desc` | DESC | \ No newline at end of file +```typescript +"ASC" | "DESC" +``` \ No newline at end of file diff --git a/docs/models/operations/organizationcontrollerremoverequest.md b/docs/models/operations/organizationcontrollerremoverequest.md deleted file mode 100644 index a605bc91..00000000 --- a/docs/models/operations/organizationcontrollerremoverequest.md +++ /dev/null @@ -1,8 +0,0 @@ -# OrganizationControllerRemoveRequest - - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `memberId` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/parameter.md b/docs/models/operations/parameter.md index b74e3eb8..b05e3f36 100644 --- a/docs/models/operations/parameter.md +++ b/docs/models/operations/parameter.md @@ -2,10 +2,16 @@ the preferences level to be retrieved( Subscriber / Topic) +## Example Usage + +```typescript +import { Parameter } from "@novu/api/models/operations"; + +let value: Parameter = "Topic"; +``` ## Values -| Name | Value | -| ------------ | ------------ | -| `Subscriber` | Subscriber | -| `Topic` | Topic | \ No newline at end of file +```typescript +"Subscriber" | "Topic" +``` \ No newline at end of file diff --git a/docs/models/operations/queryparamchannel.md b/docs/models/operations/queryparamchannel.md index 35e6c229..9aefd8c7 100644 --- a/docs/models/operations/queryparamchannel.md +++ b/docs/models/operations/queryparamchannel.md @@ -1,12 +1,15 @@ # QueryParamChannel +## Example Usage + +```typescript +import { QueryParamChannel } from "@novu/api/models/operations"; + +let value: QueryParamChannel = "in_app"; +``` ## Values -| Name | Value | -| ------- | ------- | -| `InApp` | in_app | -| `Email` | email | -| `Sms` | sms | -| `Chat` | chat | -| `Push` | push | \ No newline at end of file +```typescript +"in_app" | "email" | "sms" | "chat" | "push" +``` \ No newline at end of file diff --git a/docs/models/operations/subscriberscontrollerchataccessoauthrequest.md b/docs/models/operations/subscriberscontrollerchataccessoauthrequest.md index 36164265..86769f60 100644 --- a/docs/models/operations/subscriberscontrollerchataccessoauthrequest.md +++ b/docs/models/operations/subscriberscontrollerchataccessoauthrequest.md @@ -1,12 +1,24 @@ # SubscribersControllerChatAccessOauthRequest +## Example Usage + +```typescript +import { SubscribersControllerChatAccessOauthRequest } from "@novu/api/models/operations"; + +let value: SubscribersControllerChatAccessOauthRequest = { + subscriberId: "", + providerId: "", + hmacHash: "", + environmentId: "", +}; +``` ## Fields | Field | Type | Required | Description | | ----------------------- | ----------------------- | ----------------------- | ----------------------- | | `subscriberId` | *string* | :heavy_check_mark: | N/A | -| `providerId` | *string* | :heavy_check_mark: | N/A | +| `providerId` | *any* | :heavy_check_mark: | N/A | | `hmacHash` | *string* | :heavy_check_mark: | N/A | | `environmentId` | *string* | :heavy_check_mark: | N/A | | `integrationIdentifier` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/subscriberscontrollerchatoauthcallbackrequest.md b/docs/models/operations/subscriberscontrollerchatoauthcallbackrequest.md index c7e1b57f..a5f089f1 100644 --- a/docs/models/operations/subscriberscontrollerchatoauthcallbackrequest.md +++ b/docs/models/operations/subscriberscontrollerchatoauthcallbackrequest.md @@ -1,12 +1,25 @@ # SubscribersControllerChatOauthCallbackRequest +## Example Usage + +```typescript +import { SubscribersControllerChatOauthCallbackRequest } from "@novu/api/models/operations"; + +let value: SubscribersControllerChatOauthCallbackRequest = { + subscriberId: "", + providerId: "", + code: "", + hmacHash: "", + environmentId: "", +}; +``` ## Fields | Field | Type | Required | Description | | ----------------------- | ----------------------- | ----------------------- | ----------------------- | | `subscriberId` | *string* | :heavy_check_mark: | N/A | -| `providerId` | *string* | :heavy_check_mark: | N/A | +| `providerId` | *any* | :heavy_check_mark: | N/A | | `code` | *string* | :heavy_check_mark: | N/A | | `hmacHash` | *string* | :heavy_check_mark: | N/A | | `environmentId` | *string* | :heavy_check_mark: | N/A | diff --git a/docs/models/operations/subscriberscontrollerchatoauthcallbackresponsebody.md b/docs/models/operations/subscriberscontrollerchatoauthcallbackresponsebody.md index 7f046d12..9476de24 100644 --- a/docs/models/operations/subscriberscontrollerchatoauthcallbackresponsebody.md +++ b/docs/models/operations/subscriberscontrollerchatoauthcallbackresponsebody.md @@ -1,5 +1,12 @@ # SubscribersControllerChatOauthCallbackResponseBody +## Example Usage + +```typescript +import { SubscribersControllerChatOauthCallbackResponseBody } from "@novu/api/models/operations"; + +let value: SubscribersControllerChatOauthCallbackResponseBody = {}; +``` ## Fields diff --git a/docs/models/operations/subscriberscontrollerdeletesubscribercredentialsrequest.md b/docs/models/operations/subscriberscontrollerdeletesubscribercredentialsrequest.md index b2eaa410..de8d020a 100644 --- a/docs/models/operations/subscriberscontrollerdeletesubscribercredentialsrequest.md +++ b/docs/models/operations/subscriberscontrollerdeletesubscribercredentialsrequest.md @@ -1,5 +1,15 @@ # SubscribersControllerDeleteSubscriberCredentialsRequest +## Example Usage + +```typescript +import { SubscribersControllerDeleteSubscriberCredentialsRequest } from "@novu/api/models/operations"; + +let value: SubscribersControllerDeleteSubscriberCredentialsRequest = { + subscriberId: "", + providerId: "", +}; +``` ## Fields diff --git a/docs/models/operations/subscriberscontrollergetnotificationsfeedrequest.md b/docs/models/operations/subscriberscontrollergetnotificationsfeedrequest.md index 95617cc4..d91b5962 100644 --- a/docs/models/operations/subscriberscontrollergetnotificationsfeedrequest.md +++ b/docs/models/operations/subscriberscontrollergetnotificationsfeedrequest.md @@ -1,5 +1,16 @@ # SubscribersControllerGetNotificationsFeedRequest +## Example Usage + +```typescript +import { SubscribersControllerGetNotificationsFeedRequest } from "@novu/api/models/operations"; + +let value: SubscribersControllerGetNotificationsFeedRequest = { + subscriberId: "", + payload: + "btoa(JSON.stringify({ foo: 123 })) results in base64 encoded string like eyJmb28iOjEyM30=", +}; +``` ## Fields diff --git a/docs/models/operations/subscriberscontrollergetnotificationsfeedresponsebody.md b/docs/models/operations/subscriberscontrollergetnotificationsfeedresponsebody.md index a48b5aeb..fb6fc3cc 100644 --- a/docs/models/operations/subscriberscontrollergetnotificationsfeedresponsebody.md +++ b/docs/models/operations/subscriberscontrollergetnotificationsfeedresponsebody.md @@ -1,5 +1,24 @@ # SubscribersControllerGetNotificationsFeedResponseBody +## Example Usage + +```typescript +import { SubscribersControllerGetNotificationsFeedResponseBody } from "@novu/api/models/operations"; + +let value: SubscribersControllerGetNotificationsFeedResponseBody = { + data: [ + { + data: [""], + hasMore: false, + page: 6235.1, + pageSize: 1589.69, + }, + ], + hasMore: false, + page: 3380.07, + pageSize: 1103.75, +}; +``` ## Fields diff --git a/docs/models/operations/subscriberscontrollergetsubscriberpreferencebylevelrequest.md b/docs/models/operations/subscriberscontrollergetsubscriberpreferencebylevelrequest.md index e5643a99..ac94961f 100644 --- a/docs/models/operations/subscriberscontrollergetsubscriberpreferencebylevelrequest.md +++ b/docs/models/operations/subscriberscontrollergetsubscriberpreferencebylevelrequest.md @@ -1,5 +1,15 @@ # SubscribersControllerGetSubscriberPreferenceByLevelRequest +## Example Usage + +```typescript +import { SubscribersControllerGetSubscriberPreferenceByLevelRequest } from "@novu/api/models/operations"; + +let value: SubscribersControllerGetSubscriberPreferenceByLevelRequest = { + parameter: "Subscriber", + subscriberId: "", +}; +``` ## Fields diff --git a/docs/models/operations/subscriberscontrollergetsubscriberrequest.md b/docs/models/operations/subscriberscontrollergetsubscriberrequest.md index 735ed0ab..580d10aa 100644 --- a/docs/models/operations/subscriberscontrollergetsubscriberrequest.md +++ b/docs/models/operations/subscriberscontrollergetsubscriberrequest.md @@ -1,5 +1,14 @@ # SubscribersControllerGetSubscriberRequest +## Example Usage + +```typescript +import { SubscribersControllerGetSubscriberRequest } from "@novu/api/models/operations"; + +let value: SubscribersControllerGetSubscriberRequest = { + subscriberId: "", +}; +``` ## Fields diff --git a/docs/models/operations/subscriberscontrollergetunseencountrequest.md b/docs/models/operations/subscriberscontrollergetunseencountrequest.md index 08dda053..2acd8436 100644 --- a/docs/models/operations/subscriberscontrollergetunseencountrequest.md +++ b/docs/models/operations/subscriberscontrollergetunseencountrequest.md @@ -1,5 +1,16 @@ # SubscribersControllerGetUnseenCountRequest +## Example Usage + +```typescript +import { SubscribersControllerGetUnseenCountRequest } from "@novu/api/models/operations"; + +let value: SubscribersControllerGetUnseenCountRequest = { + seen: false, + subscriberId: "", + limit: 6747.52, +}; +``` ## Fields diff --git a/docs/models/operations/subscriberscontrollerlistsubscriberpreferencesrequest.md b/docs/models/operations/subscriberscontrollerlistsubscriberpreferencesrequest.md index a4221d7d..24588586 100644 --- a/docs/models/operations/subscriberscontrollerlistsubscriberpreferencesrequest.md +++ b/docs/models/operations/subscriberscontrollerlistsubscriberpreferencesrequest.md @@ -1,5 +1,14 @@ # SubscribersControllerListSubscriberPreferencesRequest +## Example Usage + +```typescript +import { SubscribersControllerListSubscriberPreferencesRequest } from "@novu/api/models/operations"; + +let value: SubscribersControllerListSubscriberPreferencesRequest = { + subscriberId: "", +}; +``` ## Fields diff --git a/docs/models/operations/subscriberscontrollerlistsubscribersrequest.md b/docs/models/operations/subscriberscontrollerlistsubscribersrequest.md index 6c7853de..b96e44f9 100644 --- a/docs/models/operations/subscriberscontrollerlistsubscribersrequest.md +++ b/docs/models/operations/subscriberscontrollerlistsubscribersrequest.md @@ -1,5 +1,12 @@ # SubscribersControllerListSubscribersRequest +## Example Usage + +```typescript +import { SubscribersControllerListSubscribersRequest } from "@novu/api/models/operations"; + +let value: SubscribersControllerListSubscribersRequest = {}; +``` ## Fields diff --git a/docs/models/operations/subscriberscontrollerlistsubscribersresponse.md b/docs/models/operations/subscriberscontrollerlistsubscribersresponse.md index ca8e8410..b56856fd 100644 --- a/docs/models/operations/subscriberscontrollerlistsubscribersresponse.md +++ b/docs/models/operations/subscriberscontrollerlistsubscribersresponse.md @@ -1,5 +1,28 @@ # SubscribersControllerListSubscribersResponse +## Example Usage + +```typescript +import { SubscribersControllerListSubscribersResponse } from "@novu/api/models/operations"; + +let value: SubscribersControllerListSubscribersResponse = { + result: { + data: [ + { + environmentId: "", + organizationId: "", + createdAt: "", + deleted: false, + subscriberId: "", + updatedAt: "", + }, + ], + hasMore: false, + page: 9953, + pageSize: 6531.08, + }, +}; +``` ## Fields diff --git a/docs/models/operations/subscriberscontrollerlistsubscribersresponsebody.md b/docs/models/operations/subscriberscontrollerlistsubscribersresponsebody.md index 3dd32484..accde6f1 100644 --- a/docs/models/operations/subscriberscontrollerlistsubscribersresponsebody.md +++ b/docs/models/operations/subscriberscontrollerlistsubscribersresponsebody.md @@ -1,5 +1,26 @@ # SubscribersControllerListSubscribersResponseBody +## Example Usage + +```typescript +import { SubscribersControllerListSubscribersResponseBody } from "@novu/api/models/operations"; + +let value: SubscribersControllerListSubscribersResponseBody = { + data: [ + { + environmentId: "", + organizationId: "", + createdAt: "", + deleted: false, + subscriberId: "", + updatedAt: "", + }, + ], + hasMore: false, + page: 6350.59, + pageSize: 1613.09, +}; +``` ## Fields diff --git a/docs/models/operations/subscriberscontrollermarkactionasseenrequest.md b/docs/models/operations/subscriberscontrollermarkactionasseenrequest.md index 1ef3aa57..625dbaf7 100644 --- a/docs/models/operations/subscriberscontrollermarkactionasseenrequest.md +++ b/docs/models/operations/subscriberscontrollermarkactionasseenrequest.md @@ -1,11 +1,25 @@ # SubscribersControllerMarkActionAsSeenRequest +## Example Usage + +```typescript +import { SubscribersControllerMarkActionAsSeenRequest } from "@novu/api/models/operations"; + +let value: SubscribersControllerMarkActionAsSeenRequest = { + messageId: "", + type: "", + subscriberId: "", + markMessageActionAsSeenDto: { + status: "pending", + }, +}; +``` ## Fields | Field | Type | Required | Description | | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | | `messageId` | *string* | :heavy_check_mark: | N/A | -| `type` | *string* | :heavy_check_mark: | N/A | +| `type` | *any* | :heavy_check_mark: | N/A | | `subscriberId` | *string* | :heavy_check_mark: | N/A | | `markMessageActionAsSeenDto` | [components.MarkMessageActionAsSeenDto](../../models/components/markmessageactionasseendto.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/subscriberscontrollermarkallunreadasreadrequest.md b/docs/models/operations/subscriberscontrollermarkallunreadasreadrequest.md index bfa7ef6c..740d08f0 100644 --- a/docs/models/operations/subscriberscontrollermarkallunreadasreadrequest.md +++ b/docs/models/operations/subscriberscontrollermarkallunreadasreadrequest.md @@ -1,5 +1,17 @@ # SubscribersControllerMarkAllUnreadAsReadRequest +## Example Usage + +```typescript +import { SubscribersControllerMarkAllUnreadAsReadRequest } from "@novu/api/models/operations"; + +let value: SubscribersControllerMarkAllUnreadAsReadRequest = { + subscriberId: "", + markAllMessageAsRequestDto: { + markAs: "seen", + }, +}; +``` ## Fields diff --git a/docs/models/operations/subscriberscontrollermarkmessagesasrequest.md b/docs/models/operations/subscriberscontrollermarkmessagesasrequest.md index 3a0d8a78..5e54cd40 100644 --- a/docs/models/operations/subscriberscontrollermarkmessagesasrequest.md +++ b/docs/models/operations/subscriberscontrollermarkmessagesasrequest.md @@ -1,5 +1,18 @@ # SubscribersControllerMarkMessagesAsRequest +## Example Usage + +```typescript +import { SubscribersControllerMarkMessagesAsRequest } from "@novu/api/models/operations"; + +let value: SubscribersControllerMarkMessagesAsRequest = { + subscriberId: "", + messageMarkAsRequestDto: { + markAs: "seen", + messageId: "", + }, +}; +``` ## Fields diff --git a/docs/models/operations/subscriberscontrollermodifysubscriberchannelrequest.md b/docs/models/operations/subscriberscontrollermodifysubscriberchannelrequest.md index 6fd22fd2..f60209c5 100644 --- a/docs/models/operations/subscriberscontrollermodifysubscriberchannelrequest.md +++ b/docs/models/operations/subscriberscontrollermodifysubscriberchannelrequest.md @@ -1,5 +1,20 @@ # SubscribersControllerModifySubscriberChannelRequest +## Example Usage + +```typescript +import { SubscribersControllerModifySubscriberChannelRequest } from "@novu/api/models/operations"; + +let value: SubscribersControllerModifySubscriberChannelRequest = { + subscriberId: "", + updateSubscriberChannelRequestDto: { + credentials: { + webhookUrl: "", + }, + providerId: 5818.5, + }, +}; +``` ## Fields diff --git a/docs/models/operations/subscriberscontrollerremovesubscriberrequest.md b/docs/models/operations/subscriberscontrollerremovesubscriberrequest.md index 24bd849b..e2c61b95 100644 --- a/docs/models/operations/subscriberscontrollerremovesubscriberrequest.md +++ b/docs/models/operations/subscriberscontrollerremovesubscriberrequest.md @@ -1,5 +1,14 @@ # SubscribersControllerRemoveSubscriberRequest +## Example Usage + +```typescript +import { SubscribersControllerRemoveSubscriberRequest } from "@novu/api/models/operations"; + +let value: SubscribersControllerRemoveSubscriberRequest = { + subscriberId: "", +}; +``` ## Fields diff --git a/docs/models/operations/subscriberscontrollerupdatesubscriberchannelrequest.md b/docs/models/operations/subscriberscontrollerupdatesubscriberchannelrequest.md index 34e299fe..621047c3 100644 --- a/docs/models/operations/subscriberscontrollerupdatesubscriberchannelrequest.md +++ b/docs/models/operations/subscriberscontrollerupdatesubscriberchannelrequest.md @@ -1,5 +1,20 @@ # SubscribersControllerUpdateSubscriberChannelRequest +## Example Usage + +```typescript +import { SubscribersControllerUpdateSubscriberChannelRequest } from "@novu/api/models/operations"; + +let value: SubscribersControllerUpdateSubscriberChannelRequest = { + subscriberId: "", + updateSubscriberChannelRequestDto: { + credentials: { + webhookUrl: "", + }, + providerId: 2532.91, + }, +}; +``` ## Fields diff --git a/docs/models/operations/subscriberscontrollerupdatesubscriberglobalpreferencesrequest.md b/docs/models/operations/subscriberscontrollerupdatesubscriberglobalpreferencesrequest.md index a40e5d9d..96513c5b 100644 --- a/docs/models/operations/subscriberscontrollerupdatesubscriberglobalpreferencesrequest.md +++ b/docs/models/operations/subscriberscontrollerupdatesubscriberglobalpreferencesrequest.md @@ -1,5 +1,15 @@ # SubscribersControllerUpdateSubscriberGlobalPreferencesRequest +## Example Usage + +```typescript +import { SubscribersControllerUpdateSubscriberGlobalPreferencesRequest } from "@novu/api/models/operations"; + +let value: SubscribersControllerUpdateSubscriberGlobalPreferencesRequest = { + subscriberId: "", + updateSubscriberGlobalPreferencesRequestDto: {}, +}; +``` ## Fields diff --git a/docs/models/operations/subscriberscontrollerupdatesubscriberonlineflagrequest.md b/docs/models/operations/subscriberscontrollerupdatesubscriberonlineflagrequest.md index 764e4f66..1918813e 100644 --- a/docs/models/operations/subscriberscontrollerupdatesubscriberonlineflagrequest.md +++ b/docs/models/operations/subscriberscontrollerupdatesubscriberonlineflagrequest.md @@ -1,5 +1,17 @@ # SubscribersControllerUpdateSubscriberOnlineFlagRequest +## Example Usage + +```typescript +import { SubscribersControllerUpdateSubscriberOnlineFlagRequest } from "@novu/api/models/operations"; + +let value: SubscribersControllerUpdateSubscriberOnlineFlagRequest = { + subscriberId: "", + updateSubscriberOnlineFlagRequestDto: { + isOnline: false, + }, +}; +``` ## Fields diff --git a/docs/models/operations/subscriberscontrollerupdatesubscriberpreferencerequest.md b/docs/models/operations/subscriberscontrollerupdatesubscriberpreferencerequest.md index 1b031817..a1f6b87b 100644 --- a/docs/models/operations/subscriberscontrollerupdatesubscriberpreferencerequest.md +++ b/docs/models/operations/subscriberscontrollerupdatesubscriberpreferencerequest.md @@ -1,5 +1,16 @@ # SubscribersControllerUpdateSubscriberPreferenceRequest +## Example Usage + +```typescript +import { SubscribersControllerUpdateSubscriberPreferenceRequest } from "@novu/api/models/operations"; + +let value: SubscribersControllerUpdateSubscriberPreferenceRequest = { + subscriberId: "", + parameter: "", + updateSubscriberPreferenceRequestDto: {}, +}; +``` ## Fields diff --git a/docs/models/operations/subscriberscontrollerupdatesubscriberrequest.md b/docs/models/operations/subscriberscontrollerupdatesubscriberrequest.md index bdcc397f..2fd3a73a 100644 --- a/docs/models/operations/subscriberscontrollerupdatesubscriberrequest.md +++ b/docs/models/operations/subscriberscontrollerupdatesubscriberrequest.md @@ -1,5 +1,15 @@ # SubscribersControllerUpdateSubscriberRequest +## Example Usage + +```typescript +import { SubscribersControllerUpdateSubscriberRequest } from "@novu/api/models/operations"; + +let value: SubscribersControllerUpdateSubscriberRequest = { + subscriberId: "", + updateSubscriberRequestDto: {}, +}; +``` ## Fields diff --git a/docs/models/operations/tenantcontrollergettenantbyidrequest.md b/docs/models/operations/tenantcontrollergettenantbyidrequest.md index 5cd85a1c..ac956fb2 100644 --- a/docs/models/operations/tenantcontrollergettenantbyidrequest.md +++ b/docs/models/operations/tenantcontrollergettenantbyidrequest.md @@ -1,5 +1,14 @@ # TenantControllerGetTenantByIdRequest +## Example Usage + +```typescript +import { TenantControllerGetTenantByIdRequest } from "@novu/api/models/operations"; + +let value: TenantControllerGetTenantByIdRequest = { + identifier: "", +}; +``` ## Fields diff --git a/docs/models/operations/tenantcontrollerlisttenantsrequest.md b/docs/models/operations/tenantcontrollerlisttenantsrequest.md index 7875a138..bdd36c71 100644 --- a/docs/models/operations/tenantcontrollerlisttenantsrequest.md +++ b/docs/models/operations/tenantcontrollerlisttenantsrequest.md @@ -1,5 +1,12 @@ # TenantControllerListTenantsRequest +## Example Usage + +```typescript +import { TenantControllerListTenantsRequest } from "@novu/api/models/operations"; + +let value: TenantControllerListTenantsRequest = {}; +``` ## Fields diff --git a/docs/models/operations/tenantcontrollerlisttenantsresponse.md b/docs/models/operations/tenantcontrollerlisttenantsresponse.md index 969fb64c..9c54d368 100644 --- a/docs/models/operations/tenantcontrollerlisttenantsresponse.md +++ b/docs/models/operations/tenantcontrollerlisttenantsresponse.md @@ -1,5 +1,27 @@ # TenantControllerListTenantsResponse +## Example Usage + +```typescript +import { TenantControllerListTenantsResponse } from "@novu/api/models/operations"; + +let value: TenantControllerListTenantsResponse = { + result: { + data: [ + { + environmentId: "", + id: "", + createdAt: "", + identifier: "", + updatedAt: "", + }, + ], + hasMore: false, + page: 1965.82, + pageSize: 9495.72, + }, +}; +``` ## Fields diff --git a/docs/models/operations/tenantcontrollerlisttenantsresponsebody.md b/docs/models/operations/tenantcontrollerlisttenantsresponsebody.md index 2238c6c4..43d3f54b 100644 --- a/docs/models/operations/tenantcontrollerlisttenantsresponsebody.md +++ b/docs/models/operations/tenantcontrollerlisttenantsresponsebody.md @@ -1,5 +1,25 @@ # TenantControllerListTenantsResponseBody +## Example Usage + +```typescript +import { TenantControllerListTenantsResponseBody } from "@novu/api/models/operations"; + +let value: TenantControllerListTenantsResponseBody = { + data: [ + { + environmentId: "", + id: "", + createdAt: "", + identifier: "", + updatedAt: "", + }, + ], + hasMore: false, + page: 1381.83, + pageSize: 7783.46, +}; +``` ## Fields diff --git a/docs/models/operations/tenantcontrollerremovetenantrequest.md b/docs/models/operations/tenantcontrollerremovetenantrequest.md index 5096003c..eaf07da3 100644 --- a/docs/models/operations/tenantcontrollerremovetenantrequest.md +++ b/docs/models/operations/tenantcontrollerremovetenantrequest.md @@ -1,5 +1,14 @@ # TenantControllerRemoveTenantRequest +## Example Usage + +```typescript +import { TenantControllerRemoveTenantRequest } from "@novu/api/models/operations"; + +let value: TenantControllerRemoveTenantRequest = { + identifier: "", +}; +``` ## Fields diff --git a/docs/models/operations/tenantcontrollerupdatetenantrequest.md b/docs/models/operations/tenantcontrollerupdatetenantrequest.md index 9df8de82..625191ad 100644 --- a/docs/models/operations/tenantcontrollerupdatetenantrequest.md +++ b/docs/models/operations/tenantcontrollerupdatetenantrequest.md @@ -1,5 +1,15 @@ # TenantControllerUpdateTenantRequest +## Example Usage + +```typescript +import { TenantControllerUpdateTenantRequest } from "@novu/api/models/operations"; + +let value: TenantControllerUpdateTenantRequest = { + identifier: "", + updateTenantRequestDto: {}, +}; +``` ## Fields diff --git a/docs/models/operations/topicscontrolleraddsubscribersrequest.md b/docs/models/operations/topicscontrolleraddsubscribersrequest.md index 9ce7e56d..bac4e298 100644 --- a/docs/models/operations/topicscontrolleraddsubscribersrequest.md +++ b/docs/models/operations/topicscontrolleraddsubscribersrequest.md @@ -1,9 +1,21 @@ # TopicsControllerAddSubscribersRequest +## Example Usage + +```typescript +import { TopicsControllerAddSubscribersRequest } from "@novu/api/models/operations"; + +let value: TopicsControllerAddSubscribersRequest = { + topicKey: "", + addSubscribersRequestDto: { + subscribers: [""], + }, +}; +``` ## Fields | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `topicKey` | *string* | :heavy_check_mark: | N/A | +| `topicKey` | *string* | :heavy_check_mark: | The topic key | | `addSubscribersRequestDto` | [components.AddSubscribersRequestDto](../../models/components/addsubscribersrequestdto.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/topicscontrollerdeletetopicrequest.md b/docs/models/operations/topicscontrollerdeletetopicrequest.md index e538418a..bb852cb5 100644 --- a/docs/models/operations/topicscontrollerdeletetopicrequest.md +++ b/docs/models/operations/topicscontrollerdeletetopicrequest.md @@ -1,8 +1,17 @@ # TopicsControllerDeleteTopicRequest +## Example Usage + +```typescript +import { TopicsControllerDeleteTopicRequest } from "@novu/api/models/operations"; + +let value: TopicsControllerDeleteTopicRequest = { + topicKey: "", +}; +``` ## Fields | Field | Type | Required | Description | | ------------------ | ------------------ | ------------------ | ------------------ | -| `topicKey` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file +| `topicKey` | *string* | :heavy_check_mark: | The topic key | \ No newline at end of file diff --git a/docs/models/operations/topicscontrollergettopicrequest.md b/docs/models/operations/topicscontrollergettopicrequest.md index 06580b54..d2598bc6 100644 --- a/docs/models/operations/topicscontrollergettopicrequest.md +++ b/docs/models/operations/topicscontrollergettopicrequest.md @@ -1,8 +1,17 @@ # TopicsControllerGetTopicRequest +## Example Usage + +```typescript +import { TopicsControllerGetTopicRequest } from "@novu/api/models/operations"; + +let value: TopicsControllerGetTopicRequest = { + topicKey: "", +}; +``` ## Fields | Field | Type | Required | Description | | ------------------ | ------------------ | ------------------ | ------------------ | -| `topicKey` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file +| `topicKey` | *string* | :heavy_check_mark: | The topic key | \ No newline at end of file diff --git a/docs/models/operations/topicscontrollergettopicsubscriberrequest.md b/docs/models/operations/topicscontrollergettopicsubscriberrequest.md index 5719d72a..4820002d 100644 --- a/docs/models/operations/topicscontrollergettopicsubscriberrequest.md +++ b/docs/models/operations/topicscontrollergettopicsubscriberrequest.md @@ -1,9 +1,19 @@ # TopicsControllerGetTopicSubscriberRequest +## Example Usage + +```typescript +import { TopicsControllerGetTopicSubscriberRequest } from "@novu/api/models/operations"; + +let value: TopicsControllerGetTopicSubscriberRequest = { + externalSubscriberId: "", + topicKey: "", +}; +``` ## Fields -| Field | Type | Required | Description | -| ---------------------- | ---------------------- | ---------------------- | ---------------------- | -| `topicKey` | *string* | :heavy_check_mark: | N/A | -| `externalSubscriberId` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------- | -------------------------- | -------------------------- | -------------------------- | +| `externalSubscriberId` | *string* | :heavy_check_mark: | The external subscriber id | +| `topicKey` | *string* | :heavy_check_mark: | The topic key | \ No newline at end of file diff --git a/docs/models/operations/topicscontrollerlisttopicsrequest.md b/docs/models/operations/topicscontrollerlisttopicsrequest.md index 47a38771..ef798d99 100644 --- a/docs/models/operations/topicscontrollerlisttopicsrequest.md +++ b/docs/models/operations/topicscontrollerlisttopicsrequest.md @@ -1,5 +1,12 @@ # TopicsControllerListTopicsRequest +## Example Usage + +```typescript +import { TopicsControllerListTopicsRequest } from "@novu/api/models/operations"; + +let value: TopicsControllerListTopicsRequest = {}; +``` ## Fields diff --git a/docs/models/operations/topicscontrollerremovesubscribersrequest.md b/docs/models/operations/topicscontrollerremovesubscribersrequest.md index 3c4b75da..339dc820 100644 --- a/docs/models/operations/topicscontrollerremovesubscribersrequest.md +++ b/docs/models/operations/topicscontrollerremovesubscribersrequest.md @@ -1,9 +1,21 @@ # TopicsControllerRemoveSubscribersRequest +## Example Usage + +```typescript +import { TopicsControllerRemoveSubscribersRequest } from "@novu/api/models/operations"; + +let value: TopicsControllerRemoveSubscribersRequest = { + topicKey: "", + removeSubscribersRequestDto: { + subscribers: [""], + }, +}; +``` ## Fields | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | -| `topicKey` | *string* | :heavy_check_mark: | N/A | +| `topicKey` | *string* | :heavy_check_mark: | The topic key | | `removeSubscribersRequestDto` | [components.RemoveSubscribersRequestDto](../../models/components/removesubscribersrequestdto.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/topicscontrollerrenametopicrequest.md b/docs/models/operations/topicscontrollerrenametopicrequest.md index 376f257a..6ba308ab 100644 --- a/docs/models/operations/topicscontrollerrenametopicrequest.md +++ b/docs/models/operations/topicscontrollerrenametopicrequest.md @@ -1,9 +1,21 @@ # TopicsControllerRenameTopicRequest +## Example Usage + +```typescript +import { TopicsControllerRenameTopicRequest } from "@novu/api/models/operations"; + +let value: TopicsControllerRenameTopicRequest = { + topicKey: "", + renameTopicRequestDto: { + name: "", + }, +}; +``` ## Fields | Field | Type | Required | Description | | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | -| `topicKey` | *string* | :heavy_check_mark: | N/A | +| `topicKey` | *string* | :heavy_check_mark: | The topic key | | `renameTopicRequestDto` | [components.RenameTopicRequestDto](../../models/components/renametopicrequestdto.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/workflowcontrollerdeleteworkflowbyidrequest.md b/docs/models/operations/workflowcontrollerdeleteworkflowbyidrequest.md index 538027c7..cd20c8b4 100644 --- a/docs/models/operations/workflowcontrollerdeleteworkflowbyidrequest.md +++ b/docs/models/operations/workflowcontrollerdeleteworkflowbyidrequest.md @@ -1,5 +1,14 @@ # WorkflowControllerDeleteWorkflowByIdRequest +## Example Usage + +```typescript +import { WorkflowControllerDeleteWorkflowByIdRequest } from "@novu/api/models/operations"; + +let value: WorkflowControllerDeleteWorkflowByIdRequest = { + workflowId: "", +}; +``` ## Fields diff --git a/docs/models/operations/workflowcontrollergetworkflowbyidrequest.md b/docs/models/operations/workflowcontrollergetworkflowbyidrequest.md index 1f077159..efd0872b 100644 --- a/docs/models/operations/workflowcontrollergetworkflowbyidrequest.md +++ b/docs/models/operations/workflowcontrollergetworkflowbyidrequest.md @@ -1,5 +1,14 @@ # WorkflowControllerGetWorkflowByIdRequest +## Example Usage + +```typescript +import { WorkflowControllerGetWorkflowByIdRequest } from "@novu/api/models/operations"; + +let value: WorkflowControllerGetWorkflowByIdRequest = { + workflowId: "", +}; +``` ## Fields diff --git a/docs/models/operations/workflowcontrollerlistworkflowsrequest.md b/docs/models/operations/workflowcontrollerlistworkflowsrequest.md index 5f447ca1..92891755 100644 --- a/docs/models/operations/workflowcontrollerlistworkflowsrequest.md +++ b/docs/models/operations/workflowcontrollerlistworkflowsrequest.md @@ -1,5 +1,12 @@ # WorkflowControllerListWorkflowsRequest +## Example Usage + +```typescript +import { WorkflowControllerListWorkflowsRequest } from "@novu/api/models/operations"; + +let value: WorkflowControllerListWorkflowsRequest = {}; +``` ## Fields diff --git a/docs/models/operations/workflowcontrollerupdateactivestatusrequest.md b/docs/models/operations/workflowcontrollerupdateactivestatusrequest.md index 9f7d758e..0e81bdd5 100644 --- a/docs/models/operations/workflowcontrollerupdateactivestatusrequest.md +++ b/docs/models/operations/workflowcontrollerupdateactivestatusrequest.md @@ -1,5 +1,17 @@ # WorkflowControllerUpdateActiveStatusRequest +## Example Usage + +```typescript +import { WorkflowControllerUpdateActiveStatusRequest } from "@novu/api/models/operations"; + +let value: WorkflowControllerUpdateActiveStatusRequest = { + workflowId: "", + changeWorkflowStatusRequestDto: { + active: false, + }, +}; +``` ## Fields diff --git a/docs/models/operations/workflowcontrollerupdateworkflowbyidrequest.md b/docs/models/operations/workflowcontrollerupdateworkflowbyidrequest.md index 51199fc0..51e8c4e2 100644 --- a/docs/models/operations/workflowcontrollerupdateworkflowbyidrequest.md +++ b/docs/models/operations/workflowcontrollerupdateworkflowbyidrequest.md @@ -1,5 +1,18 @@ # WorkflowControllerUpdateWorkflowByIdRequest +## Example Usage + +```typescript +import { WorkflowControllerUpdateWorkflowByIdRequest } from "@novu/api/models/operations"; + +let value: WorkflowControllerUpdateWorkflowByIdRequest = { + workflowId: "", + updateWorkflowRequestDto: { + name: "", + notificationGroupId: "", + }, +}; +``` ## Fields diff --git a/docs/sdks/apikeys/README.md b/docs/sdks/apikeys/README.md index c080ab4f..35ddd53b 100644 --- a/docs/sdks/apikeys/README.md +++ b/docs/sdks/apikeys/README.md @@ -1,10 +1,11 @@ # ApiKeys (*environments.apiKeys*) +## Overview + ### Available Operations * [list](#list) - Get api keys -* [regenerate](#regenerate) - Regenerate api keys ## list @@ -29,39 +30,28 @@ async function run() { run(); ``` -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - +### Standalone function -### Response - -**Promise\<[components.ApiKey[]](../../models/.md)\>** -### Errors - -| Error Object | Status Code | Content Type | -| --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - -## regenerate - -Regenerate api keys - -### Example Usage +The standalone function version of this method: ```typescript -import { Novu } from "@novu/api"; +import { NovuCore } from "@novu/api/core.js"; +import { environmentsApiKeysList } from "@novu/api/funcs/environmentsApiKeysList.js"; -const novu = new Novu({ +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ apiKey: "", }); async function run() { - const result = await novu.environments.apiKeys.regenerate(); + const res = await environmentsApiKeysList(novu); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; // Handle the result console.log(result) @@ -78,10 +68,10 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.ApiKey[]](../../models/.md)\>** + ### Errors | Error Object | Status Code | Content Type | diff --git a/docs/sdks/authentication/README.md b/docs/sdks/authentication/README.md index 23d1a4dc..ffaf21ba 100644 --- a/docs/sdks/authentication/README.md +++ b/docs/sdks/authentication/README.md @@ -1,6 +1,8 @@ # Authentication (*subscribers.authentication*) +## Overview + ### Available Operations * [chatAccessOauth](#chataccessoauth) - Handle chat oauth @@ -28,6 +30,40 @@ async function run() { }); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { subscribersAuthenticationChatAccessOauth } from "@novu/api/funcs/subscribersAuthenticationChatAccessOauth.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await subscribersAuthenticationChatAccessOauth(novu, { + subscriberId: "", + providerId: "", + hmacHash: "", + environmentId: "", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + } run(); @@ -42,16 +78,17 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## chatAccessOauthCallBack Handle providers oauth redirect @@ -81,6 +118,42 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { subscribersAuthenticationChatAccessOauthCallBack } from "@novu/api/funcs/subscribersAuthenticationChatAccessOauthCallBack.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await subscribersAuthenticationChatAccessOauthCallBack(novu, { + subscriberId: "", + providerId: "", + code: "", + hmacHash: "", + environmentId: "", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -90,10 +163,10 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[operations.SubscribersControllerChatOauthCallbackResponseBody](../../models/operations/subscriberscontrollerchatoauthcallbackresponsebody.md)\>** + ### Errors | Error Object | Status Code | Content Type | diff --git a/docs/sdks/branding/README.md b/docs/sdks/branding/README.md deleted file mode 100644 index 4319d9c3..00000000 --- a/docs/sdks/branding/README.md +++ /dev/null @@ -1,53 +0,0 @@ -# Branding -(*organizations.branding*) - -### Available Operations - -* [update](#update) - Update organization branding details - -## update - -Update organization branding details - -### Example Usage - -```typescript -import { Novu } from "@novu/api"; - -const novu = new Novu({ - apiKey: "", -}); - -async function run() { - const result = await novu.organizations.branding.update({ - color: "fuchsia", - contentBackground: "", - fontColor: "", - logo: "", - }); - - // Handle the result - console.log(result) -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [components.UpdateBrandingDetailsDto](../../models/components/updatebrandingdetailsdto.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - - -### Response - -**Promise\<[components.OrganizationBrandingResponseDto](../../models/components/organizationbrandingresponsedto.md)\>** -### Errors - -| Error Object | Status Code | Content Type | -| --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/changes/README.md b/docs/sdks/changes/README.md index 7eae6f9f..cb800114 100644 --- a/docs/sdks/changes/README.md +++ b/docs/sdks/changes/README.md @@ -4,8 +4,8 @@ ## Overview Changes represent a change in state of an environment. They are analagous to a pending pull request in git, enabling you to test changes before they are applied to your environment and atomically apply them when you are ready. - + ### Available Operations * [apply](#apply) - Apply change @@ -36,6 +36,36 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { changesApply } from "@novu/api/funcs/changesApply.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await changesApply(novu, ""); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -45,16 +75,17 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.ChangeResponseDto[]](../../models/.md)\>** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## applyBulk Apply changes @@ -82,6 +113,40 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { changesApplyBulk } from "@novu/api/funcs/changesApplyBulk.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await changesApplyBulk(novu, { + changeIds: [ + "", + ], + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -91,16 +156,17 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.ChangeResponseDto[]](../../models/.md)\>** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## count Get changes count @@ -124,6 +190,36 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { changesCount } from "@novu/api/funcs/changesCount.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await changesCount(novu); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -132,16 +228,17 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.DataNumberDto](../../models/components/datanumberdto.md)\>** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## retrieve Get changes @@ -167,6 +264,38 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { changesRetrieve } from "@novu/api/funcs/changesRetrieve.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await changesRetrieve(novu, { + promoted: "false", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -176,10 +305,10 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.ChangesResponseDto](../../models/components/changesresponsedto.md)\>** + ### Errors | Error Object | Status Code | Content Type | diff --git a/docs/sdks/credentials/README.md b/docs/sdks/credentials/README.md index 3f7e981f..4b43129c 100644 --- a/docs/sdks/credentials/README.md +++ b/docs/sdks/credentials/README.md @@ -1,6 +1,8 @@ # Credentials (*subscribers.credentials*) +## Overview + ### Available Operations * [append](#append) - Modify subscriber credentials @@ -26,7 +28,7 @@ async function run() { credentials: { webhookUrl: "", }, - providerId: "zulip", + providerId: 3462.44, }); // Handle the result @@ -36,6 +38,41 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { subscribersCredentialsAppend } from "@novu/api/funcs/subscribersCredentialsAppend.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await subscribersCredentialsAppend(novu, "", { + credentials: { + webhookUrl: "", + }, + providerId: 5829.63, + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -46,16 +83,17 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.SubscriberResponseDto](../../models/components/subscriberresponsedto.md)\>** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## delete Delete subscriber credentials such as slack and expo tokens. @@ -73,6 +111,35 @@ async function run() { await novu.subscribers.credentials.delete("", ""); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { subscribersCredentialsDelete } from "@novu/api/funcs/subscribersCredentialsDelete.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await subscribersCredentialsDelete(novu, "", ""); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + } run(); @@ -88,16 +155,17 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## update Subscriber credentials associated to the delivery methods such as slack and push tokens. @@ -116,7 +184,7 @@ async function run() { credentials: { webhookUrl: "", }, - providerId: "pushpad", + providerId: 8574.78, }); // Handle the result @@ -126,6 +194,41 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { subscribersCredentialsUpdate } from "@novu/api/funcs/subscribersCredentialsUpdate.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await subscribersCredentialsUpdate(novu, "", { + credentials: { + webhookUrl: "", + }, + providerId: 5971.29, + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -136,10 +239,10 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.SubscriberResponseDto](../../models/components/subscriberresponsedto.md)\>** + ### Errors | Error Object | Status Code | Content Type | diff --git a/docs/sdks/environments/README.md b/docs/sdks/environments/README.md index ab1b9c50..fa6ac560 100644 --- a/docs/sdks/environments/README.md +++ b/docs/sdks/environments/README.md @@ -4,8 +4,8 @@ ## Overview Novu uses the concept of environments to ensure logical separation of your data and configuration. This means that subscribers, and preferences created in one environment are never accessible to another. - + ### Available Operations * [list](#list) - Get environments @@ -34,6 +34,36 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { environmentsList } from "@novu/api/funcs/environmentsList.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await environmentsList(novu); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -42,16 +72,17 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.EnvironmentResponseDto[]](../../models/.md)\>** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## retrieve Get current environment @@ -75,6 +106,36 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { environmentsRetrieve } from "@novu/api/funcs/environmentsRetrieve.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await environmentsRetrieve(novu); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -83,10 +144,10 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.EnvironmentResponseDto](../../models/components/environmentresponsedto.md)\>** + ### Errors | Error Object | Status Code | Content Type | diff --git a/docs/sdks/events/README.md b/docs/sdks/events/README.md deleted file mode 100644 index a46efbe2..00000000 --- a/docs/sdks/events/README.md +++ /dev/null @@ -1,164 +0,0 @@ -# Events -(*events*) - -## Overview - -Events represent a change in state of a subscriber. They are used to trigger workflows, and enable you to send notifications to subscribers based on their actions. - - -### Available Operations - -* [cancel](#cancel) - Cancel triggered event -* [triggerBroadcast](#triggerbroadcast) - Broadcast event to all -* [triggerBulk](#triggerbulk) - Bulk trigger event - -## cancel - - - Using a previously generated transactionId during the event trigger, - will cancel any active or pending workflows. This is useful to cancel active digests, delays etc... - - -### Example Usage - -```typescript -import { Novu } from "@novu/api"; - -const novu = new Novu({ - apiKey: "", -}); - -async function run() { - const result = await novu.events.cancel(""); - - // Handle the result - console.log(result) -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `transactionId` | *string* | :heavy_check_mark: | N/A | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - - -### Response - -**Promise\<[components.DataBooleanDto](../../models/components/databooleandto.md)\>** -### Errors - -| Error Object | Status Code | Content Type | -| --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - -## triggerBroadcast - -Trigger a broadcast event to all existing subscribers, could be used to send announcements, etc. - In the future could be used to trigger events to a subset of subscribers based on defined filters. - -### Example Usage - -```typescript -import { Novu } from "@novu/api"; - -const novu = new Novu({ - apiKey: "", -}); - -async function run() { - const result = await novu.events.triggerBroadcast({ - name: "", - overrides: {}, - payload: {}, - }); - - // Handle the result - console.log(result) -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [components.TriggerEventToAllRequestDto](../../models/components/triggereventtoallrequestdto.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - - -### Response - -**Promise\<[components.TriggerEventResponseDto](../../models/components/triggereventresponsedto.md)\>** -### Errors - -| Error Object | Status Code | Content Type | -| --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - -## triggerBulk - - - Using this endpoint you can trigger multiple events at once, to avoid multiple calls to the API. - The bulk API is limited to 100 events per request. - - -### Example Usage - -```typescript -import { Novu } from "@novu/api"; - -const novu = new Novu({ - apiKey: "", -}); - -async function run() { - const result = await novu.events.triggerBulk({ - events: [ - { - name: "workflow_identifier", - overrides: {}, - payload: {}, - to: [ - { - topicKey: "topic_key", - type: "Topic", - }, - ], - }, - ], - }); - - // Handle the result - console.log(result) -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [components.BulkTriggerEventDto](../../models/components/bulktriggereventdto.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - - -### Response - -**Promise\<[components.TriggerEventResponseDto[]](../../models/.md)\>** -### Errors - -| Error Object | Status Code | Content Type | -| --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/executiondetails/README.md b/docs/sdks/executiondetails/README.md index b83317d3..9d87719e 100644 --- a/docs/sdks/executiondetails/README.md +++ b/docs/sdks/executiondetails/README.md @@ -4,8 +4,8 @@ ## Overview Execution details are used to track the execution of a workflow. They provided detailed information on the execution of a workflow, including the status of each step, the input and output of each step, and the overall status of the execution. - + ### Available Operations * [retrieve](#retrieve) - Get execution details @@ -33,6 +33,36 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { executionDetailsRetrieve } from "@novu/api/funcs/executionDetailsRetrieve.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await executionDetailsRetrieve(novu, "", ""); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -43,10 +73,10 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.ExecutionDetailsResponseDto[]](../../models/.md)\>** + ### Errors | Error Object | Status Code | Content Type | diff --git a/docs/sdks/feeds/README.md b/docs/sdks/feeds/README.md index fcc75b1b..c6aac119 100644 --- a/docs/sdks/feeds/README.md +++ b/docs/sdks/feeds/README.md @@ -4,8 +4,8 @@ ## Overview Novu provides a notification activity feed that monitors every outgoing message associated with its relevant metadata. This can be used to monitor activity and discover potential issues with a specific provider or a channel type. - + ### Available Operations * [create](#create) - Create feed @@ -37,6 +37,38 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { feedsCreate } from "@novu/api/funcs/feedsCreate.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await feedsCreate(novu, { + name: "", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -46,16 +78,17 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.FeedResponseDto](../../models/components/feedresponsedto.md)\>** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## delete Delete feed @@ -79,6 +112,36 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { feedsDelete } from "@novu/api/funcs/feedsDelete.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await feedsDelete(novu, ""); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -88,16 +151,17 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.FeedResponseDto[]](../../models/.md)\>** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## retrieve Get feeds @@ -121,6 +185,36 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { feedsRetrieve } from "@novu/api/funcs/feedsRetrieve.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await feedsRetrieve(novu); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -129,10 +223,10 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.FeedResponseDto[]](../../models/.md)\>** + ### Errors | Error Object | Status Code | Content Type | diff --git a/docs/sdks/integrations/README.md b/docs/sdks/integrations/README.md index f5aaa464..672704a6 100644 --- a/docs/sdks/integrations/README.md +++ b/docs/sdks/integrations/README.md @@ -4,8 +4,8 @@ ## Overview With the help of the Integration Store, you can easily integrate your favorite delivery provider. During the runtime of the API, the Integrations Store is responsible for storing the configurations of all the providers. - + ### Available Operations * [create](#create) - Create integration @@ -41,6 +41,39 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { integrationsCreate } from "@novu/api/funcs/integrationsCreate.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await integrationsCreate(novu, { + channel: "chat", + providerId: "", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -50,16 +83,17 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.IntegrationResponseDto](../../models/components/integrationresponsedto.md)\>** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## delete Delete integration @@ -83,6 +117,36 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { integrationsDelete } from "@novu/api/funcs/integrationsDelete.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await integrationsDelete(novu, ""); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -92,16 +156,17 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.IntegrationResponseDto[]](../../models/.md)\>** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## list Return all the integrations the user has created for that organization. Review v.0.17.0 changelog for a breaking change @@ -125,6 +190,36 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { integrationsList } from "@novu/api/funcs/integrationsList.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await integrationsList(novu); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -133,16 +228,17 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.IntegrationResponseDto[]](../../models/.md)\>** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## listActive Return all the active integrations the user has created for that organization. Review v.0.17.0 changelog for a breaking change @@ -166,6 +262,36 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { integrationsListActive } from "@novu/api/funcs/integrationsListActive.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await integrationsListActive(novu); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -174,16 +300,17 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.IntegrationResponseDto[]](../../models/.md)\>** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## setAsPrimary Set integration as primary @@ -207,6 +334,36 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { integrationsSetAsPrimary } from "@novu/api/funcs/integrationsSetAsPrimary.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await integrationsSetAsPrimary(novu, ""); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -216,16 +373,17 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.IntegrationResponseDto](../../models/components/integrationresponsedto.md)\>** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## update Update integration @@ -249,6 +407,36 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { integrationsUpdate } from "@novu/api/funcs/integrationsUpdate.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await integrationsUpdate(novu, "", {}); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -259,10 +447,10 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.IntegrationResponseDto](../../models/components/integrationresponsedto.md)\>** + ### Errors | Error Object | Status Code | Content Type | diff --git a/docs/sdks/layouts/README.md b/docs/sdks/layouts/README.md index f311050e..af14baaa 100644 --- a/docs/sdks/layouts/README.md +++ b/docs/sdks/layouts/README.md @@ -4,8 +4,8 @@ ## Overview Novu allows the creation of layouts - a specific HTML design or structure to wrap content of email notifications. Layouts can be manipulated and assigned to new or existing workflows within the Novu platform, allowing users to create, manage, and assign these layouts to workflows, so they can be reused to structure the appearance of notifications sent through the platform. - + ### Available Operations * [create](#create) - Layout creation @@ -38,6 +38,36 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { layoutsCreate } from "@novu/api/funcs/layoutsCreate.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await layoutsCreate(novu); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -46,16 +76,17 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.CreateLayoutResponseDto](../../models/components/createlayoutresponsedto.md)\>** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## delete Execute a soft delete of a layout given a certain ID. @@ -73,6 +104,35 @@ async function run() { await novu.layouts.delete(""); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { layoutsDelete } from "@novu/api/funcs/layoutsDelete.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await layoutsDelete(novu, ""); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + } run(); @@ -82,21 +142,22 @@ run(); | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `layoutId` | *string* | :heavy_check_mark: | N/A | +| `layoutId` | *string* | :heavy_check_mark: | The layout id | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## list Returns a list of layouts that can be paginated using the `page` query parameter and filtered by the environment where it is executed from the organization the user belongs to. @@ -114,6 +175,35 @@ async function run() { await novu.layouts.list({}); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { layoutsList } from "@novu/api/funcs/layoutsList.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await layoutsList(novu, {}); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + } run(); @@ -128,16 +218,17 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## retrieve Get a layout by its ID @@ -161,25 +252,56 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { layoutsRetrieve } from "@novu/api/funcs/layoutsRetrieve.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await layoutsRetrieve(novu, ""); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `layoutId` | *string* | :heavy_check_mark: | N/A | +| `layoutId` | *string* | :heavy_check_mark: | The layout id | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.GetLayoutResponseDto](../../models/components/getlayoutresponsedto.md)\>** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## setAsDefault Sets the default layout for the environment and updates to non default to the existing default layout (if any). @@ -197,6 +319,35 @@ async function run() { await novu.layouts.setAsDefault(""); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { layoutsSetAsDefault } from "@novu/api/funcs/layoutsSetAsDefault.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await layoutsSetAsDefault(novu, ""); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + } run(); @@ -206,21 +357,22 @@ run(); | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `layoutId` | *string* | :heavy_check_mark: | N/A | +| `layoutId` | *string* | :heavy_check_mark: | The layout id | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## update Update the name, content and variables of a layout. Also change it to be default or no. @@ -246,20 +398,52 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { layoutsUpdate } from "@novu/api/funcs/layoutsUpdate.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await layoutsUpdate(novu, "", { + identifier: "", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `layoutId` | *string* | :heavy_check_mark: | N/A | +| `layoutId` | *string* | :heavy_check_mark: | The layout id | | `updateLayoutRequestDto` | [components.UpdateLayoutRequestDto](../../models/components/updatelayoutrequestdto.md) | :heavy_check_mark: | N/A | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.UpdateLayoutResponseDto](../../models/components/updatelayoutresponsedto.md)\>** + ### Errors | Error Object | Status Code | Content Type | diff --git a/docs/sdks/members/README.md b/docs/sdks/members/README.md deleted file mode 100644 index a2b00633..00000000 --- a/docs/sdks/members/README.md +++ /dev/null @@ -1,90 +0,0 @@ -# Members -(*organizations.members*) - -### Available Operations - -* [delete](#delete) - Remove a member from organization using memberId -* [list](#list) - Fetch all members of current organizations - -## delete - -Remove a member from organization using memberId - -### Example Usage - -```typescript -import { Novu } from "@novu/api"; - -const novu = new Novu({ - apiKey: "", -}); - -async function run() { - const result = await novu.organizations.members.delete(""); - - // Handle the result - console.log(result) -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `memberId` | *string* | :heavy_check_mark: | N/A | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - - -### Response - -**Promise\<[components.MemberResponseDto](../../models/components/memberresponsedto.md)\>** -### Errors - -| Error Object | Status Code | Content Type | -| --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - -## list - -Fetch all members of current organizations - -### Example Usage - -```typescript -import { Novu } from "@novu/api"; - -const novu = new Novu({ - apiKey: "", -}); - -async function run() { - const result = await novu.organizations.members.list(); - - // Handle the result - console.log(result) -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - - -### Response - -**Promise\<[components.MemberResponseDto[]](../../models/.md)\>** -### Errors - -| Error Object | Status Code | Content Type | -| --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/messages/README.md b/docs/sdks/messages/README.md index e3228975..438178bf 100644 --- a/docs/sdks/messages/README.md +++ b/docs/sdks/messages/README.md @@ -4,8 +4,8 @@ ## Overview A message in Novu represents a notification delivered to a recipient on a particular channel. Messages contain information about the request that triggered its delivery, a view of the data sent to the recipient, and a timeline of its lifecycle events. Learn more about messages. - + ### Available Operations * [delete](#delete) - Delete message @@ -35,6 +35,36 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { messagesDelete } from "@novu/api/funcs/messagesDelete.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await messagesDelete(novu, ""); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -44,16 +74,17 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.DeleteMessageResponseDto](../../models/components/deletemessageresponsedto.md)\>** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## deleteByTransactionId Deletes messages entity from the Novu platform using TransactionId of message @@ -68,7 +99,36 @@ const novu = new Novu({ }); async function run() { - await novu.messages.deleteByTransactionId("", "push"); + await novu.messages.deleteByTransactionId(""); + + +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { messagesDeleteByTransactionId } from "@novu/api/funcs/messagesDeleteByTransactionId.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await messagesDeleteByTransactionId(novu, ""); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; } @@ -86,16 +146,17 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## retrieve Returns a list of messages, could paginate using the `page` query parameter @@ -119,6 +180,36 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { messagesRetrieve } from "@novu/api/funcs/messagesRetrieve.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await messagesRetrieve(novu, {}); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -128,10 +219,10 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.ActivitiesResponseDto](../../models/components/activitiesresponsedto.md)\>** + ### Errors | Error Object | Status Code | Content Type | diff --git a/docs/sdks/notifications/README.md b/docs/sdks/notifications/README.md index 99e51a79..8753ad2a 100644 --- a/docs/sdks/notifications/README.md +++ b/docs/sdks/notifications/README.md @@ -1,6 +1,8 @@ # Notifications (*notifications*) +## Overview + ### Available Operations * [list](#list) - Get notifications @@ -43,6 +45,50 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { notificationsList } from "@novu/api/funcs/notificationsList.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await notificationsList(novu, { + channels: [ + "sms", + ], + templates: [ + "", + ], + emails: [ + "", + ], + search: "", + subscriberIds: [ + "", + ], + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -52,16 +98,17 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.ActivitiesResponseDto](../../models/components/activitiesresponsedto.md)\>** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## retrieve Get notification @@ -85,6 +132,36 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { notificationsRetrieve } from "@novu/api/funcs/notificationsRetrieve.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await notificationsRetrieve(novu, ""); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -94,10 +171,10 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.ActivityNotificationResponseDto](../../models/components/activitynotificationresponsedto.md)\>** + ### Errors | Error Object | Status Code | Content Type | diff --git a/docs/sdks/novu/README.md b/docs/sdks/novu/README.md index c70e6ac0..a44ef13e 100644 --- a/docs/sdks/novu/README.md +++ b/docs/sdks/novu/README.md @@ -1,15 +1,94 @@ # Novu SDK - ## Overview Novu API: Novu REST API. Please see https://docs.novu.co/api-reference for more details. Novu Documentation + ### Available Operations +* [cancel](#cancel) - Cancel triggered event * [trigger](#trigger) - Trigger event +* [triggerBroadcast](#triggerbroadcast) - Broadcast event to all +* [triggerBulk](#triggerbulk) - Bulk trigger event + +## cancel + + + Using a previously generated transactionId during the event trigger, + will cancel any active or pending workflows. This is useful to cancel active digests, delays etc... + + +### Example Usage + +```typescript +import { Novu } from "@novu/api"; + +const novu = new Novu({ + apiKey: "", +}); + +async function run() { + const result = await novu.cancel(""); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { cancel } from "@novu/api/funcs/cancel.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await cancel(novu, ""); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `transactionId` | *string* | :heavy_check_mark: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.DataBooleanDto](../../models/components/databooleandto.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| errors.SDKError | 4xx-5xx | */* | + ## trigger @@ -34,13 +113,53 @@ async function run() { overrides: {}, payload: {}, to: [ - { - topicKey: "topic_key", - type: "Topic", - }, + { + topicKey: "", + type: "Topic", + }, + ], + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { trigger } from "@novu/api/funcs/trigger.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await trigger(novu, { + name: "workflow_identifier", + overrides: {}, + payload: {}, + to: [ + { + topicKey: "", + type: "Topic", + }, ], }); + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + // Handle the result console.log(result) } @@ -57,10 +176,176 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | +### Response + +**Promise\<[components.TriggerEventResponseDto](../../models/components/triggereventresponsedto.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| errors.SDKError | 4xx-5xx | */* | + + +## triggerBroadcast + +Trigger a broadcast event to all existing subscribers, could be used to send announcements, etc. + In the future could be used to trigger events to a subset of subscribers based on defined filters. + +### Example Usage + +```typescript +import { Novu } from "@novu/api"; + +const novu = new Novu({ + apiKey: "", +}); + +async function run() { + const result = await novu.triggerBroadcast({ + name: "", + overrides: {}, + payload: {}, + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { triggerBroadcast } from "@novu/api/funcs/triggerBroadcast.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await triggerBroadcast(novu, { + name: "", + overrides: {}, + payload: {}, + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [components.TriggerEventToAllRequestDto](../../models/components/triggereventtoallrequestdto.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response **Promise\<[components.TriggerEventResponseDto](../../models/components/triggereventresponsedto.md)\>** + +### Errors + +| Error Object | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| errors.SDKError | 4xx-5xx | */* | + + +## triggerBulk + + + Using this endpoint you can trigger multiple events at once, to avoid multiple calls to the API. + The bulk API is limited to 100 events per request. + + +### Example Usage + +```typescript +import { Novu } from "@novu/api"; + +const novu = new Novu({ + apiKey: "", +}); + +async function run() { + const result = await novu.triggerBulk({ + events: [ + + ], + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { triggerBulk } from "@novu/api/funcs/triggerBulk.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await triggerBulk(novu, { + events: [ + + ], + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [components.BulkTriggerEventDto](../../models/components/bulktriggereventdto.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.TriggerEventResponseDto[]](../../models/.md)\>** + ### Errors | Error Object | Status Code | Content Type | diff --git a/docs/sdks/novumessages/README.md b/docs/sdks/novumessages/README.md index 37dfbc83..834fa8d1 100644 --- a/docs/sdks/novumessages/README.md +++ b/docs/sdks/novumessages/README.md @@ -1,6 +1,8 @@ # NovuMessages (*subscribers.messages*) +## Overview + ### Available Operations * [markAll](#markall) - Marks all the subscriber messages as read, unread, seen or unseen. Optionally you can pass feed id (or array) to mark messages of a particular feed. @@ -32,6 +34,38 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { subscribersMessagesMarkAll } from "@novu/api/funcs/subscribersMessagesMarkAll.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await subscribersMessagesMarkAll(novu, "", { + markAs: "seen", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -42,16 +76,17 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[number](../../models/.md)\>** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## markAllAs Mark a subscriber messages as seen, read, unseen or unread @@ -68,9 +103,42 @@ const novu = new Novu({ async function run() { const result = await novu.subscribers.messages.markAllAs("", { markAs: "seen", - messageId: "", + messageId: "", + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { subscribersMessagesMarkAllAs } from "@novu/api/funcs/subscribersMessagesMarkAllAs.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await subscribersMessagesMarkAllAs(novu, "", { + markAs: "read", + messageId: "", }); + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + // Handle the result console.log(result) } @@ -88,16 +156,17 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.MessageEntity[]](../../models/.md)\>** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## updateAsSeen Mark message action as seen @@ -128,6 +197,43 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { subscribersMessagesUpdateAsSeen } from "@novu/api/funcs/subscribersMessagesUpdateAsSeen.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await subscribersMessagesUpdateAsSeen(novu, { + messageId: "", + type: "", + subscriberId: "", + markMessageActionAsSeenDto: { + status: "pending", + }, + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -137,10 +243,10 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.MessageResponseDto](../../models/components/messageresponsedto.md)\>** + ### Errors | Error Object | Status Code | Content Type | diff --git a/docs/sdks/novunotifications/README.md b/docs/sdks/novunotifications/README.md index 6d58cfe0..ea735858 100644 --- a/docs/sdks/novunotifications/README.md +++ b/docs/sdks/novunotifications/README.md @@ -1,6 +1,8 @@ # NovuNotifications (*subscribers.notifications*) +## Overview + ### Available Operations * [retrieve](#retrieve) - Get in-app notification feed for a particular subscriber @@ -32,6 +34,39 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { subscribersNotificationsRetrieve } from "@novu/api/funcs/subscribersNotificationsRetrieve.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await subscribersNotificationsRetrieve(novu, { + subscriberId: "", + payload: "btoa(JSON.stringify({ foo: 123 })) results in base64 encoded string like eyJmb28iOjEyM30=", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -41,16 +76,17 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[operations.SubscribersControllerGetNotificationsFeedResponseBody](../../models/operations/subscriberscontrollergetnotificationsfeedresponsebody.md)\>** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## unseenCount Get the unseen in-app notifications count for subscribers feed @@ -78,6 +114,40 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { subscribersNotificationsUnseenCount } from "@novu/api/funcs/subscribersNotificationsUnseenCount.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await subscribersNotificationsUnseenCount(novu, { + seen: false, + subscriberId: "", + limit: 4327.98, + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -87,10 +157,10 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.UnseenCountResponse](../../models/components/unseencountresponse.md)\>** + ### Errors | Error Object | Status Code | Content Type | diff --git a/docs/sdks/novusubscribers/README.md b/docs/sdks/novusubscribers/README.md index 4e6bf427..d2edd7bf 100644 --- a/docs/sdks/novusubscribers/README.md +++ b/docs/sdks/novusubscribers/README.md @@ -1,6 +1,8 @@ # NovuSubscribers (*topics.subscribers*) +## Overview + ### Available Operations * [assign](#assign) - Subscribers addition @@ -28,6 +30,39 @@ async function run() { }); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { topicsSubscribersAssign } from "@novu/api/funcs/topicsSubscribersAssign.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await topicsSubscribersAssign(novu, "", { + subscribers: [ + "", + ], + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + } run(); @@ -37,22 +72,23 @@ run(); | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `topicKey` | *string* | :heavy_check_mark: | N/A | +| `topicKey` | *string* | :heavy_check_mark: | The topic key | | `addSubscribersRequestDto` | [components.AddSubscribersRequestDto](../../models/components/addsubscribersrequestdto.md) | :heavy_check_mark: | N/A | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## delete Remove subscribers from a topic @@ -74,6 +110,39 @@ async function run() { }); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { topicsSubscribersDelete } from "@novu/api/funcs/topicsSubscribersDelete.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await topicsSubscribersDelete(novu, "", { + subscribers: [ + "", + ], + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + } run(); @@ -83,22 +152,23 @@ run(); | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `topicKey` | *string* | :heavy_check_mark: | N/A | +| `topicKey` | *string* | :heavy_check_mark: | The topic key | | `removeSubscribersRequestDto` | [components.RemoveSubscribersRequestDto](../../models/components/removesubscribersrequestdto.md) | :heavy_check_mark: | N/A | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## retrieve Check if a subscriber belongs to a certain topic @@ -122,20 +192,50 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { topicsSubscribersRetrieve } from "@novu/api/funcs/topicsSubscribersRetrieve.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await topicsSubscribersRetrieve(novu, "", ""); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `topicKey` | *string* | :heavy_check_mark: | N/A | -| `externalSubscriberId` | *string* | :heavy_check_mark: | N/A | +| `externalSubscriberId` | *string* | :heavy_check_mark: | The external subscriber id | +| `topicKey` | *string* | :heavy_check_mark: | The topic key | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.TopicSubscriberDto](../../models/components/topicsubscriberdto.md)\>** + ### Errors | Error Object | Status Code | Content Type | diff --git a/docs/sdks/organizations/README.md b/docs/sdks/organizations/README.md index d52d679e..736c0018 100644 --- a/docs/sdks/organizations/README.md +++ b/docs/sdks/organizations/README.md @@ -4,18 +4,17 @@ ## Overview An organization serves as a separate entity within your Novu account. Each organization you create has its own separate integration store, workflows, subscribers, and API keys. This separation of resources allows you to manage multi-tenant environments and separate domains within a single account. - + ### Available Operations -* [create](#create) - Create an organization -* [list](#list) - Fetch all organizations -* [rename](#rename) - Rename organization name +* [eeOrganizationControllerRenameOrganization](#eeorganizationcontrollerrenameorganization) - Rename organization name * [retrieve](#retrieve) - Fetch current organization details +* [update](#update) - Update organization branding details -## create +## eeOrganizationControllerRenameOrganization -Create an organization +Rename organization name ### Example Usage @@ -27,10 +26,42 @@ const novu = new Novu({ }); async function run() { - const result = await novu.organizations.create({ + const result = await novu.organizations.eeOrganizationControllerRenameOrganization({ + name: "", + }); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { organizationsEEOrganizationControllerRenameOrganization } from "@novu/api/funcs/organizationsEEOrganizationControllerRenameOrganization.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await organizationsEEOrganizationControllerRenameOrganization(novu, { name: "", }); + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + // Handle the result console.log(result) } @@ -42,24 +73,25 @@ run(); | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [components.CreateOrganizationDto](../../models/components/createorganizationdto.md) | :heavy_check_mark: | The request object to use for the request. | +| `request` | [components.RenameOrganizationDto](../../models/components/renameorganizationdto.md) | :heavy_check_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response -**Promise\<[components.OrganizationResponseDto](../../models/components/organizationresponsedto.md)\>** +**Promise\<[components.RenameOrganizationDto](../../models/components/renameorganizationdto.md)\>** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | -## list -Fetch all organizations +## retrieve + +Fetch current organization details ### Example Usage @@ -71,7 +103,37 @@ const novu = new Novu({ }); async function run() { - const result = await novu.organizations.list(); + const result = await novu.organizations.retrieve(); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { organizationsRetrieve } from "@novu/api/funcs/organizationsRetrieve.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await organizationsRetrieve(novu); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; // Handle the result console.log(result) @@ -88,19 +150,20 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response -**Promise\<[components.OrganizationResponseDto[]](../../models/.md)\>** +**Promise\<[components.OrganizationResponseDto](../../models/components/organizationresponsedto.md)\>** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | -## rename -Rename organization name +## update + +Update organization branding details ### Example Usage @@ -112,8 +175,11 @@ const novu = new Novu({ }); async function run() { - const result = await novu.organizations.rename({ - name: "", + const result = await novu.organizations.update({ + color: "fuchsia", + contentBackground: "", + fontColor: "", + logo: "", }); // Handle the result @@ -123,40 +189,33 @@ async function run() { run(); ``` -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [components.RenameOrganizationDto](../../models/components/renameorganizationdto.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - - -### Response - -**Promise\<[components.RenameOrganizationDto](../../models/components/renameorganizationdto.md)\>** -### Errors - -| Error Object | Status Code | Content Type | -| --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - -## retrieve - -Fetch current organization details +### Standalone function -### Example Usage +The standalone function version of this method: ```typescript -import { Novu } from "@novu/api"; +import { NovuCore } from "@novu/api/core.js"; +import { organizationsUpdate } from "@novu/api/funcs/organizationsUpdate.js"; -const novu = new Novu({ +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ apiKey: "", }); async function run() { - const result = await novu.organizations.retrieve(); + const res = await organizationsUpdate(novu, { + color: "plum", + contentBackground: "", + fontColor: "", + logo: "", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; // Handle the result console.log(result) @@ -169,14 +228,15 @@ run(); | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [components.UpdateBrandingDetailsDto](../../models/components/updatebrandingdetailsdto.md) | :heavy_check_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response -**Promise\<[components.OrganizationResponseDto](../../models/components/organizationresponsedto.md)\>** +**Promise\<[components.OrganizationBrandingResponseDto](../../models/components/organizationbrandingresponsedto.md)\>** + ### Errors | Error Object | Status Code | Content Type | diff --git a/docs/sdks/preferences/README.md b/docs/sdks/preferences/README.md index a2b7a2e1..206a737a 100644 --- a/docs/sdks/preferences/README.md +++ b/docs/sdks/preferences/README.md @@ -1,6 +1,8 @@ # Preferences (*subscribers.preferences*) +## Overview + ### Available Operations * [list](#list) - Get subscriber preferences @@ -31,6 +33,36 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { subscribersPreferencesList } from "@novu/api/funcs/subscribersPreferencesList.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await subscribersPreferencesList(novu, ""); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -40,16 +72,17 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.UpdateSubscriberPreferenceResponseDto[]](../../models/.md)\>** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## retrieveByLevel Get subscriber preferences by level @@ -73,6 +106,36 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { subscribersPreferencesRetrieveByLevel } from "@novu/api/funcs/subscribersPreferencesRetrieveByLevel.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await subscribersPreferencesRetrieveByLevel(novu, "Subscriber", ""); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -83,16 +146,17 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.GetSubscriberPreferencesResponseDto[]](../../models/.md)\>** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## update Update subscriber preference @@ -120,6 +184,40 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { subscribersPreferencesUpdate } from "@novu/api/funcs/subscribersPreferencesUpdate.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await subscribersPreferencesUpdate(novu, { + subscriberId: "", + parameter: "", + updateSubscriberPreferenceRequestDto: {}, + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -129,16 +227,17 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.UpdateSubscriberPreferenceResponseDto](../../models/components/updatesubscriberpreferenceresponsedto.md)\>** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## updateGlobal Update subscriber global preferences @@ -162,6 +261,36 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { subscribersPreferencesUpdateGlobal } from "@novu/api/funcs/subscribersPreferencesUpdateGlobal.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await subscribersPreferencesUpdateGlobal(novu, "", {}); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -172,10 +301,10 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.UpdateSubscriberPreferenceResponseDto](../../models/components/updatesubscriberpreferenceresponsedto.md)\>** + ### Errors | Error Object | Status Code | Content Type | diff --git a/docs/sdks/properties/README.md b/docs/sdks/properties/README.md index 2404a067..983a2330 100644 --- a/docs/sdks/properties/README.md +++ b/docs/sdks/properties/README.md @@ -1,6 +1,8 @@ # Properties (*subscribers.properties*) +## Overview + ### Available Operations * [updateOnlineFlag](#updateonlineflag) - Update subscriber online status @@ -30,6 +32,38 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { subscribersPropertiesUpdateOnlineFlag } from "@novu/api/funcs/subscribersPropertiesUpdateOnlineFlag.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await subscribersPropertiesUpdateOnlineFlag(novu, "", { + isOnline: false, + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -40,10 +74,10 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.SubscriberResponseDto](../../models/components/subscriberresponsedto.md)\>** + ### Errors | Error Object | Status Code | Content Type | diff --git a/docs/sdks/stats/README.md b/docs/sdks/stats/README.md index 6e439cee..3997e6c3 100644 --- a/docs/sdks/stats/README.md +++ b/docs/sdks/stats/README.md @@ -1,6 +1,8 @@ # Stats (*notifications.stats*) +## Overview + ### Available Operations * [graph](#graph) - Get notification graph statistics @@ -20,7 +22,37 @@ const novu = new Novu({ }); async function run() { - const result = await novu.notifications.stats.graph(4018.61); + const result = await novu.notifications.stats.graph(); + + // Handle the result + console.log(result) +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { notificationsStatsGraph } from "@novu/api/funcs/notificationsStatsGraph.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await notificationsStatsGraph(novu); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; // Handle the result console.log(result) @@ -38,16 +70,17 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.ActivityGraphStatesResponse[]](../../models/.md)\>** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## retrieve Get notification statistics @@ -71,6 +104,36 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { notificationsStatsRetrieve } from "@novu/api/funcs/notificationsStatsRetrieve.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await notificationsStatsRetrieve(novu); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -79,10 +142,10 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.ActivityStatsResponseDto](../../models/components/activitystatsresponsedto.md)\>** + ### Errors | Error Object | Status Code | Content Type | diff --git a/docs/sdks/status/README.md b/docs/sdks/status/README.md index 78e5eee9..3f263ee5 100644 --- a/docs/sdks/status/README.md +++ b/docs/sdks/status/README.md @@ -1,6 +1,8 @@ # Status (*workflows.status*) +## Overview + ### Available Operations * [update](#update) - Update workflow status @@ -30,6 +32,38 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { workflowsStatusUpdate } from "@novu/api/funcs/workflowsStatusUpdate.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await workflowsStatusUpdate(novu, "", { + active: false, + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -40,10 +74,10 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.WorkflowResponse](../../models/components/workflowresponse.md)\>** + ### Errors | Error Object | Status Code | Content Type | diff --git a/docs/sdks/subscribers/README.md b/docs/sdks/subscribers/README.md index 28235c12..157012b1 100644 --- a/docs/sdks/subscribers/README.md +++ b/docs/sdks/subscribers/README.md @@ -4,8 +4,8 @@ ## Overview A subscriber in Novu represents someone who should receive a message. A subscriber’s profile information contains important attributes about the subscriber that will be used in messages (name, email). The subscriber object can contain other key-value pairs that can be used to further personalize your messages. - + ### Available Operations * [create](#create) - Create subscriber @@ -40,6 +40,38 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { subscribersCreate } from "@novu/api/funcs/subscribersCreate.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await subscribersCreate(novu, { + subscriberId: "", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -49,16 +81,17 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.SubscriberResponseDto](../../models/components/subscriberresponsedto.md)\>** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## createBulk @@ -78,13 +111,44 @@ const novu = new Novu({ async function run() { await novu.subscribers.createBulk({ subscribers: [ - { - subscriberId: "", - }, + "", ], }); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { subscribersCreateBulk } from "@novu/api/funcs/subscribersCreateBulk.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await subscribersCreateBulk(novu, { + subscribers: [ + "", + ], + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + } run(); @@ -99,16 +163,17 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## delete Deletes a subscriber entity from the Novu platform @@ -132,6 +197,36 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { subscribersDelete } from "@novu/api/funcs/subscribersDelete.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await subscribersDelete(novu, ""); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -141,16 +236,17 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.DeleteSubscriberResponseDto](../../models/components/deletesubscriberresponsedto.md)\>** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## list Returns a list of subscribers, could paginated using the `page` and `limit` query parameter @@ -165,10 +261,43 @@ const novu = new Novu({ }); async function run() { - const result = await novu.subscribers.list(7685.78, 10); + const result = await novu.subscribers.list(); + + for await (const page of result) { + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { subscribersList } from "@novu/api/funcs/subscribersList.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await subscribersList(novu); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; for await (const page of result) { - // handle page + // Handle the page + console.log(page); } } @@ -185,16 +314,17 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[operations.SubscribersControllerListSubscribersResponse](../../models/operations/subscriberscontrollerlistsubscribersresponse.md)\>** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## retrieve Get subscriber by your internal id used to identify the subscriber @@ -218,6 +348,36 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { subscribersRetrieve } from "@novu/api/funcs/subscribersRetrieve.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await subscribersRetrieve(novu, ""); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -227,16 +387,17 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.SubscriberResponseDto](../../models/components/subscriberresponsedto.md)\>** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## update Used to update the subscriber entity with new information @@ -260,6 +421,36 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { subscribersUpdate } from "@novu/api/funcs/subscribersUpdate.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await subscribersUpdate(novu, "", {}); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -270,10 +461,10 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.SubscriberResponseDto](../../models/components/subscriberresponsedto.md)\>** + ### Errors | Error Object | Status Code | Content Type | diff --git a/docs/sdks/tenants/README.md b/docs/sdks/tenants/README.md index efdc41e6..33e24622 100644 --- a/docs/sdks/tenants/README.md +++ b/docs/sdks/tenants/README.md @@ -4,8 +4,8 @@ ## Overview A tenant represents a group of users. As a developer, when your apps have organizations, they are referred to as tenants. Tenants in Novu provides the ability to tailor specific notification experiences to users of different groups or organizations. - + ### Available Operations * [create](#create) - Create tenant @@ -16,7 +16,7 @@ A tenant represents a group of users. As a developer, when your apps have organi ## create -Create tenant under the current environment +Create tenant under the current environment Tenants is not supported in code first version of the API. ### Example Usage @@ -40,6 +40,39 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { tenantsCreate } from "@novu/api/funcs/tenantsCreate.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await tenantsCreate(novu, { + identifier: "", + name: "", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -49,19 +82,20 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.CreateTenantResponseDto](../../models/components/createtenantresponsedto.md)\>** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## delete -Deletes a tenant entity from the Novu platform +Deletes a tenant entity from the Novu platform. Tenants is not supported in code first version of the API. ### Example Usage @@ -76,6 +110,35 @@ async function run() { await novu.tenants.delete(""); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { tenantsDelete } from "@novu/api/funcs/tenantsDelete.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await tenantsDelete(novu, ""); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + } run(); @@ -90,19 +153,20 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## list -Returns a list of tenants, could paginated using the `page` and `limit` query parameter +Returns a list of tenants, could paginated using the `page` and `limit` query parameter. Tenants is not supported in code first version of the API. ### Example Usage @@ -114,10 +178,43 @@ const novu = new Novu({ }); async function run() { - const result = await novu.tenants.list(7685.78, 10); + const result = await novu.tenants.list(); for await (const page of result) { - // handle page + // Handle the page + console.log(page); + } +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { tenantsList } from "@novu/api/funcs/tenantsList.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await tenantsList(novu); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + for await (const page of result) { + // Handle the page + console.log(page); } } @@ -134,19 +231,20 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[operations.TenantControllerListTenantsResponse](../../models/operations/tenantcontrollerlisttenantsresponse.md)\>** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## retrieve -Get tenant by your internal id used to identify the tenant +Get tenant by your internal id used to identify the tenant Tenants is not supported in code first version of the API. ### Example Usage @@ -167,6 +265,36 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { tenantsRetrieve } from "@novu/api/funcs/tenantsRetrieve.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await tenantsRetrieve(novu, ""); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -176,19 +304,20 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.GetTenantResponseDto](../../models/components/gettenantresponsedto.md)\>** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## update -Update tenant by your internal id used to identify the tenant +Update tenant by your internal id used to identify the tenant Tenants is not supported in code first version of the API. ### Example Usage @@ -209,6 +338,36 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { tenantsUpdate } from "@novu/api/funcs/tenantsUpdate.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await tenantsUpdate(novu, "", {}); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -219,10 +378,10 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.UpdateTenantResponseDto](../../models/components/updatetenantresponsedto.md)\>** + ### Errors | Error Object | Status Code | Content Type | diff --git a/docs/sdks/topics/README.md b/docs/sdks/topics/README.md index 1904ce4d..a2d35d88 100644 --- a/docs/sdks/topics/README.md +++ b/docs/sdks/topics/README.md @@ -4,8 +4,8 @@ ## Overview Topics are a way to group subscribers together so that they can be notified of events at once. A topic is identified by a custom key. This can be helpful for things like sending out marketing emails or notifying users of new features. Topics can also be used to send notifications to the subscribers who have been grouped together based on their interests, location, activities and much more. - + ### Available Operations * [create](#create) - Topic creation @@ -40,6 +40,39 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { topicsCreate } from "@novu/api/funcs/topicsCreate.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await topicsCreate(novu, { + key: "", + name: "", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -49,16 +82,17 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.CreateTopicResponseDto](../../models/components/createtopicresponsedto.md)\>** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## delete Delete a topic by its topic key if it has no subscribers @@ -76,6 +110,35 @@ async function run() { await novu.topics.delete(""); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { topicsDelete } from "@novu/api/funcs/topicsDelete.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await topicsDelete(novu, ""); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + } run(); @@ -85,21 +148,22 @@ run(); | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `topicKey` | *string* | :heavy_check_mark: | N/A | +| `topicKey` | *string* | :heavy_check_mark: | The topic key | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## list Returns a list of topics that can be paginated using the `page` query parameter and filtered by the topic key with the `key` query parameter @@ -123,6 +187,36 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { topicsList } from "@novu/api/funcs/topicsList.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await topicsList(novu, {}); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -132,16 +226,17 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.FilterTopicsResponseDto](../../models/components/filtertopicsresponsedto.md)\>** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## rename Rename a topic by providing a new name @@ -167,26 +262,59 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { topicsRename } from "@novu/api/funcs/topicsRename.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await topicsRename(novu, "", { + name: "", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `topicKey` | *string* | :heavy_check_mark: | N/A | +| `topicKey` | *string* | :heavy_check_mark: | The topic key | | `renameTopicRequestDto` | [components.RenameTopicRequestDto](../../models/components/renametopicrequestdto.md) | :heavy_check_mark: | N/A | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.RenameTopicResponseDto](../../models/components/renametopicresponsedto.md)\>** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## retrieve Get a topic by its topic key @@ -210,19 +338,49 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { topicsRetrieve } from "@novu/api/funcs/topicsRetrieve.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await topicsRetrieve(novu, ""); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `topicKey` | *string* | :heavy_check_mark: | N/A | +| `topicKey` | *string* | :heavy_check_mark: | The topic key | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.GetTopicResponseDto](../../models/components/gettopicresponsedto.md)\>** + ### Errors | Error Object | Status Code | Content Type | diff --git a/docs/sdks/variables/README.md b/docs/sdks/variables/README.md index d86dc734..94bc07ac 100644 --- a/docs/sdks/variables/README.md +++ b/docs/sdks/variables/README.md @@ -1,6 +1,8 @@ # Variables (*workflows.variables*) +## Overview + ### Available Operations * [retrieve](#retrieve) - Get available variables @@ -28,6 +30,36 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { workflowsVariablesRetrieve } from "@novu/api/funcs/workflowsVariablesRetrieve.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await workflowsVariablesRetrieve(novu); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -36,10 +68,10 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.VariablesResponseDto](../../models/components/variablesresponsedto.md)\>** + ### Errors | Error Object | Status Code | Content Type | diff --git a/docs/sdks/webhooks/README.md b/docs/sdks/webhooks/README.md index cf7846d2..2e933e03 100644 --- a/docs/sdks/webhooks/README.md +++ b/docs/sdks/webhooks/README.md @@ -1,6 +1,8 @@ # Webhooks (*integrations.webhooks*) +## Overview + ### Available Operations * [retrieve](#retrieve) - Get webhook support status for provider @@ -28,6 +30,36 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { integrationsWebhooksRetrieve } from "@novu/api/funcs/integrationsWebhooksRetrieve.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await integrationsWebhooksRetrieve(novu, ""); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -37,10 +69,10 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[boolean](../../models/.md)\>** + ### Errors | Error Object | Status Code | Content Type | diff --git a/docs/sdks/workflowgroups/README.md b/docs/sdks/workflowgroups/README.md index 4c2655ef..03fef41e 100644 --- a/docs/sdks/workflowgroups/README.md +++ b/docs/sdks/workflowgroups/README.md @@ -38,6 +38,38 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { workflowGroupsCreate } from "@novu/api/funcs/workflowGroupsCreate.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await workflowGroupsCreate(novu, { + name: "", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -47,16 +79,17 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.NotificationGroupResponseDto](../../models/components/notificationgroupresponsedto.md)\>** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## delete workflow group was previously named notification group @@ -80,6 +113,36 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { workflowGroupsDelete } from "@novu/api/funcs/workflowGroupsDelete.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await workflowGroupsDelete(novu, ""); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -89,16 +152,17 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.DeleteNotificationGroupResponseDto](../../models/components/deletenotificationgroupresponsedto.md)\>** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## list workflow group was previously named notification group @@ -122,6 +186,36 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { workflowGroupsList } from "@novu/api/funcs/workflowGroupsList.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await workflowGroupsList(novu); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -130,16 +224,17 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.NotificationGroupResponseDto[]](../../models/.md)\>** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## retrieve workflow group was previously named notification group @@ -163,6 +258,36 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { workflowGroupsRetrieve } from "@novu/api/funcs/workflowGroupsRetrieve.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await workflowGroupsRetrieve(novu, ""); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -172,16 +297,17 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.NotificationGroupResponseDto](../../models/components/notificationgroupresponsedto.md)\>** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## update workflow group was previously named notification group @@ -207,6 +333,38 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { workflowGroupsUpdate } from "@novu/api/funcs/workflowGroupsUpdate.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await workflowGroupsUpdate(novu, "", { + name: "", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -217,10 +375,10 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.NotificationGroupResponseDto](../../models/components/notificationgroupresponsedto.md)\>** + ### Errors | Error Object | Status Code | Content Type | diff --git a/docs/sdks/workflows/README.md b/docs/sdks/workflows/README.md index 00830bb9..d0bf56b0 100644 --- a/docs/sdks/workflows/README.md +++ b/docs/sdks/workflows/README.md @@ -4,8 +4,8 @@ ## Overview All notifications are sent via a workflow. Each workflow acts as a container for the logic and blueprint that are associated with a type of notification in your system. - + ### Available Operations * [create](#create) - Create workflow @@ -32,7 +32,7 @@ async function run() { name: "", notificationGroupId: "", steps: [ - {}, + ], }); @@ -43,6 +43,42 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { workflowsCreate } from "@novu/api/funcs/workflowsCreate.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await workflowsCreate(novu, { + name: "", + notificationGroupId: "", + steps: [ + + ], + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -52,16 +88,17 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.WorkflowResponse](../../models/components/workflowresponse.md)\>** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## delete Workflow was previously named notification template @@ -85,6 +122,36 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { workflowsDelete } from "@novu/api/funcs/workflowsDelete.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await workflowsDelete(novu, ""); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -94,16 +161,17 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.DataBooleanDto](../../models/components/databooleandto.md)\>** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## list Workflows were previously named notification templates @@ -127,6 +195,36 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { workflowsList } from "@novu/api/funcs/workflowsList.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await workflowsList(novu, {}); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -136,16 +234,17 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.WorkflowsResponseDto](../../models/components/workflowsresponsedto.md)\>** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## retrieve Workflow was previously named notification template @@ -169,6 +268,36 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { workflowsRetrieve } from "@novu/api/funcs/workflowsRetrieve.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await workflowsRetrieve(novu, ""); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -178,16 +307,17 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.WorkflowResponse](../../models/components/workflowresponse.md)\>** + ### Errors | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | + ## update Workflow was previously named notification template @@ -214,6 +344,39 @@ async function run() { run(); ``` +### Standalone function + +The standalone function version of this method: + +```typescript +import { NovuCore } from "@novu/api/core.js"; +import { workflowsUpdate } from "@novu/api/funcs/workflowsUpdate.js"; + +// Use `NovuCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const novu = new NovuCore({ + apiKey: "", +}); + +async function run() { + const res = await workflowsUpdate(novu, "", { + name: "", + notificationGroupId: "", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result) +} + +run(); +``` + ### Parameters | Parameter | Type | Required | Description | @@ -224,10 +387,10 @@ run(); | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - ### Response **Promise\<[components.WorkflowResponse](../../models/components/workflowresponse.md)\>** + ### Errors | Error Object | Status Code | Content Type | diff --git a/jsr.json b/jsr.json index f238bd2f..f582fa1f 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@novu/api", - "version": "0.0.1-alpha.9", + "version": "0.0.1-alpha.10", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package-lock.json b/package-lock.json index 41d505bc..ef596a9b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,17 +1,13 @@ { "name": "@novu/api", - "version": "0.0.1-alpha.9", + "version": "0.0.1-alpha.10", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@novu/api", - "version": "0.0.1-alpha.9", - "dependencies": { - "jsonpath": "^1.1.1" - }, + "version": "0.0.1-alpha.10", "devDependencies": { - "@types/jsonpath": "^0.2.4", "@typescript-eslint/eslint-plugin": "^7.7.1", "@typescript-eslint/parser": "^7.7.1", "eslint": "^8.57.0", @@ -200,12 +196,6 @@ "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true }, - "node_modules/@types/jsonpath": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/@types/jsonpath/-/jsonpath-0.2.4.tgz", - "integrity": "sha512-K3hxB8Blw0qgW6ExKgMbXQv2UPZBoE2GqLpVY+yr7nMD2Pq86lsuIzyAaiQ7eMqFL5B6di6pxSkogLJEyEHoGA==", - "dev": true - }, "node_modules/@typescript-eslint/eslint-plugin": { "version": "7.13.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.13.0.tgz", @@ -782,7 +772,8 @@ "node_modules/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==" + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true }, "node_modules/define-data-property": { "version": "1.1.4", @@ -1000,94 +991,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/escodegen": { - "version": "1.14.3", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz", - "integrity": "sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==", - "dependencies": { - "esprima": "^4.0.1", - "estraverse": "^4.2.0", - "esutils": "^2.0.2", - "optionator": "^0.8.1" - }, - "bin": { - "escodegen": "bin/escodegen.js", - "esgenerate": "bin/esgenerate.js" - }, - "engines": { - "node": ">=4.0" - }, - "optionalDependencies": { - "source-map": "~0.6.1" - } - }, - "node_modules/escodegen/node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/escodegen/node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "engines": { - "node": ">=4.0" - } - }, - "node_modules/escodegen/node_modules/levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", - "dependencies": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/escodegen/node_modules/optionator": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", - "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", - "dependencies": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.6", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "word-wrap": "~1.2.3" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/escodegen/node_modules/prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==", - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/escodegen/node_modules/type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==", - "dependencies": { - "prelude-ls": "~1.1.2" - }, - "engines": { - "node": ">= 0.8.0" - } - }, "node_modules/eslint": { "version": "8.57.0", "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", @@ -1364,18 +1267,6 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/esprima": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-1.2.2.tgz", - "integrity": "sha512-+JpPZam9w5DuJ3Q67SqsMGtiHKENSMRVoxvArfJZK01/BfLEObtZ6orJa/MtoGNR/rfMgp5837T41PAmTwAv/A==", - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" - }, - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/esquery": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", @@ -1413,6 +1304,7 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -1460,7 +1352,8 @@ "node_modules/fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==" + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true }, "node_modules/fastq": { "version": "1.17.1", @@ -2212,16 +2105,6 @@ "json5": "lib/cli.js" } }, - "node_modules/jsonpath": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/jsonpath/-/jsonpath-1.1.1.tgz", - "integrity": "sha512-l6Cg7jRpixfbgoWgkrl77dgEj8RPvND0wMH6TwQmi9Qs4TFfS9u5cUFnbeKTwj5ga5Y3BTGGNI28k117LJ009w==", - "dependencies": { - "esprima": "1.2.2", - "static-eval": "2.0.2", - "underscore": "1.12.1" - } - }, "node_modules/keyv": { "version": "4.5.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", @@ -2806,23 +2689,6 @@ "node": ">=8" } }, - "node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/static-eval": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/static-eval/-/static-eval-2.0.2.tgz", - "integrity": "sha512-N/D219Hcr2bPjLxPiV+TQE++Tsmrady7TqAJugLy7Xk1EumfDWS/f5dtBbkRCGE7wKKXuYockQoj8Rm2/pVKyg==", - "dependencies": { - "escodegen": "^1.8.1" - } - }, "node_modules/string.prototype.trim": { "version": "1.2.9", "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz", @@ -3105,11 +2971,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/underscore": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.12.1.tgz", - "integrity": "sha512-hEQt0+ZLDVUMhebKxL4x1BTtDY7bavVofhZ9KZ4aI26X9SRaE+Y3m83XUL1UP2jn8ynjndwCCpEHdUG+9pP1Tw==" - }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -3173,6 +3034,7 @@ "version": "1.2.5", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, "engines": { "node": ">=0.10.0" } diff --git a/package.json b/package.json index d04a5297..1062ff02 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { "name": "@novu/api", - "version": "0.0.1-alpha.9", - "author": "Novu", + "version": "0.0.1-alpha.10", + "author": "Novu", "main": "./index.js", "sideEffects": false, "repository": { "type": "git", - "url": "https://github.com/novuhq/novu-node.git" + "url": "https://github.com/novuhq/novu-ts.git" }, "scripts": { "lint": "eslint --max-warnings=0 src", @@ -17,7 +17,6 @@ "zod": ">= 3" }, "devDependencies": { - "@types/jsonpath": "^0.2.4", "@typescript-eslint/eslint-plugin": "^7.7.1", "@typescript-eslint/parser": "^7.7.1", "eslint": "^8.57.0", @@ -27,6 +26,6 @@ "zod": "^3.23.4" }, "dependencies": { - "jsonpath": "^1.1.1" + } } diff --git a/sources/code-samples.yaml b/sources/code-samples.yaml index d3043820..088fb282 100644 --- a/sources/code-samples.yaml +++ b/sources/code-samples.yaml @@ -3,1761 +3,507 @@ info: title: CodeSamples overlay for typescript target version: 0.0.0 actions: - - target: $["paths"]["/v1/layouts"]["get"] + - target: $["paths"]["/v1/notification-groups"]["get"] update: "x-codeSamples": - "lang": "typescript" - "label": "LayoutsController_listLayouts" - "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n await novu.layouts.list({});\n\n \n}\n\nrun();" - - target: $["paths"]["/v1/subscribers/{subscriberId}"]["delete"] + "label": "NotificationGroupsController_listNotificationGroups" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.workflowGroups.list();\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/organizations/me"]["get"] update: "x-codeSamples": - "lang": "typescript" - "label": "SubscribersController_removeSubscriber" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.subscribers.delete(""); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/changes"]["get"] + "label": "EEOrganizationController_getMyOrganization" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.organizations.retrieve();\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/integrations/active"]["get"] update: "x-codeSamples": - "lang": "typescript" - "label": "ChangesController_getChanges" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.changes.retrieve({ - promoted: "false", - }); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/execution-details"]["get"] + "label": "IntegrationsController_getActiveIntegrations" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.integrations.listActive();\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/integrations/{integrationId}/set-primary"]["post"] update: "x-codeSamples": - "lang": "typescript" - "label": "ExecutionDetailsController_getExecutionDetailsForNotification" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.executionDetails.retrieve("", ""); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/layouts/{layoutId}/default"]["post"] + "label": "IntegrationsController_setIntegrationAsPrimary" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.integrations.setAsPrimary(\"\");\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/subscribers/{subscriberId}/preferences"]["get"] update: "x-codeSamples": - "lang": "typescript" - "label": "LayoutsController_setDefaultLayout" - "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n await novu.layouts.setAsDefault(\"\");\n\n \n}\n\nrun();" - - target: $["paths"]["/v1/subscribers/{subscriberId}/messages/mark-all"]["post"] + "label": "SubscribersController_listSubscriberPreferences" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.subscribers.preferences.list(\"\");\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/subscribers/{subscriberId}/preferences"]["patch"] update: "x-codeSamples": - "lang": "typescript" - "label": "SubscribersController_markAllUnreadAsRead" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.subscribers.messages.markAll("", { - markAs: "seen", - }); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/subscribers/{subscriberId}/online-status"]["patch"] + "label": "SubscribersController_updateSubscriberGlobalPreferences" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.subscribers.preferences.updateGlobal(\"\", {});\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/messages"]["get"] update: "x-codeSamples": - "lang": "typescript" - "label": "SubscribersController_updateSubscriberOnlineFlag" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.subscribers.properties.updateOnlineFlag("", { - isOnline: false, - }); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/subscribers/{subscriberId}/preferences"]["patch"] + "label": "MessagesController_getMessages" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.messages.retrieve({});\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/workflows/{workflowId}"]["delete"] update: "x-codeSamples": - "lang": "typescript" - "label": "SubscribersController_updateSubscriberGlobalPreferences" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.subscribers.preferences.updateGlobal("", {}); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/subscribers/{subscriberId}/preferences/{parameter}"]["patch"] + "label": "WorkflowController_deleteWorkflowById" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.workflows.delete(\"\");\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/notification-groups"]["post"] update: "x-codeSamples": - "lang": "typescript" - "label": "SubscribersController_updateSubscriberPreference" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.subscribers.preferences.update({ - subscriberId: "", - parameter: "", - updateSubscriberPreferenceRequestDto: {}, - }); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/workflows/{workflowId}"]["get"] + "label": "NotificationGroupsController_createNotificationGroup" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.workflowGroups.create({\n name: \"\",\n });\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/organizations/branding"]["put"] update: "x-codeSamples": - "lang": "typescript" - "label": "WorkflowController_getWorkflowById" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.workflows.retrieve(""); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/changes/count"]["get"] + "label": "EEOrganizationController_updateBrandingDetails" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.organizations.update({\n logo: \"\",\n color: \"fuchsia\",\n fontColor: \"\",\n contentBackground: \"\",\n });\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/integrations/{integrationId}"]["delete"] update: "x-codeSamples": - "lang": "typescript" - "label": "ChangesController_getChangesCount" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.changes.count(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/integrations/{integrationId}"]["delete"] + "label": "IntegrationsController_removeIntegration" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.integrations.delete(\"\");\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/subscribers/{subscriberId}/credentials"]["put"] update: "x-codeSamples": - "lang": "typescript" - "label": "IntegrationsController_removeIntegration" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.integrations.delete(""); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/notification-groups/{id}"]["patch"] + "label": "SubscribersController_updateSubscriberChannel" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.subscribers.credentials.update(\"\", {\n providerId: 8574.78,\n credentials: {\n webhookUrl: \"\",\n },\n });\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/layouts"]["post"] update: "x-codeSamples": - "lang": "typescript" - "label": "NotificationGroupsController_updateNotificationGroup" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.workflowGroups.update("", { - name: "", - }); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/subscribers"]["get"] + "label": "LayoutsController_PropertyDescriptor" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.layouts.create();\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/layouts"]["get"] update: "x-codeSamples": - "lang": "typescript" - "label": "SubscribersController_listSubscribers" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.subscribers.list(7685.78, 10); - - for await (const page of result) { - // handle page - } - } - - run(); - - target: $["paths"]["/v1/subscribers/{subscriberId}/credentials"]["patch"] + "label": "LayoutsController_listLayouts" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n await novu.layouts.list({});\n\n \n}\n\nrun();" + - target: $["paths"]["/v1/events/trigger/bulk"]["post"] update: "x-codeSamples": - "lang": "typescript" - "label": "SubscribersController_modifySubscriberChannel" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.subscribers.credentials.append("", { - credentials: { - webhookUrl: "", - }, - providerId: "zulip", - }); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/tenants"]["get"] + "label": "EventsController_triggerBulk" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.triggerBulk({\n events: [\n \n ],\n });\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/environments"]["get"] update: "x-codeSamples": - "lang": "typescript" - "label": "TenantController_listTenants" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.tenants.list(7685.78, 10); - - for await (const page of result) { - // handle page - } - } - - run(); - - target: $["paths"]["/v1/tenants/{identifier}"]["patch"] + "label": "EnvironmentsController_listMyEnvironments" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.environments.list();\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/workflows"]["post"] update: "x-codeSamples": - "lang": "typescript" - "label": "TenantController_updateTenant" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.tenants.update("", {}); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/workflows/{workflowId}"]["put"] + "label": "WorkflowController_create" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.workflows.create({\n name: \"\",\n notificationGroupId: \"\",\n steps: [\n \n ],\n });\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/layouts/{layoutId}"]["patch"] update: "x-codeSamples": - "lang": "typescript" - "label": "WorkflowController_updateWorkflowById" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.workflows.update("", { - name: "", - notificationGroupId: "", - }); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/environments/api-keys/regenerate"]["post"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "EnvironmentsController_regenerateOrganizationApiKeys" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.environments.apiKeys.regenerate(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/notification-groups/{id}"]["get"] + "label": "LayoutsController_updateLayout" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.layouts.update(\"\", {\n identifier: \"\",\n });\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/topics/{topicKey}"]["patch"] update: "x-codeSamples": - "lang": "typescript" - "label": "NotificationGroupsController_getNotificationGroup" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.workflowGroups.retrieve(""); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/layouts/{layoutId}"]["delete"] + "label": "TopicsController_renameTopic" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.topics.rename(\"\", {\n name: \"\",\n });\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/topics/{topicKey}/subscribers"]["post"] update: "x-codeSamples": - "lang": "typescript" - "label": "LayoutsController_deleteLayout" - "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n await novu.layouts.delete(\"\");\n\n \n}\n\nrun();" - - target: $["paths"]["/v1/messages/{messageId}"]["delete"] + "label": "TopicsController_addSubscribers" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n await novu.topics.subscribers.assign(\"\", {\n subscribers: [\n \"\",\n ],\n });\n\n \n}\n\nrun();" + - target: $["paths"]["/v1/layouts/{layoutId}"]["get"] update: "x-codeSamples": - "lang": "typescript" - "label": "MessagesController_deleteMessage" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.messages.delete(""); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/notifications/stats"]["get"] + "label": "LayoutsController_getLayout" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.layouts.retrieve(\"\");\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/tenants/{identifier}"]["patch"] update: "x-codeSamples": - "lang": "typescript" - "label": "NotificationsController_getActivityStats" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.notifications.stats.retrieve(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/environments"]["get"] + "label": "TenantController_updateTenant" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.tenants.update(\"\", {});\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/subscribers/{subscriberId}"]["get"] update: "x-codeSamples": - "lang": "typescript" - "label": "EnvironmentsController_listMyEnvironments" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.environments.list(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/integrations/{integrationId}/set-primary"]["post"] + "label": "SubscribersController_getSubscriber" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.subscribers.retrieve(\"\");\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/subscribers/{subscriberId}/notifications/feed"]["get"] update: "x-codeSamples": - "lang": "typescript" - "label": "IntegrationsController_setIntegrationAsPrimary" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.integrations.setAsPrimary(""); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/subscribers/{subscriberId}/credentials/{providerId}/oauth"]["get"] + "label": "SubscribersController_getNotificationsFeed" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.subscribers.notifications.retrieve({\n subscriberId: \"\",\n payload: \"btoa(JSON.stringify({ foo: 123 })) results in base64 encoded string like eyJmb28iOjEyM30=\",\n });\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/layouts/{layoutId}"]["delete"] update: "x-codeSamples": - "lang": "typescript" - "label": "SubscribersController_chatAccessOauth" - "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n await novu.subscribers.authentication.chatAccessOauth({\n subscriberId: \"\",\n providerId: \"\",\n hmacHash: \"\",\n environmentId: \"\",\n });\n\n \n}\n\nrun();" - - target: $["paths"]["/v1/subscribers/{subscriberId}/preferences/{parameter}"]["get"] + "label": "LayoutsController_deleteLayout" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n await novu.layouts.delete(\"\");\n\n \n}\n\nrun();" + - target: $["paths"]["/v1/topics"]["post"] update: "x-codeSamples": - "lang": "typescript" - "label": "SubscribersController_getSubscriberPreferenceByLevel" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.subscribers.preferences.retrieveByLevel("Topic", ""); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/tenants"]["post"] + "label": "TopicsController_createTopic" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.topics.create({\n key: \"\",\n name: \"\",\n });\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/integrations/{integrationId}"]["put"] update: "x-codeSamples": - "lang": "typescript" - "label": "TenantController_createTenant" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.tenants.create({ - identifier: "", - name: "", - }); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/topics/{topicKey}/subscribers/{externalSubscriberId}"]["get"] + "label": "IntegrationsController_updateIntegrationById" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.integrations.update(\"\", {});\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/changes/{changeId}/apply"]["post"] update: "x-codeSamples": - "lang": "typescript" - "label": "TopicsController_getTopicSubscriber" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.topics.subscribers.retrieve("", ""); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/feeds/{feedId}"]["delete"] + "label": "ChangesController_applyDiff" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.changes.apply(\"\");\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/subscribers/{subscriberId}"]["delete"] update: "x-codeSamples": - "lang": "typescript" - "label": "FeedsController_deleteFeedById" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.feeds.delete(""); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/notifications/{notificationId}"]["get"] + "label": "SubscribersController_removeSubscriber" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.subscribers.delete(\"\");\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/layouts/{layoutId}/default"]["post"] update: "x-codeSamples": - "lang": "typescript" - "label": "NotificationsController_getNotification" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.notifications.retrieve(""); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/workflows/{workflowId}"]["delete"] + "label": "LayoutsController_setDefaultLayout" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n await novu.layouts.setAsDefault(\"\");\n\n \n}\n\nrun();" + - target: $["paths"]["/v1/workflows/{workflowId}"]["put"] update: "x-codeSamples": - "lang": "typescript" - "label": "WorkflowController_deleteWorkflowById" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.workflows.delete(""); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/workflows/{workflowId}/status"]["put"] + "label": "WorkflowController_updateWorkflowById" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.workflows.update(\"\", {\n name: \"\",\n notificationGroupId: \"\",\n });\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/integrations"]["get"] update: "x-codeSamples": - "lang": "typescript" - "label": "WorkflowController_updateActiveStatus" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.workflows.status.update("", { - active: false, - }); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/messages/transaction/{transactionId}"]["delete"] + "label": "IntegrationsController_listIntegrations" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.integrations.list();\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/integrations"]["post"] update: "x-codeSamples": - "lang": "typescript" - "label": "MessagesController_deleteMessagesByTransactionId" - "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n await novu.messages.deleteByTransactionId(\"\", \"push\");\n\n \n}\n\nrun();" - - target: $["paths"]["/v1/notification-groups"]["get"] + "label": "IntegrationsController_createIntegration" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.integrations.create({\n providerId: \"\",\n channel: \"sms\",\n });\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/integrations/webhook/provider/{providerOrIntegrationId}/status"]["get"] update: "x-codeSamples": - "lang": "typescript" - "label": "NotificationGroupsController_listNotificationGroups" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.workflowGroups.list(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/organizations/branding"]["put"] + "label": "IntegrationsController_getWebhookSupportStatus" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.integrations.webhooks.retrieve(\"\");\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/subscribers/{subscriberId}/credentials/{providerId}/oauth/callback"]["get"] update: "x-codeSamples": - "lang": "typescript" - "label": "OrganizationController_updateBrandingDetails" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.organizations.branding.update({ - color: "fuchsia", - contentBackground: "", - fontColor: "", - logo: "", - }); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/subscribers/{subscriberId}"]["get"] + "label": "SubscribersController_chatOauthCallback" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.subscribers.authentication.chatAccessOauthCallBack({\n subscriberId: \"\",\n providerId: \"\",\n code: \"\",\n hmacHash: \"\",\n environmentId: \"\",\n });\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/feeds/{feedId}"]["delete"] update: "x-codeSamples": - "lang": "typescript" - "label": "SubscribersController_getSubscriber" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.subscribers.retrieve(""); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/subscribers/{subscriberId}/messages/{messageId}/actions/{type}"]["post"] + "label": "FeedsController_deleteFeedById" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.feeds.delete(\"\");\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/tenants"]["post"] update: "x-codeSamples": - "lang": "typescript" - "label": "SubscribersController_markActionAsSeen" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.subscribers.messages.updateAsSeen({ - messageId: "", - type: "", - subscriberId: "", - markMessageActionAsSeenDto: { - status: "done", - }, - }); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/tenants/{identifier}"]["get"] + "label": "TenantController_createTenant" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.tenants.create({\n identifier: \"\",\n name: \"\",\n });\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/notifications/{notificationId}"]["get"] update: "x-codeSamples": - "lang": "typescript" - "label": "TenantController_getTenantById" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.tenants.retrieve(""); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/topics/{topicKey}"]["patch"] + "label": "NotificationsController_getNotification" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.notifications.retrieve(\"\");\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/changes"]["get"] update: "x-codeSamples": - "lang": "typescript" - "label": "TopicsController_renameTopic" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.topics.rename("", { - name: "", - }); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/integrations"]["post"] + "label": "ChangesController_getChanges" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.changes.retrieve({\n promoted: \"false\",\n });\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/subscribers"]["post"] update: "x-codeSamples": - "lang": "typescript" - "label": "IntegrationsController_createIntegration" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.integrations.create({ - channel: "sms", - providerId: "", - }); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/organizations"]["get"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "OrganizationController_listOrganizations" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.organizations.list(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/organizations"]["patch"] + "label": "SubscribersController_createSubscriber" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.subscribers.create({\n subscriberId: \"\",\n });\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/topics"]["get"] update: "x-codeSamples": - "lang": "typescript" - "label": "OrganizationController_rename" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.organizations.rename({ - name: "", - }); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/subscribers"]["post"] + "label": "TopicsController_listTopics" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.topics.list({});\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/events/trigger"]["post"] update: "x-codeSamples": - "lang": "typescript" - "label": "SubscribersController_createSubscriber" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.subscribers.create({ - subscriberId: "", - }); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/subscribers/{subscriberId}/preferences"]["get"] + "label": "EventsController_trigger" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.trigger({\n name: \"workflow_identifier\",\n payload: {},\n overrides: {},\n to: [\n {\n topicKey: \"\",\n type: \"Topic\",\n },\n ],\n });\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/organizations"]["patch"] update: "x-codeSamples": - "lang": "typescript" - "label": "SubscribersController_listSubscriberPreferences" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.subscribers.preferences.list(""); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/topics"]["get"] + "label": "EEOrganizationController_renameOrganization" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.organizations.eeOrganizationControllerRenameOrganization({\n name: \"\",\n });\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/subscribers/{subscriberId}/notifications/unseen"]["get"] update: "x-codeSamples": - "lang": "typescript" - "label": "TopicsController_listTopics" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.topics.list({}); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/environments/me"]["get"] + "label": "SubscribersController_getUnseenCount" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.subscribers.notifications.unseenCount({\n seen: false,\n subscriberId: \"\",\n limit: 2166.35,\n });\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/subscribers/{subscriberId}/messages/mark-as"]["post"] update: "x-codeSamples": - "lang": "typescript" - "label": "EnvironmentsController_getCurrentEnvironment" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.environments.retrieve(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/notifications/graph/stats"]["get"] + "label": "SubscribersController_markMessagesAs" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.subscribers.messages.markAllAs(\"\", {\n messageId: \"\",\n markAs: \"seen\",\n });\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/environments/api-keys"]["get"] update: "x-codeSamples": - "lang": "typescript" - "label": "NotificationsController_getActivityGraphStats" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.notifications.stats.graph(4018.61); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/workflows"]["get"] + "label": "EnvironmentsController_listOrganizationApiKeys" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.environments.apiKeys.list();\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/workflows/{workflowId}"]["get"] update: "x-codeSamples": - "lang": "typescript" - "label": "WorkflowController_listWorkflows" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.workflows.list({}); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/workflows/variables"]["get"] + "label": "WorkflowController_getWorkflowById" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.workflows.retrieve(\"\");\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/notification-groups/{id}"]["delete"] update: "x-codeSamples": - "lang": "typescript" - "label": "WorkflowController_getWorkflowVariables" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.workflows.variables.retrieve(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/events/trigger/{transactionId}"]["delete"] + "label": "NotificationGroupsController_deleteNotificationGroup" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.workflowGroups.delete(\"\");\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/subscribers/bulk"]["post"] update: "x-codeSamples": - "lang": "typescript" - "label": "EventsController_cancel" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.events.cancel(""); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/notification-groups"]["post"] + "label": "SubscribersController_bulkCreateSubscribers" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n await novu.subscribers.createBulk({\n subscribers: [\n \"\",\n ],\n });\n\n \n}\n\nrun();" + - target: $["paths"]["/v1/subscribers/{subscriberId}/credentials"]["patch"] update: "x-codeSamples": - "lang": "typescript" - "label": "NotificationGroupsController_createNotificationGroup" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.workflowGroups.create({ - name: "", - }); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/environments/api-keys"]["get"] + "label": "SubscribersController_modifySubscriberChannel" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.subscribers.credentials.append(\"\", {\n providerId: 3462.44,\n credentials: {\n webhookUrl: \"\",\n },\n });\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/messages/transaction/{transactionId}"]["delete"] update: "x-codeSamples": - "lang": "typescript" - "label": "EnvironmentsController_listOrganizationApiKeys" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.environments.apiKeys.list(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/integrations"]["get"] + "label": "MessagesController_deleteMessagesByTransactionId" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n await novu.messages.deleteByTransactionId(\"\");\n\n \n}\n\nrun();" + - target: $["paths"]["/v1/tenants"]["get"] update: "x-codeSamples": - "lang": "typescript" - "label": "IntegrationsController_listIntegrations" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.integrations.list(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/messages"]["get"] + "label": "TenantController_listTenants" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.tenants.list();\n\n for await (const page of result) {\n // Handle the page\n console.log(page);\n }\n}\n\nrun();" + - target: $["paths"]["/v1/events/trigger/broadcast"]["post"] update: "x-codeSamples": - "lang": "typescript" - "label": "MessagesController_getMessages" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.messages.retrieve({}); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/topics/{topicKey}/subscribers/removal"]["post"] + "label": "EventsController_broadcastEventToAll" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.triggerBroadcast({\n name: \"\",\n payload: {},\n overrides: {},\n });\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/execution-details"]["get"] update: "x-codeSamples": - "lang": "typescript" - "label": "TopicsController_removeSubscribers" - "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n await novu.topics.subscribers.delete(\"\", {\n subscribers: [\n \"\",\n ],\n });\n\n \n}\n\nrun();" - - target: $["paths"]["/v1/events/trigger"]["post"] + "label": "ExecutionDetailsController_getExecutionDetailsForNotification" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.executionDetails.retrieve(\"\", \"\");\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/workflows"]["get"] update: "x-codeSamples": - "lang": "typescript" - "label": "EventsController_trigger" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.trigger({ - name: "workflow_identifier", - overrides: {}, - payload: {}, - to: [ - { - topicKey: "topic_key", - type: "Topic", - }, - ], - }); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/changes/{changeId}/apply"]["post"] + "label": "WorkflowController_listWorkflows" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.workflows.list({});\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/notifications/stats"]["get"] update: "x-codeSamples": - "lang": "typescript" - "label": "ChangesController_applyDiff" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.changes.apply(""); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/tenants/{identifier}"]["delete"] + "label": "NotificationsController_getActivityStats" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.notifications.stats.retrieve();\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/changes/bulk/apply"]["post"] update: "x-codeSamples": - "lang": "typescript" - "label": "TenantController_removeTenant" - "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n await novu.tenants.delete(\"\");\n\n \n}\n\nrun();" - - target: $["paths"]["/v1/workflows"]["post"] + "label": "ChangesController_bulkApplyDiff" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.changes.applyBulk({\n changeIds: [\n \"\",\n ],\n });\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/feeds"]["post"] update: "x-codeSamples": - "lang": "typescript" - "label": "WorkflowController_create" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.workflows.create({ - name: "", - notificationGroupId: "", - steps: [ - {}, - ], - }); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/organizations/me"]["get"] + "label": "FeedsController_createFeed" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.feeds.create({\n name: \"\",\n });\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/tenants/{identifier}"]["delete"] update: "x-codeSamples": - "lang": "typescript" - "label": "OrganizationController_getSelfOrganizationData" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.organizations.retrieve(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/subscribers/{subscriberId}/notifications/unseen"]["get"] + "label": "TenantController_removeTenant" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n await novu.tenants.delete(\"\");\n\n \n}\n\nrun();" + - target: $["paths"]["/v1/notifications"]["get"] update: "x-codeSamples": - "lang": "typescript" - "label": "SubscribersController_getUnseenCount" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.subscribers.notifications.unseenCount({ - seen: false, - subscriberId: "", - limit: 2166.35, - }); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/subscribers/{subscriberId}/credentials"]["put"] + "label": "NotificationsController_listNotifications" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.notifications.list({\n channels: [\n \"chat\",\n ],\n templates: [\n \"\",\n ],\n emails: [\n \"\",\n ],\n search: \"\",\n subscriberIds: [\n \"\",\n ],\n });\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/subscribers/{subscriberId}/preferences/{parameter}"]["get"] update: "x-codeSamples": - "lang": "typescript" - "label": "SubscribersController_updateSubscriberChannel" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.subscribers.credentials.update("", { - credentials: { - webhookUrl: "", - }, - providerId: "pushpad", - }); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/subscribers/{subscriberId}/credentials/{providerId}/oauth/callback"]["get"] + "label": "SubscribersController_getSubscriberPreferenceByLevel" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.subscribers.preferences.retrieveByLevel(\"Topic\", \"\");\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/subscribers/{subscriberId}/messages/{messageId}/actions/{type}"]["post"] update: "x-codeSamples": - "lang": "typescript" - "label": "SubscribersController_chatOauthCallback" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.subscribers.authentication.chatAccessOauthCallBack({ - subscriberId: "", - providerId: "", - code: "", - hmacHash: "", - environmentId: "", - }); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/integrations/{integrationId}"]["put"] + "label": "SubscribersController_markActionAsSeen" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.subscribers.messages.updateAsSeen({\n messageId: \"\",\n type: \"\",\n subscriberId: \"\",\n markMessageActionAsSeenDto: {\n status: \"done\",\n },\n });\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/subscribers/{subscriberId}/credentials/{providerId}"]["delete"] update: "x-codeSamples": - "lang": "typescript" - "label": "IntegrationsController_updateIntegrationById" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.integrations.update("", {}); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/subscribers/bulk"]["post"] + "label": "SubscribersController_deleteSubscriberCredentials" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n await novu.subscribers.credentials.delete(\"\", \"\");\n\n \n}\n\nrun();" + - target: $["paths"]["/v1/subscribers/{subscriberId}/preferences/{parameter}"]["patch"] update: "x-codeSamples": - "lang": "typescript" - "label": "SubscribersController_bulkCreateSubscribers" - "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n await novu.subscribers.createBulk({\n subscribers: [\n {\n subscriberId: \"\",\n },\n ],\n });\n\n \n}\n\nrun();" - - target: $["paths"]["/v1/layouts"]["post"] + "label": "SubscribersController_updateSubscriberPreference" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.subscribers.preferences.update({\n subscriberId: \"\",\n parameter: \"\",\n updateSubscriberPreferenceRequestDto: {},\n });\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/topics/{topicKey}/subscribers/removal"]["post"] update: "x-codeSamples": - "lang": "typescript" - "label": "LayoutsController_PropertyDescriptor" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.layouts.create(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/organizations/members"]["get"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "OrganizationController_listOrganizationMembers" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.organizations.members.list(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/organizations/members/{memberId}"]["delete"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "OrganizationController_remove" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.organizations.members.delete(""); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/events/trigger/bulk"]["post"] + "label": "TopicsController_removeSubscribers" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n await novu.topics.subscribers.delete(\"\", {\n subscribers: [\n \"\",\n ],\n });\n\n \n}\n\nrun();" + - target: $["paths"]["/v1/events/trigger/{transactionId}"]["delete"] update: "x-codeSamples": - "lang": "typescript" - "label": "EventsController_triggerBulk" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.events.triggerBulk({ - events: [ - { - name: "workflow_identifier", - overrides: {}, - payload: {}, - to: [ - { - topicKey: "topic_key", - type: "Topic", - }, - ], - }, - ], - }); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/feeds"]["post"] + "label": "EventsController_cancel" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.cancel(\"\");\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/notifications/graph/stats"]["get"] update: "x-codeSamples": - "lang": "typescript" - "label": "FeedsController_createFeed" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.feeds.create({ - name: "", - }); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/layouts/{layoutId}"]["patch"] + "label": "NotificationsController_getActivityGraphStats" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.notifications.stats.graph();\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/notification-groups/{id}"]["get"] update: "x-codeSamples": - "lang": "typescript" - "label": "LayoutsController_updateLayout" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.layouts.update("", { - identifier: "", - }); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/subscribers/{subscriberId}/credentials/{providerId}"]["delete"] + "label": "NotificationGroupsController_getNotificationGroup" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.workflowGroups.retrieve(\"\");\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/subscribers/{subscriberId}"]["put"] update: "x-codeSamples": - "lang": "typescript" - "label": "SubscribersController_deleteSubscriberCredentials" - "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n await novu.subscribers.credentials.delete(\"\", \"\");\n\n \n}\n\nrun();" - - target: $["paths"]["/v1/subscribers/{subscriberId}/notifications/feed"]["get"] + "label": "SubscribersController_updateSubscriber" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.subscribers.update(\"\", {});\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/subscribers/{subscriberId}/credentials/{providerId}/oauth"]["get"] update: "x-codeSamples": - "lang": "typescript" - "label": "SubscribersController_getNotificationsFeed" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.subscribers.notifications.retrieve({ - subscriberId: "", - payload: "btoa(JSON.stringify({ foo: 123 })) results in base64 encoded string like eyJmb28iOjEyM30=", - }); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/events/trigger/broadcast"]["post"] + "label": "SubscribersController_chatAccessOauth" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n await novu.subscribers.authentication.chatAccessOauth({\n subscriberId: \"\",\n providerId: \"\",\n hmacHash: \"\",\n environmentId: \"\",\n });\n\n \n}\n\nrun();" + - target: $["paths"]["/v1/topics/{topicKey}"]["delete"] update: "x-codeSamples": - "lang": "typescript" - "label": "EventsController_broadcastEventToAll" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.events.triggerBroadcast({ - name: "", - overrides: {}, - payload: {}, - }); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/integrations/active"]["get"] + "label": "TopicsController_deleteTopic" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n await novu.topics.delete(\"\");\n\n \n}\n\nrun();" + - target: $["paths"]["/v1/workflows/{workflowId}/status"]["put"] update: "x-codeSamples": - "lang": "typescript" - "label": "IntegrationsController_getActiveIntegrations" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.integrations.listActive(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/layouts/{layoutId}"]["get"] + "label": "WorkflowController_updateActiveStatus" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.workflows.status.update(\"\", {\n active: false,\n });\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/notification-groups/{id}"]["patch"] update: "x-codeSamples": - "lang": "typescript" - "label": "LayoutsController_getLayout" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.layouts.retrieve(""); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/subscribers/{subscriberId}/messages/mark-as"]["post"] + "label": "NotificationGroupsController_updateNotificationGroup" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.workflowGroups.update(\"\", {\n name: \"\",\n });\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/subscribers/{subscriberId}/online-status"]["patch"] update: "x-codeSamples": - "lang": "typescript" - "label": "SubscribersController_markMessagesAs" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.subscribers.messages.markAllAs("", { - markAs: "seen", - messageId: "", - }); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/topics"]["post"] + "label": "SubscribersController_updateSubscriberOnlineFlag" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.subscribers.properties.updateOnlineFlag(\"\", {\n isOnline: false,\n });\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/subscribers/{subscriberId}/messages/mark-all"]["post"] update: "x-codeSamples": - "lang": "typescript" - "label": "TopicsController_createTopic" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.topics.create({ - key: "", - name: "", - }); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/topics/{topicKey}/subscribers"]["post"] + "label": "SubscribersController_markAllUnreadAsRead" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.subscribers.messages.markAll(\"\", {\n markAs: \"seen\",\n });\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/messages/{messageId}"]["delete"] update: "x-codeSamples": - "lang": "typescript" - "label": "TopicsController_addSubscribers" - "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n await novu.topics.subscribers.assign(\"\", {\n subscribers: [\n \"\",\n ],\n });\n\n \n}\n\nrun();" - - target: $["paths"]["/v1/feeds"]["get"] + "label": "MessagesController_deleteMessage" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.messages.delete(\"\");\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/topics/{topicKey}"]["get"] update: "x-codeSamples": - "lang": "typescript" - "label": "FeedsController_getFeeds" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.feeds.retrieve(); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/integrations/webhook/provider/{providerOrIntegrationId}/status"]["get"] + "label": "TopicsController_getTopic" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.topics.retrieve(\"\");\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/tenants/{identifier}"]["get"] update: "x-codeSamples": - "lang": "typescript" - "label": "IntegrationsController_getWebhookSupportStatus" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.integrations.webhooks.retrieve(""); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/notifications"]["get"] + "label": "TenantController_getTenantById" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.tenants.retrieve(\"\");\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/environments/me"]["get"] update: "x-codeSamples": - "lang": "typescript" - "label": "NotificationsController_listNotifications" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.notifications.list({ - channels: [ - "chat", - ], - templates: [ - "", - ], - emails: [ - "", - ], - search: "", - subscriberIds: [ - "", - ], - }); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/organizations"]["post"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "OrganizationController_createOrganization" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.organizations.create({ - name: "", - }); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/subscribers/{subscriberId}"]["put"] + "label": "EnvironmentsController_getCurrentEnvironment" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.environments.retrieve();\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/workflows/variables"]["get"] update: "x-codeSamples": - "lang": "typescript" - "label": "SubscribersController_updateSubscriber" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.subscribers.update("", {}); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/topics/{topicKey}"]["delete"] + "label": "WorkflowController_getWorkflowVariables" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.workflows.variables.retrieve();\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/changes/count"]["get"] update: "x-codeSamples": - "lang": "typescript" - "label": "TopicsController_deleteTopic" - "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n await novu.topics.delete(\"\");\n\n \n}\n\nrun();" - - target: $["paths"]["/v1/topics/{topicKey}"]["get"] + "label": "ChangesController_getChangesCount" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.changes.count();\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/subscribers"]["get"] update: "x-codeSamples": - "lang": "typescript" - "label": "TopicsController_getTopic" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.topics.retrieve(""); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/changes/bulk/apply"]["post"] + "label": "SubscribersController_listSubscribers" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.subscribers.list();\n\n for await (const page of result) {\n // Handle the page\n console.log(page);\n }\n}\n\nrun();" + - target: $["paths"]["/v1/feeds"]["get"] update: "x-codeSamples": - "lang": "typescript" - "label": "ChangesController_bulkApplyDiff" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.changes.applyBulk({ - changeIds: [ - "", - ], - }); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/v1/notification-groups/{id}"]["delete"] + "label": "FeedsController_getFeeds" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.feeds.retrieve();\n\n // Handle the result\n console.log(result)\n}\n\nrun();" + - target: $["paths"]["/v1/topics/{topicKey}/subscribers/{externalSubscriberId}"]["get"] update: "x-codeSamples": - "lang": "typescript" - "label": "NotificationGroupsController_deleteNotificationGroup" - "source": |- - import { Novu } from "@novu/api"; - - const novu = new Novu({ - apiKey: "", - }); - - async function run() { - const result = await novu.workflowGroups.delete(""); - - // Handle the result - console.log(result) - } - - run(); + "label": "TopicsController_getTopicSubscriber" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.topics.subscribers.retrieve(\"\", \"\");\n\n // Handle the result\n console.log(result)\n}\n\nrun();" diff --git a/sources/json-development.json b/sources/json-development.json index 7abb4167..40dd42fa 100644 --- a/sources/json-development.json +++ b/sources/json-development.json @@ -1,7065 +1,10147 @@ -components: - headers: - Content-Type: - description: The MIME type of the response body. - example: application/json - required: true - schema: - type: string - Idempotency-Key: - description: The idempotency key used to evaluate the request. - example: "8" - required: false - schema: - type: string - Idempotency-Replay: - description: Whether the request was a replay of a previous request. - example: "true" - required: false - schema: - type: string - Link: - description: A link to the documentation. - example: https://docs.novu.co/ - required: false - schema: - type: string - RateLimit-Limit: - description: The number of requests that the client is permitted to make per second. The actual maximum may differ when burst is enabled. - example: "100" - required: false - schema: - type: string - RateLimit-Policy: - description: The rate limit policy that was used to evaluate the request. - example: 100;w=1;burst=110;comment="token bucket";category="trigger";cost="single" - required: false - schema: - type: string - RateLimit-Remaining: - description: The number of requests remaining until the next window. - example: "93" - required: false - schema: - type: string - RateLimit-Reset: - description: The remaining seconds until a request of the same cost will be refreshed. - example: "8" - required: false - schema: - type: string - Retry-After: - description: The number of seconds after which the client may retry the request that was previously rejected. - example: "8" - required: false - schema: - type: string - schemas: - ActivitiesResponseDto: - properties: - data: - items: - $ref: '#/components/schemas/ActivityNotificationResponseDto' - type: array - hasMore: - type: boolean - page: - type: number - pageSize: - type: number - required: - - hasMore - - data - - pageSize - - page - type: object - ActivityGraphStatesResponse: - properties: - _id: - type: string - channels: - items: - enum: - - in_app - - email - - sms - - chat - - push - type: string - type: array - count: - type: number - templates: - items: - type: string - type: array - required: - - _id - - count - - templates - - channels - type: object - ActivityNotificationExecutionDetailResponseDto: - properties: - _id: - type: string - _jobId: - type: string - detail: - type: string - isRetry: - type: boolean - isTest: - type: boolean - providerId: - type: object - raw: - type: string - source: - enum: - - Credentials - - Internal - - Payload - - Webhook - type: string - status: - enum: - - Success - - Warning - - Failed - - Pending - - Queued - - ReadConfirmation - type: string - required: - - _id - - _jobId - - status - - detail - - isRetry - - isTest - - providerId - - source - type: object - ActivityNotificationJobResponseDto: - properties: - _id: - type: string - digest: - type: object - executionDetails: - items: - $ref: '#/components/schemas/ActivityNotificationExecutionDetailResponseDto' - type: array - payload: - type: object - providerId: - type: object - status: - type: string - step: - $ref: '#/components/schemas/ActivityNotificationStepResponseDto' - type: - type: string - required: - - _id - - type - - executionDetails - - step - - providerId - - status - type: object - ActivityNotificationResponseDto: - properties: - _environmentId: - type: string - _id: - type: string - _organizationId: - type: string - channels: - enum: - - in_app - - email - - sms - - chat - - push - - digest - - trigger - - delay - - custom - items: - enum: - - in_app - - email - - sms - - chat - - push - - digest - - trigger - - delay - - custom - type: string - type: string - createdAt: - type: string - jobs: - items: - $ref: '#/components/schemas/ActivityNotificationJobResponseDto' - type: array - subscriber: - $ref: '#/components/schemas/ActivityNotificationSubscriberResponseDto' - template: - $ref: '#/components/schemas/ActivityNotificationTemplateResponseDto' - transactionId: - type: string - required: - - _environmentId - - _organizationId - - transactionId - type: object - ActivityNotificationStepResponseDto: - properties: - _id: - type: string - active: - type: boolean - filters: - $ref: '#/components/schemas/StepFilter' - template: - $ref: '#/components/schemas/MessageTemplateDto' - required: - - _id - - active - - filters - type: object - ActivityNotificationSubscriberResponseDto: - properties: - _id: - type: string - email: - type: string - firstName: - type: string - lastName: - type: string - phone: - type: string - required: - - _id - type: object - ActivityNotificationTemplateResponseDto: - properties: - _id: - type: string - name: - type: string - triggers: - items: - $ref: '#/components/schemas/NotificationTrigger' - type: array - required: - - name - - triggers - type: object - ActivityStatsResponseDto: - properties: - monthlySent: - type: number - weeklySent: - type: number - required: - - weeklySent - - monthlySent - type: object - Actor: - properties: - data: - nullable: true - type: string - type: - enum: - - none - - user - - system_icon - - system_custom - type: string - required: - - data - - type - type: object - AddSubscribersRequestDto: - properties: - subscribers: - description: List of subscriber identifiers that will be associated to the topic - items: - type: string - type: array - required: - - subscribers - type: object - ApiKey: - properties: - _userId: - type: string - key: - type: string - required: - - key - - _userId - type: object - BulkApplyChangeDto: - properties: - changeIds: - items: - type: string - type: array - required: - - changeIds - type: object - BulkSubscriberCreateDto: - properties: - subscribers: - items: - $ref: '#/components/schemas/CreateSubscriberRequestDto' - type: array - required: - - subscribers - type: object - BulkTriggerEventDto: - properties: - events: - items: - $ref: '#/components/schemas/TriggerEventRequestDto' - type: array - required: - - events - type: object - ChangeResponseDto: - properties: - _creatorId: - type: string - _entityId: - type: string - _environmentId: - type: string - _id: - type: string - _organizationId: - type: string - _parentId: - type: string - change: - type: object - createdAt: - type: string - enabled: - type: boolean - type: - enum: - - Feed - - MessageTemplate - - Layout - - DefaultLayout - - NotificationTemplate - - NotificationGroup - - TranslationGroup - - Translation - type: string - required: - - _creatorId - - _environmentId - - _organizationId - - _entityId - - enabled - - type - - change - - createdAt - type: object - ChangeWorkflowStatusRequestDto: - properties: - active: - type: boolean - required: - - active - type: object - ChangesResponseDto: - properties: - data: - items: - $ref: '#/components/schemas/ChangeResponseDto' - type: array - page: - type: number - pageSize: - type: number - totalCount: - type: number - required: - - totalCount - - data - - pageSize - - page - type: object - ChannelCredentials: - properties: - alertUid: - description: alert_uid for grafana on-call webhook payload - type: string - channel: - description: Channel specification for Mattermost chat notifications - type: string - deviceTokens: - description: Contains an array of the subscriber device tokens for a given provider. Used on Push integrations - items: - type: string - type: array - externalUrl: - description: link_to_upstream_details property fo grafana on call webhook - type: string - imageUrl: - description: image_url property fo grafana on call webhook - type: string - state: - description: state property fo grafana on call webhook - type: string - title: - description: title to be used with grafana on call webhook - type: string - webhookUrl: - description: Webhook url used by chat app integrations. The webhook should be obtained from the chat app provider. - type: string - required: - - webhookUrl - type: object - ChannelCredentialsDto: - properties: - deviceTokens: - items: - type: string - type: array - webhookUrl: - type: string - type: object - ChannelPreference: - properties: - enabled: - description: If channel is enabled or not - type: boolean - type: - description: The type of channel that is enabled or not - enum: - - in_app - - email - - sms - - chat - - push - type: string - required: - - type - - enabled - type: object - ChannelSettings: - properties: - _integrationId: - description: Id of the integration that is used for this channel - type: string - credentials: - allOf: - - $ref: '#/components/schemas/ChannelCredentials' - description: Credentials payload for the specified provider - integrationIdentifier: - description: The integration identifier - type: string - providerId: - description: The provider identifier for the credentials - enum: - - slack - - discord - - msteams - - mattermost - - ryver - - zulip - - grafana-on-call - - getstream - - rocket-chat - - whatsapp-business - - fcm - - apns - - expo - - one-signal - - pushpad - - push-webhook - - pusher-beams - type: string - required: - - providerId - - credentials - - _integrationId - type: object - CreateFeedRequestDto: - properties: - name: - type: string - required: - - name - type: object - CreateIntegrationRequestDto: - properties: - _environmentId: - type: string - active: - description: If the integration is active the validation on the credentials field will run - type: boolean - channel: - enum: - - in_app - - email - - sms - - chat - - push - type: string - check: - type: boolean - conditions: - items: - $ref: '#/components/schemas/StepFilter' - type: array - credentials: - $ref: '#/components/schemas/CredentialsDto' - identifier: - type: string - name: - type: string - providerId: - type: string - required: - - providerId - - channel - type: object - CreateLayoutResponseDto: - properties: - _id: - type: string - required: - - _id - type: object - CreateNotificationGroupRequestDto: - properties: - name: - type: string - required: - - name - type: object - CreateOrganizationDto: - properties: - domain: - type: string - jobTitle: - enum: - - engineer - - engineering_manager - - architect - - product_manager - - designer - - cxo_founder - - marketing_manager - - other - type: string - logo: - type: string - name: - type: string - productUseCases: - type: object - required: - - name - type: object - CreateSubscriberRequestDto: - properties: - avatar: - description: An http url to the profile image of your subscriber - type: string - channels: - items: - $ref: '#/components/schemas/SubscriberChannelDto' - type: array - data: - type: object - email: - type: string - firstName: - type: string - lastName: - type: string - locale: - type: string - phone: - type: string - subscriberId: - description: The internal identifier you used to create this subscriber, usually correlates to the id the user in your systems - type: string - required: - - subscriberId - type: object - CreateTenantRequestDto: - properties: - data: - type: object - identifier: - type: string - name: - type: string - required: - - identifier - - name - type: object - CreateTenantResponseDto: - properties: - _environmentId: - type: string - _id: - type: string - createdAt: - type: string - data: - type: object - identifier: - type: string - name: - type: string - updatedAt: - type: string - required: - - _id - - identifier - - _environmentId - - createdAt - - updatedAt - type: object - CreateTopicRequestDto: - properties: - key: - description: User defined custom key and provided by the user that will be an unique identifier for the Topic created. - type: string - name: - description: User defined custom name and provided by the user that will name the Topic created. - type: string - required: - - key - - name - type: object - CreateTopicResponseDto: - properties: {} - type: object - CreateWorkflowRequestDto: - properties: - active: - type: boolean - blueprintId: - type: string - critical: - type: boolean - data: - type: object - description: - maxLength: 1000 - type: string - draft: - deprecated: true - type: boolean - name: - type: string - notificationGroup: - type: object - notificationGroupId: - type: string - preferenceSettings: - $ref: '#/components/schemas/PreferenceChannels' - steps: - items: - $ref: '#/components/schemas/NotificationStep' - type: array - tags: - items: - type: string - type: array - required: - - name - - notificationGroupId - - steps - type: object - CredentialsDto: - properties: - accountSid: - type: string - alertUid: - type: string - apiKey: - type: string - apiKeyRequestHeader: - type: string - apiToken: - type: string - applicationId: - type: string - authenticateByToken: - type: boolean - authenticationTokenKey: - type: string - baseUrl: - type: string - channelId: - type: string - clientId: - type: string - datePath: - type: string - domain: - type: string - externalLink: - type: string - from: - type: string - hmac: - type: boolean - host: - type: string - idPath: - type: string - ignoreTls: - type: boolean - imageUrl: - type: string - instanceId: - type: string - ipPoolName: - type: string - messageProfileId: - type: string - password: - type: string - phoneNumberIdentification: - type: string - port: - type: string - projectName: - type: string - redirectUrl: - type: string - region: - type: string - requireTls: - type: boolean - secretKey: - type: string - secretKeyRequestHeader: - type: string - secure: - type: boolean - senderName: - type: string - serviceAccount: - type: string - state: - type: string - title: - type: string - tlsOptions: - type: object - token: - type: string - user: - type: string - webhookUrl: - type: string - type: object - DataBooleanDto: - properties: - data: - type: boolean - required: - - data - type: object - DataNumberDto: - properties: - data: - type: number - required: - - data - type: object - DataWrapperDto: - properties: - data: - type: object - required: - - data - type: object - DelayRegularMetadata: - properties: - amount: - type: number - type: - enum: - - regular - type: string - unit: - enum: - - seconds - - minutes - - hours - - days - - weeks - - months - type: string - required: - - type - type: object - DelayScheduledMetadata: - properties: - delayPath: - type: string - type: - enum: - - scheduled - type: string - required: - - type - - delayPath - type: object - DeleteMessageResponseDto: - properties: - acknowledged: - description: A boolean stating the success of the action - type: boolean - status: - description: The status enum for the performed action - enum: - - deleted - type: string - required: - - acknowledged - - status - type: object - DeleteNotificationGroupResponseDto: - properties: - acknowledged: - description: A boolean stating the success of the action - type: boolean - status: - description: The status enum for the performed action - enum: - - deleted - type: string - required: - - acknowledged - - status - type: object - DeleteSubscriberResponseDto: - properties: - acknowledged: - description: A boolean stating the success of the action - type: boolean - status: - description: The status enum for the performed action - enum: - - deleted - type: string - required: - - acknowledged - - status - type: object - DigestRegularMetadata: - properties: - amount: - type: number - backoff: - type: boolean - backoffAmount: - type: number - backoffUnit: - enum: - - seconds - - minutes - - hours - - days - - weeks - - months - type: string - digestKey: - type: string - type: - enum: - - regular - - backoff - type: string - unit: - enum: - - seconds - - minutes - - hours - - days - - weeks - - months - type: string - updateMode: - type: boolean - required: - - type - type: object - DigestTimedMetadata: - properties: - amount: - type: number - digestKey: - type: string - timed: - $ref: '#/components/schemas/TimedConfig' - type: - enum: - - timed - type: string - unit: - enum: - - seconds - - minutes - - hours - - days - - weeks - - months - type: string - required: - - type - type: object - EmailBlock: - properties: - content: - type: string - styles: - $ref: '#/components/schemas/EmailBlockStyles' - type: - enum: - - text - - button - type: string - url: - type: string - required: - - type - - content - type: object - EmailBlockStyles: - properties: - textAlign: - enum: - - left - - right - - center - type: string - type: object - EnvironmentResponseDto: - properties: - _id: - type: string - _organizationId: - type: string - _parentId: - type: string - apiKeys: - items: - type: object - type: array - identifier: - type: string - name: - type: string - required: - - name - - _organizationId - - identifier - - _parentId - type: object - ExecutionDetailsResponseDto: - properties: - _environmentId: - type: string - _id: - type: string - _jobId: - type: string - _messageId: - type: string - _notificationId: - type: string - _notificationTemplateId: - type: string - _organizationId: - type: string - _subscriberId: - type: string - channel: - enum: - - in_app - - email - - sms - - chat - - push - - digest - - trigger - - delay - - custom - type: string - createdAt: - type: string - detail: - type: string - isRetry: - type: boolean - isTest: - type: boolean - providerId: - type: string - source: - enum: - - Credentials - - Internal - - Payload - - Webhook - type: string - status: - enum: - - Success - - Warning - - Failed - - Pending - - Queued - - ReadConfirmation - type: string - transactionId: - type: string - required: - - _organizationId - - _jobId - - _environmentId - - _notificationId - - _notificationTemplateId - - _subscriberId - - transactionId - - channel - - detail - - source - - status - - isTest - - isRetry - type: object - FeedResponseDto: - properties: - _environmentId: - type: string - _id: - type: string - _organizationId: - type: string - identifier: - type: string - name: - type: string - required: - - name - - identifier - - _environmentId - - _organizationId - type: object - FieldFilterPart: - properties: - field: - type: string - "on": - enum: - - subscriber - - payload - type: string - operator: - enum: - - LARGER - - SMALLER - - LARGER_EQUAL - - SMALLER_EQUAL - - EQUAL - - NOT_EQUAL - - ALL_IN - - ANY_IN - - NOT_IN - - BETWEEN - - NOT_BETWEEN - - LIKE - - NOT_LIKE - - IN - type: string - value: - type: string - required: - - field - - value - - operator - - "on" - type: object - FilterTopicsResponseDto: - properties: - data: - items: - $ref: '#/components/schemas/TopicDto' - type: array - page: - type: number - pageSize: - type: number - totalCount: - type: number - required: - - data - - page - - pageSize - - totalCount - type: object - GetLayoutResponseDto: - properties: - _creatorId: - type: string - _environmentId: - type: string - _id: - type: string - _organizationId: - type: string - _parentId: - type: string - channel: - enum: - - in_app - - email - - sms - - chat - - push - type: string - content: - type: string - contentType: - type: string - createdAt: - type: string - description: - type: string - identifier: - type: string - isDefault: - type: boolean - isDeleted: - type: boolean - name: - type: string - updatedAt: - type: string - variables: - items: - type: object - type: array - required: - - _organizationId - - _environmentId - - _creatorId - - name - - identifier - - channel - - content - - contentType - - isDefault - - isDeleted - type: object - GetSubscriberPreferencesResponseDto: - properties: - preference: - allOf: - - $ref: '#/components/schemas/Preference' - description: The preferences of the subscriber regarding the related workflow - template: - allOf: - - $ref: '#/components/schemas/TemplateResponse' - description: The workflow information and if it is critical or not - required: - - preference - type: object - GetTenantResponseDto: - properties: - _environmentId: - type: string - _id: - type: string - createdAt: - type: string - data: - type: object - identifier: - type: string - name: - type: string - updatedAt: - type: string - required: - - _id - - identifier - - _environmentId - - createdAt - - updatedAt - type: object - GetTopicResponseDto: - properties: - _environmentId: - type: string - _id: - type: string - _organizationId: - type: string - key: - type: string - name: - type: string - subscribers: - items: - type: string - type: array - required: - - _organizationId - - _environmentId - - key - - name - - subscribers - type: object - IPartnerConfigurationResponseDto: - properties: - accessToken: - type: string - configurationId: - type: string - partnerType: - description: Partner Type Enum - enum: - - vercel - type: string - projectIds: - items: - type: string - type: array - teamId: - type: string - required: - - accessToken - - configurationId - - partnerType - type: object - IntegrationResponseDto: - properties: - _environmentId: - type: string - _id: - type: string - _organizationId: - type: string - active: - type: boolean - channel: - enum: - - in_app - - email - - sms - - chat - - push - type: string - conditions: - items: - $ref: '#/components/schemas/StepFilter' - type: array - credentials: - $ref: '#/components/schemas/CredentialsDto' - deleted: - type: boolean - deletedAt: - type: string - deletedBy: - type: string - identifier: - type: string - name: - type: string - primary: - type: boolean - providerId: - type: string - required: - - _environmentId - - _organizationId - - name - - identifier - - providerId - - channel - - credentials - - active - - deleted - - deletedAt - - deletedBy - - primary - type: object - MarkAllMessageAsRequestDto: - properties: - feedIdentifier: - description: Optional feed identifier or array of feed identifiers - oneOf: - - type: string - - items: - type: string - type: array - markAs: - description: Mark all subscriber messages as read, unread, seen or unseen - enum: - - read - - seen - - unread - - unseen - type: string - required: - - markAs - type: object - MarkMessageActionAsSeenDto: - properties: - payload: - description: Message action payload - type: object - status: - description: Message action status - enum: - - pending - - done - type: string - required: - - status - type: object - MemberInviteDTO: - properties: - _inviterId: - type: string - answerDate: - format: date-time - type: string - email: - type: string - invitationDate: - format: date-time - type: string - token: - type: string - required: - - email - - token - - invitationDate - - _inviterId - type: object - MemberResponseDto: - properties: - _id: - type: string - _organizationId: - type: string - _userId: - type: string - invite: - $ref: '#/components/schemas/MemberInviteDTO' - memberStatus: - enum: - - new - - active - - invited - type: string - roles: - enum: - - admin - - member - type: string - user: - $ref: '#/components/schemas/MemberUserDto' - required: - - _id - - _userId - - _organizationId - type: object - MemberUserDto: - properties: - _id: - type: string - email: - type: string - firstName: - type: string - lastName: - type: string - required: - - _id - - firstName - - lastName - - email - type: object - MessageAction: - properties: - buttons: - items: - $ref: '#/components/schemas/MessageButton' - type: array - result: - $ref: '#/components/schemas/MessageActionResult' - status: - enum: - - pending - - done - type: string - type: object - MessageActionResult: - properties: - payload: - type: object - type: - enum: - - primary - - secondary - type: string - type: object - MessageButton: - properties: - content: - type: string - resultContent: - type: string - type: - enum: - - primary - - secondary - type: string - required: - - type - - content - type: object - MessageCTA: - properties: - action: - $ref: '#/components/schemas/MessageAction' - data: - $ref: '#/components/schemas/MessageCTAData' - type: - enum: - - redirect - type: string - required: - - data - type: object - MessageCTAData: - properties: - url: - type: string - type: object - MessageEntity: - properties: {} - type: object - MessageMarkAsRequestDto: - properties: - markAs: - enum: - - read - - seen - - unread - - unseen - type: string - messageId: - oneOf: - - type: string - - items: - type: string - type: array - required: - - messageId - - markAs - type: object - MessageResponseDto: - properties: - _environmentId: - type: string - _feedId: - nullable: true - type: string - _id: - type: string - _messageTemplateId: - type: string - _notificationId: - type: string - _organizationId: - type: string - _subscriberId: - type: string - _templateId: - type: string - channel: - enum: - - in_app - - email - - sms - - chat - - push - type: string - content: - oneOf: - - $ref: '#/components/schemas/EmailBlock' - - type: string - createdAt: - type: string - cta: - $ref: '#/components/schemas/MessageCTA' - deviceTokens: - items: - type: string - type: array - directWebhookUrl: - type: string - email: - type: string - errorId: - type: string - errorText: - type: string - lastReadDate: - type: string - lastSeenDate: - type: string - overrides: - description: Provider specific overrides used when triggering the notification - type: object - payload: - description: The payload that was used to send the notification trigger - type: object - phone: - type: string - providerId: - type: string - read: - type: boolean - seen: - type: boolean - status: - enum: - - sent - - error - - warning - type: string - subject: - type: string - subscriber: - $ref: '#/components/schemas/SubscriberResponseDto' - template: - $ref: '#/components/schemas/WorkflowResponse' - templateIdentifier: - type: string - title: - type: string - transactionId: - type: string - required: - - _templateId - - _environmentId - - _messageTemplateId - - _organizationId - - _notificationId - - _subscriberId - - createdAt - - content - - transactionId - - channel - - read - - seen - - cta - - status - - errorId - - errorText - - payload - - overrides - type: object - MessageTemplate: - properties: {} - type: object - MessageTemplateDto: - properties: {} - type: object - NotificationDto: - properties: - _environmentId: - type: string - _feedId: - type: string - _id: - type: string - _jobId: - type: string - _messageTemplateId: - type: string - _notificationId: - type: string - _organizationId: - type: string - _subscriberId: - type: string - _templateId: - type: string - actor: - $ref: '#/components/schemas/Actor' - channel: - enum: - - in_app - - email - - sms - - chat - - push - type: string - content: - type: string - createdAt: - type: string - cta: - $ref: '#/components/schemas/MessageCTA' - deleted: - type: boolean - deviceTokens: - items: - type: string - type: array - expireAt: - type: string - overrides: - description: Provider specific overrides used when triggering the notification - type: object - payload: - description: The payload that was used to send the notification trigger - type: object - providerId: - type: string - read: - type: boolean - seen: - type: boolean - status: - enum: - - sent - - error - - warning - type: string - subject: - type: string - subscriber: - $ref: '#/components/schemas/SubscriberResponseDto' - templateIdentifier: - type: string - transactionId: - type: string - updatedAt: - type: string - required: - - _templateId - - _environmentId - - _messageTemplateId - - _organizationId - - _notificationId - - _subscriberId - - _feedId - - _jobId - - transactionId - - content - - channel - - read - - seen - - deleted - - cta - - status - - payload - - overrides - type: object - NotificationGroup: - properties: - _environmentId: - type: string - _id: - type: string - _organizationId: - type: string - _parentId: - type: string - name: - type: string - required: - - name - - _environmentId - - _organizationId - type: object - NotificationGroupResponseDto: - properties: - _environmentId: - type: string - _id: - type: string - _organizationId: - type: string - _parentId: - type: string - name: - type: string - required: - - name - - _environmentId - - _organizationId - type: object - NotificationStep: - properties: - _id: - type: string - _parentId: - type: object - _templateId: - type: string - active: - type: boolean - filters: - items: - $ref: '#/components/schemas/StepFilter' - type: array - metadata: - oneOf: - - $ref: '#/components/schemas/DigestRegularMetadata' - - $ref: '#/components/schemas/DigestTimedMetadata' - - $ref: '#/components/schemas/DelayRegularMetadata' - - $ref: '#/components/schemas/DelayScheduledMetadata' - name: - type: string - replyCallback: - type: object - shouldStopOnFail: - type: boolean - template: - $ref: '#/components/schemas/MessageTemplate' - uuid: - type: string - variants: - $ref: '#/components/schemas/NotificationStepVariant' - type: object - NotificationStepVariant: - properties: - _id: - type: string - _parentId: - type: object - _templateId: - type: string - active: - type: boolean - filters: - items: - $ref: '#/components/schemas/StepFilter' - type: array - metadata: - oneOf: - - $ref: '#/components/schemas/DigestRegularMetadata' - - $ref: '#/components/schemas/DigestTimedMetadata' - - $ref: '#/components/schemas/DelayRegularMetadata' - - $ref: '#/components/schemas/DelayScheduledMetadata' - name: - type: string - replyCallback: - type: object - shouldStopOnFail: - type: boolean - template: - $ref: '#/components/schemas/MessageTemplate' - uuid: - type: string - type: object - NotificationTrigger: - properties: - identifier: - type: string - subscriberVariables: - items: - $ref: '#/components/schemas/NotificationTriggerVariable' - type: array - type: - enum: - - event - type: string - variables: - items: - $ref: '#/components/schemas/NotificationTriggerVariable' - type: array - required: - - type - - identifier - - variables - type: object - NotificationTriggerVariable: - properties: - name: - type: string - required: - - name - type: object - OrganizationBrandingResponseDto: - properties: - color: - type: string - contentBackground: - type: string - direction: - enum: - - ltr - - trl - type: string - fontColor: - type: string - fontFamily: - type: string - logo: - type: string - required: - - logo - - color - - fontColor - - contentBackground - type: object - OrganizationResponseDto: - properties: - branding: - $ref: '#/components/schemas/OrganizationBrandingResponseDto' - logo: - type: string - name: - type: string - partnerConfigurations: - items: - $ref: '#/components/schemas/IPartnerConfigurationResponseDto' - type: array - required: - - name - - branding - type: object - PaginatedResponseDto: - properties: - data: - description: The list of items matching the query - items: - type: object - type: array - hasMore: - description: Does the list have more items to fetch - type: boolean - page: - description: The current page of the paginated response - type: number - pageSize: - description: Number of items on each page - type: number - required: - - page - - hasMore - - pageSize - - data - type: object - Preference: - properties: - channels: - allOf: - - $ref: '#/components/schemas/PreferenceChannels' - description: Subscriber preferences for the different channels regarding this workflow - enabled: - description: Sets if the workflow is fully enabled for all channels or not for the subscriber. - type: boolean - required: - - enabled - - channels - type: object - PreferenceChannels: - properties: - chat: - type: boolean - email: - type: boolean - in_app: - type: boolean - push: - type: boolean - sms: - type: boolean - type: object - RemoveSubscribersRequestDto: - properties: - subscribers: - description: List of subscriber identifiers that will be removed to the topic - items: - type: string - type: array - required: - - subscribers - type: object - RenameOrganizationDto: - properties: - name: - type: string - required: - - name - type: object - RenameTopicRequestDto: - properties: - name: - description: User defined custom name and provided by the user to rename the topic. - type: string - required: - - name - type: object - RenameTopicResponseDto: - properties: - _environmentId: - type: string - _id: - type: string - _organizationId: - type: string - key: - type: string - name: - type: string - subscribers: - items: - type: string - type: array - required: - - _organizationId - - _environmentId - - key - - name - - subscribers - type: object - StepFilter: - properties: - children: - items: - $ref: '#/components/schemas/FieldFilterPart' - type: array - isNegated: - type: boolean - type: - enum: - - BOOLEAN - - TEXT - - DATE - - NUMBER - - STATEMENT - - LIST - - MULTI_LIST - - GROUP - type: string - value: - enum: - - AND - - OR - type: string - required: - - isNegated - - type - - value - - children - type: object - SubscriberChannelDto: - properties: - credentials: - $ref: '#/components/schemas/ChannelCredentialsDto' - integrationIdentifier: - type: string - providerId: - type: object - required: - - providerId - - credentials - type: object - SubscriberPayloadDto: - properties: - avatar: - description: An http url to the profile image of your subscriber - type: string - channels: - items: - $ref: '#/components/schemas/SubscriberChannelDto' - type: array - data: - type: object - email: - type: string - firstName: - type: string - lastName: - type: string - locale: - type: string - phone: - type: string - subscriberId: - description: The internal identifier you used to create this subscriber, usually correlates to the id the user in your systems - type: string - required: - - subscriberId - type: object - SubscriberResponseDto: - properties: - __v: - type: number - _environmentId: - type: string - _id: - description: The internal id novu generated for your subscriber, this is not the subscriberId matching your query. See `subscriberId` for that - type: string - _organizationId: - type: string - avatar: - type: string - channels: - description: Channels settings for subscriber - items: - $ref: '#/components/schemas/ChannelSettings' - type: array - createdAt: - type: string - deleted: - type: boolean - email: - type: string - firstName: - type: string - isOnline: - type: boolean - lastName: - type: string - lastOnlineAt: - type: string - locale: - type: string - phone: - type: string - subscriberId: - description: The internal identifier you used to create this subscriber, usually correlates to the id the user in your systems - type: string - updatedAt: - type: string - required: - - subscriberId - - _organizationId - - _environmentId - - deleted - - createdAt - - updatedAt - type: object - TemplateResponse: - properties: - _id: - description: Unique identifier of the workflow - type: string - critical: - description: Critical templates will always be delivered to the end user and should be hidden from the subscriber preferences screen - type: boolean - name: - description: Name of the workflow - type: string - triggers: - description: Triggers are the events that will trigger the workflow. - items: - type: string - type: array - required: - - _id - - name - - critical - - triggers - type: object - TenantPayloadDto: - properties: - data: - type: object - identifier: - type: string - name: - type: string - type: object - TimedConfig: - properties: - atTime: - type: string - monthDays: - items: - type: string - type: array - monthlyType: - enum: - - each - - "on" - type: string - ordinal: - enum: - - "1" - - "2" - - "3" - - "4" - - "5" - - last - type: string - ordinalValue: - enum: - - day - - weekday - - weekend - - sunday - - monday - - tuesday - - wednesday - - thursday - - friday - - saturday - type: string - weekDays: - items: - enum: - - monday - - tuesday - - wednesday - - thursday - - friday - - saturday - - sunday - type: string - type: array - type: object - TopicDto: - properties: - _environmentId: - type: string - _id: - type: string - _organizationId: - type: string - key: - type: string - name: - type: string - subscribers: - items: - type: string - type: array - required: - - _organizationId - - _environmentId - - key - - name - - subscribers - type: object - TopicPayloadDto: - properties: - topicKey: - example: topic_key - type: string - type: - enum: - - Subscriber - - Topic - example: Topic - type: string - required: - - topicKey - - type - type: object - TopicSubscriberDto: - properties: - _environmentId: - type: string - _organizationId: - type: string - _subscriberId: - type: string - _topicId: - type: string - externalSubscriberId: - type: string - topicKey: - type: string - required: - - _organizationId - - _environmentId - - _subscriberId - - _topicId - - topicKey - - externalSubscriberId - type: object - TriggerEventRequestDto: - properties: - actor: - description: "It is used to display the Avatar of the provided actor's subscriber id or actor object.\n If a new actor object is provided, we will create a new subscriber in our system\n " - oneOf: - - description: Unique identifier of a subscriber in your systems - type: string - - $ref: '#/components/schemas/SubscriberPayloadDto' - name: - description: The trigger identifier of the workflow you wish to send. This identifier can be found on the workflow page. - example: workflow_identifier - type: string - overrides: - description: This could be used to override provider specific configurations - example: - fcm: - data: - key: value - type: object - payload: - description: "The payload object is used to pass additional custom information that could be used to render the workflow, or perform routing rules based on it. \n This data will also be available when fetching the notifications feed from the API to display certain parts of the UI." - example: - comment_id: string - post: - text: string - type: object - tenant: - description: "It is used to specify a tenant context during trigger event.\n Existing tenants will be updated with the provided details.\n " - oneOf: - - description: Unique identifier of a tenant in your system - type: string - - $ref: '#/components/schemas/TenantPayloadDto' - to: - description: The recipients list of people who will receive the notification. - items: - oneOf: - - $ref: '#/components/schemas/SubscriberPayloadDto' - - description: Unique identifier of a subscriber in your systems - example: SUBSCRIBER_ID - type: string - - $ref: '#/components/schemas/TopicPayloadDto' - type: array - transactionId: - description: A unique identifier for this transaction, we will generated a UUID if not provided. - type: string - required: - - name - - to - type: object - TriggerEventResponseDto: - properties: - acknowledged: - description: If trigger was acknowledged or not - type: boolean - error: - description: In case of an error, this field will contain the error message - items: - type: string - type: array - status: - description: Status for trigger - enum: - - error - - trigger_not_active - - no_workflow_active_steps_defined - - no_workflow_steps_defined - - processed - - subscriber_id_missing - - no_tenant_found - type: string - transactionId: - description: Transaction id for trigger - type: string - required: - - acknowledged - - status - type: object - TriggerEventToAllRequestDto: - properties: - actor: - description: "It is used to display the Avatar of the provided actor's subscriber id or actor object.\n If a new actor object is provided, we will create a new subscriber in our system\n " - oneOf: - - description: Unique identifier of a subscriber in your systems - type: string - - $ref: '#/components/schemas/SubscriberPayloadDto' - name: - description: The trigger identifier associated for the template you wish to send. This identifier can be found on the template page. - type: string - overrides: - description: This could be used to override provider specific configurations - example: - fcm: - data: - key: value - type: object - payload: - description: "The payload object is used to pass additional custom information that could be used to render the template, or perform routing rules based on it. \n This data will also be available when fetching the notifications feed from the API to display certain parts of the UI." - example: - comment_id: string - post: - text: string - type: object - tenant: - description: "It is used to specify a tenant context during trigger event.\n If a new tenant object is provided, we will create a new tenant.\n " - oneOf: - - description: Unique identifier of a tenant in your system - type: string - - $ref: '#/components/schemas/TenantPayloadDto' - transactionId: - description: A unique identifier for this transaction, we will generated a UUID if not provided. - type: string - required: - - name - - payload - type: object - UnseenCountResponse: - properties: - count: - type: number - required: - - count - type: object - UpdateBrandingDetailsDto: - properties: - color: - type: string - contentBackground: - type: string - fontColor: - type: string - fontFamily: - type: string - logo: - type: string - required: - - logo - - color - - fontColor - - contentBackground - type: object - UpdateIntegrationRequestDto: - properties: - _environmentId: - type: string - active: - description: If the integration is active the validation on the credentials field will run - type: boolean - check: - type: boolean - conditions: - items: - $ref: '#/components/schemas/StepFilter' - type: array - credentials: - $ref: '#/components/schemas/CredentialsDto' - identifier: - type: string - name: - type: string - type: object - UpdateLayoutRequestDto: - properties: - content: - description: User defined content for the layout. - type: string - description: - description: User defined description of the layout - type: string - identifier: - description: User defined custom key that will be a unique identifier for the Layout updated. - type: string - isDefault: - description: Variable that defines if the layout is chosen as default when creating a layout. - type: boolean - name: - description: User defined custom name and provided by the user that will name the Layout updated. - type: string - variables: - description: User defined variables to render in the layout placeholders. - items: - type: object - type: array - required: - - identifier - type: object - UpdateLayoutResponseDto: - properties: - _creatorId: - type: string - _environmentId: - type: string - _id: - type: string - _organizationId: - type: string - _parentId: - type: string - channel: - enum: - - in_app - - email - - sms - - chat - - push - type: string - content: - type: string - contentType: - type: string - createdAt: - type: string - description: - type: string - identifier: - type: string - isDefault: - type: boolean - isDeleted: - type: boolean - name: - type: string - updatedAt: - type: string - variables: - items: - type: object - type: array - required: - - _organizationId - - _environmentId - - _creatorId - - name - - identifier - - channel - - content - - contentType - - isDefault - - isDeleted - type: object - UpdateSubscriberChannelRequestDto: - properties: - credentials: - allOf: - - $ref: '#/components/schemas/ChannelCredentials' - description: Credentials payload for the specified provider - integrationIdentifier: - description: The integration identifier - type: string - providerId: - description: The provider identifier for the credentials - enum: - - slack - - discord - - msteams - - mattermost - - ryver - - zulip - - grafana-on-call - - getstream - - rocket-chat - - whatsapp-business - - fcm - - apns - - expo - - one-signal - - pushpad - - push-webhook - - pusher-beams - type: string - required: - - providerId - - credentials - type: object - UpdateSubscriberGlobalPreferencesRequestDto: - properties: - enabled: - description: Enable or disable the subscriber global preferences. - type: boolean - preferences: - description: The subscriber global preferences for every ChannelTypeEnum. - items: - $ref: '#/components/schemas/ChannelPreference' - type: array - type: object - UpdateSubscriberOnlineFlagRequestDto: - properties: - isOnline: - type: boolean - required: - - isOnline - type: object - UpdateSubscriberPreferenceRequestDto: - properties: - channel: - allOf: - - $ref: '#/components/schemas/ChannelPreference' - description: The subscriber preferences for every ChannelTypeEnum for the workflow assigned. - enabled: - description: Sets if the workflow is fully enabled for all channels or not for the subscriber. - type: boolean - type: object - UpdateSubscriberPreferenceResponseDto: - properties: - preference: - allOf: - - $ref: '#/components/schemas/Preference' - description: The preferences of the subscriber regarding the related workflow - template: - allOf: - - $ref: '#/components/schemas/TemplateResponse' - description: The workflow information and if it is critical or not - required: - - template - - preference - type: object - UpdateSubscriberRequestDto: - properties: - avatar: - type: string - data: - type: object - email: - type: string - firstName: - type: string - lastName: - type: string - locale: - type: string - phone: - type: string - type: object - UpdateTenantRequestDto: - properties: - data: - type: object - identifier: - type: string - name: - type: string - type: object - UpdateTenantResponseDto: - properties: - _environmentId: - type: string - _id: - type: string - createdAt: - type: string - data: - type: object - identifier: - type: string - name: - type: string - updatedAt: - type: string - required: - - _id - - identifier - - _environmentId - - createdAt - - updatedAt - type: object - UpdateWorkflowRequestDto: - properties: - critical: - type: boolean - data: - type: object - description: - maxLength: 300 - type: string - identifier: - type: string - name: - type: string - notificationGroupId: - type: string - preferenceSettings: - $ref: '#/components/schemas/PreferenceChannels' - steps: - items: - $ref: '#/components/schemas/NotificationStep' - type: array - tags: - items: - type: string - type: array - required: - - name - - notificationGroupId - type: object - VariablesResponseDto: - properties: - system: - type: object - translations: - type: object - required: - - translations - - system - type: object - WorkflowResponse: - properties: - _creatorId: - type: string - _environmentId: - type: string - _id: - type: string - _notificationGroupId: - type: string - _organizationId: - type: string - _parentId: - type: string - active: - type: boolean - critical: - type: boolean - data: - type: object - deleted: - type: boolean - deletedAt: - type: string - deletedBy: - type: string - description: - type: string - draft: - type: boolean - name: - type: string - notificationGroup: - $ref: '#/components/schemas/NotificationGroup' - preferenceSettings: - $ref: '#/components/schemas/PreferenceChannels' - steps: - items: - $ref: '#/components/schemas/NotificationStep' - type: array - tags: - items: - type: string - type: array - triggers: - items: - $ref: '#/components/schemas/NotificationTrigger' - type: array - workflowIntegrationStatus: - type: object - required: - - name - - description - - active - - draft - - preferenceSettings - - critical - - tags - - steps - - _organizationId - - _creatorId - - _environmentId - - triggers - - _notificationGroupId - - deleted - - deletedAt - - deletedBy - type: object - WorkflowsResponseDto: - properties: - data: - items: - $ref: '#/components/schemas/WorkflowResponse' - type: array - page: - type: number - pageSize: - type: number - totalCount: - type: number - required: - - totalCount - - data - - pageSize - - page - type: object - securitySchemes: - api-key: - description: 'API key authentication. Allowed headers-- "Authorization: ApiKey ".' - in: header - name: Authorization - type: apiKey -externalDocs: - description: Novu Documentation - url: https://docs.novu.co -info: - contact: - email: support@novu.co - name: Novu Support - url: https://discord.gg/novu - description: Novu REST API. Please see https://docs.novu.co/api-reference for more details. - license: - name: MIT - url: https://opensource.org/license/mit - termsOfService: https://novu.co/terms - title: Novu API - version: "1.0" -openapi: 3.0.0 -paths: - /v1/auth/google: {} - /v1/auth/google/callback: {} - /v1/changes: - get: - operationId: ChangesController_getChanges - parameters: - - in: query - name: page - required: false - schema: - type: number - - in: query - name: limit - required: false - schema: - default: 10 - maximum: 100 - type: number - - in: query - name: promoted - required: true - schema: - default: "false" - type: string - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/ChangesResponseDto' - description: "" - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Get changes - tags: - - Changes - /v1/changes/{changeId}/apply: - post: - operationId: ChangesController_applyDiff - parameters: - - in: path - name: changeId - required: true - schema: - type: string - responses: - "201": - content: - application/json: - schema: - items: - $ref: '#/components/schemas/ChangeResponseDto' - type: array - description: Created - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Apply change - tags: - - Changes - x-speakeasy-name-override: apply - /v1/changes/bulk/apply: - post: - operationId: ChangesController_bulkApplyDiff - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/BulkApplyChangeDto' - required: true - responses: - "201": - content: - application/json: - schema: - items: - $ref: '#/components/schemas/ChangeResponseDto' - type: array - description: Created - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Apply changes - tags: - - Changes - x-speakeasy-name-override: applyBulk - /v1/changes/count: - get: - operationId: ChangesController_getChangesCount - parameters: [] - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/DataNumberDto' - description: "" - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Get changes count - tags: - - Changes - x-speakeasy-name-override: count - /v1/environments: - get: - operationId: EnvironmentsController_listMyEnvironments - parameters: [] - responses: - "200": - content: - application/json: - schema: - items: - $ref: '#/components/schemas/EnvironmentResponseDto' - type: array - description: Ok - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Get environments - tags: - - Environments - /v1/environments/api-keys: - get: - operationId: EnvironmentsController_listOrganizationApiKeys - parameters: [] - responses: - "200": - content: - application/json: - schema: - items: - $ref: '#/components/schemas/ApiKey' - type: array - description: Ok - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Get api keys - tags: - - Environments - x-speakeasy-group: Environments.ApiKeys - /v1/environments/api-keys/regenerate: - post: - operationId: EnvironmentsController_regenerateOrganizationApiKeys - parameters: [] - responses: - "201": - content: - application/json: - schema: - items: - $ref: '#/components/schemas/ApiKey' - type: array - description: Created - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Regenerate api keys - tags: - - Environments - x-speakeasy-group: Environments.ApiKeys - x-speakeasy-name-override: regenerate - /v1/environments/me: - get: - operationId: EnvironmentsController_getCurrentEnvironment - parameters: [] - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/EnvironmentResponseDto' - description: Ok - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Get current environment - tags: - - Environments - /v1/events/trigger: - post: - description: "\n Trigger event is the main (and only) way to send notifications to subscribers. \n The trigger identifier is used to match the particular workflow associated with it. \n Additional information can be passed according the body interface below.\n " - operationId: EventsController_trigger - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/TriggerEventRequestDto' - required: true - responses: - "201": - content: - application/json: - schema: - $ref: '#/components/schemas/TriggerEventResponseDto' - description: Created - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Trigger event - tags: - - Events - x-speakeasy-group: "" - x-speakeasy-name-override: trigger - x-speakeasy-usage-example: - title: Trigger Notification Event - /v1/events/trigger/{transactionId}: - delete: - description: "\n Using a previously generated transactionId during the event trigger,\n will cancel any active or pending workflows. This is useful to cancel active digests, delays etc...\n " - operationId: EventsController_cancel - parameters: - - in: path - name: transactionId - required: true - schema: - type: string - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/DataBooleanDto' - description: "" - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Cancel triggered event - tags: - - Events - x-speakeasy-name-override: cancel - /v1/events/trigger/broadcast: - post: - description: |- - Trigger a broadcast event to all existing subscribers, could be used to send announcements, etc. - In the future could be used to trigger events to a subset of subscribers based on defined filters. - operationId: EventsController_broadcastEventToAll - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/TriggerEventToAllRequestDto' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/TriggerEventResponseDto' - description: Ok - "201": - content: - application/json: - schema: - $ref: '#/components/schemas/TriggerEventResponseDto' - description: "" - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Broadcast event to all - tags: - - Events - x-speakeasy-name-override: triggerBroadcast - /v1/events/trigger/bulk: - post: - description: "\n Using this endpoint you can trigger multiple events at once, to avoid multiple calls to the API.\n The bulk API is limited to 100 events per request.\n " - operationId: EventsController_triggerBulk - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/BulkTriggerEventDto' - required: true - responses: - "201": - content: - application/json: - schema: - items: - $ref: '#/components/schemas/TriggerEventResponseDto' - type: array - description: Created - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Bulk trigger event - tags: - - Events - x-speakeasy-name-override: triggerBulk - /v1/execution-details: - get: - operationId: ExecutionDetailsController_getExecutionDetailsForNotification - parameters: - - in: query - name: notificationId - required: true - schema: - type: string - - in: query - name: subscriberId - required: true - schema: - type: string - responses: - "200": - content: - application/json: - schema: - items: - $ref: '#/components/schemas/ExecutionDetailsResponseDto' - type: array - description: Ok - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Get execution details - tags: - - Execution Details - /v1/feeds: - get: - operationId: FeedsController_getFeeds - parameters: [] - responses: - "200": - content: - application/json: - schema: - items: - $ref: '#/components/schemas/FeedResponseDto' - type: array - description: Ok - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Get feeds - tags: - - Feeds - post: - operationId: FeedsController_createFeed - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateFeedRequestDto' - required: true - responses: - "201": - content: - application/json: - schema: - $ref: '#/components/schemas/FeedResponseDto' - description: Created - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Create feed - tags: - - Feeds - /v1/feeds/{feedId}: - delete: - operationId: FeedsController_deleteFeedById - parameters: - - in: path - name: feedId - required: true - schema: - type: string - responses: - "200": - content: - application/json: - schema: - items: - $ref: '#/components/schemas/FeedResponseDto' - type: array - description: Ok - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Delete feed - tags: - - Feeds - /v1/integrations: - get: - description: Return all the integrations the user has created for that organization. Review v.0.17.0 changelog for a breaking change - operationId: IntegrationsController_listIntegrations - parameters: [] - responses: - "200": - content: - application/json: - schema: - items: - $ref: '#/components/schemas/IntegrationResponseDto' - type: array - description: The list of integrations belonging to the organization that are successfully returned. - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Get integrations - tags: - - Integrations - post: - description: Create an integration for the current environment the user is based on the API key provided - operationId: IntegrationsController_createIntegration - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateIntegrationRequestDto' - required: true - responses: - "201": - content: - application/json: - schema: - $ref: '#/components/schemas/IntegrationResponseDto' - description: Created - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Create integration - tags: - - Integrations - /v1/integrations/{integrationId}: - delete: - operationId: IntegrationsController_removeIntegration - parameters: - - in: path - name: integrationId - required: true - schema: - type: string - responses: - "200": - content: - application/json: - schema: - items: - $ref: '#/components/schemas/IntegrationResponseDto' - type: array - description: Ok - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Delete integration - tags: - - Integrations - put: - operationId: IntegrationsController_updateIntegrationById - parameters: - - in: path - name: integrationId - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateIntegrationRequestDto' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/IntegrationResponseDto' - description: Ok - "404": - description: The integration with the integrationId provided does not exist in the database. - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Update integration - tags: - - Integrations - /v1/integrations/{integrationId}/set-primary: - post: - operationId: IntegrationsController_setIntegrationAsPrimary - parameters: - - in: path - name: integrationId - required: true - schema: - type: string - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/IntegrationResponseDto' - description: Ok - "201": - content: - application/json: - schema: - $ref: '#/components/schemas/IntegrationResponseDto' - description: "" - "404": - description: The integration with the integrationId provided does not exist in the database. - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Set integration as primary - tags: - - Integrations - x-speakeasy-name-override: setAsPrimary - /v1/integrations/active: - get: - description: Return all the active integrations the user has created for that organization. Review v.0.17.0 changelog for a breaking change - operationId: IntegrationsController_getActiveIntegrations - parameters: [] - responses: - "200": - content: - application/json: - schema: - items: - $ref: '#/components/schemas/IntegrationResponseDto' - type: array - description: The list of active integrations belonging to the organization that are successfully returned. - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Get active integrations - tags: - - Integrations - x-speakeasy-name-override: listActive - /v1/integrations/webhook/provider/{providerOrIntegrationId}/status: - get: - description: Return the status of the webhook for this provider, if it is supported or if it is not based on a boolean value - operationId: IntegrationsController_getWebhookSupportStatus - parameters: - - in: path - name: providerOrIntegrationId - required: true - schema: - type: string - responses: - "200": - content: - application/json: - schema: - type: boolean - description: The status of the webhook for the provider requested - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Get webhook support status for provider - tags: - - Integrations - x-speakeasy-group: Integrations.Webhooks - /v1/layouts: - get: - description: Returns a list of layouts that can be paginated using the `page` query parameter and filtered by the environment where it is executed from the organization the user belongs to. - operationId: LayoutsController_listLayouts - parameters: - - description: Number of page for pagination - in: query - name: page - required: false - schema: - minimum: 0 - type: number - - description: Size of page for pagination - in: query - name: pageSize - required: false - schema: - minimum: 0 - type: number - - description: Sort field. Currently only supported `createdAt` - in: query - name: sortBy - required: false - schema: - type: string - - description: Direction of the sorting query param - in: query - name: orderBy - required: false - schema: - enum: - - ASC - - DESC - type: string - responses: - "200": - description: The list of layouts that match the criteria of the query params are successfully returned. - "400": - description: Page size can not be larger than the page size limit. - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Filter layouts - tags: - - Layouts - post: - description: Create a layout - operationId: LayoutsController_PropertyDescriptor - parameters: [] - responses: - "201": - content: - application/json: - schema: - $ref: '#/components/schemas/CreateLayoutResponseDto' - description: Created - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Layout creation - tags: - - Layouts - x-speakeasy-name-override: create - /v1/layouts/{layoutId}: - delete: - description: Execute a soft delete of a layout given a certain ID. - operationId: LayoutsController_deleteLayout - parameters: - - in: path - name: layoutId - required: true - schema: - type: string - responses: - "204": - description: The layout has been deleted correctly - "404": - description: The layout with the layoutId provided does not exist in the database so it can not be deleted. - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: Either you are trying to delete a layout that is being used or a layout that is the default in the environment. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Delete layout - tags: - - Layouts - get: - description: Get a layout by its ID - operationId: LayoutsController_getLayout - parameters: - - in: path - name: layoutId - required: true - schema: - type: string - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/GetLayoutResponseDto' - description: Ok - "404": - description: The layout with the layoutId provided does not exist in the database. - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Get layout - tags: - - Layouts - patch: - description: Update the name, content and variables of a layout. Also change it to be default or no. - operationId: LayoutsController_updateLayout - parameters: - - in: path - name: layoutId - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateLayoutRequestDto' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateLayoutResponseDto' - description: Ok - "400": - description: The payload provided or the URL param are not right. - "404": - description: The layout with the layoutId provided does not exist in the database so it can not be updated. - "409": - content: - application/json: - schema: - example: One default layout is required - description: One default layout is needed. If you are trying to turn a default layout as not default, you should turn a different layout as default first and automatically it will be done by the system. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Update a layout - tags: - - Layouts - /v1/layouts/{layoutId}/default: - post: - description: Sets the default layout for the environment and updates to non default to the existing default layout (if any). - operationId: LayoutsController_setDefaultLayout - parameters: - - in: path - name: layoutId - required: true - schema: - type: string - responses: - "204": - description: The selected layout has been set as the default for the environment. - "404": - description: The layout with the layoutId provided does not exist in the database so it can not be set as the default for the environment. - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Set default layout - tags: - - Layouts - x-speakeasy-name-override: setAsDefault - /v1/messages: - get: - description: Returns a list of messages, could paginate using the `page` query parameter - operationId: MessagesController_getMessages - parameters: - - in: query - name: channel - required: false - schema: - enum: - - in_app - - email - - sms - - chat - - push - type: string - - in: query - name: subscriberId - required: false - schema: - type: string - - in: query - name: transactionId - required: false - schema: - items: - type: string - type: array - - in: query - name: page - required: false - schema: - default: 0 - type: number - - in: query - name: limit - required: false - schema: - default: 10 - type: number - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/ActivitiesResponseDto' - description: "" - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Get messages - tags: - - Messages - /v1/messages/{messageId}: - delete: - description: Deletes a message entity from the Novu platform - operationId: MessagesController_deleteMessage - parameters: - - in: path - name: messageId - required: true - schema: - type: string - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/DeleteMessageResponseDto' - description: Ok - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Delete message - tags: - - Messages - /v1/messages/transaction/{transactionId}: - delete: - description: Deletes messages entity from the Novu platform using TransactionId of message - operationId: MessagesController_deleteMessagesByTransactionId - parameters: - - description: The channel of the message to be deleted - in: query - name: channel - required: false - schema: - enum: - - in_app - - email - - sms - - chat - - push - type: string - - in: path - name: transactionId - required: true - schema: - type: string - responses: - "204": - description: "" - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Delete messages by transactionId - tags: - - Messages - x-speakeasy-name-override: deleteByTransactionId - /v1/notification-groups: - get: - description: workflow group was previously named notification group - operationId: NotificationGroupsController_listNotificationGroups - parameters: [] - responses: - "200": - content: - application/json: - schema: - items: - $ref: '#/components/schemas/NotificationGroupResponseDto' - type: array - description: Ok - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Get workflow groups - tags: - - Workflow groups - post: - description: workflow group was previously named notification group - operationId: NotificationGroupsController_createNotificationGroup - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateNotificationGroupRequestDto' - required: true - responses: - "201": - content: - application/json: - schema: - $ref: '#/components/schemas/NotificationGroupResponseDto' - description: Created - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Create workflow group - tags: - - Workflow groups - /v1/notification-groups/{id}: - delete: - description: workflow group was previously named notification group - operationId: NotificationGroupsController_deleteNotificationGroup - parameters: - - in: path - name: id - required: true - schema: - type: string - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/DeleteNotificationGroupResponseDto' - description: Ok - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Delete workflow group - tags: - - Workflow groups - get: - description: workflow group was previously named notification group - operationId: NotificationGroupsController_getNotificationGroup - parameters: - - in: path - name: id - required: true - schema: - type: string - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/NotificationGroupResponseDto' - description: Ok - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Get workflow group - tags: - - Workflow groups - patch: - description: workflow group was previously named notification group - operationId: NotificationGroupsController_updateNotificationGroup - parameters: - - in: path - name: id - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateNotificationGroupRequestDto' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/NotificationGroupResponseDto' - description: Ok - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Update workflow group - tags: - - Workflow groups - /v1/notifications: - get: - operationId: NotificationsController_listNotifications - parameters: - - in: query - name: channels - required: true - schema: - items: - enum: - - in_app - - email - - sms - - chat - - push - type: string - type: array - - in: query - name: templates - required: true - schema: - items: - type: string - type: array - - in: query - name: emails - required: true - schema: - items: - type: string - type: array - - deprecated: true - in: query - name: search - required: true - schema: - type: string - - in: query - name: subscriberIds - required: true - schema: - items: - type: string - type: array - - in: query - name: page - required: false - schema: - default: 0 - type: number - - in: query - name: transactionId - required: false - schema: - type: string - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/ActivitiesResponseDto' - description: "" - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Get notifications - tags: - - Notifications - /v1/notifications/{notificationId}: - get: - operationId: NotificationsController_getNotification - parameters: - - in: path - name: notificationId - required: true - schema: - type: string - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityNotificationResponseDto' - description: Ok - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Get notification - tags: - - Notifications - /v1/notifications/graph/stats: - get: - operationId: NotificationsController_getActivityGraphStats - parameters: - - in: query - name: days - required: false - schema: - type: number - responses: - "200": - content: - application/json: - schema: - items: - $ref: '#/components/schemas/ActivityGraphStatesResponse' - type: array - description: Ok - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Get notification graph statistics - tags: - - Notifications - x-speakeasy-group: Notifications.Stats - x-speakeasy-name-override: graph - /v1/notifications/stats: - get: - operationId: NotificationsController_getActivityStats - parameters: [] - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityStatsResponseDto' - description: Ok - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Get notification statistics - tags: - - Notifications - x-speakeasy-group: Notifications.Stats - /v1/organizations: - get: - operationId: OrganizationController_listOrganizations - parameters: [] - responses: - "200": - content: - application/json: - schema: - items: - $ref: '#/components/schemas/OrganizationResponseDto' - type: array - description: Ok - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Fetch all organizations - tags: - - Organizations - patch: - operationId: OrganizationController_rename - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RenameOrganizationDto' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/RenameOrganizationDto' - description: Ok - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Rename organization name - tags: - - Organizations - x-speakeasy-name-override: rename - post: - operationId: OrganizationController_createOrganization - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateOrganizationDto' - required: true - responses: - "201": - content: - application/json: - schema: - $ref: '#/components/schemas/OrganizationResponseDto' - description: Created - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Create an organization - tags: - - Organizations - /v1/organizations/branding: - put: - operationId: OrganizationController_updateBrandingDetails - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateBrandingDetailsDto' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/OrganizationBrandingResponseDto' - description: Ok - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Update organization branding details - tags: - - Organizations - x-speakeasy-group: Organizations.Branding - /v1/organizations/me: - get: - operationId: OrganizationController_getSelfOrganizationData - parameters: [] - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/OrganizationResponseDto' - description: Ok - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Fetch current organization details - tags: - - Organizations - /v1/organizations/members: - get: - operationId: OrganizationController_listOrganizationMembers - parameters: [] - responses: - "200": - content: - application/json: - schema: - items: - $ref: '#/components/schemas/MemberResponseDto' - type: array - description: Ok - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Fetch all members of current organizations - tags: - - Organizations - x-speakeasy-group: Organizations.Members - /v1/organizations/members/{memberId}: - delete: - operationId: OrganizationController_remove - parameters: - - in: path - name: memberId - required: true - schema: - type: string - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/MemberResponseDto' - description: Ok - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Remove a member from organization using memberId - tags: - - Organizations - x-speakeasy-group: Organizations.Members - /v1/subscribers: - get: - description: Returns a list of subscribers, could paginated using the `page` and `limit` query parameter - operationId: SubscribersController_listSubscribers - parameters: - - in: query - name: page - required: false - schema: - type: number - - in: query - name: limit - required: false - schema: - default: 10 - maximum: 100 - type: number - responses: - "200": - content: - application/json: - schema: - allOf: - - $ref: '#/components/schemas/PaginatedResponseDto' - - properties: - data: - items: - $ref: '#/components/schemas/SubscriberResponseDto' - type: array - description: "" - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Get subscribers - tags: - - Subscribers - x-speakeasy-pagination: - inputs: - - in: parameters - name: page - type: page - - in: parameters - name: limit - type: limit - outputs: - results: $.data.resultArray - type: offsetLimit - post: - description: Creates a subscriber entity, in the Novu platform. The subscriber will be later used to receive notifications, and access notification feeds. Communication credentials such as email, phone number, and 3 rd party credentials i.e slack tokens could be later associated to this entity. - operationId: SubscribersController_createSubscriber - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateSubscriberRequestDto' - required: true - responses: - "201": - content: - application/json: - schema: - $ref: '#/components/schemas/SubscriberResponseDto' - description: Created - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Create subscriber - tags: - - Subscribers - /v1/subscribers/{subscriberId}: - delete: - description: Deletes a subscriber entity from the Novu platform - operationId: SubscribersController_removeSubscriber - parameters: - - in: path - name: subscriberId - required: true - schema: - type: string - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/DeleteSubscriberResponseDto' - description: Ok - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Delete subscriber - tags: - - Subscribers - get: - description: Get subscriber by your internal id used to identify the subscriber - operationId: SubscribersController_getSubscriber - parameters: - - in: path - name: subscriberId - required: true - schema: - type: string - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/SubscriberResponseDto' - description: Ok - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Get subscriber - tags: - - Subscribers - put: - description: Used to update the subscriber entity with new information - operationId: SubscribersController_updateSubscriber - parameters: - - in: path - name: subscriberId - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateSubscriberRequestDto' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/SubscriberResponseDto' - description: Ok - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Update subscriber - tags: - - Subscribers - /v1/subscribers/{subscriberId}/credentials: - patch: - description: |- - Subscriber credentials associated to the delivery methods such as slack and push tokens. - This endpoint appends provided credentials and deviceTokens to the existing ones. - operationId: SubscribersController_modifySubscriberChannel - parameters: - - in: path - name: subscriberId - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateSubscriberChannelRequestDto' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/SubscriberResponseDto' - description: Ok - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Modify subscriber credentials - tags: - - Subscribers - x-speakeasy-group: Subscribers.Credentials - x-speakeasy-name-override: append - put: - description: Subscriber credentials associated to the delivery methods such as slack and push tokens. - operationId: SubscribersController_updateSubscriberChannel - parameters: - - in: path - name: subscriberId - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateSubscriberChannelRequestDto' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/SubscriberResponseDto' - description: Ok - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Update subscriber credentials - tags: - - Subscribers - x-speakeasy-group: Subscribers.Credentials - /v1/subscribers/{subscriberId}/credentials/{providerId}: - delete: - description: Delete subscriber credentials such as slack and expo tokens. - operationId: SubscribersController_deleteSubscriberCredentials - parameters: - - in: path - name: subscriberId - required: true - schema: - type: string - - in: path - name: providerId - required: true - schema: - type: string - responses: - "204": - description: "" - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Delete subscriber credentials by providerId - tags: - - Subscribers - x-speakeasy-group: Subscribers.Credentials - /v1/subscribers/{subscriberId}/credentials/{providerId}/oauth: - get: - operationId: SubscribersController_chatAccessOauth - parameters: - - in: path - name: subscriberId - required: true - schema: - type: string - - in: path - name: providerId - required: true - schema: - type: string - - in: query - name: hmacHash - required: true - schema: - type: string - - in: query - name: environmentId - required: true - schema: - type: string - - in: query - name: integrationIdentifier - required: false - schema: - type: string - responses: - "200": - description: "" - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Handle chat oauth - tags: - - Subscribers - x-speakeasy-group: Subscribers.Authentication - x-speakeasy-name-override: chatAccessOauth - /v1/subscribers/{subscriberId}/credentials/{providerId}/oauth/callback: - get: - operationId: SubscribersController_chatOauthCallback - parameters: - - in: path - name: subscriberId - required: true - schema: - type: string - - in: path - name: providerId - required: true - schema: - type: string - - in: query - name: code - required: true - schema: - type: string - - in: query - name: hmacHash - required: true - schema: - type: string - - in: query - name: environmentId - required: true - schema: - type: string - - in: query - name: integrationIdentifier - required: false - schema: - type: string - responses: - "200": - content: - application/json: - schema: - type: object - description: "" - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Handle providers oauth redirect - tags: - - Subscribers - x-speakeasy-group: Subscribers.Authentication - x-speakeasy-name-override: chatAccessOauthCallBack - /v1/subscribers/{subscriberId}/messages/{messageId}/actions/{type}: - post: - operationId: SubscribersController_markActionAsSeen - parameters: - - in: path - name: messageId - required: true - schema: - type: string - - in: path - name: type - required: true - schema: - type: string - - in: path - name: subscriberId - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/MarkMessageActionAsSeenDto' - required: true - responses: - "201": - content: - application/json: - schema: - $ref: '#/components/schemas/MessageResponseDto' - description: Created - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Mark message action as seen - tags: - - Subscribers - x-speakeasy-group: Subscribers.Messages - x-speakeasy-name-override: updateAsSeen - /v1/subscribers/{subscriberId}/messages/mark-all: - post: - operationId: SubscribersController_markAllUnreadAsRead - parameters: - - in: path - name: subscriberId - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/MarkAllMessageAsRequestDto' - required: true - responses: - "201": - content: - application/json: - schema: - type: number - description: "" - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Marks all the subscriber messages as read, unread, seen or unseen. Optionally you can pass feed id (or array) to mark messages of a particular feed. - tags: - - Subscribers - x-speakeasy-group: Subscribers.Messages - x-speakeasy-name-override: markAll - /v1/subscribers/{subscriberId}/messages/mark-as: - post: - operationId: SubscribersController_markMessagesAs - parameters: - - in: path - name: subscriberId - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/MessageMarkAsRequestDto' - required: true - responses: - "201": - content: - application/json: - schema: - items: - $ref: '#/components/schemas/MessageEntity' - type: array - description: "" - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Mark a subscriber messages as seen, read, unseen or unread - tags: - - Subscribers - x-speakeasy-group: Subscribers.Messages - x-speakeasy-name-override: markAllAs - /v1/subscribers/{subscriberId}/notifications/feed: - get: - operationId: SubscribersController_getNotificationsFeed - parameters: - - in: path - name: subscriberId - required: true - schema: - type: string - - in: query - name: page - required: false - schema: - type: number - - in: query - name: limit - required: false - schema: - default: 10 - maximum: 100 - type: number - - in: query - name: read - required: false - schema: - type: boolean - - in: query - name: seen - required: false - schema: - type: boolean - - description: Base64 encoded string of the partial payload JSON object - example: 'btoa(JSON.stringify({ foo: 123 })) results in base64 encoded string like eyJmb28iOjEyM30=' - in: query - name: payload - required: false - schema: - type: string - responses: - "200": - content: - application/json: - schema: - allOf: - - $ref: '#/components/schemas/PaginatedResponseDto' - - properties: - data: - items: - $ref: '#/components/schemas/FeedResponseDto' - type: array - description: "" - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Get in-app notification feed for a particular subscriber - tags: - - Subscribers - x-speakeasy-group: Subscribers.Notifications - /v1/subscribers/{subscriberId}/notifications/unseen: - get: - operationId: SubscribersController_getUnseenCount - parameters: - - in: query - name: seen - required: true - schema: - type: boolean - - in: path - name: subscriberId - required: true - schema: - type: string - - in: query - name: limit - required: true - schema: - type: number - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/UnseenCountResponse' - description: Ok - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Get the unseen in-app notifications count for subscribers feed - tags: - - Subscribers - x-speakeasy-group: Subscribers.Notifications - x-speakeasy-name-override: unseenCount - /v1/subscribers/{subscriberId}/online-status: - patch: - description: Used to update the subscriber isOnline flag. - operationId: SubscribersController_updateSubscriberOnlineFlag - parameters: - - in: path - name: subscriberId - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateSubscriberOnlineFlagRequestDto' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/SubscriberResponseDto' - description: Ok - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Update subscriber online status - tags: - - Subscribers - x-speakeasy-group: Subscribers.properties - x-speakeasy-name-override: updateOnlineFlag - /v1/subscribers/{subscriberId}/preferences: - get: - operationId: SubscribersController_listSubscriberPreferences - parameters: - - in: path - name: subscriberId - required: true - schema: - type: string - responses: - "200": - content: - application/json: - schema: - items: - $ref: '#/components/schemas/UpdateSubscriberPreferenceResponseDto' - type: array - description: Ok - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Get subscriber preferences - tags: - - Subscribers - x-speakeasy-group: Subscribers.Preferences - patch: - operationId: SubscribersController_updateSubscriberGlobalPreferences - parameters: - - in: path - name: subscriberId - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateSubscriberGlobalPreferencesRequestDto' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateSubscriberPreferenceResponseDto' - description: Ok - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Update subscriber global preferences - tags: - - Subscribers - x-speakeasy-group: Subscribers.Preferences - x-speakeasy-name-override: updateGlobal - /v1/subscribers/{subscriberId}/preferences/{parameter}: - get: - operationId: SubscribersController_getSubscriberPreferenceByLevel - parameters: - - description: 'the preferences level to be retrieved( Subscriber / Topic) ' - in: path - name: parameter - required: true - schema: - enum: - - Subscriber - - Topic - type: string - - in: path - name: subscriberId - required: true - schema: - type: string - responses: - "200": - content: - application/json: - schema: - items: - $ref: '#/components/schemas/GetSubscriberPreferencesResponseDto' - type: array - description: Ok - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Get subscriber preferences by level - tags: - - Subscribers - x-speakeasy-group: Subscribers.Preferences - x-speakeasy-name-override: retrieveByLevel - patch: - operationId: SubscribersController_updateSubscriberPreference - parameters: - - in: path - name: subscriberId - required: true - schema: - type: string - - in: path - name: parameter - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateSubscriberPreferenceRequestDto' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateSubscriberPreferenceResponseDto' - description: Ok - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Update subscriber preference - tags: - - Subscribers - x-speakeasy-group: Subscribers.Preferences - /v1/subscribers/bulk: - post: - description: "\n Using this endpoint you can create multiple subscribers at once, to avoid multiple calls to the API.\n The bulk API is limited to 500 subscribers per request.\n " - operationId: SubscribersController_bulkCreateSubscribers - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/BulkSubscriberCreateDto' - required: true - responses: - "201": - description: "" - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Bulk create subscribers - tags: - - Subscribers - x-speakeasy-name-override: createBulk - /v1/tenants: - get: - description: Returns a list of tenants, could paginated using the `page` and `limit` query parameter - operationId: TenantController_listTenants - parameters: - - in: query - name: page - required: false - schema: - type: number - - in: query - name: limit - required: false - schema: - default: 10 - maximum: 100 - type: number - responses: - "200": - content: - application/json: - schema: - allOf: - - $ref: '#/components/schemas/PaginatedResponseDto' - - properties: - data: - items: - $ref: '#/components/schemas/GetTenantResponseDto' - type: array - description: "" - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Get tenants - tags: - - Tenants - x-speakeasy-pagination: - inputs: - - in: parameters - name: page - type: page - - in: parameters - name: limit - type: limit - outputs: - results: $.data.resultArray - type: offsetLimit - post: - description: Create tenant under the current environment - operationId: TenantController_createTenant - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateTenantRequestDto' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/CreateTenantResponseDto' - description: Ok - "201": - content: - application/json: - schema: - $ref: '#/components/schemas/CreateTenantResponseDto' - description: "" - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: A tenant with the same identifier is already exist. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Create tenant - tags: - - Tenants - /v1/tenants/{identifier}: - delete: - description: Deletes a tenant entity from the Novu platform - operationId: TenantController_removeTenant - parameters: - - in: path - name: identifier - required: true - schema: - type: string - responses: - "204": - description: The tenant has been deleted correctly - "404": - description: The tenant with the identifier provided does not exist in the database so it can not be deleted. - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Delete tenant - tags: - - Tenants - get: - description: Get tenant by your internal id used to identify the tenant - operationId: TenantController_getTenantById - parameters: - - in: path - name: identifier - required: true - schema: - type: string - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/GetTenantResponseDto' - description: Ok - "404": - description: The tenant with the identifier provided does not exist in the database. - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Get tenant - tags: - - Tenants - patch: - description: Update tenant by your internal id used to identify the tenant - operationId: TenantController_updateTenant - parameters: - - in: path - name: identifier - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateTenantRequestDto' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateTenantResponseDto' - description: Ok - "404": - description: The tenant with the identifier provided does not exist in the database. - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Update tenant - tags: - - Tenants - /v1/topics: - get: - description: Returns a list of topics that can be paginated using the `page` query parameter and filtered by the topic key with the `key` query parameter - operationId: TopicsController_listTopics - parameters: - - description: Number of page for the pagination - in: query - name: page - required: false - schema: - default: 0 - minimum: 0 - type: number - - description: Size of page for the pagination - in: query - name: pageSize - required: false - schema: - default: 10 - minimum: 0 - type: number - - description: Topic key - in: query - name: key - required: false - schema: - type: string - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/FilterTopicsResponseDto' - description: "" - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Filter topics - tags: - - Topics - post: - description: Create a topic - operationId: TopicsController_createTopic - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateTopicRequestDto' - required: true - responses: - "201": - content: - application/json: - schema: - $ref: '#/components/schemas/CreateTopicResponseDto' - description: Created - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Topic creation - tags: - - Topics - /v1/topics/{topicKey}: - delete: - description: Delete a topic by its topic key if it has no subscribers - operationId: TopicsController_deleteTopic - parameters: - - in: path - name: topicKey - required: true - schema: - type: string - responses: - "204": - description: The topic has been deleted correctly - "404": - description: The topic with the key provided does not exist in the database so it can not be deleted. - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The topic you are trying to delete has subscribers assigned to it. Delete the subscribers before deleting the topic. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Delete topic - tags: - - Topics - get: - description: Get a topic by its topic key - operationId: TopicsController_getTopic - parameters: - - in: path - name: topicKey - required: true - schema: - type: string - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/GetTopicResponseDto' - description: Ok - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Get topic - tags: - - Topics - patch: - description: Rename a topic by providing a new name - operationId: TopicsController_renameTopic - parameters: - - in: path - name: topicKey - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RenameTopicRequestDto' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/RenameTopicResponseDto' - description: Ok - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Rename a topic - tags: - - Topics - x-speakeasy-name-override: rename - /v1/topics/{topicKey}/subscribers: - post: - description: Add subscribers to a topic by key - operationId: TopicsController_addSubscribers - parameters: - - in: path - name: topicKey - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/AddSubscribersRequestDto' - required: true - responses: - "200": - description: "" - "204": - description: "" - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Subscribers addition - tags: - - Topics - x-speakeasy-group: Topics.Subscribers - x-speakeasy-name-override: assign - /v1/topics/{topicKey}/subscribers/{externalSubscriberId}: - get: - description: Check if a subscriber belongs to a certain topic - operationId: TopicsController_getTopicSubscriber - parameters: - - in: path - name: topicKey - required: true - schema: - type: string - - in: path - name: externalSubscriberId - required: true - schema: - type: string - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/TopicSubscriberDto' - description: "" - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Check topic subscriber - tags: - - Topics - x-speakeasy-group: Topics.Subscribers - /v1/topics/{topicKey}/subscribers/removal: - post: - description: Remove subscribers from a topic - operationId: TopicsController_removeSubscribers - parameters: - - in: path - name: topicKey - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RemoveSubscribersRequestDto' - required: true - responses: - "204": - description: "" - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Subscribers removal - tags: - - Topics - x-speakeasy-group: Topics.Subscribers - /v1/workflows: - get: - description: Workflows were previously named notification templates - operationId: WorkflowController_listWorkflows - parameters: - - in: query - name: page - required: false - schema: - type: number - - in: query - name: limit - required: false - schema: - default: 10 - maximum: 100 - type: number - - description: A query string to filter the results. It allows filtering based on either the name or trigger identifier of the workflow items. - in: query - name: query - required: false - schema: - type: string - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/WorkflowsResponseDto' - description: Ok - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Get workflows - tags: - - Workflows - post: - description: Workflow was previously named notification template - operationId: WorkflowController_create - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateWorkflowRequestDto' - required: true - responses: - "201": - content: - application/json: - schema: - $ref: '#/components/schemas/WorkflowResponse' - description: Created - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Create workflow - tags: - - Workflows - /v1/workflows/{workflowId}: - delete: - description: Workflow was previously named notification template - operationId: WorkflowController_deleteWorkflowById - parameters: - - in: path - name: workflowId - required: true - schema: - type: string - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/DataBooleanDto' - description: "" - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Delete workflow - tags: - - Workflows - get: - description: Workflow was previously named notification template - operationId: WorkflowController_getWorkflowById - parameters: - - in: path - name: workflowId - required: true - schema: - type: string - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/WorkflowResponse' - description: Ok - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Get workflow - tags: - - Workflows - put: - description: Workflow was previously named notification template - operationId: WorkflowController_updateWorkflowById - parameters: - - in: path - name: workflowId - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateWorkflowRequestDto' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/WorkflowResponse' - description: Ok - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Update workflow - tags: - - Workflows - /v1/workflows/{workflowId}/status: - put: - description: Workflow was previously named notification template - operationId: WorkflowController_updateActiveStatus - parameters: - - in: path - name: workflowId - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ChangeWorkflowStatusRequestDto' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/WorkflowResponse' - description: Ok - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Update workflow status - tags: - - Workflows - x-speakeasy-group: Workflows.Status - /v1/workflows/variables: - get: - description: Get the variables that can be used in the workflow - operationId: WorkflowController_getWorkflowVariables - parameters: [] - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/VariablesResponseDto' - description: Ok - "409": - content: - application/json: - schema: - example: Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second - type: string - description: The request could not be completed due to a conflict with the current state of the target resource. - "429": - content: - application/json: - schema: - example: API rate limit exceeded - type: string - description: 'The client has sent too many requests in a given amount of time. ' - "503": - content: - application/json: - schema: - example: Please wait some time, then try again. - type: string - description: The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. - security: - - api-key: [] - summary: Get available variables - tags: - - Workflows - x-speakeasy-group: Workflows.Variables -servers: - - url: https://api.novu.co - - url: https://eu.api.novu.co -tags: - - description: Events represent a change in state of a subscriber. They are used to trigger workflows, and enable you to send notifications to subscribers based on their actions. - externalDocs: - url: https://docs.novu.co/workflows - name: Events - - description: A subscriber in Novu represents someone who should receive a message. A subscriber’s profile information contains important attributes about the subscriber that will be used in messages (name, email). The subscriber object can contain other key-value pairs that can be used to further personalize your messages. - externalDocs: - url: https://docs.novu.co/subscribers/subscribers - name: Subscribers - - description: Topics are a way to group subscribers together so that they can be notified of events at once. A topic is identified by a custom key. This can be helpful for things like sending out marketing emails or notifying users of new features. Topics can also be used to send notifications to the subscribers who have been grouped together based on their interests, location, activities and much more. - externalDocs: - url: https://docs.novu.co/subscribers/topics - name: Topics - - description: A notification conveys information from source to recipient, triggered by a workflow acting as a message blueprint. Notifications can be individual or bundled as digest for user-friendliness. - externalDocs: - url: https://docs.novu.co/getting-started/introduction - name: Notification - - description: With the help of the Integration Store, you can easily integrate your favorite delivery provider. During the runtime of the API, the Integrations Store is responsible for storing the configurations of all the providers. - externalDocs: - url: https://docs.novu.co/channels-and-providers/integration-store - name: Integrations - - description: Novu allows the creation of layouts - a specific HTML design or structure to wrap content of email notifications. Layouts can be manipulated and assigned to new or existing workflows within the Novu platform, allowing users to create, manage, and assign these layouts to workflows, so they can be reused to structure the appearance of notifications sent through the platform. - externalDocs: - url: https://docs.novu.co/content-creation-design/layouts - name: Layouts - - description: All notifications are sent via a workflow. Each workflow acts as a container for the logic and blueprint that are associated with a type of notification in your system. - externalDocs: - url: https://docs.novu.co/workflows - name: Workflows - - description: Deprecated. Use Workflows (/workflows) instead, which provide the same functionality under a new name. - name: Notification Templates - - description: Workflow groups are used to organize workflows into logical groups. - name: Workflow groups - - description: Changes represent a change in state of an environment. They are analagous to a pending pull request in git, enabling you to test changes before they are applied to your environment and atomically apply them when you are ready. - externalDocs: - url: https://docs.novu.co/platform/environments#promoting-pending-changes-to-production - name: Changes - - description: Novu uses the concept of environments to ensure logical separation of your data and configuration. This means that subscribers, and preferences created in one environment are never accessible to another. - externalDocs: - url: https://docs.novu.co/platform/environments - name: Environments - - description: Inbound Webhook is a feature that allows processing of incoming emails for a domain or subdomain. The feature parses the contents of the email and POSTs the information to a specified URL in a multipart/form-data format. - externalDocs: - url: https://docs.novu.co/platform/inbound-parse-webhook - name: Inbound Parse - - description: Novu provides a notification activity feed that monitors every outgoing message associated with its relevant metadata. This can be used to monitor activity and discover potential issues with a specific provider or a channel type. - externalDocs: - url: https://docs.novu.co/activity-feed - name: Feeds - - description: A tenant represents a group of users. As a developer, when your apps have organizations, they are referred to as tenants. Tenants in Novu provides the ability to tailor specific notification experiences to users of different groups or organizations. - externalDocs: - url: https://docs.novu.co/tenants - name: Tenants - - description: A message in Novu represents a notification delivered to a recipient on a particular channel. Messages contain information about the request that triggered its delivery, a view of the data sent to the recipient, and a timeline of its lifecycle events. Learn more about messages. - externalDocs: - url: https://docs.novu.co/workflows/messages - name: Messages - - description: An organization serves as a separate entity within your Novu account. Each organization you create has its own separate integration store, workflows, subscribers, and API keys. This separation of resources allows you to manage multi-tenant environments and separate domains within a single account. - externalDocs: - url: https://docs.novu.co/platform/organizations - name: Organizations - - description: Execution details are used to track the execution of a workflow. They provided detailed information on the execution of a workflow, including the status of each step, the input and output of each step, and the overall status of the execution. - externalDocs: - url: https://docs.novu.co/activity-feed - name: Execution Details - - description: Translations are used to localize your messages for different languages and regions. Novu provides a way to create and manage translations for your messages. You can create translations for your messages in different languages and regions, and assign them to your subscribers based on their preferences. - externalDocs: - url: https://docs.novu.co/content-creation-design/translations - name: Translations -x-speakeasy-name-override: - - methodNameOverride: retrieve - operationId: ^.*get.* - - methodNameOverride: retrieve - operationId: ^.*retrieve.* - - methodNameOverride: create - operationId: ^.*create.* - - methodNameOverride: update - operationId: ^.*update.* - - methodNameOverride: list - operationId: ^.*list.* - - methodNameOverride: delete - operationId: ^.*delete.* - - methodNameOverride: delete - operationId: ^.*remove.* -x-speakeasy-retries: - backoff: - exponent: 1.5 - initialInterval: 500 - maxElapsedTime: 3600000 - maxInterval: 30000 - retryConnectionErrors: true - statusCodes: - - "408" - - "409" - - "429" - - 5XX - strategy: backoff +{ + "openapi": "3.0.0", + "paths": { + "/v1/environments/me": { + "get": { + "operationId": "EnvironmentsController_getCurrentEnvironment", + "summary": "Get current environment", + "parameters": [], + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EnvironmentResponseDto" + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Environments" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/environments": { + "get": { + "operationId": "EnvironmentsController_listMyEnvironments", + "summary": "Get environments", + "parameters": [], + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EnvironmentResponseDto" + } + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Environments" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/environments/api-keys": { + "get": { + "operationId": "EnvironmentsController_listOrganizationApiKeys", + "x-speakeasy-group": "Environments.ApiKeys", + "summary": "Get api keys", + "parameters": [], + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ApiKey" + } + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Environments" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/execution-details": { + "get": { + "operationId": "ExecutionDetailsController_getExecutionDetailsForNotification", + "summary": "Get execution details", + "parameters": [ + { + "name": "notificationId", + "required": true, + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "subscriberId", + "required": true, + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExecutionDetailsResponseDto" + } + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Execution Details" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/workflows": { + "get": { + "operationId": "WorkflowController_listWorkflows", + "summary": "Get workflows", + "description": "Workflows were previously named notification templates", + "parameters": [ + { + "name": "page", + "required": false, + "in": "query", + "schema": { + "type": "number" + } + }, + { + "name": "limit", + "required": false, + "in": "query", + "schema": { + "maximum": 100, + "default": 10, + "type": "number" + } + }, + { + "name": "query", + "required": false, + "in": "query", + "description": "A query string to filter the results. It allows filtering based on either the name or trigger identifier of the workflow items.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/WorkflowsResponseDto" + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Workflows" + ], + "security": [ + { + "api-key": [] + } + ] + }, + "post": { + "operationId": "WorkflowController_create", + "summary": "Create workflow", + "description": "Workflow was previously named notification template", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateWorkflowRequestDto" + } + } + } + }, + "responses": { + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/WorkflowResponse" + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Workflows" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/workflows/{workflowId}": { + "put": { + "operationId": "WorkflowController_updateWorkflowById", + "summary": "Update workflow", + "description": "Workflow was previously named notification template", + "parameters": [ + { + "name": "workflowId", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateWorkflowRequestDto" + } + } + } + }, + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/WorkflowResponse" + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Workflows" + ], + "security": [ + { + "api-key": [] + } + ] + }, + "delete": { + "operationId": "WorkflowController_deleteWorkflowById", + "summary": "Delete workflow", + "description": "Workflow was previously named notification template", + "parameters": [ + { + "name": "workflowId", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DataBooleanDto" + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Workflows" + ], + "security": [ + { + "api-key": [] + } + ] + }, + "get": { + "operationId": "WorkflowController_getWorkflowById", + "summary": "Get workflow", + "description": "Workflow was previously named notification template", + "parameters": [ + { + "name": "workflowId", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/WorkflowResponse" + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Workflows" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/workflows/variables": { + "get": { + "operationId": "WorkflowController_getWorkflowVariables", + "x-speakeasy-group": "Workflows.Variables", + "summary": "Get available variables", + "description": "Get the variables that can be used in the workflow", + "parameters": [], + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VariablesResponseDto" + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Workflows" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/workflows/{workflowId}/status": { + "put": { + "operationId": "WorkflowController_updateActiveStatus", + "x-speakeasy-group": "Workflows.Status", + "summary": "Update workflow status", + "description": "Workflow was previously named notification template", + "parameters": [ + { + "name": "workflowId", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ChangeWorkflowStatusRequestDto" + } + } + } + }, + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/WorkflowResponse" + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Workflows" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/events/trigger": { + "post": { + "operationId": "EventsController_trigger", + "x-speakeasy-group": "", + "x-speakeasy-usage-example": { + "title": "Trigger Notification Event" + }, + "x-speakeasy-name-override": "trigger", + "summary": "Trigger event", + "description": "\n Trigger event is the main (and only) way to send notifications to subscribers. \n The trigger identifier is used to match the particular workflow associated with it. \n Additional information can be passed according the body interface below.\n ", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TriggerEventRequestDto" + } + } + } + }, + "responses": { + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TriggerEventResponseDto" + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Events" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/events/trigger/bulk": { + "post": { + "operationId": "EventsController_triggerBulk", + "x-speakeasy-group": "", + "x-speakeasy-usage-example": { + "title": "Trigger Notification Events in Bulk" + }, + "x-speakeasy-name-override": "triggerBulk", + "summary": "Bulk trigger event", + "description": "\n Using this endpoint you can trigger multiple events at once, to avoid multiple calls to the API.\n The bulk API is limited to 100 events per request.\n ", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkTriggerEventDto" + } + } + } + }, + "responses": { + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TriggerEventResponseDto" + } + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Events" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/events/trigger/broadcast": { + "post": { + "operationId": "EventsController_broadcastEventToAll", + "x-speakeasy-group": "", + "x-speakeasy-usage-example": { + "title": "Broadcast Event to All" + }, + "x-speakeasy-name-override": "triggerBroadcast", + "summary": "Broadcast event to all", + "description": "Trigger a broadcast event to all existing subscribers, could be used to send announcements, etc.\n In the future could be used to trigger events to a subset of subscribers based on defined filters.", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TriggerEventToAllRequestDto" + } + } + } + }, + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TriggerEventResponseDto" + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Events" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/events/trigger/{transactionId}": { + "delete": { + "operationId": "EventsController_cancel", + "x-speakeasy-group": "", + "x-speakeasy-usage-example": { + "title": "Cancel Triggered Event" + }, + "x-speakeasy-name-override": "cancel", + "summary": "Cancel triggered event", + "description": "\n Using a previously generated transactionId during the event trigger,\n will cancel any active or pending workflows. This is useful to cancel active digests, delays etc...\n ", + "parameters": [ + { + "name": "transactionId", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DataBooleanDto" + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Events" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/notifications": { + "get": { + "operationId": "NotificationsController_listNotifications", + "summary": "Get notifications", + "parameters": [ + { + "name": "channels", + "required": true, + "in": "query", + "schema": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "in_app", + "email", + "sms", + "chat", + "push" + ] + } + } + }, + { + "name": "templates", + "required": true, + "in": "query", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "emails", + "required": true, + "in": "query", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "search", + "required": true, + "in": "query", + "deprecated": true, + "schema": { + "type": "string" + } + }, + { + "name": "subscriberIds", + "required": true, + "in": "query", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "page", + "required": false, + "in": "query", + "schema": { + "default": 0, + "type": "number" + } + }, + { + "name": "transactionId", + "required": false, + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ActivitiesResponseDto" + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Notifications" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/notifications/stats": { + "get": { + "operationId": "NotificationsController_getActivityStats", + "x-speakeasy-group": "Notifications.Stats", + "summary": "Get notification statistics", + "parameters": [], + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ActivityStatsResponseDto" + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Notifications" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/notifications/graph/stats": { + "get": { + "operationId": "NotificationsController_getActivityGraphStats", + "x-speakeasy-name-override": "graph", + "x-speakeasy-group": "Notifications.Stats", + "summary": "Get notification graph statistics", + "parameters": [ + { + "name": "days", + "required": false, + "in": "query", + "schema": { + "type": "number" + } + } + ], + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ActivityGraphStatesResponse" + } + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Notifications" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/notifications/{notificationId}": { + "get": { + "operationId": "NotificationsController_getNotification", + "summary": "Get notification", + "parameters": [ + { + "name": "notificationId", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ActivityNotificationResponseDto" + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Notifications" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/notification-groups": { + "post": { + "operationId": "NotificationGroupsController_createNotificationGroup", + "summary": "Create workflow group", + "description": "workflow group was previously named notification group", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateNotificationGroupRequestDto" + } + } + } + }, + "responses": { + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotificationGroupResponseDto" + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Workflow groups" + ], + "security": [ + { + "api-key": [] + } + ] + }, + "get": { + "operationId": "NotificationGroupsController_listNotificationGroups", + "summary": "Get workflow groups", + "description": "workflow group was previously named notification group", + "parameters": [], + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NotificationGroupResponseDto" + } + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Workflow groups" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/notification-groups/{id}": { + "get": { + "operationId": "NotificationGroupsController_getNotificationGroup", + "summary": "Get workflow group", + "description": "workflow group was previously named notification group", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotificationGroupResponseDto" + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Workflow groups" + ], + "security": [ + { + "api-key": [] + } + ] + }, + "patch": { + "operationId": "NotificationGroupsController_updateNotificationGroup", + "summary": "Update workflow group", + "description": "workflow group was previously named notification group", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateNotificationGroupRequestDto" + } + } + } + }, + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotificationGroupResponseDto" + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Workflow groups" + ], + "security": [ + { + "api-key": [] + } + ] + }, + "delete": { + "operationId": "NotificationGroupsController_deleteNotificationGroup", + "summary": "Delete workflow group", + "description": "workflow group was previously named notification group", + "parameters": [ + { + "name": "id", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteNotificationGroupResponseDto" + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Workflow groups" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/organizations/me": { + "get": { + "operationId": "EEOrganizationController_getMyOrganization", + "summary": "Fetch current organization details", + "parameters": [], + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OrganizationResponseDto" + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Organizations" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/organizations/branding": { + "put": { + "operationId": "EEOrganizationController_updateBrandingDetails", + "summary": "Update organization branding details", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateBrandingDetailsDto" + } + } + } + }, + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OrganizationBrandingResponseDto" + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Organizations" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/organizations": { + "patch": { + "operationId": "EEOrganizationController_renameOrganization", + "summary": "Rename organization name", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RenameOrganizationDto" + } + } + } + }, + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RenameOrganizationDto" + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Organizations" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/integrations": { + "get": { + "operationId": "IntegrationsController_listIntegrations", + "summary": "Get integrations", + "description": "Return all the integrations the user has created for that organization. Review v.0.17.0 changelog for a breaking change", + "parameters": [], + "responses": { + "200": { + "description": "The list of integrations belonging to the organization that are successfully returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/IntegrationResponseDto" + } + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Integrations" + ], + "security": [ + { + "api-key": [] + } + ] + }, + "post": { + "operationId": "IntegrationsController_createIntegration", + "summary": "Create integration", + "description": "Create an integration for the current environment the user is based on the API key provided", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateIntegrationRequestDto" + } + } + } + }, + "responses": { + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IntegrationResponseDto" + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Integrations" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/integrations/active": { + "get": { + "operationId": "IntegrationsController_getActiveIntegrations", + "x-speakeasy-name-override": "listActive", + "summary": "Get active integrations", + "description": "Return all the active integrations the user has created for that organization. Review v.0.17.0 changelog for a breaking change", + "parameters": [], + "responses": { + "200": { + "description": "The list of active integrations belonging to the organization that are successfully returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/IntegrationResponseDto" + } + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Integrations" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/integrations/webhook/provider/{providerOrIntegrationId}/status": { + "get": { + "operationId": "IntegrationsController_getWebhookSupportStatus", + "x-speakeasy-group": "Integrations.Webhooks", + "summary": "Get webhook support status for provider", + "description": "Return the status of the webhook for this provider, if it is supported or if it is not based on a boolean value", + "parameters": [ + { + "name": "providerOrIntegrationId", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The status of the webhook for the provider requested", + "content": { + "application/json": { + "schema": { + "type": "boolean" + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Integrations" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/integrations/{integrationId}": { + "put": { + "operationId": "IntegrationsController_updateIntegrationById", + "summary": "Update integration", + "parameters": [ + { + "name": "integrationId", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateIntegrationRequestDto" + } + } + } + }, + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IntegrationResponseDto" + } + } + } + }, + "404": { + "description": "The integration with the integrationId provided does not exist in the database." + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Integrations" + ], + "security": [ + { + "api-key": [] + } + ] + }, + "delete": { + "operationId": "IntegrationsController_removeIntegration", + "summary": "Delete integration", + "parameters": [ + { + "name": "integrationId", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/IntegrationResponseDto" + } + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Integrations" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/integrations/{integrationId}/set-primary": { + "post": { + "operationId": "IntegrationsController_setIntegrationAsPrimary", + "x-speakeasy-name-override": "setAsPrimary", + "summary": "Set integration as primary", + "parameters": [ + { + "name": "integrationId", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IntegrationResponseDto" + } + } + } + }, + "404": { + "description": "The integration with the integrationId provided does not exist in the database." + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Integrations" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/changes": { + "get": { + "operationId": "ChangesController_getChanges", + "summary": "Get changes", + "parameters": [ + { + "name": "page", + "required": false, + "in": "query", + "schema": { + "type": "number" + } + }, + { + "name": "limit", + "required": false, + "in": "query", + "schema": { + "maximum": 100, + "default": 10, + "type": "number" + } + }, + { + "name": "promoted", + "required": true, + "in": "query", + "schema": { + "default": "false", + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ChangesResponseDto" + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Changes" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/changes/count": { + "get": { + "operationId": "ChangesController_getChangesCount", + "x-speakeasy-name-override": "count", + "summary": "Get changes count", + "parameters": [], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DataNumberDto" + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Changes" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/changes/bulk/apply": { + "post": { + "operationId": "ChangesController_bulkApplyDiff", + "x-speakeasy-name-override": "applyBulk", + "summary": "Apply changes", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkApplyChangeDto" + } + } + } + }, + "responses": { + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ChangeResponseDto" + } + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Changes" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/changes/{changeId}/apply": { + "post": { + "operationId": "ChangesController_applyDiff", + "x-speakeasy-name-override": "apply", + "summary": "Apply change", + "parameters": [ + { + "name": "changeId", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "responses": { + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ChangeResponseDto" + } + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Changes" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/subscribers": { + "get": { + "operationId": "SubscribersController_listSubscribers", + "x-speakeasy-pagination": { + "type": "offsetLimit", + "inputs": [ + { + "name": "page", + "in": "parameters", + "type": "page" + }, + { + "name": "limit", + "in": "parameters", + "type": "limit" + } + ], + "outputs": { + "results": "$.data.resultArray" + } + }, + "summary": "Get subscribers", + "description": "Returns a list of subscribers, could paginated using the `page` and `limit` query parameter", + "parameters": [ + { + "name": "page", + "required": false, + "in": "query", + "schema": { + "type": "number" + } + }, + { + "name": "limit", + "required": false, + "in": "query", + "schema": { + "maximum": 100, + "default": 10, + "type": "number" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PaginatedResponseDto" + }, + { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SubscriberResponseDto" + } + } + } + } + ] + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Subscribers" + ], + "security": [ + { + "api-key": [] + } + ] + }, + "post": { + "operationId": "SubscribersController_createSubscriber", + "summary": "Create subscriber", + "description": "Creates a subscriber entity, in the Novu platform. The subscriber will be later used to receive notifications, and access notification feeds. Communication credentials such as email, phone number, and 3 rd party credentials i.e slack tokens could be later associated to this entity.", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateSubscriberRequestDto" + } + } + } + }, + "responses": { + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SubscriberResponseDto" + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Subscribers" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/subscribers/{subscriberId}": { + "get": { + "operationId": "SubscribersController_getSubscriber", + "summary": "Get subscriber", + "description": "Get subscriber by your internal id used to identify the subscriber", + "parameters": [ + { + "name": "subscriberId", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SubscriberResponseDto" + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Subscribers" + ], + "security": [ + { + "api-key": [] + } + ] + }, + "put": { + "operationId": "SubscribersController_updateSubscriber", + "summary": "Update subscriber", + "description": "Used to update the subscriber entity with new information", + "parameters": [ + { + "name": "subscriberId", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateSubscriberRequestDto" + } + } + } + }, + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SubscriberResponseDto" + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Subscribers" + ], + "security": [ + { + "api-key": [] + } + ] + }, + "delete": { + "operationId": "SubscribersController_removeSubscriber", + "summary": "Delete subscriber", + "description": "Deletes a subscriber entity from the Novu platform", + "parameters": [ + { + "name": "subscriberId", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteSubscriberResponseDto" + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Subscribers" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/subscribers/bulk": { + "post": { + "operationId": "SubscribersController_bulkCreateSubscribers", + "x-speakeasy-name-override": "createBulk", + "summary": "Bulk create subscribers", + "description": "\n Using this endpoint you can create multiple subscribers at once, to avoid multiple calls to the API.\n The bulk API is limited to 500 subscribers per request.\n ", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BulkSubscriberCreateDto" + } + } + } + }, + "responses": { + "201": { + "description": "" + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Subscribers" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/subscribers/{subscriberId}/credentials": { + "put": { + "operationId": "SubscribersController_updateSubscriberChannel", + "x-speakeasy-group": "Subscribers.Credentials", + "summary": "Update subscriber credentials", + "description": "Subscriber credentials associated to the delivery methods such as slack and push tokens.", + "parameters": [ + { + "name": "subscriberId", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateSubscriberChannelRequestDto" + } + } + } + }, + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SubscriberResponseDto" + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Subscribers" + ], + "security": [ + { + "api-key": [] + } + ] + }, + "patch": { + "operationId": "SubscribersController_modifySubscriberChannel", + "x-speakeasy-name-override": "append", + "x-speakeasy-group": "Subscribers.Credentials", + "summary": "Modify subscriber credentials", + "description": "Subscriber credentials associated to the delivery methods such as slack and push tokens.\n This endpoint appends provided credentials and deviceTokens to the existing ones.", + "parameters": [ + { + "name": "subscriberId", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateSubscriberChannelRequestDto" + } + } + } + }, + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SubscriberResponseDto" + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Subscribers" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/subscribers/{subscriberId}/credentials/{providerId}": { + "delete": { + "operationId": "SubscribersController_deleteSubscriberCredentials", + "x-speakeasy-group": "Subscribers.Credentials", + "summary": "Delete subscriber credentials by providerId", + "description": "Delete subscriber credentials such as slack and expo tokens.", + "parameters": [ + { + "name": "subscriberId", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + }, + { + "name": "providerId", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "" + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Subscribers" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/subscribers/{subscriberId}/online-status": { + "patch": { + "operationId": "SubscribersController_updateSubscriberOnlineFlag", + "x-speakeasy-name-override": "updateOnlineFlag", + "x-speakeasy-group": "Subscribers.properties", + "summary": "Update subscriber online status", + "description": "Used to update the subscriber isOnline flag.", + "parameters": [ + { + "name": "subscriberId", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateSubscriberOnlineFlagRequestDto" + } + } + } + }, + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SubscriberResponseDto" + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Subscribers" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/subscribers/{subscriberId}/preferences": { + "get": { + "operationId": "SubscribersController_listSubscriberPreferences", + "x-speakeasy-group": "Subscribers.Preferences", + "summary": "Get subscriber preferences", + "parameters": [ + { + "name": "subscriberId", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UpdateSubscriberPreferenceResponseDto" + } + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Subscribers" + ], + "security": [ + { + "api-key": [] + } + ] + }, + "patch": { + "operationId": "SubscribersController_updateSubscriberGlobalPreferences", + "x-speakeasy-name-override": "updateGlobal", + "x-speakeasy-group": "Subscribers.Preferences", + "summary": "Update subscriber global preferences", + "parameters": [ + { + "name": "subscriberId", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateSubscriberGlobalPreferencesRequestDto" + } + } + } + }, + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateSubscriberPreferenceResponseDto" + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Subscribers" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/subscribers/{subscriberId}/preferences/{parameter}": { + "get": { + "operationId": "SubscribersController_getSubscriberPreferenceByLevel", + "x-speakeasy-name-override": "retrieveByLevel", + "x-speakeasy-group": "Subscribers.Preferences", + "summary": "Get subscriber preferences by level", + "parameters": [ + { + "name": "parameter", + "required": true, + "in": "path", + "description": "the preferences level to be retrieved( Subscriber / Topic) ", + "schema": { + "type": "string", + "enum": [ + "Subscriber", + "Topic" + ] + } + }, + { + "name": "subscriberId", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GetSubscriberPreferencesResponseDto" + } + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Subscribers" + ], + "security": [ + { + "api-key": [] + } + ] + }, + "patch": { + "operationId": "SubscribersController_updateSubscriberPreference", + "x-speakeasy-group": "Subscribers.Preferences", + "summary": "Update subscriber preference", + "parameters": [ + { + "name": "subscriberId", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + }, + { + "name": "parameter", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateSubscriberPreferenceRequestDto" + } + } + } + }, + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateSubscriberPreferenceResponseDto" + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Subscribers" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/subscribers/{subscriberId}/notifications/feed": { + "get": { + "operationId": "SubscribersController_getNotificationsFeed", + "x-speakeasy-group": "Subscribers.Notifications", + "summary": "Get in-app notification feed for a particular subscriber", + "parameters": [ + { + "name": "subscriberId", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + }, + { + "name": "page", + "required": false, + "in": "query", + "schema": { + "type": "number" + } + }, + { + "name": "limit", + "required": false, + "in": "query", + "schema": { + "maximum": 100, + "default": 10, + "type": "number" + } + }, + { + "name": "read", + "required": false, + "in": "query", + "schema": { + "type": "boolean" + } + }, + { + "name": "seen", + "required": false, + "in": "query", + "schema": { + "type": "boolean" + } + }, + { + "name": "payload", + "required": false, + "in": "query", + "description": "Base64 encoded string of the partial payload JSON object", + "example": "btoa(JSON.stringify({ foo: 123 })) results in base64 encoded string like eyJmb28iOjEyM30=", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PaginatedResponseDto" + }, + { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FeedResponseDto" + } + } + } + } + ] + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Subscribers" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/subscribers/{subscriberId}/notifications/unseen": { + "get": { + "operationId": "SubscribersController_getUnseenCount", + "x-speakeasy-name-override": "unseenCount", + "x-speakeasy-group": "Subscribers.Notifications", + "summary": "Get the unseen in-app notifications count for subscribers feed", + "parameters": [ + { + "name": "seen", + "required": true, + "in": "query", + "schema": { + "type": "boolean" + } + }, + { + "name": "subscriberId", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + }, + { + "name": "limit", + "required": true, + "in": "query", + "schema": { + "type": "number" + } + } + ], + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnseenCountResponse" + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Subscribers" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/subscribers/{subscriberId}/messages/mark-as": { + "post": { + "operationId": "SubscribersController_markMessagesAs", + "x-speakeasy-name-override": "markAllAs", + "x-speakeasy-group": "Subscribers.Messages", + "summary": "Mark a subscriber messages as seen, read, unseen or unread", + "parameters": [ + { + "name": "subscriberId", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MessageMarkAsRequestDto" + } + } + } + }, + "responses": { + "201": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MessageEntity" + } + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Subscribers" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/subscribers/{subscriberId}/messages/mark-all": { + "post": { + "operationId": "SubscribersController_markAllUnreadAsRead", + "x-speakeasy-name-override": "markAll", + "x-speakeasy-group": "Subscribers.Messages", + "summary": "Marks all the subscriber messages as read, unread, seen or unseen. Optionally you can pass feed id (or array) to mark messages of a particular feed.", + "parameters": [ + { + "name": "subscriberId", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MarkAllMessageAsRequestDto" + } + } + } + }, + "responses": { + "201": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "number" + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Subscribers" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/subscribers/{subscriberId}/messages/{messageId}/actions/{type}": { + "post": { + "operationId": "SubscribersController_markActionAsSeen", + "x-speakeasy-name-override": "updateAsSeen", + "x-speakeasy-group": "Subscribers.Messages", + "summary": "Mark message action as seen", + "parameters": [ + { + "name": "messageId", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + }, + { + "name": "type", + "required": true, + "in": "path", + "schema": {} + }, + { + "name": "subscriberId", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MarkMessageActionAsSeenDto" + } + } + } + }, + "responses": { + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MessageResponseDto" + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Subscribers" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/subscribers/{subscriberId}/credentials/{providerId}/oauth/callback": { + "get": { + "operationId": "SubscribersController_chatOauthCallback", + "x-speakeasy-name-override": "chatAccessOauthCallBack", + "x-speakeasy-group": "Subscribers.Authentication", + "summary": "Handle providers oauth redirect", + "parameters": [ + { + "name": "subscriberId", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + }, + { + "name": "providerId", + "required": true, + "in": "path", + "schema": {} + }, + { + "name": "code", + "required": true, + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "hmacHash", + "required": true, + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "environmentId", + "required": true, + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "integrationIdentifier", + "required": false, + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Subscribers" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/subscribers/{subscriberId}/credentials/{providerId}/oauth": { + "get": { + "operationId": "SubscribersController_chatAccessOauth", + "x-speakeasy-name-override": "chatAccessOauth", + "x-speakeasy-group": "Subscribers.Authentication", + "summary": "Handle chat oauth", + "parameters": [ + { + "name": "subscriberId", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + }, + { + "name": "providerId", + "required": true, + "in": "path", + "schema": {} + }, + { + "name": "hmacHash", + "required": true, + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "environmentId", + "required": true, + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "integrationIdentifier", + "required": false, + "in": "query", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "" + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Subscribers" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/feeds": { + "post": { + "operationId": "FeedsController_createFeed", + "summary": "Create feed", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateFeedRequestDto" + } + } + } + }, + "responses": { + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FeedResponseDto" + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Feeds" + ], + "security": [ + { + "api-key": [] + } + ] + }, + "get": { + "operationId": "FeedsController_getFeeds", + "summary": "Get feeds", + "parameters": [], + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FeedResponseDto" + } + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Feeds" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/feeds/{feedId}": { + "delete": { + "operationId": "FeedsController_deleteFeedById", + "summary": "Delete feed", + "parameters": [ + { + "name": "feedId", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FeedResponseDto" + } + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Feeds" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/layouts": { + "post": { + "operationId": "LayoutsController_PropertyDescriptor", + "x-speakeasy-name-override": "create", + "summary": "Layout creation", + "description": "Create a layout", + "parameters": [], + "responses": { + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateLayoutResponseDto" + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Layouts" + ], + "security": [ + { + "api-key": [] + } + ] + }, + "get": { + "operationId": "LayoutsController_listLayouts", + "summary": "Filter layouts", + "description": "Returns a list of layouts that can be paginated using the `page` query parameter and filtered by the environment where it is executed from the organization the user belongs to.", + "parameters": [ + { + "name": "page", + "required": false, + "in": "query", + "description": "Number of page for pagination", + "schema": { + "minimum": 0, + "type": "number" + } + }, + { + "name": "pageSize", + "required": false, + "in": "query", + "description": "Size of page for pagination", + "schema": { + "minimum": 0, + "type": "number" + } + }, + { + "name": "sortBy", + "required": false, + "in": "query", + "description": "Sort field. Currently only supported `createdAt`", + "schema": { + "type": "string" + } + }, + { + "name": "orderBy", + "required": false, + "in": "query", + "description": "Direction of the sorting query param", + "schema": { + "enum": [ + "ASC", + "DESC" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The list of layouts that match the criteria of the query params are successfully returned." + }, + "400": { + "description": "Page size can not be larger than the page size limit." + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Layouts" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/layouts/{layoutId}": { + "get": { + "operationId": "LayoutsController_getLayout", + "summary": "Get layout", + "description": "Get a layout by its ID", + "parameters": [ + { + "name": "layoutId", + "required": true, + "in": "path", + "description": "The layout id", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetLayoutResponseDto" + } + } + } + }, + "404": { + "description": "The layout with the layoutId provided does not exist in the database." + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Layouts" + ], + "security": [ + { + "api-key": [] + } + ] + }, + "delete": { + "operationId": "LayoutsController_deleteLayout", + "summary": "Delete layout", + "description": "Execute a soft delete of a layout given a certain ID.", + "parameters": [ + { + "name": "layoutId", + "required": true, + "in": "path", + "description": "The layout id", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "The layout has been deleted correctly" + }, + "404": { + "description": "The layout with the layoutId provided does not exist in the database so it can not be deleted." + }, + "409": { + "description": "Either you are trying to delete a layout that is being used or a layout that is the default in the environment.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Layouts" + ], + "security": [ + { + "api-key": [] + } + ] + }, + "patch": { + "operationId": "LayoutsController_updateLayout", + "summary": "Update a layout", + "description": "Update the name, content and variables of a layout. Also change it to be default or no.", + "parameters": [ + { + "name": "layoutId", + "required": true, + "in": "path", + "description": "The layout id", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateLayoutRequestDto" + } + } + } + }, + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateLayoutResponseDto" + } + } + } + }, + "400": { + "description": "The payload provided or the URL param are not right." + }, + "404": { + "description": "The layout with the layoutId provided does not exist in the database so it can not be updated." + }, + "409": { + "description": "One default layout is needed. If you are trying to turn a default layout as not default, you should turn a different layout as default first and automatically it will be done by the system.", + "content": { + "application/json": { + "schema": { + "example": "One default layout is required" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Layouts" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/layouts/{layoutId}/default": { + "post": { + "operationId": "LayoutsController_setDefaultLayout", + "x-speakeasy-name-override": "setAsDefault", + "summary": "Set default layout", + "description": "Sets the default layout for the environment and updates to non default to the existing default layout (if any).", + "parameters": [ + { + "name": "layoutId", + "required": true, + "in": "path", + "description": "The layout id", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "The selected layout has been set as the default for the environment." + }, + "404": { + "description": "The layout with the layoutId provided does not exist in the database so it can not be set as the default for the environment." + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Layouts" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/messages": { + "get": { + "operationId": "MessagesController_getMessages", + "summary": "Get messages", + "description": "Returns a list of messages, could paginate using the `page` query parameter", + "parameters": [ + { + "name": "channel", + "required": false, + "in": "query", + "schema": { + "enum": [ + "in_app", + "email", + "sms", + "chat", + "push" + ], + "type": "string" + } + }, + { + "name": "subscriberId", + "required": false, + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "transactionId", + "required": false, + "in": "query", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "page", + "required": false, + "in": "query", + "schema": { + "default": 0, + "type": "number" + } + }, + { + "name": "limit", + "required": false, + "in": "query", + "schema": { + "default": 10, + "type": "number" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ActivitiesResponseDto" + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Messages" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/messages/{messageId}": { + "delete": { + "operationId": "MessagesController_deleteMessage", + "summary": "Delete message", + "description": "Deletes a message entity from the Novu platform", + "parameters": [ + { + "name": "messageId", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteMessageResponseDto" + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Messages" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/messages/transaction/{transactionId}": { + "delete": { + "operationId": "MessagesController_deleteMessagesByTransactionId", + "x-speakeasy-name-override": "deleteByTransactionId", + "summary": "Delete messages by transactionId", + "description": "Deletes messages entity from the Novu platform using TransactionId of message", + "parameters": [ + { + "name": "channel", + "required": false, + "in": "query", + "description": "The channel of the message to be deleted", + "schema": { + "enum": [ + "in_app", + "email", + "sms", + "chat", + "push" + ], + "type": "string" + } + }, + { + "name": "transactionId", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "" + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Messages" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/topics": { + "post": { + "operationId": "TopicsController_createTopic", + "summary": "Topic creation", + "description": "Create a topic", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateTopicRequestDto" + } + } + } + }, + "responses": { + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateTopicResponseDto" + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Topics" + ], + "security": [ + { + "api-key": [] + } + ] + }, + "get": { + "operationId": "TopicsController_listTopics", + "summary": "Filter topics", + "description": "Returns a list of topics that can be paginated using the `page` query parameter and filtered by the topic key with the `key` query parameter", + "parameters": [ + { + "name": "page", + "required": false, + "in": "query", + "description": "Number of page for the pagination", + "schema": { + "minimum": 0, + "default": 0, + "type": "number" + } + }, + { + "name": "pageSize", + "required": false, + "in": "query", + "description": "Size of page for the pagination", + "schema": { + "minimum": 0, + "default": 10, + "type": "number" + } + }, + { + "name": "key", + "required": false, + "in": "query", + "description": "Topic key", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FilterTopicsResponseDto" + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Topics" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/topics/{topicKey}/subscribers": { + "post": { + "operationId": "TopicsController_addSubscribers", + "x-speakeasy-name-override": "assign", + "x-speakeasy-group": "Topics.Subscribers", + "summary": "Subscribers addition", + "description": "Add subscribers to a topic by key", + "parameters": [ + { + "name": "topicKey", + "required": true, + "in": "path", + "description": "The topic key", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AddSubscribersRequestDto" + } + } + } + }, + "responses": { + "204": { + "description": "" + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Topics" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/topics/{topicKey}/subscribers/{externalSubscriberId}": { + "get": { + "operationId": "TopicsController_getTopicSubscriber", + "x-speakeasy-group": "Topics.Subscribers", + "summary": "Check topic subscriber", + "description": "Check if a subscriber belongs to a certain topic", + "parameters": [ + { + "name": "externalSubscriberId", + "required": true, + "in": "path", + "description": "The external subscriber id", + "schema": { + "type": "string" + } + }, + { + "name": "topicKey", + "required": true, + "in": "path", + "description": "The topic key", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TopicSubscriberDto" + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Topics" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/topics/{topicKey}/subscribers/removal": { + "post": { + "operationId": "TopicsController_removeSubscribers", + "x-speakeasy-group": "Topics.Subscribers", + "summary": "Subscribers removal", + "description": "Remove subscribers from a topic", + "parameters": [ + { + "name": "topicKey", + "required": true, + "in": "path", + "description": "The topic key", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RemoveSubscribersRequestDto" + } + } + } + }, + "responses": { + "204": { + "description": "" + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Topics" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/topics/{topicKey}": { + "delete": { + "operationId": "TopicsController_deleteTopic", + "summary": "Delete topic", + "description": "Delete a topic by its topic key if it has no subscribers", + "parameters": [ + { + "name": "topicKey", + "required": true, + "in": "path", + "description": "The topic key", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "The topic has been deleted correctly" + }, + "404": { + "description": "The topic with the key provided does not exist in the database so it can not be deleted." + }, + "409": { + "description": "The topic you are trying to delete has subscribers assigned to it. Delete the subscribers before deleting the topic.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Topics" + ], + "security": [ + { + "api-key": [] + } + ] + }, + "get": { + "operationId": "TopicsController_getTopic", + "summary": "Get topic", + "description": "Get a topic by its topic key", + "parameters": [ + { + "name": "topicKey", + "required": true, + "in": "path", + "description": "The topic key", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetTopicResponseDto" + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Topics" + ], + "security": [ + { + "api-key": [] + } + ] + }, + "patch": { + "operationId": "TopicsController_renameTopic", + "x-speakeasy-name-override": "rename", + "summary": "Rename a topic", + "description": "Rename a topic by providing a new name", + "parameters": [ + { + "name": "topicKey", + "required": true, + "in": "path", + "description": "The topic key", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RenameTopicRequestDto" + } + } + } + }, + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RenameTopicResponseDto" + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Topics" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/tenants": { + "get": { + "operationId": "TenantController_listTenants", + "x-speakeasy-pagination": { + "type": "offsetLimit", + "inputs": [ + { + "name": "page", + "in": "parameters", + "type": "page" + }, + { + "name": "limit", + "in": "parameters", + "type": "limit" + } + ], + "outputs": { + "results": "$.data.resultArray" + } + }, + "summary": "Get tenants", + "description": "Returns a list of tenants, could paginated using the `page` and `limit` query parameter. Tenants is not supported in code first version of the API.", + "parameters": [ + { + "name": "page", + "required": false, + "in": "query", + "schema": { + "type": "number" + } + }, + { + "name": "limit", + "required": false, + "in": "query", + "schema": { + "maximum": 100, + "default": 10, + "type": "number" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/PaginatedResponseDto" + }, + { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GetTenantResponseDto" + } + } + } + } + ] + } + } + } + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Tenants" + ], + "security": [ + { + "api-key": [] + } + ] + }, + "post": { + "operationId": "TenantController_createTenant", + "summary": "Create tenant", + "description": "Create tenant under the current environment Tenants is not supported in code first version of the API.", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateTenantRequestDto" + } + } + } + }, + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateTenantResponseDto" + } + } + } + }, + "409": { + "description": "A tenant with the same identifier is already exist.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Tenants" + ], + "security": [ + { + "api-key": [] + } + ] + } + }, + "/v1/tenants/{identifier}": { + "get": { + "operationId": "TenantController_getTenantById", + "summary": "Get tenant", + "description": "Get tenant by your internal id used to identify the tenant Tenants is not supported in code first version of the API.", + "parameters": [ + { + "name": "identifier", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetTenantResponseDto" + } + } + } + }, + "404": { + "description": "The tenant with the identifier provided does not exist in the database." + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Tenants" + ], + "security": [ + { + "api-key": [] + } + ] + }, + "patch": { + "operationId": "TenantController_updateTenant", + "summary": "Update tenant", + "description": "Update tenant by your internal id used to identify the tenant Tenants is not supported in code first version of the API.", + "parameters": [ + { + "name": "identifier", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateTenantRequestDto" + } + } + } + }, + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateTenantResponseDto" + } + } + } + }, + "404": { + "description": "The tenant with the identifier provided does not exist in the database." + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Tenants" + ], + "security": [ + { + "api-key": [] + } + ] + }, + "delete": { + "operationId": "TenantController_removeTenant", + "summary": "Delete tenant", + "description": "Deletes a tenant entity from the Novu platform. Tenants is not supported in code first version of the API.", + "parameters": [ + { + "name": "identifier", + "required": true, + "in": "path", + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "The tenant has been deleted correctly" + }, + "404": { + "description": "The tenant with the identifier provided does not exist in the database so it can not be deleted." + }, + "409": { + "description": "The request could not be completed due to a conflict with the current state of the target resource.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Request with key 3909d656-d4fe-4e80-ba86-90d3861afcd7 is currently being processed. Please retry after 1 second" + } + } + } + }, + "429": { + "description": "The client has sent too many requests in a given amount of time. ", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "API rate limit exceeded" + } + } + } + }, + "503": { + "description": "The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay.", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Please wait some time, then try again." + } + } + } + } + }, + "tags": [ + "Tenants" + ], + "security": [ + { + "api-key": [] + } + ] + } + } + }, + "info": { + "title": "Novu API", + "description": "Novu REST API. Please see https://docs.novu.co/api-reference for more details.", + "version": "1.0", + "contact": { + "name": "Novu Support", + "url": "https://discord.gg/novu", + "email": "support@novu.co" + }, + "termsOfService": "https://novu.co/terms", + "license": { + "name": "MIT", + "url": "https://opensource.org/license/mit" + } + }, + "tags": [ + { + "name": "Events", + "description": "Events represent a change in state of a subscriber. They are used to trigger workflows, and enable you to send notifications to subscribers based on their actions.", + "externalDocs": { + "url": "https://docs.novu.co/workflows" + } + }, + { + "name": "Subscribers", + "description": "A subscriber in Novu represents someone who should receive a message. A subscriber’s profile information contains important attributes about the subscriber that will be used in messages (name, email). The subscriber object can contain other key-value pairs that can be used to further personalize your messages.", + "externalDocs": { + "url": "https://docs.novu.co/subscribers/subscribers" + } + }, + { + "name": "Topics", + "description": "Topics are a way to group subscribers together so that they can be notified of events at once. A topic is identified by a custom key. This can be helpful for things like sending out marketing emails or notifying users of new features. Topics can also be used to send notifications to the subscribers who have been grouped together based on their interests, location, activities and much more.", + "externalDocs": { + "url": "https://docs.novu.co/subscribers/topics" + } + }, + { + "name": "Notification", + "description": "A notification conveys information from source to recipient, triggered by a workflow acting as a message blueprint. Notifications can be individual or bundled as digest for user-friendliness.", + "externalDocs": { + "url": "https://docs.novu.co/getting-started/introduction" + } + }, + { + "name": "Integrations", + "description": "With the help of the Integration Store, you can easily integrate your favorite delivery provider. During the runtime of the API, the Integrations Store is responsible for storing the configurations of all the providers.", + "externalDocs": { + "url": "https://docs.novu.co/channels-and-providers/integration-store" + } + }, + { + "name": "Layouts", + "description": "Novu allows the creation of layouts - a specific HTML design or structure to wrap content of email notifications. Layouts can be manipulated and assigned to new or existing workflows within the Novu platform, allowing users to create, manage, and assign these layouts to workflows, so they can be reused to structure the appearance of notifications sent through the platform.", + "externalDocs": { + "url": "https://docs.novu.co/content-creation-design/layouts" + } + }, + { + "name": "Workflows", + "description": "All notifications are sent via a workflow. Each workflow acts as a container for the logic and blueprint that are associated with a type of notification in your system.", + "externalDocs": { + "url": "https://docs.novu.co/workflows" + } + }, + { + "name": "Notification Templates", + "description": "Deprecated. Use Workflows (/workflows) instead, which provide the same functionality under a new name." + }, + { + "name": "Workflow groups", + "description": "Workflow groups are used to organize workflows into logical groups." + }, + { + "name": "Changes", + "description": "Changes represent a change in state of an environment. They are analagous to a pending pull request in git, enabling you to test changes before they are applied to your environment and atomically apply them when you are ready.", + "externalDocs": { + "url": "https://docs.novu.co/platform/environments#promoting-pending-changes-to-production" + } + }, + { + "name": "Environments", + "description": "Novu uses the concept of environments to ensure logical separation of your data and configuration. This means that subscribers, and preferences created in one environment are never accessible to another.", + "externalDocs": { + "url": "https://docs.novu.co/platform/environments" + } + }, + { + "name": "Inbound Parse", + "description": "Inbound Webhook is a feature that allows processing of incoming emails for a domain or subdomain. The feature parses the contents of the email and POSTs the information to a specified URL in a multipart/form-data format.", + "externalDocs": { + "url": "https://docs.novu.co/platform/inbound-parse-webhook" + } + }, + { + "name": "Feeds", + "description": "Novu provides a notification activity feed that monitors every outgoing message associated with its relevant metadata. This can be used to monitor activity and discover potential issues with a specific provider or a channel type.", + "externalDocs": { + "url": "https://docs.novu.co/activity-feed" + } + }, + { + "name": "Tenants", + "description": "A tenant represents a group of users. As a developer, when your apps have organizations, they are referred to as tenants. Tenants in Novu provides the ability to tailor specific notification experiences to users of different groups or organizations.", + "externalDocs": { + "url": "https://docs.novu.co/tenants" + } + }, + { + "name": "Messages", + "description": "A message in Novu represents a notification delivered to a recipient on a particular channel. Messages contain information about the request that triggered its delivery, a view of the data sent to the recipient, and a timeline of its lifecycle events. Learn more about messages.", + "externalDocs": { + "url": "https://docs.novu.co/workflows/messages" + } + }, + { + "name": "Organizations", + "description": "An organization serves as a separate entity within your Novu account. Each organization you create has its own separate integration store, workflows, subscribers, and API keys. This separation of resources allows you to manage multi-tenant environments and separate domains within a single account.", + "externalDocs": { + "url": "https://docs.novu.co/platform/organizations" + } + }, + { + "name": "Execution Details", + "description": "Execution details are used to track the execution of a workflow. They provided detailed information on the execution of a workflow, including the status of each step, the input and output of each step, and the overall status of the execution.", + "externalDocs": { + "url": "https://docs.novu.co/activity-feed" + } + }, + { + "name": "Translations", + "description": "Translations are used to localize your messages for different languages and regions. Novu provides a way to create and manage translations for your messages. You can create translations for your messages in different languages and regions, and assign them to your subscribers based on their preferences.", + "externalDocs": { + "url": "https://docs.novu.co/content-creation-design/translations" + } + } + ], + "servers": [ + { + "url": "https://api.novu.co" + }, + { + "url": "https://eu.api.novu.co" + } + ], + "components": { + "securitySchemes": { + "api-key": { + "type": "apiKey", + "in": "header", + "name": "Authorization", + "description": "API key authentication. Allowed headers-- \"Authorization: ApiKey \u003capi_key\u003e\"." + } + }, + "schemas": { + "DataWrapperDto": { + "type": "object", + "properties": { + "data": { + "type": "object" + } + }, + "required": [ + "data" + ] + }, + "EnvironmentResponseDto": { + "type": "object", + "properties": { + "_id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "_organizationId": { + "type": "string" + }, + "identifier": { + "type": "string" + }, + "apiKeys": { + "type": "array", + "items": { + "type": "string" + } + }, + "_parentId": { + "type": "string" + } + }, + "required": [ + "name", + "_organizationId", + "identifier", + "_parentId" + ] + }, + "ApiKey": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "_userId": { + "type": "string" + } + }, + "required": [ + "key", + "_userId" + ] + }, + "ExecutionDetailsResponseDto": { + "type": "object", + "properties": { + "_id": { + "type": "string" + }, + "_organizationId": { + "type": "string" + }, + "_jobId": { + "type": "string" + }, + "_environmentId": { + "type": "string" + }, + "_notificationId": { + "type": "string" + }, + "_notificationTemplateId": { + "type": "string" + }, + "_subscriberId": { + "type": "string" + }, + "_messageId": { + "type": "string" + }, + "providerId": { + "type": "string" + }, + "transactionId": { + "type": "string" + }, + "channel": { + "type": "string", + "enum": [ + "in_app", + "email", + "sms", + "chat", + "push", + "digest", + "trigger", + "delay", + "custom" + ] + }, + "detail": { + "type": "string" + }, + "source": { + "type": "string", + "enum": [ + "Credentials", + "Internal", + "Payload", + "Webhook" + ] + }, + "status": { + "type": "string", + "enum": [ + "Success", + "Warning", + "Failed", + "Pending", + "Queued", + "ReadConfirmation" + ] + }, + "isTest": { + "type": "boolean" + }, + "isRetry": { + "type": "boolean" + }, + "createdAt": { + "type": "string" + } + }, + "required": [ + "_organizationId", + "_jobId", + "_environmentId", + "_notificationId", + "_notificationTemplateId", + "_subscriberId", + "transactionId", + "channel", + "detail", + "source", + "status", + "isTest", + "isRetry" + ] + }, + "WorkflowsResponseDto": { + "type": "object", + "properties": { + "totalCount": { + "type": "number" + }, + "data": { + "type": "array", + "items": { + "type": "string" + } + }, + "pageSize": { + "type": "number" + }, + "page": { + "type": "number" + } + }, + "required": [ + "totalCount", + "data", + "pageSize", + "page" + ] + }, + "NotificationGroup": { + "type": "object", + "properties": { + "_id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "_environmentId": { + "type": "string" + }, + "_organizationId": { + "type": "string" + }, + "_parentId": { + "type": "string" + } + }, + "required": [ + "name", + "_environmentId", + "_organizationId" + ] + }, + "PreferenceChannels": { + "type": "object", + "properties": { + "email": { + "type": "boolean" + }, + "sms": { + "type": "boolean" + }, + "in_app": { + "type": "boolean" + }, + "chat": { + "type": "boolean" + }, + "push": { + "type": "boolean" + } + } + }, + "DigestRegularMetadata": { + "type": "object", + "properties": { + "amount": { + "type": "number" + }, + "unit": { + "type": "string", + "enum": [ + "seconds", + "minutes", + "hours", + "days", + "weeks", + "months" + ] + }, + "digestKey": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "regular", + "backoff" + ] + }, + "backoff": { + "type": "boolean" + }, + "backoffAmount": { + "type": "number" + }, + "backoffUnit": { + "type": "string", + "enum": [ + "seconds", + "minutes", + "hours", + "days", + "weeks", + "months" + ] + }, + "updateMode": { + "type": "boolean" + } + }, + "required": [ + "type" + ] + }, + "TimedConfig": { + "type": "object", + "properties": { + "atTime": { + "type": "string" + }, + "weekDays": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "monday", + "tuesday", + "wednesday", + "thursday", + "friday", + "saturday", + "sunday" + ] + } + }, + "monthDays": { + "type": "array", + "items": { + "type": "string" + } + }, + "ordinal": { + "type": "string", + "enum": [ + "1", + "2", + "3", + "4", + "5", + "last" + ] + }, + "ordinalValue": { + "type": "string", + "enum": [ + "day", + "weekday", + "weekend", + "sunday", + "monday", + "tuesday", + "wednesday", + "thursday", + "friday", + "saturday" + ] + }, + "monthlyType": { + "type": "string", + "enum": [ + "each", + "on" + ] + } + } + }, + "DigestTimedMetadata": { + "type": "object", + "properties": { + "amount": { + "type": "number" + }, + "unit": { + "type": "string", + "enum": [ + "seconds", + "minutes", + "hours", + "days", + "weeks", + "months" + ] + }, + "digestKey": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "timed" + ] + }, + "timed": { + "$ref": "#/components/schemas/TimedConfig" + } + }, + "required": [ + "type" + ] + }, + "DelayRegularMetadata": { + "type": "object", + "properties": { + "amount": { + "type": "number" + }, + "unit": { + "type": "string", + "enum": [ + "seconds", + "minutes", + "hours", + "days", + "weeks", + "months" + ] + }, + "type": { + "type": "string", + "enum": [ + "regular" + ] + } + }, + "required": [ + "type" + ] + }, + "DelayScheduledMetadata": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "scheduled" + ] + }, + "delayPath": { + "type": "string" + } + }, + "required": [ + "type", + "delayPath" + ] + }, + "MessageTemplate": { + "type": "object", + "properties": {} + }, + "FieldFilterPart": { + "type": "object", + "properties": { + "field": { + "type": "string" + }, + "value": { + "type": "string" + }, + "operator": { + "type": "string", + "enum": [ + "LARGER", + "SMALLER", + "LARGER_EQUAL", + "SMALLER_EQUAL", + "EQUAL", + "NOT_EQUAL", + "ALL_IN", + "ANY_IN", + "NOT_IN", + "BETWEEN", + "NOT_BETWEEN", + "LIKE", + "NOT_LIKE", + "IN" + ] + }, + "on": { + "type": "string", + "enum": [ + "subscriber", + "payload" + ] + } + }, + "required": [ + "field", + "value", + "operator", + "on" + ] + }, + "StepFilter": { + "type": "object", + "properties": { + "isNegated": { + "type": "boolean" + }, + "type": { + "type": "string", + "enum": [ + "BOOLEAN", + "TEXT", + "DATE", + "NUMBER", + "STATEMENT", + "LIST", + "MULTI_LIST", + "GROUP" + ] + }, + "value": { + "type": "string", + "enum": [ + "AND", + "OR" + ] + }, + "children": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FieldFilterPart" + } + } + }, + "required": [ + "isNegated", + "type", + "value", + "children" + ] + }, + "NotificationStepVariant": { + "type": "object", + "properties": { + "_id": { + "type": "string" + }, + "uuid": { + "type": "string" + }, + "name": { + "type": "string" + }, + "_templateId": { + "type": "string" + }, + "active": { + "type": "boolean" + }, + "shouldStopOnFail": { + "type": "boolean" + }, + "template": { + "$ref": "#/components/schemas/MessageTemplate" + }, + "filters": { + "type": "array", + "items": { + "$ref": "#/components/schemas/StepFilter" + } + }, + "_parentId": { + "type": "object" + }, + "metadata": { + "oneOf": [ + { + "$ref": "#/components/schemas/DigestRegularMetadata" + }, + { + "$ref": "#/components/schemas/DigestTimedMetadata" + }, + { + "$ref": "#/components/schemas/DelayRegularMetadata" + }, + { + "$ref": "#/components/schemas/DelayScheduledMetadata" + } + ] + }, + "replyCallback": { + "type": "object" + } + } + }, + "NotificationStep": { + "type": "object", + "properties": { + "_id": { + "type": "string" + }, + "uuid": { + "type": "string" + }, + "name": { + "type": "string" + }, + "_templateId": { + "type": "string" + }, + "active": { + "type": "boolean" + }, + "shouldStopOnFail": { + "type": "boolean" + }, + "template": { + "$ref": "#/components/schemas/MessageTemplate" + }, + "filters": { + "type": "array", + "items": { + "$ref": "#/components/schemas/StepFilter" + } + }, + "_parentId": { + "type": "object" + }, + "metadata": { + "oneOf": [ + { + "$ref": "#/components/schemas/DigestRegularMetadata" + }, + { + "$ref": "#/components/schemas/DigestTimedMetadata" + }, + { + "$ref": "#/components/schemas/DelayRegularMetadata" + }, + { + "$ref": "#/components/schemas/DelayScheduledMetadata" + } + ] + }, + "replyCallback": { + "type": "object" + }, + "variants": { + "$ref": "#/components/schemas/NotificationStepVariant" + } + } + }, + "NotificationTriggerVariable": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ] + }, + "NotificationTrigger": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "event" + ] + }, + "identifier": { + "type": "string" + }, + "variables": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NotificationTriggerVariable" + } + }, + "subscriberVariables": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NotificationTriggerVariable" + } + } + }, + "required": [ + "type", + "identifier", + "variables" + ] + }, + "WorkflowResponse": { + "type": "object", + "properties": { + "_id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "active": { + "type": "boolean" + }, + "draft": { + "type": "boolean" + }, + "preferenceSettings": { + "$ref": "#/components/schemas/PreferenceChannels" + }, + "critical": { + "type": "boolean" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "steps": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NotificationStep" + } + }, + "_organizationId": { + "type": "string" + }, + "_creatorId": { + "type": "string" + }, + "_environmentId": { + "type": "string" + }, + "triggers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NotificationTrigger" + } + }, + "_notificationGroupId": { + "type": "string" + }, + "_parentId": { + "type": "string" + }, + "deleted": { + "type": "boolean" + }, + "deletedAt": { + "type": "string" + }, + "deletedBy": { + "type": "string" + }, + "notificationGroup": { + "$ref": "#/components/schemas/NotificationGroup" + }, + "data": { + "type": "object" + }, + "workflowIntegrationStatus": { + "type": "object" + } + }, + "required": [ + "name", + "description", + "active", + "draft", + "preferenceSettings", + "critical", + "tags", + "steps", + "_organizationId", + "_creatorId", + "_environmentId", + "triggers", + "_notificationGroupId", + "deleted", + "deletedAt", + "deletedBy" + ] + }, + "UpdateWorkflowRequestDto": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "description": { + "type": "string", + "maxLength": 300 + }, + "identifier": { + "type": "string" + }, + "steps": { + "type": "array", + "items": { + "type": "string" + } + }, + "notificationGroupId": { + "type": "string" + }, + "critical": { + "type": "boolean" + }, + "preferenceSettings": { + "$ref": "#/components/schemas/PreferenceChannels" + }, + "data": { + "type": "object" + } + }, + "required": [ + "name", + "notificationGroupId" + ] + }, + "DataBooleanDto": { + "type": "object", + "properties": { + "data": { + "type": "boolean" + } + }, + "required": [ + "data" + ] + }, + "VariablesResponseDto": { + "type": "object", + "properties": { + "translations": { + "type": "object" + }, + "system": { + "type": "object" + } + }, + "required": [ + "translations", + "system" + ] + }, + "CreateWorkflowRequestDto": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "notificationGroupId": { + "type": "string" + }, + "notificationGroup": { + "type": "object" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "description": { + "type": "string", + "maxLength": 1000 + }, + "steps": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NotificationStep" + } + }, + "active": { + "type": "boolean" + }, + "draft": { + "type": "boolean", + "deprecated": true + }, + "critical": { + "type": "boolean" + }, + "preferenceSettings": { + "$ref": "#/components/schemas/PreferenceChannels" + }, + "blueprintId": { + "type": "string" + }, + "data": { + "type": "object" + } + }, + "required": [ + "name", + "notificationGroupId", + "steps" + ] + }, + "ChangeWorkflowStatusRequestDto": { + "type": "object", + "properties": { + "active": { + "type": "boolean" + } + }, + "required": [ + "active" + ] + }, + "TriggerEventResponseDto": { + "type": "object", + "properties": { + "acknowledged": { + "type": "boolean", + "description": "If trigger was acknowledged or not" + }, + "status": { + "enum": [ + "error", + "trigger_not_active", + "no_workflow_active_steps_defined", + "no_workflow_steps_defined", + "processed", + "subscriber_id_missing", + "no_tenant_found" + ], + "type": "string", + "description": "Status for trigger" + }, + "error": { + "description": "In case of an error, this field will contain the error message", + "type": "array", + "items": { + "type": "string" + } + }, + "transactionId": { + "type": "string", + "description": "Transaction id for trigger" + } + }, + "required": [ + "acknowledged", + "status" + ] + }, + "TopicPayloadDto": { + "type": "object", + "properties": { + "topicKey": { + "type": "string" + }, + "type": { + "enum": [ + "Subscriber", + "Topic" + ], + "type": "string", + "example": "Topic" + } + }, + "required": [ + "topicKey", + "type" + ] + }, + "TenantPayloadDto": { + "type": "object", + "properties": { + "identifier": { + "type": "string" + }, + "name": { + "type": "string" + }, + "data": { + "type": "object" + } + } + }, + "SubscriberPayloadDto": { + "type": "object", + "properties": { + "subscriberId": { + "type": "string", + "description": "The internal identifier you used to create this subscriber, usually correlates to the id the user in your systems" + }, + "email": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "phone": { + "type": "string" + }, + "avatar": { + "type": "string", + "description": "An http url to the profile image of your subscriber" + }, + "locale": { + "type": "string" + }, + "data": { + "type": "object" + }, + "channels": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "subscriberId" + ] + }, + "TriggerEventRequestDto": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The trigger identifier of the workflow you wish to send. This identifier can be found on the workflow page.", + "example": "workflow_identifier" + }, + "payload": { + "type": "object", + "description": "The payload object is used to pass additional custom information that could be used to render the workflow, or perform routing rules based on it. \n This data will also be available when fetching the notifications feed from the API to display certain parts of the UI.", + "example": { + "comment_id": "string", + "post": { + "text": "string" + } + } + }, + "overrides": { + "type": "object", + "description": "This could be used to override provider specific configurations", + "example": { + "fcm": { + "data": { + "key": "value" + } + } + } + }, + "to": { + "type": "array", + "description": "The recipients list of people who will receive the notification.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/SubscriberPayloadDto" + }, + { + "type": "string", + "description": "Unique identifier of a subscriber in your systems", + "example": "SUBSCRIBER_ID" + }, + { + "$ref": "#/components/schemas/TopicPayloadDto" + } + ] + } + }, + "transactionId": { + "type": "string", + "description": "A unique identifier for this transaction, we will generated a UUID if not provided." + }, + "actor": { + "description": "It is used to display the Avatar of the provided actor's subscriber id or actor object.\n If a new actor object is provided, we will create a new subscriber in our system\n ", + "oneOf": [ + { + "type": "string", + "description": "Unique identifier of a subscriber in your systems" + }, + { + "$ref": "#/components/schemas/SubscriberPayloadDto" + } + ] + }, + "tenant": { + "description": "It is used to specify a tenant context during trigger event.\n Existing tenants will be updated with the provided details.\n ", + "oneOf": [ + { + "type": "string", + "description": "Unique identifier of a tenant in your system" + }, + { + "$ref": "#/components/schemas/TenantPayloadDto" + } + ] + }, + "bridgeUrl": { + "type": "string" + }, + "controls": { + "type": "object" + } + }, + "required": [ + "name", + "to" + ] + }, + "BulkTriggerEventDto": { + "type": "object", + "properties": { + "events": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TriggerEventRequestDto" + } + } + }, + "required": [ + "events" + ] + }, + "TriggerEventToAllRequestDto": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The trigger identifier associated for the template you wish to send. This identifier can be found on the template page." + }, + "payload": { + "type": "object", + "description": "The payload object is used to pass additional custom information that could be used to render the template, or perform routing rules based on it. \n This data will also be available when fetching the notifications feed from the API to display certain parts of the UI.", + "example": { + "comment_id": "string", + "post": { + "text": "string" + } + } + }, + "overrides": { + "type": "object", + "description": "This could be used to override provider specific configurations", + "example": { + "fcm": { + "data": { + "key": "value" + } + } + } + }, + "transactionId": { + "type": "string", + "description": "A unique identifier for this transaction, we will generated a UUID if not provided." + }, + "actor": { + "description": "It is used to display the Avatar of the provided actor's subscriber id or actor object.\n If a new actor object is provided, we will create a new subscriber in our system\n ", + "oneOf": [ + { + "type": "string", + "description": "Unique identifier of a subscriber in your systems" + }, + { + "$ref": "#/components/schemas/SubscriberPayloadDto" + } + ] + }, + "tenant": { + "description": "It is used to specify a tenant context during trigger event.\n If a new tenant object is provided, we will create a new tenant.\n ", + "oneOf": [ + { + "type": "string", + "description": "Unique identifier of a tenant in your system" + }, + { + "$ref": "#/components/schemas/TenantPayloadDto" + } + ] + } + }, + "required": [ + "name", + "payload" + ] + }, + "ActivitiesResponseDto": { + "type": "object", + "properties": { + "hasMore": { + "type": "boolean" + }, + "data": { + "type": "array", + "items": { + "type": "string" + } + }, + "pageSize": { + "type": "number" + }, + "page": { + "type": "number" + } + }, + "required": [ + "hasMore", + "data", + "pageSize", + "page" + ] + }, + "ActivityStatsResponseDto": { + "type": "object", + "properties": { + "weeklySent": { + "type": "number" + }, + "monthlySent": { + "type": "number" + } + }, + "required": [ + "weeklySent", + "monthlySent" + ] + }, + "ActivityGraphStatesResponse": { + "type": "object", + "properties": { + "_id": { + "type": "string" + }, + "count": { + "type": "number" + }, + "templates": { + "type": "array", + "items": { + "type": "string" + } + }, + "channels": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "in_app", + "email", + "sms", + "chat", + "push" + ] + } + } + }, + "required": [ + "_id", + "count", + "templates", + "channels" + ] + }, + "ActivityNotificationSubscriberResponseDto": { + "type": "object", + "properties": { + "firstName": { + "type": "string" + }, + "_id": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "email": { + "type": "string" + }, + "phone": { + "type": "string" + } + }, + "required": [ + "_id" + ] + }, + "ActivityNotificationTemplateResponseDto": { + "type": "object", + "properties": { + "_id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "triggers": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "name", + "triggers" + ] + }, + "ActivityNotificationResponseDto": { + "type": "object", + "properties": { + "_id": { + "type": "string" + }, + "_environmentId": { + "type": "string" + }, + "_organizationId": { + "type": "string" + }, + "transactionId": { + "type": "string" + }, + "createdAt": { + "type": "string" + }, + "channels": { + "type": "string", + "items": { + "type": "string", + "enum": [ + "in_app", + "email", + "sms", + "chat", + "push", + "digest", + "trigger", + "delay", + "custom" + ] + }, + "enum": [ + "in_app", + "email", + "sms", + "chat", + "push", + "digest", + "trigger", + "delay", + "custom" + ] + }, + "subscriber": { + "$ref": "#/components/schemas/ActivityNotificationSubscriberResponseDto" + }, + "template": { + "$ref": "#/components/schemas/ActivityNotificationTemplateResponseDto" + }, + "jobs": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "_environmentId", + "_organizationId", + "transactionId" + ] + }, + "NotificationGroupResponseDto": { + "type": "object", + "properties": { + "_id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "_environmentId": { + "type": "string" + }, + "_organizationId": { + "type": "string" + }, + "_parentId": { + "type": "string" + } + }, + "required": [ + "name", + "_environmentId", + "_organizationId" + ] + }, + "CreateNotificationGroupRequestDto": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ] + }, + "DeleteNotificationGroupResponseDto": { + "type": "object", + "properties": { + "acknowledged": { + "type": "boolean", + "description": "A boolean stating the success of the action" + }, + "status": { + "type": "string", + "description": "The status enum for the performed action", + "enum": [ + "deleted" + ] + } + }, + "required": [ + "acknowledged", + "status" + ] + }, + "OrganizationBrandingResponseDto": { + "type": "object", + "properties": { + "direction": { + "enum": [ + "ltr", + "trl" + ], + "type": "string" + }, + "logo": { + "type": "string" + }, + "color": { + "type": "string" + }, + "fontColor": { + "type": "string" + }, + "contentBackground": { + "type": "string" + }, + "fontFamily": { + "type": "string" + } + }, + "required": [ + "logo", + "color", + "fontColor", + "contentBackground" + ] + }, + "OrganizationResponseDto": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "logo": { + "type": "string" + }, + "branding": { + "$ref": "#/components/schemas/OrganizationBrandingResponseDto" + }, + "partnerConfigurations": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "name", + "branding" + ] + }, + "UpdateBrandingDetailsDto": { + "type": "object", + "properties": { + "logo": { + "type": "string" + }, + "color": { + "type": "string" + }, + "fontColor": { + "type": "string" + }, + "contentBackground": { + "type": "string" + }, + "fontFamily": { + "type": "string" + } + }, + "required": [ + "logo", + "color", + "fontColor", + "contentBackground" + ] + }, + "RenameOrganizationDto": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ] + }, + "CredentialsDto": { + "type": "object", + "properties": { + "apiKey": { + "type": "string" + }, + "user": { + "type": "string" + }, + "secretKey": { + "type": "string" + }, + "domain": { + "type": "string" + }, + "password": { + "type": "string" + }, + "host": { + "type": "string" + }, + "port": { + "type": "string" + }, + "secure": { + "type": "boolean" + }, + "region": { + "type": "string" + }, + "accountSid": { + "type": "string" + }, + "messageProfileId": { + "type": "string" + }, + "token": { + "type": "string" + }, + "from": { + "type": "string" + }, + "senderName": { + "type": "string" + }, + "projectName": { + "type": "string" + }, + "applicationId": { + "type": "string" + }, + "clientId": { + "type": "string" + }, + "requireTls": { + "type": "boolean" + }, + "ignoreTls": { + "type": "boolean" + }, + "tlsOptions": { + "type": "object" + }, + "baseUrl": { + "type": "string" + }, + "webhookUrl": { + "type": "string" + }, + "redirectUrl": { + "type": "string" + }, + "hmac": { + "type": "boolean" + }, + "serviceAccount": { + "type": "string" + }, + "ipPoolName": { + "type": "string" + }, + "apiKeyRequestHeader": { + "type": "string" + }, + "secretKeyRequestHeader": { + "type": "string" + }, + "idPath": { + "type": "string" + }, + "datePath": { + "type": "string" + }, + "apiToken": { + "type": "string" + }, + "authenticateByToken": { + "type": "boolean" + }, + "authenticationTokenKey": { + "type": "string" + }, + "instanceId": { + "type": "string" + }, + "alertUid": { + "type": "string" + }, + "title": { + "type": "string" + }, + "imageUrl": { + "type": "string" + }, + "state": { + "type": "string" + }, + "externalLink": { + "type": "string" + }, + "channelId": { + "type": "string" + }, + "phoneNumberIdentification": { + "type": "string" + }, + "accessKey": { + "type": "string" + } + } + }, + "IntegrationResponseDto": { + "type": "object", + "properties": { + "_id": { + "type": "string" + }, + "_environmentId": { + "type": "string" + }, + "_organizationId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "identifier": { + "type": "string" + }, + "providerId": { + "type": "string" + }, + "channel": { + "enum": [ + "in_app", + "email", + "sms", + "chat", + "push" + ], + "type": "string" + }, + "credentials": { + "$ref": "#/components/schemas/CredentialsDto" + }, + "active": { + "type": "boolean" + }, + "deleted": { + "type": "boolean" + }, + "deletedAt": { + "type": "string" + }, + "deletedBy": { + "type": "string" + }, + "primary": { + "type": "boolean" + }, + "conditions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/StepFilter" + } + } + }, + "required": [ + "_environmentId", + "_organizationId", + "name", + "identifier", + "providerId", + "channel", + "credentials", + "active", + "deleted", + "deletedAt", + "deletedBy", + "primary" + ] + }, + "CreateIntegrationRequestDto": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "identifier": { + "type": "string" + }, + "_environmentId": { + "type": "string" + }, + "providerId": { + "type": "string" + }, + "channel": { + "enum": [ + "in_app", + "email", + "sms", + "chat", + "push" + ], + "type": "string" + }, + "credentials": { + "$ref": "#/components/schemas/CredentialsDto" + }, + "active": { + "type": "boolean", + "description": "If the integration is active the validation on the credentials field will run" + }, + "check": { + "type": "boolean" + }, + "conditions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/StepFilter" + } + } + }, + "required": [ + "providerId", + "channel" + ] + }, + "UpdateIntegrationRequestDto": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "identifier": { + "type": "string" + }, + "_environmentId": { + "type": "string" + }, + "active": { + "type": "boolean", + "description": "If the integration is active the validation on the credentials field will run" + }, + "credentials": { + "$ref": "#/components/schemas/CredentialsDto" + }, + "check": { + "type": "boolean" + }, + "conditions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/StepFilter" + } + } + } + }, + "ChangesResponseDto": { + "type": "object", + "properties": { + "totalCount": { + "type": "number" + }, + "data": { + "type": "array", + "items": { + "type": "string" + } + }, + "pageSize": { + "type": "number" + }, + "page": { + "type": "number" + } + }, + "required": [ + "totalCount", + "data", + "pageSize", + "page" + ] + }, + "DataNumberDto": { + "type": "object", + "properties": { + "data": { + "type": "number" + } + }, + "required": [ + "data" + ] + }, + "ChangeResponseDto": { + "type": "object", + "properties": { + "_id": { + "type": "string" + }, + "_creatorId": { + "type": "string" + }, + "_environmentId": { + "type": "string" + }, + "_organizationId": { + "type": "string" + }, + "_entityId": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "type": { + "enum": [ + "Feed", + "MessageTemplate", + "Layout", + "DefaultLayout", + "NotificationTemplate", + "NotificationGroup", + "TranslationGroup", + "Translation" + ], + "type": "string" + }, + "change": { + "type": "object" + }, + "createdAt": { + "type": "string" + }, + "_parentId": { + "type": "string" + } + }, + "required": [ + "_creatorId", + "_environmentId", + "_organizationId", + "_entityId", + "enabled", + "type", + "change", + "createdAt" + ] + }, + "BulkApplyChangeDto": { + "type": "object", + "properties": { + "changeIds": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "changeIds" + ] + }, + "PaginatedResponseDto": { + "type": "object", + "properties": { + "page": { + "type": "number", + "description": "The current page of the paginated response" + }, + "hasMore": { + "type": "boolean", + "description": "Does the list have more items to fetch" + }, + "pageSize": { + "type": "number", + "description": "Number of items on each page" + }, + "data": { + "description": "The list of items matching the query", + "type": "array", + "items": { + "type": "object" + } + } + }, + "required": [ + "page", + "hasMore", + "pageSize", + "data" + ] + }, + "ChannelCredentials": { + "type": "object", + "properties": { + "webhookUrl": { + "type": "string", + "description": "Webhook url used by chat app integrations. The webhook should be obtained from the chat app provider." + }, + "channel": { + "type": "string", + "description": "Channel specification for Mattermost chat notifications" + }, + "deviceTokens": { + "description": "Contains an array of the subscriber device tokens for a given provider. Used on Push integrations", + "type": "array", + "items": { + "type": "string" + } + }, + "alertUid": { + "type": "string", + "description": "alert_uid for grafana on-call webhook payload" + }, + "title": { + "type": "string", + "description": "title to be used with grafana on call webhook" + }, + "imageUrl": { + "type": "string", + "description": "image_url property fo grafana on call webhook" + }, + "state": { + "type": "string", + "description": "state property fo grafana on call webhook" + }, + "externalUrl": { + "type": "string", + "description": "link_to_upstream_details property fo grafana on call webhook" + } + }, + "required": [ + "webhookUrl" + ] + }, + "ChannelSettings": { + "type": "object", + "properties": { + "providerId": { + "type": "number", + "enum": [ + { + "Slack": "slack", + "Discord": "discord", + "MsTeams": "msteams", + "Mattermost": "mattermost", + "Ryver": "ryver", + "Zulip": "zulip", + "GrafanaOnCall": "grafana-on-call", + "GetStream": "getstream", + "RocketChat": "rocket-chat", + "WhatsAppBusiness": "whatsapp-business" + }, + { + "FCM": "fcm", + "APNS": "apns", + "EXPO": "expo", + "OneSignal": "one-signal", + "Pushpad": "pushpad", + "PushWebhook": "push-webhook", + "PusherBeams": "pusher-beams" + } + ], + "description": "The provider identifier for the credentials" + }, + "integrationIdentifier": { + "type": "string", + "description": "The integration identifier" + }, + "credentials": { + "description": "Credentials payload for the specified provider", + "allOf": [ + { + "$ref": "#/components/schemas/ChannelCredentials" + } + ] + }, + "_integrationId": { + "type": "string", + "description": "Id of the integration that is used for this channel" + } + }, + "required": [ + "providerId", + "credentials", + "_integrationId" + ] + }, + "SubscriberResponseDto": { + "type": "object", + "properties": { + "_id": { + "type": "string", + "description": "The internal id novu generated for your subscriber, this is not the subscriberId matching your query. See `subscriberId` for that" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "email": { + "type": "string" + }, + "phone": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "locale": { + "type": "string" + }, + "subscriberId": { + "type": "string", + "description": "The internal identifier you used to create this subscriber, usually correlates to the id the user in your systems" + }, + "channels": { + "description": "Channels settings for subscriber", + "type": "array", + "items": { + "$ref": "#/components/schemas/ChannelSettings" + } + }, + "isOnline": { + "type": "boolean" + }, + "lastOnlineAt": { + "type": "string" + }, + "_organizationId": { + "type": "string" + }, + "_environmentId": { + "type": "string" + }, + "deleted": { + "type": "boolean" + }, + "createdAt": { + "type": "string" + }, + "updatedAt": { + "type": "string" + }, + "__v": { + "type": "number" + } + }, + "required": [ + "subscriberId", + "_organizationId", + "_environmentId", + "deleted", + "createdAt", + "updatedAt" + ] + }, + "CreateSubscriberRequestDto": { + "type": "object", + "properties": { + "subscriberId": { + "type": "string", + "description": "The internal identifier you used to create this subscriber, usually correlates to the id the user in your systems" + }, + "email": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "phone": { + "type": "string" + }, + "avatar": { + "type": "string", + "description": "An http url to the profile image of your subscriber" + }, + "locale": { + "type": "string" + }, + "data": { + "type": "object" + }, + "channels": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "subscriberId" + ] + }, + "BulkSubscriberCreateDto": { + "type": "object", + "properties": { + "subscribers": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "subscribers" + ] + }, + "UpdateSubscriberRequestDto": { + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "phone": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "locale": { + "type": "string" + }, + "data": { + "type": "object" + } + } + }, + "UpdateSubscriberChannelRequestDto": { + "type": "object", + "properties": { + "providerId": { + "type": "number", + "enum": [ + { + "Slack": "slack", + "Discord": "discord", + "MsTeams": "msteams", + "Mattermost": "mattermost", + "Ryver": "ryver", + "Zulip": "zulip", + "GrafanaOnCall": "grafana-on-call", + "GetStream": "getstream", + "RocketChat": "rocket-chat", + "WhatsAppBusiness": "whatsapp-business" + }, + { + "FCM": "fcm", + "APNS": "apns", + "EXPO": "expo", + "OneSignal": "one-signal", + "Pushpad": "pushpad", + "PushWebhook": "push-webhook", + "PusherBeams": "pusher-beams" + } + ], + "description": "The provider identifier for the credentials" + }, + "integrationIdentifier": { + "type": "string", + "description": "The integration identifier" + }, + "credentials": { + "description": "Credentials payload for the specified provider", + "allOf": [ + { + "$ref": "#/components/schemas/ChannelCredentials" + } + ] + } + }, + "required": [ + "providerId", + "credentials" + ] + }, + "UpdateSubscriberOnlineFlagRequestDto": { + "type": "object", + "properties": { + "isOnline": { + "type": "boolean" + } + }, + "required": [ + "isOnline" + ] + }, + "DeleteSubscriberResponseDto": { + "type": "object", + "properties": { + "acknowledged": { + "type": "boolean", + "description": "A boolean stating the success of the action" + }, + "status": { + "type": "string", + "description": "The status enum for the performed action", + "enum": [ + "deleted" + ] + } + }, + "required": [ + "acknowledged", + "status" + ] + }, + "TemplateResponse": { + "type": "object", + "properties": { + "_id": { + "type": "string", + "description": "Unique identifier of the workflow" + }, + "name": { + "type": "string", + "description": "Name of the workflow" + }, + "critical": { + "type": "boolean", + "description": "Critical templates will always be delivered to the end user and should be hidden from the subscriber preferences screen" + }, + "triggers": { + "description": "Triggers are the events that will trigger the workflow.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "_id", + "name", + "critical", + "triggers" + ] + }, + "Preference": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "Sets if the workflow is fully enabled for all channels or not for the subscriber." + }, + "channels": { + "description": "Subscriber preferences for the different channels regarding this workflow", + "allOf": [ + { + "$ref": "#/components/schemas/PreferenceChannels" + } + ] + } + }, + "required": [ + "enabled", + "channels" + ] + }, + "UpdateSubscriberPreferenceResponseDto": { + "type": "object", + "properties": { + "template": { + "description": "The workflow information and if it is critical or not", + "allOf": [ + { + "$ref": "#/components/schemas/TemplateResponse" + } + ] + }, + "preference": { + "description": "The preferences of the subscriber regarding the related workflow", + "allOf": [ + { + "$ref": "#/components/schemas/Preference" + } + ] + } + }, + "required": [ + "template", + "preference" + ] + }, + "GetSubscriberPreferencesResponseDto": { + "type": "object", + "properties": { + "template": { + "description": "The workflow information and if it is critical or not", + "allOf": [ + { + "$ref": "#/components/schemas/TemplateResponse" + } + ] + }, + "preference": { + "description": "The preferences of the subscriber regarding the related workflow", + "allOf": [ + { + "$ref": "#/components/schemas/Preference" + } + ] + } + }, + "required": [ + "preference" + ] + }, + "ChannelPreference": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "in_app", + "email", + "sms", + "chat", + "push" + ], + "description": "The type of channel that is enabled or not" + }, + "enabled": { + "type": "boolean", + "description": "If channel is enabled or not" + } + }, + "required": [ + "type", + "enabled" + ] + }, + "UpdateSubscriberPreferenceRequestDto": { + "type": "object", + "properties": { + "channel": { + "description": "The subscriber preferences for every ChannelTypeEnum for the workflow assigned.", + "allOf": [ + { + "$ref": "#/components/schemas/ChannelPreference" + } + ] + }, + "enabled": { + "type": "boolean", + "description": "Sets if the workflow is fully enabled for all channels or not for the subscriber." + } + } + }, + "UpdateSubscriberGlobalPreferencesRequestDto": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "Enable or disable the subscriber global preferences." + }, + "preferences": { + "description": "The subscriber global preferences for every ChannelTypeEnum.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ChannelPreference" + } + } + } + }, + "FeedResponseDto": { + "type": "object", + "properties": { + "totalCount": { + "type": "number" + }, + "hasMore": { + "type": "boolean" + }, + "data": { + "type": "array", + "items": { + "type": "string" + } + }, + "pageSize": { + "type": "number" + }, + "page": { + "type": "number" + } + }, + "required": [ + "hasMore", + "data", + "pageSize", + "page" + ] + }, + "UnseenCountResponse": { + "type": "object", + "properties": { + "count": { + "type": "number" + } + }, + "required": [ + "count" + ] + }, + "MessageMarkAsRequestDto": { + "type": "object", + "properties": { + "messageId": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "markAs": { + "enum": [ + "read", + "seen", + "unread", + "unseen" + ], + "type": "string" + } + }, + "required": [ + "messageId", + "markAs" + ] + }, + "MessageEntity": { + "type": "object", + "properties": {} + }, + "MarkAllMessageAsRequestDto": { + "type": "object", + "properties": { + "feedIdentifier": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ], + "description": "Optional feed identifier or array of feed identifiers" + }, + "markAs": { + "enum": [ + "read", + "seen", + "unread", + "unseen" + ], + "type": "string", + "description": "Mark all subscriber messages as read, unread, seen or unseen" + } + }, + "required": [ + "markAs" + ] + }, + "EmailBlockStyles": { + "type": "object", + "properties": { + "textAlign": { + "type": "string", + "enum": [ + "center", + "left", + "right" + ] + } + }, + "required": [ + "textAlign" + ] + }, + "EmailBlock": { + "type": "object", + "properties": { + "type": { + "enum": [ + "button", + "text" + ], + "type": "string" + }, + "content": { + "type": "string" + }, + "url": { + "type": "string" + }, + "styles": { + "$ref": "#/components/schemas/EmailBlockStyles" + } + }, + "required": [ + "type", + "content" + ] + }, + "MessageCTAData": { + "type": "object", + "properties": { + "url": { + "type": "string" + } + } + }, + "MessageButton": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "primary", + "secondary" + ] + }, + "content": { + "type": "string" + }, + "resultContent": { + "type": "string" + } + }, + "required": [ + "type", + "content" + ] + }, + "MessageActionResult": { + "type": "object", + "properties": { + "payload": { + "type": "object" + }, + "type": { + "type": "string", + "enum": [ + "primary", + "secondary" + ] + } + } + }, + "MessageAction": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "pending", + "done" + ] + }, + "buttons": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MessageButton" + } + }, + "result": { + "$ref": "#/components/schemas/MessageActionResult" + } + } + }, + "MessageCTA": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "redirect" + ] + }, + "data": { + "$ref": "#/components/schemas/MessageCTAData" + }, + "action": { + "$ref": "#/components/schemas/MessageAction" + } + }, + "required": [ + "data" + ] + }, + "MessageResponseDto": { + "type": "object", + "properties": { + "_id": { + "type": "string" + }, + "_templateId": { + "type": "string" + }, + "_environmentId": { + "type": "string" + }, + "_messageTemplateId": { + "type": "string" + }, + "_organizationId": { + "type": "string" + }, + "_notificationId": { + "type": "string" + }, + "_subscriberId": { + "type": "string" + }, + "subscriber": { + "$ref": "#/components/schemas/SubscriberResponseDto" + }, + "template": { + "$ref": "#/components/schemas/WorkflowResponse" + }, + "templateIdentifier": { + "type": "string" + }, + "createdAt": { + "type": "string" + }, + "lastSeenDate": { + "type": "string" + }, + "lastReadDate": { + "type": "string" + }, + "content": { + "oneOf": [ + { + "$ref": "#/components/schemas/EmailBlock" + }, + { + "type": "string" + } + ] + }, + "transactionId": { + "type": "string" + }, + "subject": { + "type": "string" + }, + "channel": { + "enum": [ + "in_app", + "email", + "sms", + "chat", + "push" + ], + "type": "string" + }, + "read": { + "type": "boolean" + }, + "seen": { + "type": "boolean" + }, + "email": { + "type": "string" + }, + "phone": { + "type": "string" + }, + "directWebhookUrl": { + "type": "string" + }, + "providerId": { + "type": "string" + }, + "deviceTokens": { + "type": "array", + "items": { + "type": "string" + } + }, + "title": { + "type": "string" + }, + "cta": { + "$ref": "#/components/schemas/MessageCTA" + }, + "_feedId": { + "type": "object", + "nullable": true + }, + "status": { + "type": "string", + "enum": [ + "sent", + "error", + "warning" + ] + }, + "errorId": { + "type": "string" + }, + "errorText": { + "type": "string" + }, + "payload": { + "type": "object", + "description": "The payload that was used to send the notification trigger" + }, + "overrides": { + "type": "object", + "description": "Provider specific overrides used when triggering the notification" + } + }, + "required": [ + "_templateId", + "_environmentId", + "_messageTemplateId", + "_organizationId", + "_notificationId", + "_subscriberId", + "createdAt", + "content", + "transactionId", + "channel", + "read", + "seen", + "cta", + "status", + "errorId", + "errorText", + "payload", + "overrides" + ] + }, + "MarkMessageActionAsSeenDto": { + "type": "object", + "properties": { + "status": { + "enum": [ + "pending", + "done" + ], + "type": "string", + "description": "Message action status" + }, + "payload": { + "type": "object", + "description": "Message action payload" + } + }, + "required": [ + "status" + ] + }, + "CreateFeedRequestDto": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ] + }, + "CreateLayoutResponseDto": { + "type": "object", + "properties": { + "_id": { + "type": "string", + "description": "The unique identifier for the Layout created." + } + }, + "required": [ + "_id" + ] + }, + "GetLayoutResponseDto": { + "type": "object", + "properties": { + "_id": { + "type": "string" + }, + "_organizationId": { + "type": "string" + }, + "_environmentId": { + "type": "string" + }, + "_creatorId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "identifier": { + "type": "string" + }, + "description": { + "type": "string" + }, + "channel": { + "enum": [ + "in_app", + "email", + "sms", + "chat", + "push" + ], + "type": "string" + }, + "content": { + "type": "string" + }, + "contentType": { + "type": "string" + }, + "variables": { + "type": "array", + "items": { + "type": "string" + } + }, + "isDefault": { + "type": "boolean" + }, + "isDeleted": { + "type": "boolean" + }, + "createdAt": { + "type": "string" + }, + "updatedAt": { + "type": "string" + }, + "_parentId": { + "type": "string" + } + }, + "required": [ + "_organizationId", + "_environmentId", + "_creatorId", + "name", + "identifier", + "channel", + "content", + "contentType", + "isDefault", + "isDeleted" + ] + }, + "UpdateLayoutResponseDto": { + "type": "object", + "properties": { + "_id": { + "type": "string" + }, + "_organizationId": { + "type": "string" + }, + "_environmentId": { + "type": "string" + }, + "_creatorId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "identifier": { + "type": "string" + }, + "description": { + "type": "string" + }, + "channel": { + "enum": [ + "in_app", + "email", + "sms", + "chat", + "push" + ], + "type": "string" + }, + "content": { + "type": "string" + }, + "contentType": { + "type": "string" + }, + "variables": { + "type": "array", + "items": { + "type": "string" + } + }, + "isDefault": { + "type": "boolean" + }, + "isDeleted": { + "type": "boolean" + }, + "createdAt": { + "type": "string" + }, + "updatedAt": { + "type": "string" + }, + "_parentId": { + "type": "string" + } + }, + "required": [ + "_organizationId", + "_environmentId", + "_creatorId", + "name", + "identifier", + "channel", + "content", + "contentType", + "isDefault", + "isDeleted" + ] + }, + "UpdateLayoutRequestDto": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "User defined custom name and provided by the user that will name the Layout updated." + }, + "identifier": { + "type": "string", + "description": "User defined custom key that will be a unique identifier for the Layout updated." + }, + "description": { + "type": "string", + "description": "User defined description of the layout" + }, + "content": { + "type": "string", + "description": "User defined content for the layout." + }, + "variables": { + "type": "object", + "description": "User defined variables to render in the layout placeholders." + }, + "isDefault": { + "type": "boolean", + "description": "Variable that defines if the layout is chosen as default when creating a layout." + } + }, + "required": [ + "identifier" + ] + }, + "DeleteMessageResponseDto": { + "type": "object", + "properties": { + "acknowledged": { + "type": "boolean", + "description": "A boolean stating the success of the action" + }, + "status": { + "type": "string", + "description": "The status enum for the performed action", + "enum": [ + "deleted" + ] + } + }, + "required": [ + "acknowledged", + "status" + ] + }, + "CreateTopicResponseDto": { + "type": "object", + "properties": { + "_id": { + "type": "string", + "description": "The unique identifier for the Topic created." + }, + "key": { + "type": "string", + "description": "User defined custom key and provided by the user that will be an unique identifier for the Topic created." + } + }, + "required": [ + "key" + ] + }, + "CreateTopicRequestDto": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "User defined custom key and provided by the user that will be an unique identifier for the Topic created." + }, + "name": { + "type": "string", + "description": "User defined custom name and provided by the user that will name the Topic created." + } + }, + "required": [ + "key", + "name" + ] + }, + "AddSubscribersRequestDto": { + "type": "object", + "properties": { + "subscribers": { + "description": "List of subscriber identifiers that will be associated to the topic", + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "subscribers" + ] + }, + "TopicSubscriberDto": { + "type": "object", + "properties": { + "_organizationId": { + "type": "string" + }, + "_environmentId": { + "type": "string" + }, + "_subscriberId": { + "type": "string" + }, + "_topicId": { + "type": "string" + }, + "topicKey": { + "type": "string" + }, + "externalSubscriberId": { + "type": "string" + } + }, + "required": [ + "_organizationId", + "_environmentId", + "_subscriberId", + "_topicId", + "topicKey", + "externalSubscriberId" + ] + }, + "RemoveSubscribersRequestDto": { + "type": "object", + "properties": { + "subscribers": { + "description": "List of subscriber identifiers that will be removed to the topic", + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "subscribers" + ] + }, + "TopicDto": { + "type": "object", + "properties": { + "_id": { + "type": "string" + }, + "_organizationId": { + "type": "string" + }, + "_environmentId": { + "type": "string" + }, + "key": { + "type": "string" + }, + "name": { + "type": "string" + }, + "subscribers": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "_organizationId", + "_environmentId", + "key", + "name", + "subscribers" + ] + }, + "FilterTopicsResponseDto": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TopicDto" + } + }, + "page": { + "type": "number" + }, + "pageSize": { + "type": "number" + }, + "totalCount": { + "type": "number" + } + }, + "required": [ + "data", + "page", + "pageSize", + "totalCount" + ] + }, + "GetTopicResponseDto": { + "type": "object", + "properties": { + "_id": { + "type": "string" + }, + "_organizationId": { + "type": "string" + }, + "_environmentId": { + "type": "string" + }, + "key": { + "type": "string" + }, + "name": { + "type": "string" + }, + "subscribers": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "_organizationId", + "_environmentId", + "key", + "name", + "subscribers" + ] + }, + "RenameTopicResponseDto": { + "type": "object", + "properties": { + "_id": { + "type": "string" + }, + "_organizationId": { + "type": "string" + }, + "_environmentId": { + "type": "string" + }, + "key": { + "type": "string" + }, + "name": { + "type": "string" + }, + "subscribers": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "_organizationId", + "_environmentId", + "key", + "name", + "subscribers" + ] + }, + "RenameTopicRequestDto": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "User defined custom name and provided by the user to rename the topic." + } + }, + "required": [ + "name" + ] + }, + "GetTenantResponseDto": { + "type": "object", + "properties": { + "_id": { + "type": "string" + }, + "identifier": { + "type": "string" + }, + "name": { + "type": "string" + }, + "data": { + "type": "object" + }, + "_environmentId": { + "type": "string" + }, + "createdAt": { + "type": "string" + }, + "updatedAt": { + "type": "string" + } + }, + "required": [ + "_id", + "identifier", + "_environmentId", + "createdAt", + "updatedAt" + ] + }, + "CreateTenantResponseDto": { + "type": "object", + "properties": { + "_id": { + "type": "string" + }, + "identifier": { + "type": "string" + }, + "name": { + "type": "string" + }, + "data": { + "type": "object" + }, + "_environmentId": { + "type": "string" + }, + "createdAt": { + "type": "string" + }, + "updatedAt": { + "type": "string" + } + }, + "required": [ + "_id", + "identifier", + "_environmentId", + "createdAt", + "updatedAt" + ] + }, + "CreateTenantRequestDto": { + "type": "object", + "properties": { + "identifier": { + "type": "string" + }, + "name": { + "type": "string" + }, + "data": { + "type": "object" + } + }, + "required": [ + "identifier", + "name" + ] + }, + "UpdateTenantResponseDto": { + "type": "object", + "properties": { + "_id": { + "type": "string" + }, + "identifier": { + "type": "string" + }, + "name": { + "type": "string" + }, + "data": { + "type": "object" + }, + "_environmentId": { + "type": "string" + }, + "createdAt": { + "type": "string" + }, + "updatedAt": { + "type": "string" + } + }, + "required": [ + "_id", + "identifier", + "_environmentId", + "createdAt", + "updatedAt" + ] + }, + "UpdateTenantRequestDto": { + "type": "object", + "properties": { + "identifier": { + "type": "string" + }, + "name": { + "type": "string" + }, + "data": { + "type": "object" + } + } + } + }, + "headers": { + "Content-Type": { + "required": true, + "description": "The MIME type of the response body.", + "schema": { + "type": "string" + }, + "example": "application/json" + }, + "RateLimit-Limit": { + "required": false, + "description": "The number of requests that the client is permitted to make per second. The actual maximum may differ when burst is enabled.", + "schema": { + "type": "string" + }, + "example": "100" + }, + "RateLimit-Remaining": { + "required": false, + "description": "The number of requests remaining until the next window.", + "schema": { + "type": "string" + }, + "example": "93" + }, + "RateLimit-Reset": { + "required": false, + "description": "The remaining seconds until a request of the same cost will be refreshed.", + "schema": { + "type": "string" + }, + "example": "8" + }, + "RateLimit-Policy": { + "required": false, + "description": "The rate limit policy that was used to evaluate the request.", + "schema": { + "type": "string" + }, + "example": "100;w=1;burst=110;comment=\"token bucket\";category=\"trigger\";cost=\"single\"" + }, + "Retry-After": { + "required": false, + "description": "The number of seconds after which the client may retry the request that was previously rejected.", + "schema": { + "type": "string" + }, + "example": "8" + }, + "Idempotency-Key": { + "required": false, + "description": "The idempotency key used to evaluate the request.", + "schema": { + "type": "string" + }, + "example": "8" + }, + "Idempotency-Replay": { + "required": false, + "description": "Whether the request was a replay of a previous request.", + "schema": { + "type": "string" + }, + "example": "true" + }, + "Link": { + "required": false, + "description": "A link to the documentation.", + "schema": { + "type": "string" + }, + "example": "https://docs.novu.co/" + } + } + }, + "externalDocs": { + "description": "Novu Documentation", + "url": "https://docs.novu.co" + }, + "x-speakeasy-name-override": [ + { + "operationId": "^.*get.*", + "methodNameOverride": "retrieve" + }, + { + "operationId": "^.*retrieve.*", + "methodNameOverride": "retrieve" + }, + { + "operationId": "^.*create.*", + "methodNameOverride": "create" + }, + { + "operationId": "^.*update.*", + "methodNameOverride": "update" + }, + { + "operationId": "^.*list.*", + "methodNameOverride": "list" + }, + { + "operationId": "^.*delete.*", + "methodNameOverride": "delete" + }, + { + "operationId": "^.*remove.*", + "methodNameOverride": "delete" + } + ], + "x-speakeasy-retries": { + "strategy": "backoff", + "backoff": { + "initialInterval": 500, + "maxInterval": 30000, + "maxElapsedTime": 3600000, + "exponent": 1.5 + }, + "statusCodes": [ + "408", + "409", + "429", + "5XX" + ], + "retryConnectionErrors": true + } +} \ No newline at end of file diff --git a/src/core.ts b/src/core.ts new file mode 100644 index 00000000..8e7a79d7 --- /dev/null +++ b/src/core.ts @@ -0,0 +1,13 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClientSDK } from "./lib/sdks.js"; + +/** + * A minimal client to use when calling standalone SDK functions. Typically, an + * instance of this class would be instantiated once at the start of an + * application and passed around through some dependency injection mechanism to + * parts of an application that need to make SDK calls. + */ +export class NovuCore extends ClientSDK {} diff --git a/src/funcs/cancel.ts b/src/funcs/cancel.ts new file mode 100644 index 00000000..91909877 --- /dev/null +++ b/src/funcs/cancel.ts @@ -0,0 +1,143 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Cancel triggered event + * + * @remarks + * + * Using a previously generated transactionId during the event trigger, + * will cancel any active or pending workflows. This is useful to cancel active digests, delays etc... + * + */ +export async function cancel( + client$: NovuCore, + transactionId: string, + options?: RequestOptions +): Promise< + Result< + components.DataBooleanDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.EventsControllerCancelRequest = { + transactionId: transactionId, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.EventsControllerCancelRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + transactionId: encodeSimple$("transactionId", payload$.transactionId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/events/trigger/{transactionId}")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "EventsController_cancel", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "DELETE", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.DataBooleanDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.DataBooleanDto$inboundSchema), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/changesApply.ts b/src/funcs/changesApply.ts new file mode 100644 index 00000000..afcabb6a --- /dev/null +++ b/src/funcs/changesApply.ts @@ -0,0 +1,138 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import * as z from "zod"; + +/** + * Apply change + */ +export async function changesApply( + client$: NovuCore, + changeId: string, + options?: RequestOptions +): Promise< + Result< + Array, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.ChangesControllerApplyDiffRequest = { + changeId: changeId, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.ChangesControllerApplyDiffRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + changeId: encodeSimple$("changeId", payload$.changeId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/changes/{changeId}/apply")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "ChangesController_applyDiff", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "POST", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + Array, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(201, z.array(components.ChangeResponseDto$inboundSchema)), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/changesApplyBulk.ts b/src/funcs/changesApplyBulk.ts new file mode 100644 index 00000000..9230b333 --- /dev/null +++ b/src/funcs/changesApplyBulk.ts @@ -0,0 +1,129 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeJSON as encodeJSON$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import { Result } from "../types/fp.js"; +import * as z from "zod"; + +/** + * Apply changes + */ +export async function changesApplyBulk( + client$: NovuCore, + request: components.BulkApplyChangeDto, + options?: RequestOptions +): Promise< + Result< + Array, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => components.BulkApplyChangeDto$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$, { explode: true }); + + const path$ = pathToFunc("/v1/changes/bulk/apply")(); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "ChangesController_bulkApplyDiff", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "POST", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + Array, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(201, z.array(components.ChangeResponseDto$inboundSchema)), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/changesCount.ts b/src/funcs/changesCount.ts new file mode 100644 index 00000000..501c65c9 --- /dev/null +++ b/src/funcs/changesCount.ts @@ -0,0 +1,110 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import * as m$ from "../lib/matchers.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import { Result } from "../types/fp.js"; + +/** + * Get changes count + */ +export async function changesCount( + client$: NovuCore, + options?: RequestOptions +): Promise< + Result< + components.DataNumberDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const path$ = pathToFunc("/v1/changes/count")(); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "ChangesController_getChangesCount", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.DataNumberDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.DataNumberDto$inboundSchema), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/changesRetrieve.ts b/src/funcs/changesRetrieve.ts new file mode 100644 index 00000000..101d02da --- /dev/null +++ b/src/funcs/changesRetrieve.ts @@ -0,0 +1,135 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Get changes + */ +export async function changesRetrieve( + client$: NovuCore, + request: operations.ChangesControllerGetChangesRequest, + options?: RequestOptions +): Promise< + Result< + components.ChangesResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.ChangesControllerGetChangesRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const path$ = pathToFunc("/v1/changes")(); + + const query$ = encodeFormQuery$({ + limit: payload$.limit, + page: payload$.page, + promoted: payload$.promoted, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "ChangesController_getChanges", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.ChangesResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.ChangesResponseDto$inboundSchema), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/environmentsApiKeysList.ts b/src/funcs/environmentsApiKeysList.ts new file mode 100644 index 00000000..4a3a49de --- /dev/null +++ b/src/funcs/environmentsApiKeysList.ts @@ -0,0 +1,111 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import * as m$ from "../lib/matchers.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import { Result } from "../types/fp.js"; +import * as z from "zod"; + +/** + * Get api keys + */ +export async function environmentsApiKeysList( + client$: NovuCore, + options?: RequestOptions +): Promise< + Result< + Array, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const path$ = pathToFunc("/v1/environments/api-keys")(); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "EnvironmentsController_listOrganizationApiKeys", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + Array, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, z.array(components.ApiKey$inboundSchema)), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/environmentsList.ts b/src/funcs/environmentsList.ts new file mode 100644 index 00000000..52f9ed68 --- /dev/null +++ b/src/funcs/environmentsList.ts @@ -0,0 +1,111 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import * as m$ from "../lib/matchers.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import { Result } from "../types/fp.js"; +import * as z from "zod"; + +/** + * Get environments + */ +export async function environmentsList( + client$: NovuCore, + options?: RequestOptions +): Promise< + Result< + Array, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const path$ = pathToFunc("/v1/environments")(); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "EnvironmentsController_listMyEnvironments", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + Array, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, z.array(components.EnvironmentResponseDto$inboundSchema)), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/environmentsRetrieve.ts b/src/funcs/environmentsRetrieve.ts new file mode 100644 index 00000000..257194d0 --- /dev/null +++ b/src/funcs/environmentsRetrieve.ts @@ -0,0 +1,110 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import * as m$ from "../lib/matchers.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import { Result } from "../types/fp.js"; + +/** + * Get current environment + */ +export async function environmentsRetrieve( + client$: NovuCore, + options?: RequestOptions +): Promise< + Result< + components.EnvironmentResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const path$ = pathToFunc("/v1/environments/me")(); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "EnvironmentsController_getCurrentEnvironment", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.EnvironmentResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.EnvironmentResponseDto$inboundSchema), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/executionDetailsRetrieve.ts b/src/funcs/executionDetailsRetrieve.ts new file mode 100644 index 00000000..1298440f --- /dev/null +++ b/src/funcs/executionDetailsRetrieve.ts @@ -0,0 +1,142 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import * as z from "zod"; + +/** + * Get execution details + */ +export async function executionDetailsRetrieve( + client$: NovuCore, + notificationId: string, + subscriberId: string, + options?: RequestOptions +): Promise< + Result< + Array, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.ExecutionDetailsControllerGetExecutionDetailsForNotificationRequest = { + notificationId: notificationId, + subscriberId: subscriberId, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => + operations.ExecutionDetailsControllerGetExecutionDetailsForNotificationRequest$outboundSchema.parse( + value$ + ), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const path$ = pathToFunc("/v1/execution-details")(); + + const query$ = encodeFormQuery$({ + notificationId: payload$.notificationId, + subscriberId: payload$.subscriberId, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "ExecutionDetailsController_getExecutionDetailsForNotification", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + Array, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, z.array(components.ExecutionDetailsResponseDto$inboundSchema)), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/feedsCreate.ts b/src/funcs/feedsCreate.ts new file mode 100644 index 00000000..614c8d87 --- /dev/null +++ b/src/funcs/feedsCreate.ts @@ -0,0 +1,128 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeJSON as encodeJSON$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import { Result } from "../types/fp.js"; + +/** + * Create feed + */ +export async function feedsCreate( + client$: NovuCore, + request: components.CreateFeedRequestDto, + options?: RequestOptions +): Promise< + Result< + components.FeedResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => components.CreateFeedRequestDto$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$, { explode: true }); + + const path$ = pathToFunc("/v1/feeds")(); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "FeedsController_createFeed", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "POST", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.FeedResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(201, components.FeedResponseDto$inboundSchema), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/feedsDelete.ts b/src/funcs/feedsDelete.ts new file mode 100644 index 00000000..80f04db8 --- /dev/null +++ b/src/funcs/feedsDelete.ts @@ -0,0 +1,138 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import * as z from "zod"; + +/** + * Delete feed + */ +export async function feedsDelete( + client$: NovuCore, + feedId: string, + options?: RequestOptions +): Promise< + Result< + Array, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.FeedsControllerDeleteFeedByIdRequest = { + feedId: feedId, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.FeedsControllerDeleteFeedByIdRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + feedId: encodeSimple$("feedId", payload$.feedId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/feeds/{feedId}")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "FeedsController_deleteFeedById", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "DELETE", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + Array, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, z.array(components.FeedResponseDto$inboundSchema)), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/feedsRetrieve.ts b/src/funcs/feedsRetrieve.ts new file mode 100644 index 00000000..52e755df --- /dev/null +++ b/src/funcs/feedsRetrieve.ts @@ -0,0 +1,111 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import * as m$ from "../lib/matchers.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import { Result } from "../types/fp.js"; +import * as z from "zod"; + +/** + * Get feeds + */ +export async function feedsRetrieve( + client$: NovuCore, + options?: RequestOptions +): Promise< + Result< + Array, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const path$ = pathToFunc("/v1/feeds")(); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "FeedsController_getFeeds", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + Array, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, z.array(components.FeedResponseDto$inboundSchema)), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/integrationsCreate.ts b/src/funcs/integrationsCreate.ts new file mode 100644 index 00000000..bf3c65b5 --- /dev/null +++ b/src/funcs/integrationsCreate.ts @@ -0,0 +1,131 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeJSON as encodeJSON$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import { Result } from "../types/fp.js"; + +/** + * Create integration + * + * @remarks + * Create an integration for the current environment the user is based on the API key provided + */ +export async function integrationsCreate( + client$: NovuCore, + request: components.CreateIntegrationRequestDto, + options?: RequestOptions +): Promise< + Result< + components.IntegrationResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => components.CreateIntegrationRequestDto$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$, { explode: true }); + + const path$ = pathToFunc("/v1/integrations")(); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "IntegrationsController_createIntegration", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "POST", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.IntegrationResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(201, components.IntegrationResponseDto$inboundSchema), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/integrationsDelete.ts b/src/funcs/integrationsDelete.ts new file mode 100644 index 00000000..44286976 --- /dev/null +++ b/src/funcs/integrationsDelete.ts @@ -0,0 +1,139 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import * as z from "zod"; + +/** + * Delete integration + */ +export async function integrationsDelete( + client$: NovuCore, + integrationId: string, + options?: RequestOptions +): Promise< + Result< + Array, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.IntegrationsControllerRemoveIntegrationRequest = { + integrationId: integrationId, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => + operations.IntegrationsControllerRemoveIntegrationRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + integrationId: encodeSimple$("integrationId", payload$.integrationId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/integrations/{integrationId}")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "IntegrationsController_removeIntegration", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "DELETE", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + Array, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, z.array(components.IntegrationResponseDto$inboundSchema)), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/integrationsList.ts b/src/funcs/integrationsList.ts new file mode 100644 index 00000000..62b49dce --- /dev/null +++ b/src/funcs/integrationsList.ts @@ -0,0 +1,114 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import * as m$ from "../lib/matchers.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import { Result } from "../types/fp.js"; +import * as z from "zod"; + +/** + * Get integrations + * + * @remarks + * Return all the integrations the user has created for that organization. Review v.0.17.0 changelog for a breaking change + */ +export async function integrationsList( + client$: NovuCore, + options?: RequestOptions +): Promise< + Result< + Array, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const path$ = pathToFunc("/v1/integrations")(); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "IntegrationsController_listIntegrations", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + Array, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, z.array(components.IntegrationResponseDto$inboundSchema)), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/integrationsListActive.ts b/src/funcs/integrationsListActive.ts new file mode 100644 index 00000000..4611aa92 --- /dev/null +++ b/src/funcs/integrationsListActive.ts @@ -0,0 +1,114 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import * as m$ from "../lib/matchers.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import { Result } from "../types/fp.js"; +import * as z from "zod"; + +/** + * Get active integrations + * + * @remarks + * Return all the active integrations the user has created for that organization. Review v.0.17.0 changelog for a breaking change + */ +export async function integrationsListActive( + client$: NovuCore, + options?: RequestOptions +): Promise< + Result< + Array, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const path$ = pathToFunc("/v1/integrations/active")(); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "IntegrationsController_getActiveIntegrations", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + Array, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, z.array(components.IntegrationResponseDto$inboundSchema)), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/integrationsSetAsPrimary.ts b/src/funcs/integrationsSetAsPrimary.ts new file mode 100644 index 00000000..3222a600 --- /dev/null +++ b/src/funcs/integrationsSetAsPrimary.ts @@ -0,0 +1,140 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Set integration as primary + */ +export async function integrationsSetAsPrimary( + client$: NovuCore, + integrationId: string, + options?: RequestOptions +): Promise< + Result< + components.IntegrationResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.IntegrationsControllerSetIntegrationAsPrimaryRequest = { + integrationId: integrationId, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => + operations.IntegrationsControllerSetIntegrationAsPrimaryRequest$outboundSchema.parse( + value$ + ), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + integrationId: encodeSimple$("integrationId", payload$.integrationId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/integrations/{integrationId}/set-primary")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "IntegrationsController_setIntegrationAsPrimary", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "POST", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["404", "409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.IntegrationResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.IntegrationResponseDto$inboundSchema), + m$.fail([404, 409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/integrationsUpdate.ts b/src/funcs/integrationsUpdate.ts new file mode 100644 index 00000000..67049f86 --- /dev/null +++ b/src/funcs/integrationsUpdate.ts @@ -0,0 +1,143 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Update integration + */ +export async function integrationsUpdate( + client$: NovuCore, + integrationId: string, + updateIntegrationRequestDto: components.UpdateIntegrationRequestDto, + options?: RequestOptions +): Promise< + Result< + components.IntegrationResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.IntegrationsControllerUpdateIntegrationByIdRequest = { + integrationId: integrationId, + updateIntegrationRequestDto: updateIntegrationRequestDto, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => + operations.IntegrationsControllerUpdateIntegrationByIdRequest$outboundSchema.parse( + value$ + ), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.UpdateIntegrationRequestDto, { explode: true }); + + const pathParams$ = { + integrationId: encodeSimple$("integrationId", payload$.integrationId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/integrations/{integrationId}")(pathParams$); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "IntegrationsController_updateIntegrationById", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "PUT", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["404", "409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.IntegrationResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.IntegrationResponseDto$inboundSchema), + m$.fail([404, 409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/integrationsWebhooksRetrieve.ts b/src/funcs/integrationsWebhooksRetrieve.ts new file mode 100644 index 00000000..c901be8b --- /dev/null +++ b/src/funcs/integrationsWebhooksRetrieve.ts @@ -0,0 +1,146 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import * as z from "zod"; + +/** + * Get webhook support status for provider + * + * @remarks + * Return the status of the webhook for this provider, if it is supported or if it is not based on a boolean value + */ +export async function integrationsWebhooksRetrieve( + client$: NovuCore, + providerOrIntegrationId: string, + options?: RequestOptions +): Promise< + Result< + boolean, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.IntegrationsControllerGetWebhookSupportStatusRequest = { + providerOrIntegrationId: providerOrIntegrationId, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => + operations.IntegrationsControllerGetWebhookSupportStatusRequest$outboundSchema.parse( + value$ + ), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + providerOrIntegrationId: encodeSimple$( + "providerOrIntegrationId", + payload$.providerOrIntegrationId, + { explode: false, charEncoding: "percent" } + ), + }; + + const path$ = pathToFunc("/v1/integrations/webhook/provider/{providerOrIntegrationId}/status")( + pathParams$ + ); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "IntegrationsController_getWebhookSupportStatus", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + boolean, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, z.boolean()), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/layoutsCreate.ts b/src/funcs/layoutsCreate.ts new file mode 100644 index 00000000..13be4981 --- /dev/null +++ b/src/funcs/layoutsCreate.ts @@ -0,0 +1,113 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import * as m$ from "../lib/matchers.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import { Result } from "../types/fp.js"; + +/** + * Layout creation + * + * @remarks + * Create a layout + */ +export async function layoutsCreate( + client$: NovuCore, + options?: RequestOptions +): Promise< + Result< + components.CreateLayoutResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const path$ = pathToFunc("/v1/layouts")(); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "LayoutsController_PropertyDescriptor", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "POST", + path: path$, + headers: headers$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.CreateLayoutResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(201, components.CreateLayoutResponseDto$inboundSchema), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/layoutsDelete.ts b/src/funcs/layoutsDelete.ts new file mode 100644 index 00000000..f4c50148 --- /dev/null +++ b/src/funcs/layoutsDelete.ts @@ -0,0 +1,140 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import * as z from "zod"; + +/** + * Delete layout + * + * @remarks + * Execute a soft delete of a layout given a certain ID. + */ +export async function layoutsDelete( + client$: NovuCore, + layoutId: string, + options?: RequestOptions +): Promise< + Result< + void, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.LayoutsControllerDeleteLayoutRequest = { + layoutId: layoutId, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.LayoutsControllerDeleteLayoutRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + layoutId: encodeSimple$("layoutId", payload$.layoutId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/layouts/{layoutId}")(pathParams$); + + const headers$ = new Headers({ + Accept: "*/*", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "LayoutsController_deleteLayout", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "DELETE", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["404", "409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + void, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.nil(204, z.void()), + m$.fail([404, 409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/layoutsList.ts b/src/funcs/layoutsList.ts new file mode 100644 index 00000000..fb25e131 --- /dev/null +++ b/src/funcs/layoutsList.ts @@ -0,0 +1,139 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import * as z from "zod"; + +/** + * Filter layouts + * + * @remarks + * Returns a list of layouts that can be paginated using the `page` query parameter and filtered by the environment where it is executed from the organization the user belongs to. + */ +export async function layoutsList( + client$: NovuCore, + request: operations.LayoutsControllerListLayoutsRequest, + options?: RequestOptions +): Promise< + Result< + void, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = typeof request === "undefined" ? {} : request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.LayoutsControllerListLayoutsRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const path$ = pathToFunc("/v1/layouts")(); + + const query$ = encodeFormQuery$({ + orderBy: payload$.orderBy, + page: payload$.page, + pageSize: payload$.pageSize, + sortBy: payload$.sortBy, + }); + + const headers$ = new Headers({ + Accept: "*/*", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "LayoutsController_listLayouts", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + void, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.nil(200, z.void()), + m$.fail([400, 409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/layoutsRetrieve.ts b/src/funcs/layoutsRetrieve.ts new file mode 100644 index 00000000..a8fb9101 --- /dev/null +++ b/src/funcs/layoutsRetrieve.ts @@ -0,0 +1,140 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Get layout + * + * @remarks + * Get a layout by its ID + */ +export async function layoutsRetrieve( + client$: NovuCore, + layoutId: string, + options?: RequestOptions +): Promise< + Result< + components.GetLayoutResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.LayoutsControllerGetLayoutRequest = { + layoutId: layoutId, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.LayoutsControllerGetLayoutRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + layoutId: encodeSimple$("layoutId", payload$.layoutId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/layouts/{layoutId}")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "LayoutsController_getLayout", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["404", "409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.GetLayoutResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.GetLayoutResponseDto$inboundSchema), + m$.fail([404, 409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/layoutsSetAsDefault.ts b/src/funcs/layoutsSetAsDefault.ts new file mode 100644 index 00000000..0bce5a04 --- /dev/null +++ b/src/funcs/layoutsSetAsDefault.ts @@ -0,0 +1,141 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import * as z from "zod"; + +/** + * Set default layout + * + * @remarks + * Sets the default layout for the environment and updates to non default to the existing default layout (if any). + */ +export async function layoutsSetAsDefault( + client$: NovuCore, + layoutId: string, + options?: RequestOptions +): Promise< + Result< + void, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.LayoutsControllerSetDefaultLayoutRequest = { + layoutId: layoutId, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => + operations.LayoutsControllerSetDefaultLayoutRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + layoutId: encodeSimple$("layoutId", payload$.layoutId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/layouts/{layoutId}/default")(pathParams$); + + const headers$ = new Headers({ + Accept: "*/*", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "LayoutsController_setDefaultLayout", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "POST", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["404", "409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + void, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.nil(204, z.void()), + m$.fail([404, 409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/layoutsUpdate.ts b/src/funcs/layoutsUpdate.ts new file mode 100644 index 00000000..20ac60b9 --- /dev/null +++ b/src/funcs/layoutsUpdate.ts @@ -0,0 +1,143 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Update a layout + * + * @remarks + * Update the name, content and variables of a layout. Also change it to be default or no. + */ +export async function layoutsUpdate( + client$: NovuCore, + layoutId: string, + updateLayoutRequestDto: components.UpdateLayoutRequestDto, + options?: RequestOptions +): Promise< + Result< + components.UpdateLayoutResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.LayoutsControllerUpdateLayoutRequest = { + layoutId: layoutId, + updateLayoutRequestDto: updateLayoutRequestDto, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.LayoutsControllerUpdateLayoutRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.UpdateLayoutRequestDto, { explode: true }); + + const pathParams$ = { + layoutId: encodeSimple$("layoutId", payload$.layoutId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/layouts/{layoutId}")(pathParams$); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "LayoutsController_updateLayout", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "PATCH", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["400", "404", "409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.UpdateLayoutResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.UpdateLayoutResponseDto$inboundSchema), + m$.fail([400, 404, 409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/messagesDelete.ts b/src/funcs/messagesDelete.ts new file mode 100644 index 00000000..526921e1 --- /dev/null +++ b/src/funcs/messagesDelete.ts @@ -0,0 +1,140 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Delete message + * + * @remarks + * Deletes a message entity from the Novu platform + */ +export async function messagesDelete( + client$: NovuCore, + messageId: string, + options?: RequestOptions +): Promise< + Result< + components.DeleteMessageResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.MessagesControllerDeleteMessageRequest = { + messageId: messageId, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.MessagesControllerDeleteMessageRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + messageId: encodeSimple$("messageId", payload$.messageId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/messages/{messageId}")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "MessagesController_deleteMessage", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "DELETE", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.DeleteMessageResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.DeleteMessageResponseDto$inboundSchema), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/messagesDeleteByTransactionId.ts b/src/funcs/messagesDeleteByTransactionId.ts new file mode 100644 index 00000000..00f4fbf5 --- /dev/null +++ b/src/funcs/messagesDeleteByTransactionId.ts @@ -0,0 +1,153 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { + encodeFormQuery as encodeFormQuery$, + encodeSimple as encodeSimple$, +} from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import * as z from "zod"; + +/** + * Delete messages by transactionId + * + * @remarks + * Deletes messages entity from the Novu platform using TransactionId of message + */ +export async function messagesDeleteByTransactionId( + client$: NovuCore, + transactionId: string, + channel?: operations.Channel | undefined, + options?: RequestOptions +): Promise< + Result< + void, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.MessagesControllerDeleteMessagesByTransactionIdRequest = { + channel: channel, + transactionId: transactionId, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => + operations.MessagesControllerDeleteMessagesByTransactionIdRequest$outboundSchema.parse( + value$ + ), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + transactionId: encodeSimple$("transactionId", payload$.transactionId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/messages/transaction/{transactionId}")(pathParams$); + + const query$ = encodeFormQuery$({ + channel: payload$.channel, + }); + + const headers$ = new Headers({ + Accept: "*/*", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "MessagesController_deleteMessagesByTransactionId", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "DELETE", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + void, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.nil(204, z.void()), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/messagesRetrieve.ts b/src/funcs/messagesRetrieve.ts new file mode 100644 index 00000000..14643a2d --- /dev/null +++ b/src/funcs/messagesRetrieve.ts @@ -0,0 +1,140 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Get messages + * + * @remarks + * Returns a list of messages, could paginate using the `page` query parameter + */ +export async function messagesRetrieve( + client$: NovuCore, + request: operations.MessagesControllerGetMessagesRequest, + options?: RequestOptions +): Promise< + Result< + components.ActivitiesResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = typeof request === "undefined" ? {} : request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.MessagesControllerGetMessagesRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const path$ = pathToFunc("/v1/messages")(); + + const query$ = encodeFormQuery$({ + channel: payload$.channel, + limit: payload$.limit, + page: payload$.page, + subscriberId: payload$.subscriberId, + transactionId: payload$.transactionId, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "MessagesController_getMessages", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.ActivitiesResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.ActivitiesResponseDto$inboundSchema), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/notificationsList.ts b/src/funcs/notificationsList.ts new file mode 100644 index 00000000..18a3093f --- /dev/null +++ b/src/funcs/notificationsList.ts @@ -0,0 +1,140 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Get notifications + */ +export async function notificationsList( + client$: NovuCore, + request: operations.NotificationsControllerListNotificationsRequest, + options?: RequestOptions +): Promise< + Result< + components.ActivitiesResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => + operations.NotificationsControllerListNotificationsRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const path$ = pathToFunc("/v1/notifications")(); + + const query$ = encodeFormQuery$({ + channels: payload$.channels, + emails: payload$.emails, + page: payload$.page, + search: payload$.search, + subscriberIds: payload$.subscriberIds, + templates: payload$.templates, + transactionId: payload$.transactionId, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "NotificationsController_listNotifications", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.ActivitiesResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.ActivitiesResponseDto$inboundSchema), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/notificationsRetrieve.ts b/src/funcs/notificationsRetrieve.ts new file mode 100644 index 00000000..7e43bcf7 --- /dev/null +++ b/src/funcs/notificationsRetrieve.ts @@ -0,0 +1,138 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Get notification + */ +export async function notificationsRetrieve( + client$: NovuCore, + notificationId: string, + options?: RequestOptions +): Promise< + Result< + components.ActivityNotificationResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.NotificationsControllerGetNotificationRequest = { + notificationId: notificationId, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => + operations.NotificationsControllerGetNotificationRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + notificationId: encodeSimple$("notificationId", payload$.notificationId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/notifications/{notificationId}")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "NotificationsController_getNotification", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.ActivityNotificationResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.ActivityNotificationResponseDto$inboundSchema), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/notificationsStatsGraph.ts b/src/funcs/notificationsStatsGraph.ts new file mode 100644 index 00000000..b5d1e894 --- /dev/null +++ b/src/funcs/notificationsStatsGraph.ts @@ -0,0 +1,139 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import * as z from "zod"; + +/** + * Get notification graph statistics + */ +export async function notificationsStatsGraph( + client$: NovuCore, + days?: number | undefined, + options?: RequestOptions +): Promise< + Result< + Array, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.NotificationsControllerGetActivityGraphStatsRequest = { + days: days, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => + operations.NotificationsControllerGetActivityGraphStatsRequest$outboundSchema.parse( + value$ + ), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const path$ = pathToFunc("/v1/notifications/graph/stats")(); + + const query$ = encodeFormQuery$({ + days: payload$.days, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "NotificationsController_getActivityGraphStats", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + Array, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, z.array(components.ActivityGraphStatesResponse$inboundSchema)), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/notificationsStatsRetrieve.ts b/src/funcs/notificationsStatsRetrieve.ts new file mode 100644 index 00000000..8cc0842c --- /dev/null +++ b/src/funcs/notificationsStatsRetrieve.ts @@ -0,0 +1,110 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import * as m$ from "../lib/matchers.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import { Result } from "../types/fp.js"; + +/** + * Get notification statistics + */ +export async function notificationsStatsRetrieve( + client$: NovuCore, + options?: RequestOptions +): Promise< + Result< + components.ActivityStatsResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const path$ = pathToFunc("/v1/notifications/stats")(); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "NotificationsController_getActivityStats", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.ActivityStatsResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.ActivityStatsResponseDto$inboundSchema), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/organizationsEEOrganizationControllerRenameOrganization.ts b/src/funcs/organizationsEEOrganizationControllerRenameOrganization.ts new file mode 100644 index 00000000..4781dc7f --- /dev/null +++ b/src/funcs/organizationsEEOrganizationControllerRenameOrganization.ts @@ -0,0 +1,128 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeJSON as encodeJSON$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import { Result } from "../types/fp.js"; + +/** + * Rename organization name + */ +export async function organizationsEEOrganizationControllerRenameOrganization( + client$: NovuCore, + request: components.RenameOrganizationDto, + options?: RequestOptions +): Promise< + Result< + components.RenameOrganizationDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => components.RenameOrganizationDto$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$, { explode: true }); + + const path$ = pathToFunc("/v1/organizations")(); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "EEOrganizationController_renameOrganization", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "PATCH", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.RenameOrganizationDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.RenameOrganizationDto$inboundSchema), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/organizationsRetrieve.ts b/src/funcs/organizationsRetrieve.ts new file mode 100644 index 00000000..26ca46cd --- /dev/null +++ b/src/funcs/organizationsRetrieve.ts @@ -0,0 +1,110 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import * as m$ from "../lib/matchers.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import { Result } from "../types/fp.js"; + +/** + * Fetch current organization details + */ +export async function organizationsRetrieve( + client$: NovuCore, + options?: RequestOptions +): Promise< + Result< + components.OrganizationResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const path$ = pathToFunc("/v1/organizations/me")(); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "EEOrganizationController_getMyOrganization", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.OrganizationResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.OrganizationResponseDto$inboundSchema), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/organizationsUpdate.ts b/src/funcs/organizationsUpdate.ts new file mode 100644 index 00000000..9ce7a499 --- /dev/null +++ b/src/funcs/organizationsUpdate.ts @@ -0,0 +1,128 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeJSON as encodeJSON$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import { Result } from "../types/fp.js"; + +/** + * Update organization branding details + */ +export async function organizationsUpdate( + client$: NovuCore, + request: components.UpdateBrandingDetailsDto, + options?: RequestOptions +): Promise< + Result< + components.OrganizationBrandingResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => components.UpdateBrandingDetailsDto$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$, { explode: true }); + + const path$ = pathToFunc("/v1/organizations/branding")(); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "EEOrganizationController_updateBrandingDetails", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "PUT", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.OrganizationBrandingResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.OrganizationBrandingResponseDto$inboundSchema), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/subscribersAuthenticationChatAccessOauth.ts b/src/funcs/subscribersAuthenticationChatAccessOauth.ts new file mode 100644 index 00000000..e9edaab8 --- /dev/null +++ b/src/funcs/subscribersAuthenticationChatAccessOauth.ts @@ -0,0 +1,152 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { + encodeFormQuery as encodeFormQuery$, + encodeSimple as encodeSimple$, +} from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import * as z from "zod"; + +/** + * Handle chat oauth + */ +export async function subscribersAuthenticationChatAccessOauth( + client$: NovuCore, + request: operations.SubscribersControllerChatAccessOauthRequest, + options?: RequestOptions +): Promise< + Result< + void, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => + operations.SubscribersControllerChatAccessOauthRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + providerId: encodeSimple$("providerId", payload$.providerId, { + explode: false, + charEncoding: "percent", + }), + subscriberId: encodeSimple$("subscriberId", payload$.subscriberId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/subscribers/{subscriberId}/credentials/{providerId}/oauth")( + pathParams$ + ); + + const query$ = encodeFormQuery$({ + environmentId: payload$.environmentId, + hmacHash: payload$.hmacHash, + integrationIdentifier: payload$.integrationIdentifier, + }); + + const headers$ = new Headers({ + Accept: "*/*", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "SubscribersController_chatAccessOauth", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + void, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.nil(200, z.void()), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/subscribersAuthenticationChatAccessOauthCallBack.ts b/src/funcs/subscribersAuthenticationChatAccessOauthCallBack.ts new file mode 100644 index 00000000..f9c0c713 --- /dev/null +++ b/src/funcs/subscribersAuthenticationChatAccessOauthCallBack.ts @@ -0,0 +1,152 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { + encodeFormQuery as encodeFormQuery$, + encodeSimple as encodeSimple$, +} from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Handle providers oauth redirect + */ +export async function subscribersAuthenticationChatAccessOauthCallBack( + client$: NovuCore, + request: operations.SubscribersControllerChatOauthCallbackRequest, + options?: RequestOptions +): Promise< + Result< + operations.SubscribersControllerChatOauthCallbackResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => + operations.SubscribersControllerChatOauthCallbackRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + providerId: encodeSimple$("providerId", payload$.providerId, { + explode: false, + charEncoding: "percent", + }), + subscriberId: encodeSimple$("subscriberId", payload$.subscriberId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc( + "/v1/subscribers/{subscriberId}/credentials/{providerId}/oauth/callback" + )(pathParams$); + + const query$ = encodeFormQuery$({ + code: payload$.code, + environmentId: payload$.environmentId, + hmacHash: payload$.hmacHash, + integrationIdentifier: payload$.integrationIdentifier, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "SubscribersController_chatOauthCallback", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.SubscribersControllerChatOauthCallbackResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, operations.SubscribersControllerChatOauthCallbackResponseBody$inboundSchema), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/subscribersCreate.ts b/src/funcs/subscribersCreate.ts new file mode 100644 index 00000000..bddf86f1 --- /dev/null +++ b/src/funcs/subscribersCreate.ts @@ -0,0 +1,131 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeJSON as encodeJSON$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import { Result } from "../types/fp.js"; + +/** + * Create subscriber + * + * @remarks + * Creates a subscriber entity, in the Novu platform. The subscriber will be later used to receive notifications, and access notification feeds. Communication credentials such as email, phone number, and 3 rd party credentials i.e slack tokens could be later associated to this entity. + */ +export async function subscribersCreate( + client$: NovuCore, + request: components.CreateSubscriberRequestDto, + options?: RequestOptions +): Promise< + Result< + components.SubscriberResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => components.CreateSubscriberRequestDto$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$, { explode: true }); + + const path$ = pathToFunc("/v1/subscribers")(); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "SubscribersController_createSubscriber", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "POST", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.SubscriberResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(201, components.SubscriberResponseDto$inboundSchema), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/subscribersCreateBulk.ts b/src/funcs/subscribersCreateBulk.ts new file mode 100644 index 00000000..0bf2b5a3 --- /dev/null +++ b/src/funcs/subscribersCreateBulk.ts @@ -0,0 +1,135 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeJSON as encodeJSON$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import { Result } from "../types/fp.js"; +import * as z from "zod"; + +/** + * Bulk create subscribers + * + * @remarks + * + * Using this endpoint you can create multiple subscribers at once, to avoid multiple calls to the API. + * The bulk API is limited to 500 subscribers per request. + * + */ +export async function subscribersCreateBulk( + client$: NovuCore, + request: components.BulkSubscriberCreateDto, + options?: RequestOptions +): Promise< + Result< + void, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => components.BulkSubscriberCreateDto$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$, { explode: true }); + + const path$ = pathToFunc("/v1/subscribers/bulk")(); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "*/*", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "SubscribersController_bulkCreateSubscribers", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "POST", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + void, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.nil(201, z.void()), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/subscribersCredentialsAppend.ts b/src/funcs/subscribersCredentialsAppend.ts new file mode 100644 index 00000000..730dc146 --- /dev/null +++ b/src/funcs/subscribersCredentialsAppend.ts @@ -0,0 +1,149 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Modify subscriber credentials + * + * @remarks + * Subscriber credentials associated to the delivery methods such as slack and push tokens. + * This endpoint appends provided credentials and deviceTokens to the existing ones. + */ +export async function subscribersCredentialsAppend( + client$: NovuCore, + subscriberId: string, + updateSubscriberChannelRequestDto: components.UpdateSubscriberChannelRequestDto, + options?: RequestOptions +): Promise< + Result< + components.SubscriberResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.SubscribersControllerModifySubscriberChannelRequest = { + subscriberId: subscriberId, + updateSubscriberChannelRequestDto: updateSubscriberChannelRequestDto, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => + operations.SubscribersControllerModifySubscriberChannelRequest$outboundSchema.parse( + value$ + ), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.UpdateSubscriberChannelRequestDto, { + explode: true, + }); + + const pathParams$ = { + subscriberId: encodeSimple$("subscriberId", payload$.subscriberId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/subscribers/{subscriberId}/credentials")(pathParams$); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "SubscribersController_modifySubscriberChannel", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "PATCH", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.SubscriberResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.SubscriberResponseDto$inboundSchema), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/subscribersCredentialsDelete.ts b/src/funcs/subscribersCredentialsDelete.ts new file mode 100644 index 00000000..a0f484e2 --- /dev/null +++ b/src/funcs/subscribersCredentialsDelete.ts @@ -0,0 +1,151 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import * as z from "zod"; + +/** + * Delete subscriber credentials by providerId + * + * @remarks + * Delete subscriber credentials such as slack and expo tokens. + */ +export async function subscribersCredentialsDelete( + client$: NovuCore, + subscriberId: string, + providerId: string, + options?: RequestOptions +): Promise< + Result< + void, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.SubscribersControllerDeleteSubscriberCredentialsRequest = { + subscriberId: subscriberId, + providerId: providerId, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => + operations.SubscribersControllerDeleteSubscriberCredentialsRequest$outboundSchema.parse( + value$ + ), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + providerId: encodeSimple$("providerId", payload$.providerId, { + explode: false, + charEncoding: "percent", + }), + subscriberId: encodeSimple$("subscriberId", payload$.subscriberId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/subscribers/{subscriberId}/credentials/{providerId}")( + pathParams$ + ); + + const headers$ = new Headers({ + Accept: "*/*", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "SubscribersController_deleteSubscriberCredentials", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "DELETE", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + void, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.nil(204, z.void()), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/subscribersCredentialsUpdate.ts b/src/funcs/subscribersCredentialsUpdate.ts new file mode 100644 index 00000000..4b0a1c8a --- /dev/null +++ b/src/funcs/subscribersCredentialsUpdate.ts @@ -0,0 +1,148 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Update subscriber credentials + * + * @remarks + * Subscriber credentials associated to the delivery methods such as slack and push tokens. + */ +export async function subscribersCredentialsUpdate( + client$: NovuCore, + subscriberId: string, + updateSubscriberChannelRequestDto: components.UpdateSubscriberChannelRequestDto, + options?: RequestOptions +): Promise< + Result< + components.SubscriberResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.SubscribersControllerUpdateSubscriberChannelRequest = { + subscriberId: subscriberId, + updateSubscriberChannelRequestDto: updateSubscriberChannelRequestDto, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => + operations.SubscribersControllerUpdateSubscriberChannelRequest$outboundSchema.parse( + value$ + ), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.UpdateSubscriberChannelRequestDto, { + explode: true, + }); + + const pathParams$ = { + subscriberId: encodeSimple$("subscriberId", payload$.subscriberId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/subscribers/{subscriberId}/credentials")(pathParams$); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "SubscribersController_updateSubscriberChannel", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "PUT", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.SubscriberResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.SubscriberResponseDto$inboundSchema), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/subscribersDelete.ts b/src/funcs/subscribersDelete.ts new file mode 100644 index 00000000..cf7cc81c --- /dev/null +++ b/src/funcs/subscribersDelete.ts @@ -0,0 +1,141 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Delete subscriber + * + * @remarks + * Deletes a subscriber entity from the Novu platform + */ +export async function subscribersDelete( + client$: NovuCore, + subscriberId: string, + options?: RequestOptions +): Promise< + Result< + components.DeleteSubscriberResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.SubscribersControllerRemoveSubscriberRequest = { + subscriberId: subscriberId, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => + operations.SubscribersControllerRemoveSubscriberRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + subscriberId: encodeSimple$("subscriberId", payload$.subscriberId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/subscribers/{subscriberId}")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "SubscribersController_removeSubscriber", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "DELETE", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.DeleteSubscriberResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.DeleteSubscriberResponseDto$inboundSchema), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/subscribersList.ts b/src/funcs/subscribersList.ts new file mode 100644 index 00000000..dda4ec63 --- /dev/null +++ b/src/funcs/subscribersList.ts @@ -0,0 +1,184 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { dlv } from "../lib/dlv.js"; +import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import { createPageIterator, haltIterator, PageIterator, Paginator } from "../types/operations.js"; + +/** + * Get subscribers + * + * @remarks + * Returns a list of subscribers, could paginated using the `page` and `limit` query parameter + */ +export async function subscribersList( + client$: NovuCore, + page?: number | undefined, + limit?: number | undefined, + options?: RequestOptions +): Promise< + PageIterator< + Result< + operations.SubscribersControllerListSubscribersResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > +> { + const input$: operations.SubscribersControllerListSubscribersRequest = { + page: page, + limit: limit, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => + operations.SubscribersControllerListSubscribersRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return haltIterator(parsed$); + } + const payload$ = parsed$.value; + const body$ = null; + + const path$ = pathToFunc("/v1/subscribers")(); + + const query$ = encodeFormQuery$({ + limit: payload$.limit, + page: payload$.page, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "SubscribersController_listSubscribers", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return haltIterator(requestRes); + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return haltIterator(doResult); + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$, raw$] = await m$.match< + operations.SubscribersControllerListSubscribersResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, operations.SubscribersControllerListSubscribersResponse$inboundSchema, { + key: "Result", + }), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return haltIterator(result$); + } + + const nextFunc = ( + responseData: unknown + ): Paginator< + Result< + operations.SubscribersControllerListSubscribersResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > => { + const page = input$.page || 0; + const nextPage = page + 1; + + if (!responseData) { + return () => null; + } + const results = dlv(responseData, "data.resultArray"); + if (!Array.isArray(results) || !results.length) { + return () => null; + } + const limit = input$.limit || 0; + if (results.length < limit) { + return () => null; + } + + return () => subscribersList(client$, nextPage, limit, options); + }; + + const page$ = { ...result$, next: nextFunc(raw$) }; + return { ...page$, ...createPageIterator(page$, (v) => !v.ok) }; +} diff --git a/src/funcs/subscribersMessagesMarkAll.ts b/src/funcs/subscribersMessagesMarkAll.ts new file mode 100644 index 00000000..dc61db12 --- /dev/null +++ b/src/funcs/subscribersMessagesMarkAll.ts @@ -0,0 +1,142 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import * as z from "zod"; + +/** + * Marks all the subscriber messages as read, unread, seen or unseen. Optionally you can pass feed id (or array) to mark messages of a particular feed. + */ +export async function subscribersMessagesMarkAll( + client$: NovuCore, + subscriberId: string, + markAllMessageAsRequestDto: components.MarkAllMessageAsRequestDto, + options?: RequestOptions +): Promise< + Result< + number, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.SubscribersControllerMarkAllUnreadAsReadRequest = { + subscriberId: subscriberId, + markAllMessageAsRequestDto: markAllMessageAsRequestDto, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => + operations.SubscribersControllerMarkAllUnreadAsReadRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.MarkAllMessageAsRequestDto, { explode: true }); + + const pathParams$ = { + subscriberId: encodeSimple$("subscriberId", payload$.subscriberId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/subscribers/{subscriberId}/messages/mark-all")(pathParams$); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "SubscribersController_markAllUnreadAsRead", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "POST", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + number, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(201, z.number()), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/subscribersMessagesMarkAllAs.ts b/src/funcs/subscribersMessagesMarkAllAs.ts new file mode 100644 index 00000000..2e93ada5 --- /dev/null +++ b/src/funcs/subscribersMessagesMarkAllAs.ts @@ -0,0 +1,142 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import * as z from "zod"; + +/** + * Mark a subscriber messages as seen, read, unseen or unread + */ +export async function subscribersMessagesMarkAllAs( + client$: NovuCore, + subscriberId: string, + messageMarkAsRequestDto: components.MessageMarkAsRequestDto, + options?: RequestOptions +): Promise< + Result< + Array, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.SubscribersControllerMarkMessagesAsRequest = { + subscriberId: subscriberId, + messageMarkAsRequestDto: messageMarkAsRequestDto, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => + operations.SubscribersControllerMarkMessagesAsRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.MessageMarkAsRequestDto, { explode: true }); + + const pathParams$ = { + subscriberId: encodeSimple$("subscriberId", payload$.subscriberId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/subscribers/{subscriberId}/messages/mark-as")(pathParams$); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "SubscribersController_markMessagesAs", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "POST", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + Array, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(201, z.array(components.MessageEntity$inboundSchema)), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/subscribersMessagesUpdateAsSeen.ts b/src/funcs/subscribersMessagesUpdateAsSeen.ts new file mode 100644 index 00000000..78ad3ec8 --- /dev/null +++ b/src/funcs/subscribersMessagesUpdateAsSeen.ts @@ -0,0 +1,144 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Mark message action as seen + */ +export async function subscribersMessagesUpdateAsSeen( + client$: NovuCore, + request: operations.SubscribersControllerMarkActionAsSeenRequest, + options?: RequestOptions +): Promise< + Result< + components.MessageResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => + operations.SubscribersControllerMarkActionAsSeenRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.MarkMessageActionAsSeenDto, { explode: true }); + + const pathParams$ = { + messageId: encodeSimple$("messageId", payload$.messageId, { + explode: false, + charEncoding: "percent", + }), + subscriberId: encodeSimple$("subscriberId", payload$.subscriberId, { + explode: false, + charEncoding: "percent", + }), + type: encodeSimple$("type", payload$.type, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/v1/subscribers/{subscriberId}/messages/{messageId}/actions/{type}")( + pathParams$ + ); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "SubscribersController_markActionAsSeen", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "POST", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.MessageResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(201, components.MessageResponseDto$inboundSchema), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/subscribersNotificationsRetrieve.ts b/src/funcs/subscribersNotificationsRetrieve.ts new file mode 100644 index 00000000..4452db83 --- /dev/null +++ b/src/funcs/subscribersNotificationsRetrieve.ts @@ -0,0 +1,152 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { + encodeFormQuery as encodeFormQuery$, + encodeSimple as encodeSimple$, +} from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Get in-app notification feed for a particular subscriber + */ +export async function subscribersNotificationsRetrieve( + client$: NovuCore, + request: operations.SubscribersControllerGetNotificationsFeedRequest, + options?: RequestOptions +): Promise< + Result< + operations.SubscribersControllerGetNotificationsFeedResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => + operations.SubscribersControllerGetNotificationsFeedRequest$outboundSchema.parse( + value$ + ), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + subscriberId: encodeSimple$("subscriberId", payload$.subscriberId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/subscribers/{subscriberId}/notifications/feed")(pathParams$); + + const query$ = encodeFormQuery$({ + limit: payload$.limit, + page: payload$.page, + payload: payload$.payload, + read: payload$.read, + seen: payload$.seen, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "SubscribersController_getNotificationsFeed", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.SubscribersControllerGetNotificationsFeedResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json( + 200, + operations.SubscribersControllerGetNotificationsFeedResponseBody$inboundSchema + ), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/subscribersNotificationsUnseenCount.ts b/src/funcs/subscribersNotificationsUnseenCount.ts new file mode 100644 index 00000000..b099ff47 --- /dev/null +++ b/src/funcs/subscribersNotificationsUnseenCount.ts @@ -0,0 +1,145 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { + encodeFormQuery as encodeFormQuery$, + encodeSimple as encodeSimple$, +} from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Get the unseen in-app notifications count for subscribers feed + */ +export async function subscribersNotificationsUnseenCount( + client$: NovuCore, + request: operations.SubscribersControllerGetUnseenCountRequest, + options?: RequestOptions +): Promise< + Result< + components.UnseenCountResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => + operations.SubscribersControllerGetUnseenCountRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + subscriberId: encodeSimple$("subscriberId", payload$.subscriberId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/subscribers/{subscriberId}/notifications/unseen")(pathParams$); + + const query$ = encodeFormQuery$({ + limit: payload$.limit, + seen: payload$.seen, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "SubscribersController_getUnseenCount", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.UnseenCountResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.UnseenCountResponse$inboundSchema), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/subscribersPreferencesList.ts b/src/funcs/subscribersPreferencesList.ts new file mode 100644 index 00000000..99163209 --- /dev/null +++ b/src/funcs/subscribersPreferencesList.ts @@ -0,0 +1,141 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import * as z from "zod"; + +/** + * Get subscriber preferences + */ +export async function subscribersPreferencesList( + client$: NovuCore, + subscriberId: string, + options?: RequestOptions +): Promise< + Result< + Array, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.SubscribersControllerListSubscriberPreferencesRequest = { + subscriberId: subscriberId, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => + operations.SubscribersControllerListSubscriberPreferencesRequest$outboundSchema.parse( + value$ + ), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + subscriberId: encodeSimple$("subscriberId", payload$.subscriberId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/subscribers/{subscriberId}/preferences")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "SubscribersController_listSubscriberPreferences", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + Array, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, z.array(components.UpdateSubscriberPreferenceResponseDto$inboundSchema)), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/subscribersPreferencesRetrieveByLevel.ts b/src/funcs/subscribersPreferencesRetrieveByLevel.ts new file mode 100644 index 00000000..9ccfb051 --- /dev/null +++ b/src/funcs/subscribersPreferencesRetrieveByLevel.ts @@ -0,0 +1,147 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import * as z from "zod"; + +/** + * Get subscriber preferences by level + */ +export async function subscribersPreferencesRetrieveByLevel( + client$: NovuCore, + parameter: operations.Parameter, + subscriberId: string, + options?: RequestOptions +): Promise< + Result< + Array, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.SubscribersControllerGetSubscriberPreferenceByLevelRequest = { + parameter: parameter, + subscriberId: subscriberId, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => + operations.SubscribersControllerGetSubscriberPreferenceByLevelRequest$outboundSchema.parse( + value$ + ), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + parameter: encodeSimple$("parameter", payload$.parameter, { + explode: false, + charEncoding: "percent", + }), + subscriberId: encodeSimple$("subscriberId", payload$.subscriberId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/subscribers/{subscriberId}/preferences/{parameter}")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "SubscribersController_getSubscriberPreferenceByLevel", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + Array, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, z.array(components.GetSubscriberPreferencesResponseDto$inboundSchema)), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/subscribersPreferencesUpdate.ts b/src/funcs/subscribersPreferencesUpdate.ts new file mode 100644 index 00000000..4b9b1975 --- /dev/null +++ b/src/funcs/subscribersPreferencesUpdate.ts @@ -0,0 +1,145 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Update subscriber preference + */ +export async function subscribersPreferencesUpdate( + client$: NovuCore, + request: operations.SubscribersControllerUpdateSubscriberPreferenceRequest, + options?: RequestOptions +): Promise< + Result< + components.UpdateSubscriberPreferenceResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => + operations.SubscribersControllerUpdateSubscriberPreferenceRequest$outboundSchema.parse( + value$ + ), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.UpdateSubscriberPreferenceRequestDto, { + explode: true, + }); + + const pathParams$ = { + parameter: encodeSimple$("parameter", payload$.parameter, { + explode: false, + charEncoding: "percent", + }), + subscriberId: encodeSimple$("subscriberId", payload$.subscriberId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/subscribers/{subscriberId}/preferences/{parameter}")(pathParams$); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "SubscribersController_updateSubscriberPreference", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "PATCH", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.UpdateSubscriberPreferenceResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.UpdateSubscriberPreferenceResponseDto$inboundSchema), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/subscribersPreferencesUpdateGlobal.ts b/src/funcs/subscribersPreferencesUpdateGlobal.ts new file mode 100644 index 00000000..f4c7ae19 --- /dev/null +++ b/src/funcs/subscribersPreferencesUpdateGlobal.ts @@ -0,0 +1,145 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Update subscriber global preferences + */ +export async function subscribersPreferencesUpdateGlobal( + client$: NovuCore, + subscriberId: string, + updateSubscriberGlobalPreferencesRequestDto: components.UpdateSubscriberGlobalPreferencesRequestDto, + options?: RequestOptions +): Promise< + Result< + components.UpdateSubscriberPreferenceResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.SubscribersControllerUpdateSubscriberGlobalPreferencesRequest = { + subscriberId: subscriberId, + updateSubscriberGlobalPreferencesRequestDto: updateSubscriberGlobalPreferencesRequestDto, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => + operations.SubscribersControllerUpdateSubscriberGlobalPreferencesRequest$outboundSchema.parse( + value$ + ), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.UpdateSubscriberGlobalPreferencesRequestDto, { + explode: true, + }); + + const pathParams$ = { + subscriberId: encodeSimple$("subscriberId", payload$.subscriberId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/subscribers/{subscriberId}/preferences")(pathParams$); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "SubscribersController_updateSubscriberGlobalPreferences", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "PATCH", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.UpdateSubscriberPreferenceResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.UpdateSubscriberPreferenceResponseDto$inboundSchema), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/subscribersPropertiesUpdateOnlineFlag.ts b/src/funcs/subscribersPropertiesUpdateOnlineFlag.ts new file mode 100644 index 00000000..f337897d --- /dev/null +++ b/src/funcs/subscribersPropertiesUpdateOnlineFlag.ts @@ -0,0 +1,148 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Update subscriber online status + * + * @remarks + * Used to update the subscriber isOnline flag. + */ +export async function subscribersPropertiesUpdateOnlineFlag( + client$: NovuCore, + subscriberId: string, + updateSubscriberOnlineFlagRequestDto: components.UpdateSubscriberOnlineFlagRequestDto, + options?: RequestOptions +): Promise< + Result< + components.SubscriberResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.SubscribersControllerUpdateSubscriberOnlineFlagRequest = { + subscriberId: subscriberId, + updateSubscriberOnlineFlagRequestDto: updateSubscriberOnlineFlagRequestDto, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => + operations.SubscribersControllerUpdateSubscriberOnlineFlagRequest$outboundSchema.parse( + value$ + ), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.UpdateSubscriberOnlineFlagRequestDto, { + explode: true, + }); + + const pathParams$ = { + subscriberId: encodeSimple$("subscriberId", payload$.subscriberId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/subscribers/{subscriberId}/online-status")(pathParams$); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "SubscribersController_updateSubscriberOnlineFlag", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "PATCH", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.SubscriberResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.SubscriberResponseDto$inboundSchema), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/subscribersRetrieve.ts b/src/funcs/subscribersRetrieve.ts new file mode 100644 index 00000000..2114c00f --- /dev/null +++ b/src/funcs/subscribersRetrieve.ts @@ -0,0 +1,141 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Get subscriber + * + * @remarks + * Get subscriber by your internal id used to identify the subscriber + */ +export async function subscribersRetrieve( + client$: NovuCore, + subscriberId: string, + options?: RequestOptions +): Promise< + Result< + components.SubscriberResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.SubscribersControllerGetSubscriberRequest = { + subscriberId: subscriberId, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => + operations.SubscribersControllerGetSubscriberRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + subscriberId: encodeSimple$("subscriberId", payload$.subscriberId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/subscribers/{subscriberId}")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "SubscribersController_getSubscriber", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.SubscriberResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.SubscriberResponseDto$inboundSchema), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/subscribersUpdate.ts b/src/funcs/subscribersUpdate.ts new file mode 100644 index 00000000..157cb601 --- /dev/null +++ b/src/funcs/subscribersUpdate.ts @@ -0,0 +1,144 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Update subscriber + * + * @remarks + * Used to update the subscriber entity with new information + */ +export async function subscribersUpdate( + client$: NovuCore, + subscriberId: string, + updateSubscriberRequestDto: components.UpdateSubscriberRequestDto, + options?: RequestOptions +): Promise< + Result< + components.SubscriberResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.SubscribersControllerUpdateSubscriberRequest = { + subscriberId: subscriberId, + updateSubscriberRequestDto: updateSubscriberRequestDto, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => + operations.SubscribersControllerUpdateSubscriberRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.UpdateSubscriberRequestDto, { explode: true }); + + const pathParams$ = { + subscriberId: encodeSimple$("subscriberId", payload$.subscriberId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/subscribers/{subscriberId}")(pathParams$); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "SubscribersController_updateSubscriber", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "PUT", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.SubscriberResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.SubscriberResponseDto$inboundSchema), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/tenantsCreate.ts b/src/funcs/tenantsCreate.ts new file mode 100644 index 00000000..0dad2a98 --- /dev/null +++ b/src/funcs/tenantsCreate.ts @@ -0,0 +1,131 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeJSON as encodeJSON$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import { Result } from "../types/fp.js"; + +/** + * Create tenant + * + * @remarks + * Create tenant under the current environment Tenants is not supported in code first version of the API. + */ +export async function tenantsCreate( + client$: NovuCore, + request: components.CreateTenantRequestDto, + options?: RequestOptions +): Promise< + Result< + components.CreateTenantResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => components.CreateTenantRequestDto$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$, { explode: true }); + + const path$ = pathToFunc("/v1/tenants")(); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "TenantController_createTenant", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "POST", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.CreateTenantResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.CreateTenantResponseDto$inboundSchema), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/tenantsDelete.ts b/src/funcs/tenantsDelete.ts new file mode 100644 index 00000000..539ae767 --- /dev/null +++ b/src/funcs/tenantsDelete.ts @@ -0,0 +1,140 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import * as z from "zod"; + +/** + * Delete tenant + * + * @remarks + * Deletes a tenant entity from the Novu platform. Tenants is not supported in code first version of the API. + */ +export async function tenantsDelete( + client$: NovuCore, + identifier: string, + options?: RequestOptions +): Promise< + Result< + void, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.TenantControllerRemoveTenantRequest = { + identifier: identifier, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.TenantControllerRemoveTenantRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + identifier: encodeSimple$("identifier", payload$.identifier, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/tenants/{identifier}")(pathParams$); + + const headers$ = new Headers({ + Accept: "*/*", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "TenantController_removeTenant", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "DELETE", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["404", "409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + void, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.nil(204, z.void()), + m$.fail([404, 409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/tenantsList.ts b/src/funcs/tenantsList.ts new file mode 100644 index 00000000..342ee47d --- /dev/null +++ b/src/funcs/tenantsList.ts @@ -0,0 +1,183 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { dlv } from "../lib/dlv.js"; +import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import { createPageIterator, haltIterator, PageIterator, Paginator } from "../types/operations.js"; + +/** + * Get tenants + * + * @remarks + * Returns a list of tenants, could paginated using the `page` and `limit` query parameter. Tenants is not supported in code first version of the API. + */ +export async function tenantsList( + client$: NovuCore, + page?: number | undefined, + limit?: number | undefined, + options?: RequestOptions +): Promise< + PageIterator< + Result< + operations.TenantControllerListTenantsResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > +> { + const input$: operations.TenantControllerListTenantsRequest = { + page: page, + limit: limit, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.TenantControllerListTenantsRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return haltIterator(parsed$); + } + const payload$ = parsed$.value; + const body$ = null; + + const path$ = pathToFunc("/v1/tenants")(); + + const query$ = encodeFormQuery$({ + limit: payload$.limit, + page: payload$.page, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "TenantController_listTenants", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return haltIterator(requestRes); + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return haltIterator(doResult); + } + const response = doResult.value; + + const responseFields$ = { + HttpMeta: { Response: response, Request: request$ }, + }; + + const [result$, raw$] = await m$.match< + operations.TenantControllerListTenantsResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, operations.TenantControllerListTenantsResponse$inboundSchema, { + key: "Result", + }), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response, { extraFields: responseFields$ }); + if (!result$.ok) { + return haltIterator(result$); + } + + const nextFunc = ( + responseData: unknown + ): Paginator< + Result< + operations.TenantControllerListTenantsResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > + > => { + const page = input$.page || 0; + const nextPage = page + 1; + + if (!responseData) { + return () => null; + } + const results = dlv(responseData, "data.resultArray"); + if (!Array.isArray(results) || !results.length) { + return () => null; + } + const limit = input$.limit || 0; + if (results.length < limit) { + return () => null; + } + + return () => tenantsList(client$, nextPage, limit, options); + }; + + const page$ = { ...result$, next: nextFunc(raw$) }; + return { ...page$, ...createPageIterator(page$, (v) => !v.ok) }; +} diff --git a/src/funcs/tenantsRetrieve.ts b/src/funcs/tenantsRetrieve.ts new file mode 100644 index 00000000..fb28491b --- /dev/null +++ b/src/funcs/tenantsRetrieve.ts @@ -0,0 +1,140 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Get tenant + * + * @remarks + * Get tenant by your internal id used to identify the tenant Tenants is not supported in code first version of the API. + */ +export async function tenantsRetrieve( + client$: NovuCore, + identifier: string, + options?: RequestOptions +): Promise< + Result< + components.GetTenantResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.TenantControllerGetTenantByIdRequest = { + identifier: identifier, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.TenantControllerGetTenantByIdRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + identifier: encodeSimple$("identifier", payload$.identifier, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/tenants/{identifier}")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "TenantController_getTenantById", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["404", "409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.GetTenantResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.GetTenantResponseDto$inboundSchema), + m$.fail([404, 409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/tenantsUpdate.ts b/src/funcs/tenantsUpdate.ts new file mode 100644 index 00000000..8fb6da40 --- /dev/null +++ b/src/funcs/tenantsUpdate.ts @@ -0,0 +1,143 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Update tenant + * + * @remarks + * Update tenant by your internal id used to identify the tenant Tenants is not supported in code first version of the API. + */ +export async function tenantsUpdate( + client$: NovuCore, + identifier: string, + updateTenantRequestDto: components.UpdateTenantRequestDto, + options?: RequestOptions +): Promise< + Result< + components.UpdateTenantResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.TenantControllerUpdateTenantRequest = { + identifier: identifier, + updateTenantRequestDto: updateTenantRequestDto, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.TenantControllerUpdateTenantRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.UpdateTenantRequestDto, { explode: true }); + + const pathParams$ = { + identifier: encodeSimple$("identifier", payload$.identifier, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/tenants/{identifier}")(pathParams$); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "TenantController_updateTenant", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "PATCH", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["404", "409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.UpdateTenantResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.UpdateTenantResponseDto$inboundSchema), + m$.fail([404, 409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/topicsCreate.ts b/src/funcs/topicsCreate.ts new file mode 100644 index 00000000..e44b45a4 --- /dev/null +++ b/src/funcs/topicsCreate.ts @@ -0,0 +1,131 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeJSON as encodeJSON$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import { Result } from "../types/fp.js"; + +/** + * Topic creation + * + * @remarks + * Create a topic + */ +export async function topicsCreate( + client$: NovuCore, + request: components.CreateTopicRequestDto, + options?: RequestOptions +): Promise< + Result< + components.CreateTopicResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => components.CreateTopicRequestDto$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$, { explode: true }); + + const path$ = pathToFunc("/v1/topics")(); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "TopicsController_createTopic", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "POST", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.CreateTopicResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(201, components.CreateTopicResponseDto$inboundSchema), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/topicsDelete.ts b/src/funcs/topicsDelete.ts new file mode 100644 index 00000000..327a069c --- /dev/null +++ b/src/funcs/topicsDelete.ts @@ -0,0 +1,140 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import * as z from "zod"; + +/** + * Delete topic + * + * @remarks + * Delete a topic by its topic key if it has no subscribers + */ +export async function topicsDelete( + client$: NovuCore, + topicKey: string, + options?: RequestOptions +): Promise< + Result< + void, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.TopicsControllerDeleteTopicRequest = { + topicKey: topicKey, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.TopicsControllerDeleteTopicRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + topicKey: encodeSimple$("topicKey", payload$.topicKey, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/topics/{topicKey}")(pathParams$); + + const headers$ = new Headers({ + Accept: "*/*", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "TopicsController_deleteTopic", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "DELETE", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["404", "409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + void, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.nil(204, z.void()), + m$.fail([404, 409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/topicsList.ts b/src/funcs/topicsList.ts new file mode 100644 index 00000000..45e0f734 --- /dev/null +++ b/src/funcs/topicsList.ts @@ -0,0 +1,138 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Filter topics + * + * @remarks + * Returns a list of topics that can be paginated using the `page` query parameter and filtered by the topic key with the `key` query parameter + */ +export async function topicsList( + client$: NovuCore, + request: operations.TopicsControllerListTopicsRequest, + options?: RequestOptions +): Promise< + Result< + components.FilterTopicsResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = typeof request === "undefined" ? {} : request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.TopicsControllerListTopicsRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const path$ = pathToFunc("/v1/topics")(); + + const query$ = encodeFormQuery$({ + key: payload$.key, + page: payload$.page, + pageSize: payload$.pageSize, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "TopicsController_listTopics", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.FilterTopicsResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.FilterTopicsResponseDto$inboundSchema), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/topicsRename.ts b/src/funcs/topicsRename.ts new file mode 100644 index 00000000..f6c24b0c --- /dev/null +++ b/src/funcs/topicsRename.ts @@ -0,0 +1,143 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Rename a topic + * + * @remarks + * Rename a topic by providing a new name + */ +export async function topicsRename( + client$: NovuCore, + topicKey: string, + renameTopicRequestDto: components.RenameTopicRequestDto, + options?: RequestOptions +): Promise< + Result< + components.RenameTopicResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.TopicsControllerRenameTopicRequest = { + topicKey: topicKey, + renameTopicRequestDto: renameTopicRequestDto, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.TopicsControllerRenameTopicRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.RenameTopicRequestDto, { explode: true }); + + const pathParams$ = { + topicKey: encodeSimple$("topicKey", payload$.topicKey, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/topics/{topicKey}")(pathParams$); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "TopicsController_renameTopic", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "PATCH", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.RenameTopicResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.RenameTopicResponseDto$inboundSchema), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/topicsRetrieve.ts b/src/funcs/topicsRetrieve.ts new file mode 100644 index 00000000..61310bad --- /dev/null +++ b/src/funcs/topicsRetrieve.ts @@ -0,0 +1,140 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Get topic + * + * @remarks + * Get a topic by its topic key + */ +export async function topicsRetrieve( + client$: NovuCore, + topicKey: string, + options?: RequestOptions +): Promise< + Result< + components.GetTopicResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.TopicsControllerGetTopicRequest = { + topicKey: topicKey, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.TopicsControllerGetTopicRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + topicKey: encodeSimple$("topicKey", payload$.topicKey, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/topics/{topicKey}")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "TopicsController_getTopic", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.GetTopicResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.GetTopicResponseDto$inboundSchema), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/topicsSubscribersAssign.ts b/src/funcs/topicsSubscribersAssign.ts new file mode 100644 index 00000000..3f438bf5 --- /dev/null +++ b/src/funcs/topicsSubscribersAssign.ts @@ -0,0 +1,144 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import * as z from "zod"; + +/** + * Subscribers addition + * + * @remarks + * Add subscribers to a topic by key + */ +export async function topicsSubscribersAssign( + client$: NovuCore, + topicKey: string, + addSubscribersRequestDto: components.AddSubscribersRequestDto, + options?: RequestOptions +): Promise< + Result< + void, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.TopicsControllerAddSubscribersRequest = { + topicKey: topicKey, + addSubscribersRequestDto: addSubscribersRequestDto, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.TopicsControllerAddSubscribersRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.AddSubscribersRequestDto, { explode: true }); + + const pathParams$ = { + topicKey: encodeSimple$("topicKey", payload$.topicKey, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/topics/{topicKey}/subscribers")(pathParams$); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "*/*", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "TopicsController_addSubscribers", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "POST", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + void, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.nil(204, z.void()), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/topicsSubscribersDelete.ts b/src/funcs/topicsSubscribersDelete.ts new file mode 100644 index 00000000..fc530bee --- /dev/null +++ b/src/funcs/topicsSubscribersDelete.ts @@ -0,0 +1,145 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; +import * as z from "zod"; + +/** + * Subscribers removal + * + * @remarks + * Remove subscribers from a topic + */ +export async function topicsSubscribersDelete( + client$: NovuCore, + topicKey: string, + removeSubscribersRequestDto: components.RemoveSubscribersRequestDto, + options?: RequestOptions +): Promise< + Result< + void, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.TopicsControllerRemoveSubscribersRequest = { + topicKey: topicKey, + removeSubscribersRequestDto: removeSubscribersRequestDto, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => + operations.TopicsControllerRemoveSubscribersRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.RemoveSubscribersRequestDto, { explode: true }); + + const pathParams$ = { + topicKey: encodeSimple$("topicKey", payload$.topicKey, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/topics/{topicKey}/subscribers/removal")(pathParams$); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "*/*", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "TopicsController_removeSubscribers", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "POST", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + void, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.nil(204, z.void()), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/topicsSubscribersRetrieve.ts b/src/funcs/topicsSubscribersRetrieve.ts new file mode 100644 index 00000000..a0e0f47e --- /dev/null +++ b/src/funcs/topicsSubscribersRetrieve.ts @@ -0,0 +1,149 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Check topic subscriber + * + * @remarks + * Check if a subscriber belongs to a certain topic + */ +export async function topicsSubscribersRetrieve( + client$: NovuCore, + externalSubscriberId: string, + topicKey: string, + options?: RequestOptions +): Promise< + Result< + components.TopicSubscriberDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.TopicsControllerGetTopicSubscriberRequest = { + externalSubscriberId: externalSubscriberId, + topicKey: topicKey, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => + operations.TopicsControllerGetTopicSubscriberRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + externalSubscriberId: encodeSimple$("externalSubscriberId", payload$.externalSubscriberId, { + explode: false, + charEncoding: "percent", + }), + topicKey: encodeSimple$("topicKey", payload$.topicKey, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/topics/{topicKey}/subscribers/{externalSubscriberId}")( + pathParams$ + ); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "TopicsController_getTopicSubscriber", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.TopicSubscriberDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.TopicSubscriberDto$inboundSchema), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/trigger.ts b/src/funcs/trigger.ts new file mode 100644 index 00000000..ab072ff1 --- /dev/null +++ b/src/funcs/trigger.ts @@ -0,0 +1,135 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeJSON as encodeJSON$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import { Result } from "../types/fp.js"; + +/** + * Trigger event + * + * @remarks + * + * Trigger event is the main (and only) way to send notifications to subscribers. + * The trigger identifier is used to match the particular workflow associated with it. + * Additional information can be passed according the body interface below. + * + */ +export async function trigger( + client$: NovuCore, + request: components.TriggerEventRequestDto, + options?: RequestOptions +): Promise< + Result< + components.TriggerEventResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => components.TriggerEventRequestDto$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$, { explode: true }); + + const path$ = pathToFunc("/v1/events/trigger")(); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "EventsController_trigger", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "POST", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.TriggerEventResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(201, components.TriggerEventResponseDto$inboundSchema), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/triggerBroadcast.ts b/src/funcs/triggerBroadcast.ts new file mode 100644 index 00000000..971d0da6 --- /dev/null +++ b/src/funcs/triggerBroadcast.ts @@ -0,0 +1,132 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeJSON as encodeJSON$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import { Result } from "../types/fp.js"; + +/** + * Broadcast event to all + * + * @remarks + * Trigger a broadcast event to all existing subscribers, could be used to send announcements, etc. + * In the future could be used to trigger events to a subset of subscribers based on defined filters. + */ +export async function triggerBroadcast( + client$: NovuCore, + request: components.TriggerEventToAllRequestDto, + options?: RequestOptions +): Promise< + Result< + components.TriggerEventResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => components.TriggerEventToAllRequestDto$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$, { explode: true }); + + const path$ = pathToFunc("/v1/events/trigger/broadcast")(); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "EventsController_broadcastEventToAll", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "POST", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.TriggerEventResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.TriggerEventResponseDto$inboundSchema), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/triggerBulk.ts b/src/funcs/triggerBulk.ts new file mode 100644 index 00000000..16163aea --- /dev/null +++ b/src/funcs/triggerBulk.ts @@ -0,0 +1,135 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeJSON as encodeJSON$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import { Result } from "../types/fp.js"; +import * as z from "zod"; + +/** + * Bulk trigger event + * + * @remarks + * + * Using this endpoint you can trigger multiple events at once, to avoid multiple calls to the API. + * The bulk API is limited to 100 events per request. + * + */ +export async function triggerBulk( + client$: NovuCore, + request: components.BulkTriggerEventDto, + options?: RequestOptions +): Promise< + Result< + Array, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => components.BulkTriggerEventDto$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$, { explode: true }); + + const path$ = pathToFunc("/v1/events/trigger/bulk")(); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "EventsController_triggerBulk", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "POST", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + Array, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(201, z.array(components.TriggerEventResponseDto$inboundSchema)), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/workflowGroupsCreate.ts b/src/funcs/workflowGroupsCreate.ts new file mode 100644 index 00000000..5d8f4c05 --- /dev/null +++ b/src/funcs/workflowGroupsCreate.ts @@ -0,0 +1,131 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeJSON as encodeJSON$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import { Result } from "../types/fp.js"; + +/** + * Create workflow group + * + * @remarks + * workflow group was previously named notification group + */ +export async function workflowGroupsCreate( + client$: NovuCore, + request: components.CreateNotificationGroupRequestDto, + options?: RequestOptions +): Promise< + Result< + components.NotificationGroupResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => components.CreateNotificationGroupRequestDto$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$, { explode: true }); + + const path$ = pathToFunc("/v1/notification-groups")(); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "NotificationGroupsController_createNotificationGroup", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "POST", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.NotificationGroupResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(201, components.NotificationGroupResponseDto$inboundSchema), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/workflowGroupsDelete.ts b/src/funcs/workflowGroupsDelete.ts new file mode 100644 index 00000000..b1492cf8 --- /dev/null +++ b/src/funcs/workflowGroupsDelete.ts @@ -0,0 +1,140 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Delete workflow group + * + * @remarks + * workflow group was previously named notification group + */ +export async function workflowGroupsDelete( + client$: NovuCore, + id: string, + options?: RequestOptions +): Promise< + Result< + components.DeleteNotificationGroupResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.NotificationGroupsControllerDeleteNotificationGroupRequest = { + id: id, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => + operations.NotificationGroupsControllerDeleteNotificationGroupRequest$outboundSchema.parse( + value$ + ), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/v1/notification-groups/{id}")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "NotificationGroupsController_deleteNotificationGroup", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "DELETE", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.DeleteNotificationGroupResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.DeleteNotificationGroupResponseDto$inboundSchema), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/workflowGroupsList.ts b/src/funcs/workflowGroupsList.ts new file mode 100644 index 00000000..2eaee4e0 --- /dev/null +++ b/src/funcs/workflowGroupsList.ts @@ -0,0 +1,114 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import * as m$ from "../lib/matchers.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import { Result } from "../types/fp.js"; +import * as z from "zod"; + +/** + * Get workflow groups + * + * @remarks + * workflow group was previously named notification group + */ +export async function workflowGroupsList( + client$: NovuCore, + options?: RequestOptions +): Promise< + Result< + Array, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const path$ = pathToFunc("/v1/notification-groups")(); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "NotificationGroupsController_listNotificationGroups", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + Array, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, z.array(components.NotificationGroupResponseDto$inboundSchema)), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/workflowGroupsRetrieve.ts b/src/funcs/workflowGroupsRetrieve.ts new file mode 100644 index 00000000..6ff662d9 --- /dev/null +++ b/src/funcs/workflowGroupsRetrieve.ts @@ -0,0 +1,140 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Get workflow group + * + * @remarks + * workflow group was previously named notification group + */ +export async function workflowGroupsRetrieve( + client$: NovuCore, + id: string, + options?: RequestOptions +): Promise< + Result< + components.NotificationGroupResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.NotificationGroupsControllerGetNotificationGroupRequest = { + id: id, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => + operations.NotificationGroupsControllerGetNotificationGroupRequest$outboundSchema.parse( + value$ + ), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/v1/notification-groups/{id}")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "NotificationGroupsController_getNotificationGroup", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.NotificationGroupResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.NotificationGroupResponseDto$inboundSchema), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/workflowGroupsUpdate.ts b/src/funcs/workflowGroupsUpdate.ts new file mode 100644 index 00000000..8b833c6d --- /dev/null +++ b/src/funcs/workflowGroupsUpdate.ts @@ -0,0 +1,145 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Update workflow group + * + * @remarks + * workflow group was previously named notification group + */ +export async function workflowGroupsUpdate( + client$: NovuCore, + id: string, + createNotificationGroupRequestDto: components.CreateNotificationGroupRequestDto, + options?: RequestOptions +): Promise< + Result< + components.NotificationGroupResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.NotificationGroupsControllerUpdateNotificationGroupRequest = { + id: id, + createNotificationGroupRequestDto: createNotificationGroupRequestDto, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => + operations.NotificationGroupsControllerUpdateNotificationGroupRequest$outboundSchema.parse( + value$ + ), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.CreateNotificationGroupRequestDto, { + explode: true, + }); + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/v1/notification-groups/{id}")(pathParams$); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "NotificationGroupsController_updateNotificationGroup", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "PATCH", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.NotificationGroupResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.NotificationGroupResponseDto$inboundSchema), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/workflowsCreate.ts b/src/funcs/workflowsCreate.ts new file mode 100644 index 00000000..7dd3d4f0 --- /dev/null +++ b/src/funcs/workflowsCreate.ts @@ -0,0 +1,131 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeJSON as encodeJSON$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import { Result } from "../types/fp.js"; + +/** + * Create workflow + * + * @remarks + * Workflow was previously named notification template + */ +export async function workflowsCreate( + client$: NovuCore, + request: components.CreateWorkflowRequestDto, + options?: RequestOptions +): Promise< + Result< + components.WorkflowResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => components.CreateWorkflowRequestDto$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$, { explode: true }); + + const path$ = pathToFunc("/v1/workflows")(); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "WorkflowController_create", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "POST", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.WorkflowResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(201, components.WorkflowResponse$inboundSchema), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/workflowsDelete.ts b/src/funcs/workflowsDelete.ts new file mode 100644 index 00000000..93f29d7a --- /dev/null +++ b/src/funcs/workflowsDelete.ts @@ -0,0 +1,141 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Delete workflow + * + * @remarks + * Workflow was previously named notification template + */ +export async function workflowsDelete( + client$: NovuCore, + workflowId: string, + options?: RequestOptions +): Promise< + Result< + components.DataBooleanDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.WorkflowControllerDeleteWorkflowByIdRequest = { + workflowId: workflowId, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => + operations.WorkflowControllerDeleteWorkflowByIdRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + workflowId: encodeSimple$("workflowId", payload$.workflowId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/workflows/{workflowId}")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "WorkflowController_deleteWorkflowById", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "DELETE", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.DataBooleanDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.DataBooleanDto$inboundSchema), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/workflowsList.ts b/src/funcs/workflowsList.ts new file mode 100644 index 00000000..23037ac8 --- /dev/null +++ b/src/funcs/workflowsList.ts @@ -0,0 +1,138 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Get workflows + * + * @remarks + * Workflows were previously named notification templates + */ +export async function workflowsList( + client$: NovuCore, + request: operations.WorkflowControllerListWorkflowsRequest, + options?: RequestOptions +): Promise< + Result< + components.WorkflowsResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = typeof request === "undefined" ? {} : request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.WorkflowControllerListWorkflowsRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const path$ = pathToFunc("/v1/workflows")(); + + const query$ = encodeFormQuery$({ + limit: payload$.limit, + page: payload$.page, + query: payload$.query, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "WorkflowController_listWorkflows", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.WorkflowsResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.WorkflowsResponseDto$inboundSchema), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/workflowsRetrieve.ts b/src/funcs/workflowsRetrieve.ts new file mode 100644 index 00000000..f792e60e --- /dev/null +++ b/src/funcs/workflowsRetrieve.ts @@ -0,0 +1,141 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Get workflow + * + * @remarks + * Workflow was previously named notification template + */ +export async function workflowsRetrieve( + client$: NovuCore, + workflowId: string, + options?: RequestOptions +): Promise< + Result< + components.WorkflowResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.WorkflowControllerGetWorkflowByIdRequest = { + workflowId: workflowId, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => + operations.WorkflowControllerGetWorkflowByIdRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + workflowId: encodeSimple$("workflowId", payload$.workflowId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/workflows/{workflowId}")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "WorkflowController_getWorkflowById", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.WorkflowResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.WorkflowResponse$inboundSchema), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/workflowsStatusUpdate.ts b/src/funcs/workflowsStatusUpdate.ts new file mode 100644 index 00000000..518e60f9 --- /dev/null +++ b/src/funcs/workflowsStatusUpdate.ts @@ -0,0 +1,144 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Update workflow status + * + * @remarks + * Workflow was previously named notification template + */ +export async function workflowsStatusUpdate( + client$: NovuCore, + workflowId: string, + changeWorkflowStatusRequestDto: components.ChangeWorkflowStatusRequestDto, + options?: RequestOptions +): Promise< + Result< + components.WorkflowResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.WorkflowControllerUpdateActiveStatusRequest = { + workflowId: workflowId, + changeWorkflowStatusRequestDto: changeWorkflowStatusRequestDto, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => + operations.WorkflowControllerUpdateActiveStatusRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.ChangeWorkflowStatusRequestDto, { explode: true }); + + const pathParams$ = { + workflowId: encodeSimple$("workflowId", payload$.workflowId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/workflows/{workflowId}/status")(pathParams$); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "WorkflowController_updateActiveStatus", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "PUT", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.WorkflowResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.WorkflowResponse$inboundSchema), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/workflowsUpdate.ts b/src/funcs/workflowsUpdate.ts new file mode 100644 index 00000000..0c200e85 --- /dev/null +++ b/src/funcs/workflowsUpdate.ts @@ -0,0 +1,144 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Update workflow + * + * @remarks + * Workflow was previously named notification template + */ +export async function workflowsUpdate( + client$: NovuCore, + workflowId: string, + updateWorkflowRequestDto: components.UpdateWorkflowRequestDto, + options?: RequestOptions +): Promise< + Result< + components.WorkflowResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.WorkflowControllerUpdateWorkflowByIdRequest = { + workflowId: workflowId, + updateWorkflowRequestDto: updateWorkflowRequestDto, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => + operations.WorkflowControllerUpdateWorkflowByIdRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.UpdateWorkflowRequestDto, { explode: true }); + + const pathParams$ = { + workflowId: encodeSimple$("workflowId", payload$.workflowId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/v1/workflows/{workflowId}")(pathParams$); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "WorkflowController_updateWorkflowById", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "PUT", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.WorkflowResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.WorkflowResponse$inboundSchema), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/workflowsVariablesRetrieve.ts b/src/funcs/workflowsVariablesRetrieve.ts new file mode 100644 index 00000000..b0e39a01 --- /dev/null +++ b/src/funcs/workflowsVariablesRetrieve.ts @@ -0,0 +1,113 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { NovuCore } from "../core.js"; +import * as m$ from "../lib/matchers.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import { Result } from "../types/fp.js"; + +/** + * Get available variables + * + * @remarks + * Get the variables that can be used in the workflow + */ +export async function workflowsVariablesRetrieve( + client$: NovuCore, + options?: RequestOptions +): Promise< + Result< + components.VariablesResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const path$ = pathToFunc("/v1/workflows/variables")(); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const apiKey$ = await extractSecurity(client$.options$.apiKey); + const security$ = apiKey$ == null ? {} : { apiKey: apiKey$ }; + const context = { + operationID: "WorkflowController_getWorkflowVariables", + oAuth2Scopes: [], + securitySource: client$.options$.apiKey, + }; + const securitySettings$ = resolveGlobalSecurity(security$); + + const requestRes = client$.createRequest$( + context, + { + security: securitySettings$, + method: "GET", + path: path$, + headers: headers$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: ["409", "429", "4XX", "503", "5XX"], + retryConfig: options?.retries || + client$.options$.retryConfig || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 30000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + }, + retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + components.VariablesResponseDto, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + m$.json(200, components.VariablesResponseDto$inboundSchema), + m$.fail([409, 429, "4XX", 503, "5XX"]) + )(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/hooks/hooks.ts b/src/hooks/hooks.ts index 6a1e31e0..a6b6e17a 100644 --- a/src/hooks/hooks.ts +++ b/src/hooks/hooks.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { RequestInput } from "../lib/http.js"; diff --git a/src/hooks/index.ts b/src/hooks/index.ts index d5fdd742..8f0e4dbf 100644 --- a/src/hooks/index.ts +++ b/src/hooks/index.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ export * from "./types.js"; diff --git a/src/hooks/types.ts b/src/hooks/types.ts index dd23b024..3a31914a 100644 --- a/src/hooks/types.ts +++ b/src/hooks/types.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { HTTPClient, RequestInput } from "../lib/http.js"; diff --git a/src/index.ts b/src/index.ts index 8bc6ae3e..ceb63804 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ export * from "./sdk/sdk.js"; diff --git a/src/lib/base64.ts b/src/lib/base64.ts index cda07641..c2d5b389 100644 --- a/src/lib/base64.ts +++ b/src/lib/base64.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; diff --git a/src/lib/config.ts b/src/lib/config.ts index 7988d12c..85abaeab 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -1,8 +1,9 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { HTTPClient } from "./http.js"; +import { Logger } from "./logger.js"; import { RetryConfig } from "./retries.js"; import { Params, pathToFunc } from "./url.js"; @@ -27,6 +28,8 @@ export type SDKOptions = { * Allows overriding the default retry config used by the SDK */ retryConfig?: RetryConfig; + timeoutMs?: number; + debugLogger?: Logger; }; export function serverURLFromOptions(options: SDKOptions): URL | null { @@ -49,7 +52,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "1.0", - sdkVersion: "0.0.1-alpha.9", - genVersion: "2.354.2", - userAgent: "speakeasy-sdk/typescript 0.0.1-alpha.9 2.354.2 1.0 @novu/api", + sdkVersion: "0.0.1-alpha.10", + genVersion: "2.407.2", + userAgent: "speakeasy-sdk/typescript 0.0.1-alpha.10 2.407.2 1.0 @novu/api", } as const; diff --git a/src/lib/dlv.ts b/src/lib/dlv.ts new file mode 100644 index 00000000..e81091f5 --- /dev/null +++ b/src/lib/dlv.ts @@ -0,0 +1,53 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +/* +MIT License + +Copyright (c) 2024 Jason Miller (http://jasonformat.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +/** + * @param obj The object to walk + * @param key The key path to walk the object with + * @param def A default value to return if the result is undefined + * + * @example + * dlv(obj, "a.b.c.d") + * @example + * dlv(object, ["a", "b", "c", "d"]) + * @example + * dlv(object, "foo.bar.baz", "Hello, default value!") + */ +export function dlv( + obj: any, + key: string | string[], + def?: T, + p?: number, + undef?: never, +): T | undefined { + key = Array.isArray(key) ? key : key.split("."); + for (p = 0; p < key.length; p++) { + const k = key[p]; + obj = k != null && obj ? obj[k] : undef; + } + return obj === undef ? def : obj; +} diff --git a/src/lib/encodings.ts b/src/lib/encodings.ts index 49f536b6..44fa7284 100644 --- a/src/lib/encodings.ts +++ b/src/lib/encodings.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { bytesToBase64 } from "./base64.js"; @@ -212,6 +212,24 @@ export function encodeDeepObject( return ""; } + if (!isPlainObject(value)) { + throw new EncodingError( + `Value of parameter '${key}' which uses deepObject encoding must be an object`, + ); + } + + return encodeDeepObjectObject(key, value, options); +} + +export function encodeDeepObjectObject( + key: string, + value: unknown, + options?: { charEncoding?: "percent" | "none" }, +): string { + if (value == null) { + return ""; + } + let out = ""; const encodeString = (v: string) => { @@ -219,9 +237,7 @@ export function encodeDeepObject( }; if (!isPlainObject(value)) { - throw new EncodingError( - `Value of parameter '${key}' which uses deepObject encoding must be an object`, - ); + throw new EncodingError(`Expected parameter '${key}' to be an object.`); } Object.entries(value).forEach(([ck, cv]) => { @@ -232,9 +248,11 @@ export function encodeDeepObject( const pk = `${key}[${ck}]`; if (isPlainObject(cv)) { - throw new EncodingError( - `Value of parameter field '${pk}' cannot be an array or object.`, - ); + const objOut = encodeDeepObjectObject(pk, cv, options); + + out += `&${objOut}`; + + return; } const pairs: unknown[] = Array.isArray(cv) ? cv : [cv]; diff --git a/src/lib/http.ts b/src/lib/http.ts index 7c5107ad..13cf1fd7 100644 --- a/src/lib/http.ts +++ b/src/lib/http.ts @@ -1,41 +1,39 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { never as znever } from "zod"; -import { parse } from "./schemas.js"; -import { isPlainObject } from "./is-plain-object.js"; -import { SDKError } from "../models/errors/sdkerror.js"; - -export type Fetcher = (input: RequestInfo | URL, init?: RequestInit) => Promise; +export type Fetcher = ( + input: RequestInfo | URL, + init?: RequestInit, +) => Promise; export type Awaitable = T | Promise; const DEFAULT_FETCHER: Fetcher = (input, init) => { - // If input is a Request and init is undefined, Bun will discard the method, - // headers, body and other options that were set on the request object. - // Node.js and browers would ignore an undefined init value. This check is - // therefore needed for interop with Bun. - if (init == null) { - return fetch(input); - } else { - return fetch(input, init); - } + // If input is a Request and init is undefined, Bun will discard the method, + // headers, body and other options that were set on the request object. + // Node.js and browers would ignore an undefined init value. This check is + // therefore needed for interop with Bun. + if (init == null) { + return fetch(input); + } else { + return fetch(input, init); + } }; export type RequestInput = { - /** - * The URL the request will use. - */ - url: URL; - /** - * Options used to create a [`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request). - */ - options?: RequestInit | undefined; + /** + * The URL the request will use. + */ + url: URL; + /** + * Options used to create a [`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request). + */ + options?: RequestInit | undefined; }; export interface HTTPClientOptions { - fetcher?: Fetcher; + fetcher?: Fetcher; } export type BeforeRequestHook = (req: Request) => Awaitable; @@ -43,114 +41,114 @@ export type RequestErrorHook = (err: unknown, req: Request) => Awaitable; export type ResponseHook = (res: Response, req: Request) => Awaitable; export class HTTPClient { - private fetcher: Fetcher; - private requestHooks: BeforeRequestHook[] = []; - private requestErrorHooks: RequestErrorHook[] = []; - private responseHooks: ResponseHook[] = []; - - constructor(private options: HTTPClientOptions = {}) { - this.fetcher = options.fetcher || DEFAULT_FETCHER; + private fetcher: Fetcher; + private requestHooks: BeforeRequestHook[] = []; + private requestErrorHooks: RequestErrorHook[] = []; + private responseHooks: ResponseHook[] = []; + + constructor(private options: HTTPClientOptions = {}) { + this.fetcher = options.fetcher || DEFAULT_FETCHER; + } + + async request(request: Request): Promise { + let req = request; + for (const hook of this.requestHooks) { + const nextRequest = await hook(req); + if (nextRequest) { + req = nextRequest; + } } - async request(request: Request): Promise { - let req = request; - for (const hook of this.requestHooks) { - const nextRequest = await hook(req); - if (nextRequest) { - req = nextRequest; - } - } - - try { - const res = await this.fetcher(req); - - for (const hook of this.responseHooks) { - await hook(res, req); - } - - return res; - } catch (err) { - for (const hook of this.requestErrorHooks) { - await hook(err, req); - } - - throw err; - } - } + try { + const res = await this.fetcher(req); + + for (const hook of this.responseHooks) { + await hook(res, req); + } + + return res; + } catch (err) { + for (const hook of this.requestErrorHooks) { + await hook(err, req); + } - /** - * Registers a hook that is called before a request is made. The hook function - * can mutate the request or return a new request. This may be useful to add - * additional information to request such as request IDs and tracing headers. - */ - addHook(hook: "beforeRequest", fn: BeforeRequestHook): this; - /** - * Registers a hook that is called when a request cannot be made due to a - * network error. - */ - addHook(hook: "requestError", fn: RequestErrorHook): this; - /** - * Registers a hook that is called when a response has been received from the - * server. - */ - addHook(hook: "response", fn: ResponseHook): this; - addHook( - ...args: - | [hook: "beforeRequest", fn: BeforeRequestHook] - | [hook: "requestError", fn: RequestErrorHook] - | [hook: "response", fn: ResponseHook] - ) { - if (args[0] === "beforeRequest") { - this.requestHooks.push(args[1]); - } else if (args[0] === "requestError") { - this.requestErrorHooks.push(args[1]); - } else if (args[0] === "response") { - this.responseHooks.push(args[1]); - } else { - throw new Error(`Invalid hook type: ${args[0]}`); - } - return this; + throw err; + } + } + + /** + * Registers a hook that is called before a request is made. The hook function + * can mutate the request or return a new request. This may be useful to add + * additional information to request such as request IDs and tracing headers. + */ + addHook(hook: "beforeRequest", fn: BeforeRequestHook): this; + /** + * Registers a hook that is called when a request cannot be made due to a + * network error. + */ + addHook(hook: "requestError", fn: RequestErrorHook): this; + /** + * Registers a hook that is called when a response has been received from the + * server. + */ + addHook(hook: "response", fn: ResponseHook): this; + addHook( + ...args: + | [hook: "beforeRequest", fn: BeforeRequestHook] + | [hook: "requestError", fn: RequestErrorHook] + | [hook: "response", fn: ResponseHook] + ) { + if (args[0] === "beforeRequest") { + this.requestHooks.push(args[1]); + } else if (args[0] === "requestError") { + this.requestErrorHooks.push(args[1]); + } else if (args[0] === "response") { + this.responseHooks.push(args[1]); + } else { + throw new Error(`Invalid hook type: ${args[0]}`); + } + return this; + } + + /** Removes a hook that was previously registered with `addHook`. */ + removeHook(hook: "beforeRequest", fn: BeforeRequestHook): this; + /** Removes a hook that was previously registered with `addHook`. */ + removeHook(hook: "requestError", fn: RequestErrorHook): this; + /** Removes a hook that was previously registered with `addHook`. */ + removeHook(hook: "response", fn: ResponseHook): this; + removeHook( + ...args: + | [hook: "beforeRequest", fn: BeforeRequestHook] + | [hook: "requestError", fn: RequestErrorHook] + | [hook: "response", fn: ResponseHook] + ): this { + let target: unknown[]; + if (args[0] === "beforeRequest") { + target = this.requestHooks; + } else if (args[0] === "requestError") { + target = this.requestErrorHooks; + } else if (args[0] === "response") { + target = this.responseHooks; + } else { + throw new Error(`Invalid hook type: ${args[0]}`); } - /** Removes a hook that was previously registered with `addHook`. */ - removeHook(hook: "beforeRequest", fn: BeforeRequestHook): this; - /** Removes a hook that was previously registered with `addHook`. */ - removeHook(hook: "requestError", fn: RequestErrorHook): this; - /** Removes a hook that was previously registered with `addHook`. */ - removeHook(hook: "response", fn: ResponseHook): this; - removeHook( - ...args: - | [hook: "beforeRequest", fn: BeforeRequestHook] - | [hook: "requestError", fn: RequestErrorHook] - | [hook: "response", fn: ResponseHook] - ): this { - let target: unknown[]; - if (args[0] === "beforeRequest") { - target = this.requestHooks; - } else if (args[0] === "requestError") { - target = this.requestErrorHooks; - } else if (args[0] === "response") { - target = this.responseHooks; - } else { - throw new Error(`Invalid hook type: ${args[0]}`); - } - - const index = target.findIndex((v) => v === args[1]); - if (index >= 0) { - target.splice(index, 1); - } - - return this; + const index = target.findIndex((v) => v === args[1]); + if (index >= 0) { + target.splice(index, 1); } - clone(): HTTPClient { - const child = new HTTPClient(this.options); - child.requestHooks = this.requestHooks.slice(); - child.requestErrorHooks = this.requestErrorHooks.slice(); - child.responseHooks = this.responseHooks.slice(); + return this; + } - return child; - } + clone(): HTTPClient { + const child = new HTTPClient(this.options); + child.requestHooks = this.requestHooks.slice(); + child.requestErrorHooks = this.requestErrorHooks.slice(); + child.responseHooks = this.responseHooks.slice(); + + return child; + } } export type StatusCodePredicate = number | string | (number | string)[]; @@ -159,346 +157,167 @@ export type StatusCodePredicate = number | string | (number | string)[]; // segments in a media type string. const mediaParamSeparator = /\s*;\s*/g; -function matchContentType(response: Response, pattern: string): boolean { - // `*` is a special case which means anything is acceptable. - if (pattern === "*") { - return true; +export function matchContentType(response: Response, pattern: string): boolean { + // `*` is a special case which means anything is acceptable. + if (pattern === "*") { + return true; + } + + let contentType = + response.headers.get("content-type")?.trim() || "application/octet-stream"; + contentType = contentType.toLowerCase(); + + const wantParts = pattern.toLowerCase().trim().split(mediaParamSeparator); + const [wantType = "", ...wantParams] = wantParts; + + if (wantType.split("/").length !== 2) { + return false; + } + + const gotParts = contentType.split(mediaParamSeparator); + const [gotType = "", ...gotParams] = gotParts; + + const [type = "", subtype = ""] = gotType.split("/"); + if (!type || !subtype) { + return false; + } + + if ( + wantType !== "*/*" && + gotType !== wantType && + `${type}/*` !== wantType && + `*/${subtype}` !== wantType + ) { + return false; + } + + if (gotParams.length < wantParams.length) { + return false; + } + + const params = new Set(gotParams); + for (const wantParam of wantParams) { + if (!params.has(wantParam)) { + return false; } + } - let contentType = response.headers.get("content-type")?.trim() || "application/octet-stream"; - contentType = contentType.toLowerCase(); + return true; +} - const wantParts = pattern.toLowerCase().trim().split(mediaParamSeparator); - const [wantType = "", ...wantParams] = wantParts; +const codeRangeRE = new RegExp("^[0-9]xx$", "i"); - if (wantType.split("/").length !== 2) { - return false; - } +export function matchStatusCode( + response: Response, + codes: StatusCodePredicate, +): boolean { + const actual = `${response.status}`; + const expectedCodes = Array.isArray(codes) ? codes : [codes]; + if (!expectedCodes.length) { + return false; + } - const gotParts = contentType.split(mediaParamSeparator); - const [gotType = "", ...gotParams] = gotParts; + return expectedCodes.some((ec) => { + const code = `${ec}`; - const [type = "", subtype = ""] = gotType.split("/"); - if (!type || !subtype) { - return false; + if (code === "default") { + return true; } - if ( - wantType !== "*/*" && - gotType !== wantType && - `${type}/*` !== wantType && - `*/${subtype}` !== wantType - ) { - return false; + if (!codeRangeRE.test(`${code}`)) { + return code === actual; } - if (gotParams.length < wantParams.length) { - return false; + const expectFamily = code.charAt(0); + if (!expectFamily) { + throw new Error("Invalid status code range"); } - const params = new Set(gotParams); - for (const wantParam of wantParams) { - if (!params.has(wantParam)) { - return false; - } + const actualFamily = actual.charAt(0); + if (!actualFamily) { + throw new Error(`Invalid response status code: ${actual}`); } - return true; -} - -const codeRangeRE = new RegExp("^[0-9]xx$", "i"); - -export function matchStatusCode(response: Response, codes: StatusCodePredicate): boolean { - const actual = `${response.status}`; - const expectedCodes = Array.isArray(codes) ? codes : [codes]; - if (!expectedCodes.length) { - return false; - } - - return expectedCodes.some((ec) => { - const code = `${ec}`; - - if (code === "default") { - return true; - } - - if (!codeRangeRE.test(`${code}`)) { - return code === actual; - } - - const expectFamily = code.charAt(0); - if (!expectFamily) { - throw new Error("Invalid status code range"); - } - - const actualFamily = actual.charAt(0); - if (!actualFamily) { - throw new Error(`Invalid response status code: ${actual}`); - } - - return actualFamily === expectFamily; - }); + return actualFamily === expectFamily; + }); } export function matchResponse( - response: Response, - code: StatusCodePredicate, - contentTypePattern: string + response: Response, + code: StatusCodePredicate, + contentTypePattern: string, ): boolean { - return matchStatusCode(response, code) && matchContentType(response, contentTypePattern); -} - -const headerValRE = /, */; -export function unpackHeaders(headers: Headers): Record { - const out: Record = {}; - - for (const [k, v] of headers.entries()) { - out[k] = v.split(headerValRE); - } - - return out; + return ( + matchStatusCode(response, code) && + matchContentType(response, contentTypePattern) + ); } -type ResponseMatcherSchema = - | { parse: (data: unknown) => T } - | { inboundSchema: { parse: (data: unknown) => T } }; +/** + * Uses various heurisitics to determine if an error is a connection error. + */ +export function isConnectionError(err: unknown): boolean { + if (typeof err !== "object" || err == null) { + return false; + } -type SerializationMethod = "sse" | "json" | "rawBytes" | "rawStream" | "text" | "void" | "fail"; + // Covers fetch in Deno as well + const isBrowserErr = + err instanceof TypeError && + err.message.toLowerCase().startsWith("failed to fetch"); -const defaultContentTypes: Record = { - sse: "text/event-stream", - json: "application/json", - rawBytes: "application/octet-stream", - rawStream: "application/octet-stream", - text: "text/plain", - void: "", - fail: "", -}; + const isNodeErr = + err instanceof TypeError && + err.message.toLowerCase().startsWith("fetch failed"); -type ResponsePredicateMatch = { - method: SerializationMethod; - codes: StatusCodePredicate; - ctype: string; - schema: ResponseMatcherSchema; - hdrs: boolean; - key: string | undefined; - err: boolean; - fail: boolean; -}; + const isBunErr = "name" in err && err.name === "ConnectionError"; -type ResponsePredicateOptions = { - /** Content type to match on. */ - ctype?: string; - /** Pass HTTP headers to deserializer. */ - hdrs?: boolean; -} & ( - | { - /** The result key to store the deserialized value into. */ - key?: string; - fail?: never; - err?: never; - } - | { - /** Indicates the matched response must throw the built-in error. */ - fail: true; - key?: never; - err?: never; - } - | { - /** Indicates the matched response is a custom error. */ - err: true; - key?: never; - fail?: never; - } -); - -export class ResponseMatcher { - private predicates: ResponsePredicateMatch[] = []; - - #any( - method: SerializationMethod, - codes: StatusCodePredicate, - schema: ResponseMatcherSchema, - opts?: ResponsePredicateOptions - ) { - const ctype = opts?.ctype || defaultContentTypes[method]; - const hdrs = !!opts?.hdrs; - const key = opts?.key; - const err = !!opts?.err; - const fail = !!opts?.fail; - this.predicates.push({ - method, - codes, - ctype, - schema, - hdrs, - key, - err, - fail, - }); - return this; - } + const isGenericErr = + "code" in err && + typeof err.code === "string" && + err.code.toLowerCase() === "econnreset"; - json( - codes: StatusCodePredicate, - schema: ResponseMatcherSchema, - opts?: ResponsePredicateOptions - ): this { - return this.#any("json", codes, schema, opts); - } - bytes( - codes: StatusCodePredicate, - schema: ResponseMatcherSchema, - opts?: ResponsePredicateOptions - ): this { - return this.#any("rawBytes", codes, schema, opts); - } - stream( - codes: StatusCodePredicate, - schema: ResponseMatcherSchema, - opts?: ResponsePredicateOptions - ): this { - return this.#any("rawStream", codes, schema, opts); - } - text( - codes: StatusCodePredicate, - schema: ResponseMatcherSchema, - opts?: ResponsePredicateOptions - ): this { - return this.#any("text", codes, schema, opts); - } - sse( - codes: StatusCodePredicate, - schema: ResponseMatcherSchema, - opts?: Omit - ): this { - return this.#any("sse", codes, schema, opts); - } - void( - codes: StatusCodePredicate, - schema: ResponseMatcherSchema, - opts?: Pick - ): this { - return this.#any("void", codes, schema, opts); - } - fail(codes: StatusCodePredicate): this { - return this.#any("fail", codes, znever(), { fail: true }); - } - - async match( - response: Response, - // flat - options?: { - resultKey?: string; - extraFields?: Record; - } - ): Promise<[result: Result, rawData: unknown]> { - let pred: ResponsePredicateMatch | undefined; - for (const predicate of this.predicates) { - const { codes, ctype } = predicate; - if (ctype && matchResponse(response, codes, ctype)) { - pred = predicate; - break; - } else if (!ctype && matchStatusCode(response, codes)) { - pred = predicate; - break; - } - } - if (pred == null) { - const responseBody = await response.text(); - throw new SDKError( - "Unexpected API response status or content-type", - response, - responseBody - ); - } - - const { method, schema } = pred; - - let raw: unknown; - switch (method) { - case "json": - raw = await response.json(); - break; - case "rawBytes": - raw = await response.arrayBuffer(); - break; - case "rawStream": - raw = response.body; - break; - case "text": - raw = await response.text(); - break; - case "sse": - raw = response.body; - break; - case "void": - raw = await discardResponseBody(response); - break; - case "fail": - raw = await response.text(); - break; - default: - method satisfies never; - throw new Error(`Unsupported response type: ${method}`); - } - - const resultKey = pred.key || options?.resultKey; - let data: unknown; - if (pred.fail) { - throw new SDKError("API error occurred", response, typeof raw === "string" ? raw : ""); - } else if (pred.err) { - data = { - ...options?.extraFields, - ...(pred.hdrs ? { Headers: unpackHeaders(response.headers) } : null), - ...(isPlainObject(raw) ? raw : null), - }; - } else if (resultKey) { - data = { - ...options?.extraFields, - ...(pred.hdrs ? { Headers: unpackHeaders(response.headers) } : null), - [resultKey]: raw, - }; - } else if (pred.hdrs) { - data = { - ...options?.extraFields, - ...(pred.hdrs ? { Headers: unpackHeaders(response.headers) } : null), - ...(isPlainObject(raw) ? raw : null), - }; - } else { - data = raw; - } - - const parser = "inboundSchema" in schema ? schema.inboundSchema : schema; - const body = parse(data, (v: unknown) => parser.parse(v), "Response validation failed"); - - if (body instanceof Error) { - throw body; - } - - return [body, raw]; - } + return isBrowserErr || isNodeErr || isGenericErr || isBunErr; } /** - * Discards the response body to free up resources. - * - * To learn why this is need, see the undici docs: - * https://undici.nodejs.org/#/?id=garbage-collection + * Uses various heurisitics to determine if an error is a timeout error. */ -export async function discardResponseBody(res: Response) { - const reader = res.body?.getReader(); - if (reader == null) { - return; - } +export function isTimeoutError(err: unknown): boolean { + if (typeof err !== "object" || err == null) { + return false; + } + + // Fetch in browser, Node.js, Bun, Deno + const isNative = "name" in err && err.name === "TimeoutError"; + const isLegacyNative = "code" in err && err.code === 23; + + // Node.js HTTP client and Axios + const isGenericErr = + "code" in err && + typeof err.code === "string" && + err.code.toLowerCase() === "econnaborted"; + + return isNative || isLegacyNative || isGenericErr; +} - try { - let done = false; - while (!done) { - const res = await reader.read(); - done = res.done; - } - } finally { - reader.releaseLock(); - } +/** + * Uses various heurisitics to determine if an error is a abort error. + */ +export function isAbortError(err: unknown): boolean { + if (typeof err !== "object" || err == null) { + return false; + } + + // Fetch in browser, Node.js, Bun, Deno + const isNative = "name" in err && err.name === "AbortError"; + const isLegacyNative = "code" in err && err.code === 20; + + // Node.js HTTP client and Axios + const isGenericErr = + "code" in err && + typeof err.code === "string" && + err.code.toLowerCase() === "econnaborted"; + + return isNative || isLegacyNative || isGenericErr; } diff --git a/src/lib/is-plain-object.ts b/src/lib/is-plain-object.ts index af0d6e7e..61070d3d 100644 --- a/src/lib/is-plain-object.ts +++ b/src/lib/is-plain-object.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ /* diff --git a/src/lib/logger.ts b/src/lib/logger.ts new file mode 100644 index 00000000..d181f293 --- /dev/null +++ b/src/lib/logger.ts @@ -0,0 +1,9 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +export interface Logger { + group(label?: string): void; + groupEnd(): void; + log(message: any, ...args: any[]): void; +} diff --git a/src/lib/matchers.ts b/src/lib/matchers.ts new file mode 100644 index 00000000..dcb468b8 --- /dev/null +++ b/src/lib/matchers.ts @@ -0,0 +1,308 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { safeParse } from "./schemas.js"; +import { StatusCodePredicate, matchResponse, matchStatusCode } from "./http.js"; +import { isPlainObject } from "./is-plain-object.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import { Result } from "../types/fp.js"; + +export type Encoding = "json" | "text" | "bytes" | "stream" | "sse" | "nil" | "fail"; + +const DEFAULT_CONTENT_TYPES: Record = { + json: "application/json", + text: "text/plain", + bytes: "application/octet-stream", + stream: "application/octet-stream", + sse: "text/event-stream", + nil: "*", + fail: "*", +}; + +type Schema = { parse(raw: unknown): T }; + +type MatchOptions = { ctype?: string; hdrs?: boolean; key?: string; sseSentinel?: string }; + +export type ValueMatcher = MatchOptions & { + enc: Encoding; + codes: StatusCodePredicate; + schema: Schema; +}; + +export type ErrorMatcher = MatchOptions & { + enc: Encoding; + codes: StatusCodePredicate; + schema: Schema; + err: true; +}; + +export type FailMatcher = { + enc: "fail"; + codes: StatusCodePredicate; +}; + +export type Matcher = ValueMatcher | ErrorMatcher | FailMatcher; + +export function jsonErr( + codes: StatusCodePredicate, + schema: Schema, + options?: MatchOptions +): ErrorMatcher { + return { ...options, err: true, enc: "json", codes, schema }; +} +export function json( + codes: StatusCodePredicate, + schema: Schema, + options?: MatchOptions +): ValueMatcher { + return { ...options, enc: "json", codes, schema }; +} + +export function textErr( + codes: StatusCodePredicate, + schema: Schema, + options?: MatchOptions +): ErrorMatcher { + return { ...options, err: true, enc: "text", codes, schema }; +} +export function text( + codes: StatusCodePredicate, + schema: Schema, + options?: MatchOptions +): ValueMatcher { + return { ...options, enc: "text", codes, schema }; +} + +export function bytesErr( + codes: StatusCodePredicate, + schema: Schema, + options?: MatchOptions +): ErrorMatcher { + return { ...options, err: true, enc: "bytes", codes, schema }; +} +export function bytes( + codes: StatusCodePredicate, + schema: Schema, + options?: MatchOptions +): ValueMatcher { + return { ...options, enc: "bytes", codes, schema }; +} + +export function streamErr( + codes: StatusCodePredicate, + schema: Schema, + options?: MatchOptions +): ErrorMatcher { + return { ...options, err: true, enc: "stream", codes, schema }; +} +export function stream( + codes: StatusCodePredicate, + schema: Schema, + options?: MatchOptions +): ValueMatcher { + return { ...options, enc: "stream", codes, schema }; +} + +export function sseErr( + codes: StatusCodePredicate, + schema: Schema, + options?: MatchOptions +): ErrorMatcher { + return { ...options, err: true, enc: "sse", codes, schema }; +} +export function sse( + codes: StatusCodePredicate, + schema: Schema, + options?: MatchOptions +): ValueMatcher { + return { ...options, enc: "sse", codes, schema }; +} + +export function nilErr( + codes: StatusCodePredicate, + schema: Schema, + options?: MatchOptions +): ErrorMatcher { + return { ...options, err: true, enc: "nil", codes, schema }; +} +export function nil( + codes: StatusCodePredicate, + schema: Schema, + options?: MatchOptions +): ValueMatcher { + return { ...options, enc: "nil", codes, schema }; +} + +export function fail(codes: StatusCodePredicate): FailMatcher { + return { enc: "fail", codes }; +} + +export type MatchedValue = Matchers extends Matcher[] ? T : never; +export type MatchedError = Matchers extends Matcher[] ? E : never; +export type MatchFunc = ( + response: Response, + options?: { resultKey?: string; extraFields?: Record } +) => Promise<[result: Result, raw: unknown]>; + +export function match( + ...matchers: Array> +): MatchFunc { + return async function matchFunc( + response: Response, + options?: { resultKey?: string; extraFields?: Record } + ): Promise<[result: Result, raw: unknown]> { + let raw: unknown; + let matcher: Matcher | undefined; + for (const match of matchers) { + const { codes } = match; + const ctpattern = "ctype" in match ? match.ctype : DEFAULT_CONTENT_TYPES[match.enc]; + if (ctpattern && matchResponse(response, codes, ctpattern)) { + matcher = match; + break; + } else if (!ctpattern && matchStatusCode(response, codes)) { + matcher = match; + break; + } + } + + if (!matcher) { + const responseBody = await response.text(); + return [ + { + ok: false, + error: new SDKError( + "Unexpected API response status or content-type", + response, + responseBody + ), + }, + responseBody, + ]; + } + + const encoding = matcher.enc; + switch (encoding) { + case "json": + raw = await response.json(); + break; + case "bytes": + raw = await response.arrayBuffer(); + break; + case "stream": + raw = response.body; + break; + case "text": + raw = await response.text(); + break; + case "sse": + raw = response.body; + break; + case "nil": + raw = await discardResponseBody(response); + break; + case "fail": + raw = await response.text(); + break; + default: + encoding satisfies never; + throw new Error(`Unsupported response type: ${encoding}`); + } + + if (matcher.enc === "fail") { + return [ + { + ok: false, + error: new SDKError( + "API error occurred", + response, + typeof raw === "string" ? raw : "" + ), + }, + raw, + ]; + } + + const resultKey = matcher.key || options?.resultKey; + let data: unknown; + + if ("err" in matcher) { + data = { + ...options?.extraFields, + ...(matcher.hdrs ? { Headers: unpackHeaders(response.headers) } : null), + ...(isPlainObject(raw) ? raw : null), + }; + } else if (resultKey) { + data = { + ...options?.extraFields, + ...(matcher.hdrs ? { Headers: unpackHeaders(response.headers) } : null), + [resultKey]: raw, + }; + } else if (matcher.hdrs) { + data = { + ...options?.extraFields, + ...(matcher.hdrs ? { Headers: unpackHeaders(response.headers) } : null), + ...(isPlainObject(raw) ? raw : null), + }; + } else { + data = raw; + } + + if ("err" in matcher) { + const result = safeParse( + data, + (v: unknown) => matcher.schema.parse(v), + "Response validation failed" + ); + return [result.ok ? { ok: false, error: result.value } : result, raw]; + } else { + return [ + safeParse( + data, + (v: unknown) => matcher.schema.parse(v), + "Response validation failed" + ), + raw, + ]; + } + }; +} + +const headerValRE = /, */; +/** + * Iterates over a Headers object and returns an object with all the header + * entries. Values are represented as an array to account for repeated headers. + */ +export function unpackHeaders(headers: Headers): Record { + const out: Record = {}; + + for (const [k, v] of headers.entries()) { + out[k] = v.split(headerValRE); + } + + return out; +} + +/** + * Discards the response body to free up resources. + * + * To learn why this is need, see the undici docs: + * https://undici.nodejs.org/#/?id=garbage-collection + */ +export async function discardResponseBody(res: Response) { + const reader = res.body?.getReader(); + if (reader == null) { + return; + } + + try { + let done = false; + while (!done) { + const res = await reader.read(); + done = res.done; + } + } finally { + reader.releaseLock(); + } +} diff --git a/src/lib/primitives.ts b/src/lib/primitives.ts index d3aae30b..23794a2b 100644 --- a/src/lib/primitives.ts +++ b/src/lib/primitives.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ export type Remap = { diff --git a/src/lib/retries.ts b/src/lib/retries.ts index ed9b4959..df3e0bc2 100644 --- a/src/lib/retries.ts +++ b/src/lib/retries.ts @@ -1,7 +1,9 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ +import { isConnectionError, isTimeoutError } from "./http.js"; + export type BackoffStrategy = { initialInterval: number; maxInterval: number; @@ -99,47 +101,6 @@ function wrapFetcher( }; } -function isConnectionError(err: unknown) { - if (typeof err !== "object" || err == null) { - return false; - } - - // Covers fetch in Deno as well - const isBrowserErr = - err instanceof TypeError && - err.message.toLowerCase().startsWith("failed to fetch"); - - const isNodeErr = - err instanceof TypeError && - err.message.toLowerCase().startsWith("fetch failed"); - - const isBunErr = "name" in err && err.name === "ConnectionError"; - - const isGenericErr = - "code" in err && - typeof err.code === "string" && - err.code.toLowerCase() === "econnreset"; - - return isBrowserErr || isNodeErr || isGenericErr || isBunErr; -} - -function isTimeoutError(err: unknown) { - if (typeof err !== "object" || err == null) { - return false; - } - - // Fetch in browser, Node.js, Bun, Deno - const isNative = "name" in err && err.name === "TimeoutError"; - - // Node.js HTTP client and Axios - const isGenericErr = - "code" in err && - typeof err.code === "string" && - err.code.toLowerCase() === "econnaborted"; - - return isNative || isGenericErr; -} - const codeRangeRE = new RegExp("^[0-9]xx$", "i"); function isRetryableResponse(res: Response, statusCodes: string[]): boolean { diff --git a/src/lib/schemas.ts b/src/lib/schemas.ts index 94b05354..37b0b131 100644 --- a/src/lib/schemas.ts +++ b/src/lib/schemas.ts @@ -1,9 +1,10 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { output, ZodEffects, ZodError, ZodObject, ZodRawShape, ZodTypeAny } from "zod"; import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import { ERR, OK, Result } from "../types/fp.js"; /** * Utility function that executes some code which may throw a ZodError. It @@ -21,6 +22,23 @@ export function parse(rawValue: Inp, fn: (value: Inp) => Out, errorMes } } +/** + * Utility function that executes some code which may result in a ZodError. It + * intercepts this error and converts it to an SDKValidationError so as to not + * leak Zod implementation details to user code. + */ +export function safeParse( + rawValue: Inp, + fn: (value: Inp) => Out, + errorMessage: string +): Result { + try { + return OK(fn(rawValue)); + } catch (err) { + return ERR(new SDKValidationError(errorMessage, err, rawValue)); + } +} + export function collectExtraKeys< Shape extends ZodRawShape, Catchall extends ZodTypeAny, diff --git a/src/lib/sdks.ts b/src/lib/sdks.ts index b6f45cfc..51b49bd0 100644 --- a/src/lib/sdks.ts +++ b/src/lib/sdks.ts @@ -1,16 +1,51 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { ResponseMatcher, HTTPClient, matchStatusCode } from "./http.js"; -import { SecurityState, resolveSecurity, resolveGlobalSecurity } from "./security.js"; -import { pathToFunc } from "./url.js"; +import { + HTTPClient, + matchContentType, + matchStatusCode, + isAbortError, + isTimeoutError, + isConnectionError, +} from "./http.js"; +import { SecurityState } from "./security.js"; +import { retry, RetryConfig } from "./retries.js"; +import { Logger } from "./logger.js"; import { encodeForm } from "./encodings.js"; import { stringToBase64 } from "./base64.js"; +import { SDKOptions, SDK_METADATA, serverURLFromOptions } from "./config.js"; import { SDKHooks } from "../hooks/hooks.js"; import { HookContext } from "../hooks/types.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { ERR, OK, Result } from "../types/fp.js"; export type RequestOptions = { + /** + * Sets a timeout, in milliseconds, on HTTP requests made by an SDK method. If + * `fetchOptions.signal` is set then it will take precedence over this option. + */ + timeoutMs?: number; + /** + * Set or override a retry policy on HTTP calls. + */ + retries?: RetryConfig; + /** + * Specifies the status codes which should be retried using the given retry policy. + */ + retryCodes?: string[]; + /** + * Sets various request options on the `fetch` call made by an SDK method. + * + * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options|Request} + */ fetchOptions?: Omit; }; @@ -22,35 +57,65 @@ type RequestConfig = { body?: RequestInit["body"]; headers?: HeadersInit; security?: SecurityState | null; + uaHeader?: string; + timeoutMs?: number; }; +const gt: unknown = typeof globalThis === "undefined" ? null : globalThis; +const webWorkerLike = + typeof gt === "object" && + gt != null && + "importScripts" in gt && + typeof gt["importScripts"] === "function"; +const isBrowserLike = + webWorkerLike || + (typeof navigator !== "undefined" && "serviceWorker" in navigator) || + (typeof window === "object" && typeof window.document !== "undefined"); + export class ClientSDK { - private readonly client: HTTPClient; + private readonly httpClient: HTTPClient; protected readonly baseURL: URL | null; protected readonly hooks$: SDKHooks; + protected readonly logger?: Logger | undefined; + public readonly options$: SDKOptions & { hooks?: SDKHooks }; - constructor(init: { client: HTTPClient; baseURL: URL | null; hooks: SDKHooks }) { - const url = init.baseURL; + constructor(options: SDKOptions = {}) { + const opt = options as unknown; + if ( + typeof opt === "object" && + opt != null && + "hooks" in opt && + opt.hooks instanceof SDKHooks + ) { + this.hooks$ = opt.hooks; + } else { + this.hooks$ = new SDKHooks(); + } + this.options$ = { ...options, hooks: this.hooks$ }; + + const url = serverURLFromOptions(options); if (url) { url.pathname = url.pathname.replace(/\/+$/, "") + "/"; } - - this.hooks$ = init.hooks; - const { baseURL, client } = this.hooks$.sdkInit({ baseURL: url, client: init.client }); + const { baseURL, client } = this.hooks$.sdkInit({ + baseURL: url, + client: options.httpClient || new HTTPClient(), + }); this.baseURL = baseURL; - this.client = client; + this.httpClient = client; + this.logger = options.debugLogger; } - protected createRequest$( + public createRequest$( context: HookContext, conf: RequestConfig, options?: RequestOptions - ): Request { + ): Result { const { method, path, query, headers: opHeaders, security } = conf; const base = conf.baseURL ?? this.baseURL; if (!base) { - throw new TypeError("No base URL provided for operation"); + return ERR(new InvalidRequestError("No base URL provided for operation")); } const reqURL = new URL(base); const inputURL = new URL(path, reqURL); @@ -100,49 +165,193 @@ export class ClientSDK { headers.set(k, v); } - const input = this.hooks$.beforeCreateRequest(context, { - url: reqURL, - options: { - ...options?.fetchOptions, - body: conf.body ?? null, - headers, - method, - }, - }); + // Only set user agent header in non-browser-like environments since CORS + // policy disallows setting it in browsers e.g. Chrome throws an error. + if (!isBrowserLike) { + headers.set(conf.uaHeader ?? "user-agent", SDK_METADATA.userAgent); + } - return new Request(input.url, input.options); + let fetchOptions = options?.fetchOptions; + if (!fetchOptions?.signal && conf.timeoutMs && conf.timeoutMs > 0) { + const timeoutSignal = AbortSignal.timeout(conf.timeoutMs); + if (!fetchOptions) { + fetchOptions = { signal: timeoutSignal }; + } else { + fetchOptions.signal = timeoutSignal; + } + } + + let input; + try { + input = this.hooks$.beforeCreateRequest(context, { + url: reqURL, + options: { + ...fetchOptions, + body: conf.body ?? null, + headers, + method, + }, + }); + } catch (err: unknown) { + return ERR( + new UnexpectedClientError("Create request hook failed to execute", { cause: err }) + ); + } + + return OK(new Request(input.url, input.options)); } - protected async do$( - req: Request, + public async do$( + request: Request, options: { context: HookContext; errorCodes: number | string | (number | string)[]; + retryConfig?: RetryConfig | undefined; + retryCodes?: string[] | undefined; } - ): Promise { + ): Promise< + Result< + Response, + RequestAbortedError | RequestTimeoutError | ConnectionError | UnexpectedClientError + > + > { const { context, errorCodes } = options; + const retryConfig = options.retryConfig || { strategy: "none" }; + const retryCodes = options.retryCodes || []; + + return retry( + async () => { + const req = await this.hooks$.beforeRequest(context, request.clone()); + await logRequest(this.logger, req).catch((e) => + this.logger?.log("Failed to log request:", e) + ); - let response = await this.client.request(await this.hooks$.beforeRequest(context, req)); + let response = await this.httpClient.request(req); - if (matchStatusCode(response, errorCodes)) { - const result = await this.hooks$.afterError(context, response, null); - if (result.error) { - throw result.error; + if (matchStatusCode(response, errorCodes)) { + const result = await this.hooks$.afterError(context, response, null); + if (result.error) { + throw result.error; + } + response = result.response || response; + } else { + response = await this.hooks$.afterSuccess(context, response); + } + + await logResponse(this.logger, response, req).catch((e) => + this.logger?.log("Failed to log response:", e) + ); + + return response; + }, + { config: retryConfig, statusCodes: retryCodes } + ).then( + (r) => OK(r), + (err) => { + switch (true) { + case isAbortError(err): + return ERR( + new RequestAbortedError("Request aborted by client", { cause: err }) + ); + case isTimeoutError(err): + return ERR(new RequestTimeoutError("Request timed out", { cause: err })); + case isConnectionError(err): + return ERR(new ConnectionError("Unable to make request", { cause: err })); + default: + return ERR( + new UnexpectedClientError("Unexpected HTTP client error", { + cause: err, + }) + ); + } } - response = result.response || response; - } else { - response = await this.hooks$.afterSuccess(context, response); + ); + } +} + +const jsonLikeContentTypeRE = /^application\/(?:.{0,100}\+)?json/; +async function logRequest(logger: Logger | undefined, req: Request) { + if (!logger) { + return; + } + + const contentType = req.headers.get("content-type"); + const ct = contentType?.split(";")[0] || ""; + + logger.group(`> Request: ${req.method} ${req.url}`); + + logger.group("Headers:"); + for (const [k, v] of req.headers.entries()) { + logger.log(`${k}: ${v}`); + } + logger.groupEnd(); + + logger.group("Body:"); + switch (true) { + case jsonLikeContentTypeRE.test(ct): + logger.log(await req.clone().json()); + break; + case ct.startsWith("text/"): + logger.log(await req.clone().text()); + break; + case ct === "multipart/form-data": { + const body = await req.clone().formData(); + for (const [k, v] of body) { + const vlabel = v instanceof Blob ? "" : v; + logger.log(`${k}: ${vlabel}`); + } + break; } + default: + logger.log(`<${contentType}>`); + break; + } + logger.groupEnd(); - return response; + logger.groupEnd(); +} + +async function logResponse(logger: Logger | undefined, res: Response, req: Request) { + if (!logger) { + return; } - protected matcher(): ResponseMatcher { - return new ResponseMatcher(); + const contentType = res.headers.get("content-type"); + const ct = contentType?.split(";")[0] || ""; + + logger.group(`< Response: ${req.method} ${req.url}`); + logger.log("Status Code:", res.status, res.statusText); + + logger.group("Headers:"); + for (const [k, v] of res.headers.entries()) { + logger.log(`${k}: ${v}`); } + logger.groupEnd(); - protected templateURLComponent = pathToFunc; + logger.group("Body:"); + switch (true) { + case matchContentType(res, "application/json") || jsonLikeContentTypeRE.test(ct): + logger.log(await res.clone().json()); + break; + case matchContentType(res, "text/event-stream"): + logger.log(`<${contentType}>`); + break; + case matchContentType(res, "text/*"): + logger.log(await res.clone().text()); + break; + case matchContentType(res, "multipart/form-data"): { + const body = await res.clone().formData(); + for (const [k, v] of body) { + const vlabel = v instanceof Blob ? "" : v; + logger.log(`${k}: ${vlabel}`); + } + break; + } + default: + logger.log(`<${contentType}>`); + break; + } + logger.groupEnd(); - protected resolveSecurity = resolveSecurity; - protected resolveGlobalSecurity = resolveGlobalSecurity; + logger.groupEnd(); } diff --git a/src/lib/security.ts b/src/lib/security.ts index f357a925..bc77acc8 100644 --- a/src/lib/security.ts +++ b/src/lib/security.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as components from "../models/components/index.js"; @@ -71,13 +71,20 @@ type SecurityInputOAuth2ClientCredentials = { fieldName: string; }; +type SecurityInputCustom = { + type: "http:custom"; + value: any | null | undefined; + fieldName: string; +}; + export type SecurityInput = | SecurityInputBasic | SecurityInputBearer | SecurityInputAPIKey | SecurityInputOAuth2 | SecurityInputOAuth2ClientCredentials - | SecurityInputOIDC; + | SecurityInputOIDC + | SecurityInputCustom; export function resolveSecurity(...options: SecurityInput[][]): SecurityState | null { const state: SecurityState = { @@ -93,6 +100,8 @@ export function resolveSecurity(...options: SecurityInput[][]): SecurityState | return false; } else if (o.type === "http:basic") { return o.value.username != null || o.value.password != null; + } else if (o.type === "http:custom") { + return null; } else if (typeof o.value === "string") { return !!o.value; } else { @@ -126,6 +135,8 @@ export function resolveSecurity(...options: SecurityInput[][]): SecurityState | case "http:basic": applyBasic(state, spec); break; + case "http:custom": + break; case "http:bearer": applyBearer(state, spec); break; @@ -180,3 +191,13 @@ export function resolveGlobalSecurity( }, ]); } + +export async function extractSecurity>( + sec: T | (() => Promise) | undefined +): Promise { + if (sec == null) { + return; + } + + return typeof sec === "function" ? sec() : sec; +} diff --git a/src/lib/url.ts b/src/lib/url.ts index df58acbb..6bc6356e 100644 --- a/src/lib/url.ts +++ b/src/lib/url.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ const hasOwn = Object.prototype.hasOwnProperty; diff --git a/src/models/components/activitiesresponsedto.ts b/src/models/components/activitiesresponsedto.ts index 40d68597..5bed52e3 100644 --- a/src/models/components/activitiesresponsedto.ts +++ b/src/models/components/activitiesresponsedto.ts @@ -1,41 +1,57 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { - ActivityNotificationResponseDto, - ActivityNotificationResponseDto$, -} from "./activitynotificationresponsedto.js"; import * as z from "zod"; export type ActivitiesResponseDto = { - data: Array; + data: Array; hasMore: boolean; page: number; pageSize: number; }; /** @internal */ -export namespace ActivitiesResponseDto$ { - export const inboundSchema: z.ZodType = z.object({ - data: z.array(ActivityNotificationResponseDto$.inboundSchema), - hasMore: z.boolean(), - page: z.number(), - pageSize: z.number(), - }); +export const ActivitiesResponseDto$inboundSchema: z.ZodType< + ActivitiesResponseDto, + z.ZodTypeDef, + unknown +> = z.object({ + data: z.array(z.string()), + hasMore: z.boolean(), + page: z.number(), + pageSize: z.number(), +}); + +/** @internal */ +export type ActivitiesResponseDto$Outbound = { + data: Array; + hasMore: boolean; + page: number; + pageSize: number; +}; - export type Outbound = { - data: Array; - hasMore: boolean; - page: number; - pageSize: number; - }; +/** @internal */ +export const ActivitiesResponseDto$outboundSchema: z.ZodType< + ActivitiesResponseDto$Outbound, + z.ZodTypeDef, + ActivitiesResponseDto +> = z.object({ + data: z.array(z.string()), + hasMore: z.boolean(), + page: z.number(), + pageSize: z.number(), +}); - export const outboundSchema: z.ZodType = - z.object({ - data: z.array(ActivityNotificationResponseDto$.outboundSchema), - hasMore: z.boolean(), - page: z.number(), - pageSize: z.number(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ActivitiesResponseDto$ { + /** @deprecated use `ActivitiesResponseDto$inboundSchema` instead. */ + export const inboundSchema = ActivitiesResponseDto$inboundSchema; + /** @deprecated use `ActivitiesResponseDto$outboundSchema` instead. */ + export const outboundSchema = ActivitiesResponseDto$outboundSchema; + /** @deprecated use `ActivitiesResponseDto$Outbound` instead. */ + export type Outbound = ActivitiesResponseDto$Outbound; } diff --git a/src/models/components/activitygraphstatesresponse.ts b/src/models/components/activitygraphstatesresponse.ts index b3c3198a..b8532600 100644 --- a/src/models/components/activitygraphstatesresponse.ts +++ b/src/models/components/activitygraphstatesresponse.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; @@ -23,43 +23,75 @@ export type ActivityGraphStatesResponse = { }; /** @internal */ +export const Channels$inboundSchema: z.ZodNativeEnum = z.nativeEnum(Channels); + +/** @internal */ +export const Channels$outboundSchema: z.ZodNativeEnum = Channels$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace Channels$ { - export const inboundSchema: z.ZodNativeEnum = z.nativeEnum(Channels); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; + /** @deprecated use `Channels$inboundSchema` instead. */ + export const inboundSchema = Channels$inboundSchema; + /** @deprecated use `Channels$outboundSchema` instead. */ + export const outboundSchema = Channels$outboundSchema; } /** @internal */ -export namespace ActivityGraphStatesResponse$ { - export const inboundSchema: z.ZodType = z - .object({ - _id: z.string(), - channels: z.array(Channels$.inboundSchema), - count: z.number(), - templates: z.array(z.string()), - }) - .transform((v) => { - return remap$(v, { - _id: "id", - }); +export const ActivityGraphStatesResponse$inboundSchema: z.ZodType< + ActivityGraphStatesResponse, + z.ZodTypeDef, + unknown +> = z + .object({ + _id: z.string(), + channels: z.array(Channels$inboundSchema), + count: z.number(), + templates: z.array(z.string()), + }) + .transform((v) => { + return remap$(v, { + _id: "id", }); + }); - export type Outbound = { - _id: string; - channels: Array; - count: number; - templates: Array; - }; +/** @internal */ +export type ActivityGraphStatesResponse$Outbound = { + _id: string; + channels: Array; + count: number; + templates: Array; +}; - export const outboundSchema: z.ZodType = z - .object({ - id: z.string(), - channels: z.array(Channels$.outboundSchema), - count: z.number(), - templates: z.array(z.string()), - }) - .transform((v) => { - return remap$(v, { - id: "_id", - }); +/** @internal */ +export const ActivityGraphStatesResponse$outboundSchema: z.ZodType< + ActivityGraphStatesResponse$Outbound, + z.ZodTypeDef, + ActivityGraphStatesResponse +> = z + .object({ + id: z.string(), + channels: z.array(Channels$outboundSchema), + count: z.number(), + templates: z.array(z.string()), + }) + .transform((v) => { + return remap$(v, { + id: "_id", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ActivityGraphStatesResponse$ { + /** @deprecated use `ActivityGraphStatesResponse$inboundSchema` instead. */ + export const inboundSchema = ActivityGraphStatesResponse$inboundSchema; + /** @deprecated use `ActivityGraphStatesResponse$outboundSchema` instead. */ + export const outboundSchema = ActivityGraphStatesResponse$outboundSchema; + /** @deprecated use `ActivityGraphStatesResponse$Outbound` instead. */ + export type Outbound = ActivityGraphStatesResponse$Outbound; } diff --git a/src/models/components/activitynotificationexecutiondetailresponsedto.ts b/src/models/components/activitynotificationexecutiondetailresponsedto.ts deleted file mode 100644 index c2f5c74b..00000000 --- a/src/models/components/activitynotificationexecutiondetailresponsedto.ts +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - */ - -import { remap as remap$ } from "../../lib/primitives.js"; -import { ClosedEnum } from "../../types/enums.js"; -import * as z from "zod"; - -export type ProviderId = {}; - -export const Source = { - Credentials: "Credentials", - Internal: "Internal", - Payload: "Payload", - Webhook: "Webhook", -} as const; -export type Source = ClosedEnum; - -export const Status = { - Success: "Success", - Warning: "Warning", - Failed: "Failed", - Pending: "Pending", - Queued: "Queued", - ReadConfirmation: "ReadConfirmation", -} as const; -export type Status = ClosedEnum; - -export type ActivityNotificationExecutionDetailResponseDto = { - id: string; - jobId: string; - detail: string; - isRetry: boolean; - isTest: boolean; - providerId: ProviderId; - raw?: string | undefined; - source: Source; - status: Status; -}; - -/** @internal */ -export namespace ProviderId$ { - export const inboundSchema: z.ZodType = z.object({}); - - export type Outbound = {}; - - export const outboundSchema: z.ZodType = z.object({}); -} - -/** @internal */ -export namespace Source$ { - export const inboundSchema: z.ZodNativeEnum = z.nativeEnum(Source); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; -} - -/** @internal */ -export namespace Status$ { - export const inboundSchema: z.ZodNativeEnum = z.nativeEnum(Status); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; -} - -/** @internal */ -export namespace ActivityNotificationExecutionDetailResponseDto$ { - export const inboundSchema: z.ZodType< - ActivityNotificationExecutionDetailResponseDto, - z.ZodTypeDef, - unknown - > = z - .object({ - _id: z.string(), - _jobId: z.string(), - detail: z.string(), - isRetry: z.boolean(), - isTest: z.boolean(), - providerId: z.lazy(() => ProviderId$.inboundSchema), - raw: z.string().optional(), - source: Source$.inboundSchema, - status: Status$.inboundSchema, - }) - .transform((v) => { - return remap$(v, { - _id: "id", - _jobId: "jobId", - }); - }); - - export type Outbound = { - _id: string; - _jobId: string; - detail: string; - isRetry: boolean; - isTest: boolean; - providerId: ProviderId$.Outbound; - raw?: string | undefined; - source: string; - status: string; - }; - - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - ActivityNotificationExecutionDetailResponseDto - > = z - .object({ - id: z.string(), - jobId: z.string(), - detail: z.string(), - isRetry: z.boolean(), - isTest: z.boolean(), - providerId: z.lazy(() => ProviderId$.outboundSchema), - raw: z.string().optional(), - source: Source$.outboundSchema, - status: Status$.outboundSchema, - }) - .transform((v) => { - return remap$(v, { - id: "_id", - jobId: "_jobId", - }); - }); -} diff --git a/src/models/components/activitynotificationjobresponsedto.ts b/src/models/components/activitynotificationjobresponsedto.ts deleted file mode 100644 index fb5e319e..00000000 --- a/src/models/components/activitynotificationjobresponsedto.ts +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - */ - -import { remap as remap$ } from "../../lib/primitives.js"; -import { - ActivityNotificationExecutionDetailResponseDto, - ActivityNotificationExecutionDetailResponseDto$, -} from "./activitynotificationexecutiondetailresponsedto.js"; -import { - ActivityNotificationStepResponseDto, - ActivityNotificationStepResponseDto$, -} from "./activitynotificationstepresponsedto.js"; -import * as z from "zod"; - -export type Digest = {}; - -export type Payload = {}; - -export type ActivityNotificationJobResponseDtoProviderId = {}; - -export type ActivityNotificationJobResponseDto = { - id: string; - digest?: Digest | undefined; - executionDetails: Array; - payload?: Payload | undefined; - providerId: ActivityNotificationJobResponseDtoProviderId; - status: string; - step: ActivityNotificationStepResponseDto; - type: string; -}; - -/** @internal */ -export namespace Digest$ { - export const inboundSchema: z.ZodType = z.object({}); - - export type Outbound = {}; - - export const outboundSchema: z.ZodType = z.object({}); -} - -/** @internal */ -export namespace Payload$ { - export const inboundSchema: z.ZodType = z.object({}); - - export type Outbound = {}; - - export const outboundSchema: z.ZodType = z.object({}); -} - -/** @internal */ -export namespace ActivityNotificationJobResponseDtoProviderId$ { - export const inboundSchema: z.ZodType< - ActivityNotificationJobResponseDtoProviderId, - z.ZodTypeDef, - unknown - > = z.object({}); - - export type Outbound = {}; - - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - ActivityNotificationJobResponseDtoProviderId - > = z.object({}); -} - -/** @internal */ -export namespace ActivityNotificationJobResponseDto$ { - export const inboundSchema: z.ZodType< - ActivityNotificationJobResponseDto, - z.ZodTypeDef, - unknown - > = z - .object({ - _id: z.string(), - digest: z.lazy(() => Digest$.inboundSchema).optional(), - executionDetails: z.array( - ActivityNotificationExecutionDetailResponseDto$.inboundSchema - ), - payload: z.lazy(() => Payload$.inboundSchema).optional(), - providerId: z.lazy(() => ActivityNotificationJobResponseDtoProviderId$.inboundSchema), - status: z.string(), - step: ActivityNotificationStepResponseDto$.inboundSchema, - type: z.string(), - }) - .transform((v) => { - return remap$(v, { - _id: "id", - }); - }); - - export type Outbound = { - _id: string; - digest?: Digest$.Outbound | undefined; - executionDetails: Array; - payload?: Payload$.Outbound | undefined; - providerId: ActivityNotificationJobResponseDtoProviderId$.Outbound; - status: string; - step: ActivityNotificationStepResponseDto$.Outbound; - type: string; - }; - - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - ActivityNotificationJobResponseDto - > = z - .object({ - id: z.string(), - digest: z.lazy(() => Digest$.outboundSchema).optional(), - executionDetails: z.array( - ActivityNotificationExecutionDetailResponseDto$.outboundSchema - ), - payload: z.lazy(() => Payload$.outboundSchema).optional(), - providerId: z.lazy(() => ActivityNotificationJobResponseDtoProviderId$.outboundSchema), - status: z.string(), - step: ActivityNotificationStepResponseDto$.outboundSchema, - type: z.string(), - }) - .transform((v) => { - return remap$(v, { - id: "_id", - }); - }); -} diff --git a/src/models/components/activitynotificationresponsedto.ts b/src/models/components/activitynotificationresponsedto.ts index 044cee76..cb11624b 100644 --- a/src/models/components/activitynotificationresponsedto.ts +++ b/src/models/components/activitynotificationresponsedto.ts @@ -1,20 +1,20 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; import { ClosedEnum } from "../../types/enums.js"; -import { - ActivityNotificationJobResponseDto, - ActivityNotificationJobResponseDto$, -} from "./activitynotificationjobresponsedto.js"; import { ActivityNotificationSubscriberResponseDto, - ActivityNotificationSubscriberResponseDto$, + ActivityNotificationSubscriberResponseDto$inboundSchema, + ActivityNotificationSubscriberResponseDto$Outbound, + ActivityNotificationSubscriberResponseDto$outboundSchema, } from "./activitynotificationsubscriberresponsedto.js"; import { ActivityNotificationTemplateResponseDto, - ActivityNotificationTemplateResponseDto$, + ActivityNotificationTemplateResponseDto$inboundSchema, + ActivityNotificationTemplateResponseDto$Outbound, + ActivityNotificationTemplateResponseDto$outboundSchema, } from "./activitynotificationtemplateresponsedto.js"; import * as z from "zod"; @@ -39,76 +39,105 @@ export type ActivityNotificationResponseDto = { organizationId: string; channels?: ActivityNotificationResponseDtoChannels | undefined; createdAt?: string | undefined; - jobs?: Array | undefined; + jobs?: Array | undefined; subscriber?: ActivityNotificationSubscriberResponseDto | undefined; template?: ActivityNotificationTemplateResponseDto | undefined; transactionId: string; }; /** @internal */ +export const ActivityNotificationResponseDtoChannels$inboundSchema: z.ZodNativeEnum< + typeof ActivityNotificationResponseDtoChannels +> = z.nativeEnum(ActivityNotificationResponseDtoChannels); + +/** @internal */ +export const ActivityNotificationResponseDtoChannels$outboundSchema: z.ZodNativeEnum< + typeof ActivityNotificationResponseDtoChannels +> = ActivityNotificationResponseDtoChannels$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace ActivityNotificationResponseDtoChannels$ { - export const inboundSchema: z.ZodNativeEnum = - z.nativeEnum(ActivityNotificationResponseDtoChannels); - export const outboundSchema: z.ZodNativeEnum = - inboundSchema; + /** @deprecated use `ActivityNotificationResponseDtoChannels$inboundSchema` instead. */ + export const inboundSchema = ActivityNotificationResponseDtoChannels$inboundSchema; + /** @deprecated use `ActivityNotificationResponseDtoChannels$outboundSchema` instead. */ + export const outboundSchema = ActivityNotificationResponseDtoChannels$outboundSchema; } /** @internal */ -export namespace ActivityNotificationResponseDto$ { - export const inboundSchema: z.ZodType = - z - .object({ - _environmentId: z.string(), - _id: z.string().optional(), - _organizationId: z.string(), - channels: ActivityNotificationResponseDtoChannels$.inboundSchema.optional(), - createdAt: z.string().optional(), - jobs: z.array(ActivityNotificationJobResponseDto$.inboundSchema).optional(), - subscriber: ActivityNotificationSubscriberResponseDto$.inboundSchema.optional(), - template: ActivityNotificationTemplateResponseDto$.inboundSchema.optional(), - transactionId: z.string(), - }) - .transform((v) => { - return remap$(v, { - _environmentId: "environmentId", - _id: "id", - _organizationId: "organizationId", - }); - }); +export const ActivityNotificationResponseDto$inboundSchema: z.ZodType< + ActivityNotificationResponseDto, + z.ZodTypeDef, + unknown +> = z + .object({ + _environmentId: z.string(), + _id: z.string().optional(), + _organizationId: z.string(), + channels: ActivityNotificationResponseDtoChannels$inboundSchema.optional(), + createdAt: z.string().optional(), + jobs: z.array(z.string()).optional(), + subscriber: ActivityNotificationSubscriberResponseDto$inboundSchema.optional(), + template: ActivityNotificationTemplateResponseDto$inboundSchema.optional(), + transactionId: z.string(), + }) + .transform((v) => { + return remap$(v, { + _environmentId: "environmentId", + _id: "id", + _organizationId: "organizationId", + }); + }); - export type Outbound = { - _environmentId: string; - _id?: string | undefined; - _organizationId: string; - channels?: string | undefined; - createdAt?: string | undefined; - jobs?: Array | undefined; - subscriber?: ActivityNotificationSubscriberResponseDto$.Outbound | undefined; - template?: ActivityNotificationTemplateResponseDto$.Outbound | undefined; - transactionId: string; - }; +/** @internal */ +export type ActivityNotificationResponseDto$Outbound = { + _environmentId: string; + _id?: string | undefined; + _organizationId: string; + channels?: string | undefined; + createdAt?: string | undefined; + jobs?: Array | undefined; + subscriber?: ActivityNotificationSubscriberResponseDto$Outbound | undefined; + template?: ActivityNotificationTemplateResponseDto$Outbound | undefined; + transactionId: string; +}; - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - ActivityNotificationResponseDto - > = z - .object({ - environmentId: z.string(), - id: z.string().optional(), - organizationId: z.string(), - channels: ActivityNotificationResponseDtoChannels$.outboundSchema.optional(), - createdAt: z.string().optional(), - jobs: z.array(ActivityNotificationJobResponseDto$.outboundSchema).optional(), - subscriber: ActivityNotificationSubscriberResponseDto$.outboundSchema.optional(), - template: ActivityNotificationTemplateResponseDto$.outboundSchema.optional(), - transactionId: z.string(), - }) - .transform((v) => { - return remap$(v, { - environmentId: "_environmentId", - id: "_id", - organizationId: "_organizationId", - }); +/** @internal */ +export const ActivityNotificationResponseDto$outboundSchema: z.ZodType< + ActivityNotificationResponseDto$Outbound, + z.ZodTypeDef, + ActivityNotificationResponseDto +> = z + .object({ + environmentId: z.string(), + id: z.string().optional(), + organizationId: z.string(), + channels: ActivityNotificationResponseDtoChannels$outboundSchema.optional(), + createdAt: z.string().optional(), + jobs: z.array(z.string()).optional(), + subscriber: ActivityNotificationSubscriberResponseDto$outboundSchema.optional(), + template: ActivityNotificationTemplateResponseDto$outboundSchema.optional(), + transactionId: z.string(), + }) + .transform((v) => { + return remap$(v, { + environmentId: "_environmentId", + id: "_id", + organizationId: "_organizationId", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ActivityNotificationResponseDto$ { + /** @deprecated use `ActivityNotificationResponseDto$inboundSchema` instead. */ + export const inboundSchema = ActivityNotificationResponseDto$inboundSchema; + /** @deprecated use `ActivityNotificationResponseDto$outboundSchema` instead. */ + export const outboundSchema = ActivityNotificationResponseDto$outboundSchema; + /** @deprecated use `ActivityNotificationResponseDto$Outbound` instead. */ + export type Outbound = ActivityNotificationResponseDto$Outbound; } diff --git a/src/models/components/activitynotificationstepresponsedto.ts b/src/models/components/activitynotificationstepresponsedto.ts deleted file mode 100644 index ff12ec69..00000000 --- a/src/models/components/activitynotificationstepresponsedto.ts +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - */ - -import { remap as remap$ } from "../../lib/primitives.js"; -import { MessageTemplateDto, MessageTemplateDto$ } from "./messagetemplatedto.js"; -import { StepFilter, StepFilter$ } from "./stepfilter.js"; -import * as z from "zod"; - -export type ActivityNotificationStepResponseDto = { - id: string; - active: boolean; - filters: StepFilter; - template?: MessageTemplateDto | undefined; -}; - -/** @internal */ -export namespace ActivityNotificationStepResponseDto$ { - export const inboundSchema: z.ZodType< - ActivityNotificationStepResponseDto, - z.ZodTypeDef, - unknown - > = z - .object({ - _id: z.string(), - active: z.boolean(), - filters: StepFilter$.inboundSchema, - template: MessageTemplateDto$.inboundSchema.optional(), - }) - .transform((v) => { - return remap$(v, { - _id: "id", - }); - }); - - export type Outbound = { - _id: string; - active: boolean; - filters: StepFilter$.Outbound; - template?: MessageTemplateDto$.Outbound | undefined; - }; - - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - ActivityNotificationStepResponseDto - > = z - .object({ - id: z.string(), - active: z.boolean(), - filters: StepFilter$.outboundSchema, - template: MessageTemplateDto$.outboundSchema.optional(), - }) - .transform((v) => { - return remap$(v, { - id: "_id", - }); - }); -} diff --git a/src/models/components/activitynotificationsubscriberresponsedto.ts b/src/models/components/activitynotificationsubscriberresponsedto.ts index d1064dad..a99d798c 100644 --- a/src/models/components/activitynotificationsubscriberresponsedto.ts +++ b/src/models/components/activitynotificationsubscriberresponsedto.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; @@ -14,48 +14,61 @@ export type ActivityNotificationSubscriberResponseDto = { }; /** @internal */ -export namespace ActivityNotificationSubscriberResponseDto$ { - export const inboundSchema: z.ZodType< - ActivityNotificationSubscriberResponseDto, - z.ZodTypeDef, - unknown - > = z - .object({ - _id: z.string(), - email: z.string().optional(), - firstName: z.string().optional(), - lastName: z.string().optional(), - phone: z.string().optional(), - }) - .transform((v) => { - return remap$(v, { - _id: "id", - }); +export const ActivityNotificationSubscriberResponseDto$inboundSchema: z.ZodType< + ActivityNotificationSubscriberResponseDto, + z.ZodTypeDef, + unknown +> = z + .object({ + _id: z.string(), + email: z.string().optional(), + firstName: z.string().optional(), + lastName: z.string().optional(), + phone: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + _id: "id", }); + }); - export type Outbound = { - _id: string; - email?: string | undefined; - firstName?: string | undefined; - lastName?: string | undefined; - phone?: string | undefined; - }; +/** @internal */ +export type ActivityNotificationSubscriberResponseDto$Outbound = { + _id: string; + email?: string | undefined; + firstName?: string | undefined; + lastName?: string | undefined; + phone?: string | undefined; +}; - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - ActivityNotificationSubscriberResponseDto - > = z - .object({ - id: z.string(), - email: z.string().optional(), - firstName: z.string().optional(), - lastName: z.string().optional(), - phone: z.string().optional(), - }) - .transform((v) => { - return remap$(v, { - id: "_id", - }); +/** @internal */ +export const ActivityNotificationSubscriberResponseDto$outboundSchema: z.ZodType< + ActivityNotificationSubscriberResponseDto$Outbound, + z.ZodTypeDef, + ActivityNotificationSubscriberResponseDto +> = z + .object({ + id: z.string(), + email: z.string().optional(), + firstName: z.string().optional(), + lastName: z.string().optional(), + phone: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + id: "_id", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ActivityNotificationSubscriberResponseDto$ { + /** @deprecated use `ActivityNotificationSubscriberResponseDto$inboundSchema` instead. */ + export const inboundSchema = ActivityNotificationSubscriberResponseDto$inboundSchema; + /** @deprecated use `ActivityNotificationSubscriberResponseDto$outboundSchema` instead. */ + export const outboundSchema = ActivityNotificationSubscriberResponseDto$outboundSchema; + /** @deprecated use `ActivityNotificationSubscriberResponseDto$Outbound` instead. */ + export type Outbound = ActivityNotificationSubscriberResponseDto$Outbound; } diff --git a/src/models/components/activitynotificationtemplateresponsedto.ts b/src/models/components/activitynotificationtemplateresponsedto.ts index 81e786b7..7959bf59 100644 --- a/src/models/components/activitynotificationtemplateresponsedto.ts +++ b/src/models/components/activitynotificationtemplateresponsedto.ts @@ -1,54 +1,66 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; -import { NotificationTrigger, NotificationTrigger$ } from "./notificationtrigger.js"; import * as z from "zod"; export type ActivityNotificationTemplateResponseDto = { id?: string | undefined; name: string; - triggers: Array; + triggers: Array; }; /** @internal */ -export namespace ActivityNotificationTemplateResponseDto$ { - export const inboundSchema: z.ZodType< - ActivityNotificationTemplateResponseDto, - z.ZodTypeDef, - unknown - > = z - .object({ - _id: z.string().optional(), - name: z.string(), - triggers: z.array(NotificationTrigger$.inboundSchema), - }) - .transform((v) => { - return remap$(v, { - _id: "id", - }); +export const ActivityNotificationTemplateResponseDto$inboundSchema: z.ZodType< + ActivityNotificationTemplateResponseDto, + z.ZodTypeDef, + unknown +> = z + .object({ + _id: z.string().optional(), + name: z.string(), + triggers: z.array(z.string()), + }) + .transform((v) => { + return remap$(v, { + _id: "id", }); + }); - export type Outbound = { - _id?: string | undefined; - name: string; - triggers: Array; - }; +/** @internal */ +export type ActivityNotificationTemplateResponseDto$Outbound = { + _id?: string | undefined; + name: string; + triggers: Array; +}; - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - ActivityNotificationTemplateResponseDto - > = z - .object({ - id: z.string().optional(), - name: z.string(), - triggers: z.array(NotificationTrigger$.outboundSchema), - }) - .transform((v) => { - return remap$(v, { - id: "_id", - }); +/** @internal */ +export const ActivityNotificationTemplateResponseDto$outboundSchema: z.ZodType< + ActivityNotificationTemplateResponseDto$Outbound, + z.ZodTypeDef, + ActivityNotificationTemplateResponseDto +> = z + .object({ + id: z.string().optional(), + name: z.string(), + triggers: z.array(z.string()), + }) + .transform((v) => { + return remap$(v, { + id: "_id", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ActivityNotificationTemplateResponseDto$ { + /** @deprecated use `ActivityNotificationTemplateResponseDto$inboundSchema` instead. */ + export const inboundSchema = ActivityNotificationTemplateResponseDto$inboundSchema; + /** @deprecated use `ActivityNotificationTemplateResponseDto$outboundSchema` instead. */ + export const outboundSchema = ActivityNotificationTemplateResponseDto$outboundSchema; + /** @deprecated use `ActivityNotificationTemplateResponseDto$Outbound` instead. */ + export type Outbound = ActivityNotificationTemplateResponseDto$Outbound; } diff --git a/src/models/components/activitystatsresponsedto.ts b/src/models/components/activitystatsresponsedto.ts index 6da75252..a8138b40 100644 --- a/src/models/components/activitystatsresponsedto.ts +++ b/src/models/components/activitystatsresponsedto.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -10,21 +10,40 @@ export type ActivityStatsResponseDto = { }; /** @internal */ -export namespace ActivityStatsResponseDto$ { - export const inboundSchema: z.ZodType = - z.object({ - monthlySent: z.number(), - weeklySent: z.number(), - }); +export const ActivityStatsResponseDto$inboundSchema: z.ZodType< + ActivityStatsResponseDto, + z.ZodTypeDef, + unknown +> = z.object({ + monthlySent: z.number(), + weeklySent: z.number(), +}); - export type Outbound = { - monthlySent: number; - weeklySent: number; - }; +/** @internal */ +export type ActivityStatsResponseDto$Outbound = { + monthlySent: number; + weeklySent: number; +}; - export const outboundSchema: z.ZodType = - z.object({ - monthlySent: z.number(), - weeklySent: z.number(), - }); +/** @internal */ +export const ActivityStatsResponseDto$outboundSchema: z.ZodType< + ActivityStatsResponseDto$Outbound, + z.ZodTypeDef, + ActivityStatsResponseDto +> = z.object({ + monthlySent: z.number(), + weeklySent: z.number(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ActivityStatsResponseDto$ { + /** @deprecated use `ActivityStatsResponseDto$inboundSchema` instead. */ + export const inboundSchema = ActivityStatsResponseDto$inboundSchema; + /** @deprecated use `ActivityStatsResponseDto$outboundSchema` instead. */ + export const outboundSchema = ActivityStatsResponseDto$outboundSchema; + /** @deprecated use `ActivityStatsResponseDto$Outbound` instead. */ + export type Outbound = ActivityStatsResponseDto$Outbound; } diff --git a/src/models/components/addsubscribersrequestdto.ts b/src/models/components/addsubscribersrequestdto.ts index 3e2c925d..c87f8ecb 100644 --- a/src/models/components/addsubscribersrequestdto.ts +++ b/src/models/components/addsubscribersrequestdto.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -12,18 +12,37 @@ export type AddSubscribersRequestDto = { }; /** @internal */ -export namespace AddSubscribersRequestDto$ { - export const inboundSchema: z.ZodType = - z.object({ - subscribers: z.array(z.string()), - }); +export const AddSubscribersRequestDto$inboundSchema: z.ZodType< + AddSubscribersRequestDto, + z.ZodTypeDef, + unknown +> = z.object({ + subscribers: z.array(z.string()), +}); + +/** @internal */ +export type AddSubscribersRequestDto$Outbound = { + subscribers: Array; +}; - export type Outbound = { - subscribers: Array; - }; +/** @internal */ +export const AddSubscribersRequestDto$outboundSchema: z.ZodType< + AddSubscribersRequestDto$Outbound, + z.ZodTypeDef, + AddSubscribersRequestDto +> = z.object({ + subscribers: z.array(z.string()), +}); - export const outboundSchema: z.ZodType = - z.object({ - subscribers: z.array(z.string()), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace AddSubscribersRequestDto$ { + /** @deprecated use `AddSubscribersRequestDto$inboundSchema` instead. */ + export const inboundSchema = AddSubscribersRequestDto$inboundSchema; + /** @deprecated use `AddSubscribersRequestDto$outboundSchema` instead. */ + export const outboundSchema = AddSubscribersRequestDto$outboundSchema; + /** @deprecated use `AddSubscribersRequestDto$Outbound` instead. */ + export type Outbound = AddSubscribersRequestDto$Outbound; } diff --git a/src/models/components/apikey.ts b/src/models/components/apikey.ts index ab0a5325..2e6f7ce7 100644 --- a/src/models/components/apikey.ts +++ b/src/models/components/apikey.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; @@ -11,31 +11,44 @@ export type ApiKey = { }; /** @internal */ -export namespace ApiKey$ { - export const inboundSchema: z.ZodType = z - .object({ - _userId: z.string(), - key: z.string(), - }) - .transform((v) => { - return remap$(v, { - _userId: "userId", - }); +export const ApiKey$inboundSchema: z.ZodType = z + .object({ + _userId: z.string(), + key: z.string(), + }) + .transform((v) => { + return remap$(v, { + _userId: "userId", }); + }); - export type Outbound = { - _userId: string; - key: string; - }; +/** @internal */ +export type ApiKey$Outbound = { + _userId: string; + key: string; +}; - export const outboundSchema: z.ZodType = z - .object({ - userId: z.string(), - key: z.string(), - }) - .transform((v) => { - return remap$(v, { - userId: "_userId", - }); +/** @internal */ +export const ApiKey$outboundSchema: z.ZodType = z + .object({ + userId: z.string(), + key: z.string(), + }) + .transform((v) => { + return remap$(v, { + userId: "_userId", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ApiKey$ { + /** @deprecated use `ApiKey$inboundSchema` instead. */ + export const inboundSchema = ApiKey$inboundSchema; + /** @deprecated use `ApiKey$outboundSchema` instead. */ + export const outboundSchema = ApiKey$outboundSchema; + /** @deprecated use `ApiKey$Outbound` instead. */ + export type Outbound = ApiKey$Outbound; } diff --git a/src/models/components/bulkapplychangedto.ts b/src/models/components/bulkapplychangedto.ts index 373560bb..8efca721 100644 --- a/src/models/components/bulkapplychangedto.ts +++ b/src/models/components/bulkapplychangedto.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -9,16 +9,37 @@ export type BulkApplyChangeDto = { }; /** @internal */ -export namespace BulkApplyChangeDto$ { - export const inboundSchema: z.ZodType = z.object({ - changeIds: z.array(z.string()), - }); +export const BulkApplyChangeDto$inboundSchema: z.ZodType< + BulkApplyChangeDto, + z.ZodTypeDef, + unknown +> = z.object({ + changeIds: z.array(z.string()), +}); + +/** @internal */ +export type BulkApplyChangeDto$Outbound = { + changeIds: Array; +}; - export type Outbound = { - changeIds: Array; - }; +/** @internal */ +export const BulkApplyChangeDto$outboundSchema: z.ZodType< + BulkApplyChangeDto$Outbound, + z.ZodTypeDef, + BulkApplyChangeDto +> = z.object({ + changeIds: z.array(z.string()), +}); - export const outboundSchema: z.ZodType = z.object({ - changeIds: z.array(z.string()), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace BulkApplyChangeDto$ { + /** @deprecated use `BulkApplyChangeDto$inboundSchema` instead. */ + export const inboundSchema = BulkApplyChangeDto$inboundSchema; + /** @deprecated use `BulkApplyChangeDto$outboundSchema` instead. */ + export const outboundSchema = BulkApplyChangeDto$outboundSchema; + /** @deprecated use `BulkApplyChangeDto$Outbound` instead. */ + export type Outbound = BulkApplyChangeDto$Outbound; } diff --git a/src/models/components/bulksubscribercreatedto.ts b/src/models/components/bulksubscribercreatedto.ts index 35b6a699..e2e64fd6 100644 --- a/src/models/components/bulksubscribercreatedto.ts +++ b/src/models/components/bulksubscribercreatedto.ts @@ -1,30 +1,45 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { - CreateSubscriberRequestDto, - CreateSubscriberRequestDto$, -} from "./createsubscriberrequestdto.js"; import * as z from "zod"; export type BulkSubscriberCreateDto = { - subscribers: Array; + subscribers: Array; }; /** @internal */ -export namespace BulkSubscriberCreateDto$ { - export const inboundSchema: z.ZodType = - z.object({ - subscribers: z.array(CreateSubscriberRequestDto$.inboundSchema), - }); +export const BulkSubscriberCreateDto$inboundSchema: z.ZodType< + BulkSubscriberCreateDto, + z.ZodTypeDef, + unknown +> = z.object({ + subscribers: z.array(z.string()), +}); - export type Outbound = { - subscribers: Array; - }; +/** @internal */ +export type BulkSubscriberCreateDto$Outbound = { + subscribers: Array; +}; - export const outboundSchema: z.ZodType = - z.object({ - subscribers: z.array(CreateSubscriberRequestDto$.outboundSchema), - }); +/** @internal */ +export const BulkSubscriberCreateDto$outboundSchema: z.ZodType< + BulkSubscriberCreateDto$Outbound, + z.ZodTypeDef, + BulkSubscriberCreateDto +> = z.object({ + subscribers: z.array(z.string()), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace BulkSubscriberCreateDto$ { + /** @deprecated use `BulkSubscriberCreateDto$inboundSchema` instead. */ + export const inboundSchema = BulkSubscriberCreateDto$inboundSchema; + /** @deprecated use `BulkSubscriberCreateDto$outboundSchema` instead. */ + export const outboundSchema = BulkSubscriberCreateDto$outboundSchema; + /** @deprecated use `BulkSubscriberCreateDto$Outbound` instead. */ + export type Outbound = BulkSubscriberCreateDto$Outbound; } diff --git a/src/models/components/bulktriggereventdto.ts b/src/models/components/bulktriggereventdto.ts index f9bce7e6..5eb8fbdb 100644 --- a/src/models/components/bulktriggereventdto.ts +++ b/src/models/components/bulktriggereventdto.ts @@ -1,8 +1,13 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { TriggerEventRequestDto, TriggerEventRequestDto$ } from "./triggereventrequestdto.js"; +import { + TriggerEventRequestDto, + TriggerEventRequestDto$inboundSchema, + TriggerEventRequestDto$Outbound, + TriggerEventRequestDto$outboundSchema, +} from "./triggereventrequestdto.js"; import * as z from "zod"; export type BulkTriggerEventDto = { @@ -10,16 +15,37 @@ export type BulkTriggerEventDto = { }; /** @internal */ -export namespace BulkTriggerEventDto$ { - export const inboundSchema: z.ZodType = z.object({ - events: z.array(TriggerEventRequestDto$.inboundSchema), - }); +export const BulkTriggerEventDto$inboundSchema: z.ZodType< + BulkTriggerEventDto, + z.ZodTypeDef, + unknown +> = z.object({ + events: z.array(TriggerEventRequestDto$inboundSchema), +}); - export type Outbound = { - events: Array; - }; +/** @internal */ +export type BulkTriggerEventDto$Outbound = { + events: Array; +}; - export const outboundSchema: z.ZodType = z.object({ - events: z.array(TriggerEventRequestDto$.outboundSchema), - }); +/** @internal */ +export const BulkTriggerEventDto$outboundSchema: z.ZodType< + BulkTriggerEventDto$Outbound, + z.ZodTypeDef, + BulkTriggerEventDto +> = z.object({ + events: z.array(TriggerEventRequestDto$outboundSchema), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace BulkTriggerEventDto$ { + /** @deprecated use `BulkTriggerEventDto$inboundSchema` instead. */ + export const inboundSchema = BulkTriggerEventDto$inboundSchema; + /** @deprecated use `BulkTriggerEventDto$outboundSchema` instead. */ + export const outboundSchema = BulkTriggerEventDto$outboundSchema; + /** @deprecated use `BulkTriggerEventDto$Outbound` instead. */ + export type Outbound = BulkTriggerEventDto$Outbound; } diff --git a/src/models/components/changeresponsedto.ts b/src/models/components/changeresponsedto.ts index 25182713..476d3129 100644 --- a/src/models/components/changeresponsedto.ts +++ b/src/models/components/changeresponsedto.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; @@ -34,23 +34,47 @@ export type ChangeResponseDto = { }; /** @internal */ -export namespace Change$ { - export const inboundSchema: z.ZodType = z.object({}); +export const Change$inboundSchema: z.ZodType = z.object({}); + +/** @internal */ +export type Change$Outbound = {}; - export type Outbound = {}; +/** @internal */ +export const Change$outboundSchema: z.ZodType = z.object({}); - export const outboundSchema: z.ZodType = z.object({}); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Change$ { + /** @deprecated use `Change$inboundSchema` instead. */ + export const inboundSchema = Change$inboundSchema; + /** @deprecated use `Change$outboundSchema` instead. */ + export const outboundSchema = Change$outboundSchema; + /** @deprecated use `Change$Outbound` instead. */ + export type Outbound = Change$Outbound; } /** @internal */ +export const Type$inboundSchema: z.ZodNativeEnum = z.nativeEnum(Type); + +/** @internal */ +export const Type$outboundSchema: z.ZodNativeEnum = Type$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace Type$ { - export const inboundSchema: z.ZodNativeEnum = z.nativeEnum(Type); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; + /** @deprecated use `Type$inboundSchema` instead. */ + export const inboundSchema = Type$inboundSchema; + /** @deprecated use `Type$outboundSchema` instead. */ + export const outboundSchema = Type$outboundSchema; } /** @internal */ -export namespace ChangeResponseDto$ { - export const inboundSchema: z.ZodType = z +export const ChangeResponseDto$inboundSchema: z.ZodType = + z .object({ _creatorId: z.string(), _entityId: z.string(), @@ -58,10 +82,10 @@ export namespace ChangeResponseDto$ { _id: z.string().optional(), _organizationId: z.string(), _parentId: z.string().optional(), - change: z.lazy(() => Change$.inboundSchema), + change: z.lazy(() => Change$inboundSchema), createdAt: z.string(), enabled: z.boolean(), - type: Type$.inboundSchema, + type: Type$inboundSchema, }) .transform((v) => { return remap$(v, { @@ -74,40 +98,58 @@ export namespace ChangeResponseDto$ { }); }); - export type Outbound = { - _creatorId: string; - _entityId: string; - _environmentId: string; - _id?: string | undefined; - _organizationId: string; - _parentId?: string | undefined; - change: Change$.Outbound; - createdAt: string; - enabled: boolean; - type: string; - }; +/** @internal */ +export type ChangeResponseDto$Outbound = { + _creatorId: string; + _entityId: string; + _environmentId: string; + _id?: string | undefined; + _organizationId: string; + _parentId?: string | undefined; + change: Change$Outbound; + createdAt: string; + enabled: boolean; + type: string; +}; - export const outboundSchema: z.ZodType = z - .object({ - creatorId: z.string(), - entityId: z.string(), - environmentId: z.string(), - id: z.string().optional(), - organizationId: z.string(), - parentId: z.string().optional(), - change: z.lazy(() => Change$.outboundSchema), - createdAt: z.string(), - enabled: z.boolean(), - type: Type$.outboundSchema, - }) - .transform((v) => { - return remap$(v, { - creatorId: "_creatorId", - entityId: "_entityId", - environmentId: "_environmentId", - id: "_id", - organizationId: "_organizationId", - parentId: "_parentId", - }); +/** @internal */ +export const ChangeResponseDto$outboundSchema: z.ZodType< + ChangeResponseDto$Outbound, + z.ZodTypeDef, + ChangeResponseDto +> = z + .object({ + creatorId: z.string(), + entityId: z.string(), + environmentId: z.string(), + id: z.string().optional(), + organizationId: z.string(), + parentId: z.string().optional(), + change: z.lazy(() => Change$outboundSchema), + createdAt: z.string(), + enabled: z.boolean(), + type: Type$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + creatorId: "_creatorId", + entityId: "_entityId", + environmentId: "_environmentId", + id: "_id", + organizationId: "_organizationId", + parentId: "_parentId", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ChangeResponseDto$ { + /** @deprecated use `ChangeResponseDto$inboundSchema` instead. */ + export const inboundSchema = ChangeResponseDto$inboundSchema; + /** @deprecated use `ChangeResponseDto$outboundSchema` instead. */ + export const outboundSchema = ChangeResponseDto$outboundSchema; + /** @deprecated use `ChangeResponseDto$Outbound` instead. */ + export type Outbound = ChangeResponseDto$Outbound; } diff --git a/src/models/components/changesresponsedto.ts b/src/models/components/changesresponsedto.ts index 38fbd3db..11ad5212 100644 --- a/src/models/components/changesresponsedto.ts +++ b/src/models/components/changesresponsedto.ts @@ -1,37 +1,57 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { ChangeResponseDto, ChangeResponseDto$ } from "./changeresponsedto.js"; import * as z from "zod"; export type ChangesResponseDto = { - data: Array; + data: Array; page: number; pageSize: number; totalCount: number; }; /** @internal */ -export namespace ChangesResponseDto$ { - export const inboundSchema: z.ZodType = z.object({ - data: z.array(ChangeResponseDto$.inboundSchema), - page: z.number(), - pageSize: z.number(), - totalCount: z.number(), - }); +export const ChangesResponseDto$inboundSchema: z.ZodType< + ChangesResponseDto, + z.ZodTypeDef, + unknown +> = z.object({ + data: z.array(z.string()), + page: z.number(), + pageSize: z.number(), + totalCount: z.number(), +}); + +/** @internal */ +export type ChangesResponseDto$Outbound = { + data: Array; + page: number; + pageSize: number; + totalCount: number; +}; - export type Outbound = { - data: Array; - page: number; - pageSize: number; - totalCount: number; - }; +/** @internal */ +export const ChangesResponseDto$outboundSchema: z.ZodType< + ChangesResponseDto$Outbound, + z.ZodTypeDef, + ChangesResponseDto +> = z.object({ + data: z.array(z.string()), + page: z.number(), + pageSize: z.number(), + totalCount: z.number(), +}); - export const outboundSchema: z.ZodType = z.object({ - data: z.array(ChangeResponseDto$.outboundSchema), - page: z.number(), - pageSize: z.number(), - totalCount: z.number(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ChangesResponseDto$ { + /** @deprecated use `ChangesResponseDto$inboundSchema` instead. */ + export const inboundSchema = ChangesResponseDto$inboundSchema; + /** @deprecated use `ChangesResponseDto$outboundSchema` instead. */ + export const outboundSchema = ChangesResponseDto$outboundSchema; + /** @deprecated use `ChangesResponseDto$Outbound` instead. */ + export type Outbound = ChangesResponseDto$Outbound; } diff --git a/src/models/components/changeworkflowstatusrequestdto.ts b/src/models/components/changeworkflowstatusrequestdto.ts index 2e90ee64..a409444a 100644 --- a/src/models/components/changeworkflowstatusrequestdto.ts +++ b/src/models/components/changeworkflowstatusrequestdto.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -9,18 +9,37 @@ export type ChangeWorkflowStatusRequestDto = { }; /** @internal */ -export namespace ChangeWorkflowStatusRequestDto$ { - export const inboundSchema: z.ZodType = - z.object({ - active: z.boolean(), - }); +export const ChangeWorkflowStatusRequestDto$inboundSchema: z.ZodType< + ChangeWorkflowStatusRequestDto, + z.ZodTypeDef, + unknown +> = z.object({ + active: z.boolean(), +}); + +/** @internal */ +export type ChangeWorkflowStatusRequestDto$Outbound = { + active: boolean; +}; - export type Outbound = { - active: boolean; - }; +/** @internal */ +export const ChangeWorkflowStatusRequestDto$outboundSchema: z.ZodType< + ChangeWorkflowStatusRequestDto$Outbound, + z.ZodTypeDef, + ChangeWorkflowStatusRequestDto +> = z.object({ + active: z.boolean(), +}); - export const outboundSchema: z.ZodType = - z.object({ - active: z.boolean(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ChangeWorkflowStatusRequestDto$ { + /** @deprecated use `ChangeWorkflowStatusRequestDto$inboundSchema` instead. */ + export const inboundSchema = ChangeWorkflowStatusRequestDto$inboundSchema; + /** @deprecated use `ChangeWorkflowStatusRequestDto$outboundSchema` instead. */ + export const outboundSchema = ChangeWorkflowStatusRequestDto$outboundSchema; + /** @deprecated use `ChangeWorkflowStatusRequestDto$Outbound` instead. */ + export type Outbound = ChangeWorkflowStatusRequestDto$Outbound; } diff --git a/src/models/components/channelcredentials.ts b/src/models/components/channelcredentials.ts index 468f5e73..73e02177 100644 --- a/src/models/components/channelcredentials.ts +++ b/src/models/components/channelcredentials.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -40,37 +40,58 @@ export type ChannelCredentials = { }; /** @internal */ -export namespace ChannelCredentials$ { - export const inboundSchema: z.ZodType = z.object({ - alertUid: z.string().optional(), - channel: z.string().optional(), - deviceTokens: z.array(z.string()).optional(), - externalUrl: z.string().optional(), - imageUrl: z.string().optional(), - state: z.string().optional(), - title: z.string().optional(), - webhookUrl: z.string(), - }); +export const ChannelCredentials$inboundSchema: z.ZodType< + ChannelCredentials, + z.ZodTypeDef, + unknown +> = z.object({ + alertUid: z.string().optional(), + channel: z.string().optional(), + deviceTokens: z.array(z.string()).optional(), + externalUrl: z.string().optional(), + imageUrl: z.string().optional(), + state: z.string().optional(), + title: z.string().optional(), + webhookUrl: z.string(), +}); - export type Outbound = { - alertUid?: string | undefined; - channel?: string | undefined; - deviceTokens?: Array | undefined; - externalUrl?: string | undefined; - imageUrl?: string | undefined; - state?: string | undefined; - title?: string | undefined; - webhookUrl: string; - }; +/** @internal */ +export type ChannelCredentials$Outbound = { + alertUid?: string | undefined; + channel?: string | undefined; + deviceTokens?: Array | undefined; + externalUrl?: string | undefined; + imageUrl?: string | undefined; + state?: string | undefined; + title?: string | undefined; + webhookUrl: string; +}; - export const outboundSchema: z.ZodType = z.object({ - alertUid: z.string().optional(), - channel: z.string().optional(), - deviceTokens: z.array(z.string()).optional(), - externalUrl: z.string().optional(), - imageUrl: z.string().optional(), - state: z.string().optional(), - title: z.string().optional(), - webhookUrl: z.string(), - }); +/** @internal */ +export const ChannelCredentials$outboundSchema: z.ZodType< + ChannelCredentials$Outbound, + z.ZodTypeDef, + ChannelCredentials +> = z.object({ + alertUid: z.string().optional(), + channel: z.string().optional(), + deviceTokens: z.array(z.string()).optional(), + externalUrl: z.string().optional(), + imageUrl: z.string().optional(), + state: z.string().optional(), + title: z.string().optional(), + webhookUrl: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ChannelCredentials$ { + /** @deprecated use `ChannelCredentials$inboundSchema` instead. */ + export const inboundSchema = ChannelCredentials$inboundSchema; + /** @deprecated use `ChannelCredentials$outboundSchema` instead. */ + export const outboundSchema = ChannelCredentials$outboundSchema; + /** @deprecated use `ChannelCredentials$Outbound` instead. */ + export type Outbound = ChannelCredentials$Outbound; } diff --git a/src/models/components/channelcredentialsdto.ts b/src/models/components/channelcredentialsdto.ts deleted file mode 100644 index c3ca7102..00000000 --- a/src/models/components/channelcredentialsdto.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - */ - -import * as z from "zod"; - -export type ChannelCredentialsDto = { - deviceTokens?: Array | undefined; - webhookUrl?: string | undefined; -}; - -/** @internal */ -export namespace ChannelCredentialsDto$ { - export const inboundSchema: z.ZodType = z.object({ - deviceTokens: z.array(z.string()).optional(), - webhookUrl: z.string().optional(), - }); - - export type Outbound = { - deviceTokens?: Array | undefined; - webhookUrl?: string | undefined; - }; - - export const outboundSchema: z.ZodType = - z.object({ - deviceTokens: z.array(z.string()).optional(), - webhookUrl: z.string().optional(), - }); -} diff --git a/src/models/components/channelpreference.ts b/src/models/components/channelpreference.ts index b3a7fc60..0cc20cd0 100644 --- a/src/models/components/channelpreference.ts +++ b/src/models/components/channelpreference.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { ClosedEnum } from "../../types/enums.js"; @@ -32,26 +32,56 @@ export type ChannelPreference = { }; /** @internal */ +export const ChannelPreferenceType$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(ChannelPreferenceType); + +/** @internal */ +export const ChannelPreferenceType$outboundSchema: z.ZodNativeEnum = + ChannelPreferenceType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace ChannelPreferenceType$ { - export const inboundSchema: z.ZodNativeEnum = - z.nativeEnum(ChannelPreferenceType); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; + /** @deprecated use `ChannelPreferenceType$inboundSchema` instead. */ + export const inboundSchema = ChannelPreferenceType$inboundSchema; + /** @deprecated use `ChannelPreferenceType$outboundSchema` instead. */ + export const outboundSchema = ChannelPreferenceType$outboundSchema; } /** @internal */ -export namespace ChannelPreference$ { - export const inboundSchema: z.ZodType = z.object({ +export const ChannelPreference$inboundSchema: z.ZodType = + z.object({ enabled: z.boolean(), - type: ChannelPreferenceType$.inboundSchema, + type: ChannelPreferenceType$inboundSchema, }); - export type Outbound = { - enabled: boolean; - type: string; - }; +/** @internal */ +export type ChannelPreference$Outbound = { + enabled: boolean; + type: string; +}; + +/** @internal */ +export const ChannelPreference$outboundSchema: z.ZodType< + ChannelPreference$Outbound, + z.ZodTypeDef, + ChannelPreference +> = z.object({ + enabled: z.boolean(), + type: ChannelPreferenceType$outboundSchema, +}); - export const outboundSchema: z.ZodType = z.object({ - enabled: z.boolean(), - type: ChannelPreferenceType$.outboundSchema, - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ChannelPreference$ { + /** @deprecated use `ChannelPreference$inboundSchema` instead. */ + export const inboundSchema = ChannelPreference$inboundSchema; + /** @deprecated use `ChannelPreference$outboundSchema` instead. */ + export const outboundSchema = ChannelPreference$outboundSchema; + /** @deprecated use `ChannelPreference$Outbound` instead. */ + export type Outbound = ChannelPreference$Outbound; } diff --git a/src/models/components/channelsettings.ts b/src/models/components/channelsettings.ts index 372efece..3d30399b 100644 --- a/src/models/components/channelsettings.ts +++ b/src/models/components/channelsettings.ts @@ -1,39 +1,16 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; -import { ClosedEnum } from "../../types/enums.js"; -import { ChannelCredentials, ChannelCredentials$ } from "./channelcredentials.js"; +import { + ChannelCredentials, + ChannelCredentials$inboundSchema, + ChannelCredentials$Outbound, + ChannelCredentials$outboundSchema, +} from "./channelcredentials.js"; import * as z from "zod"; -/** - * The provider identifier for the credentials - */ -export const ChannelSettingsProviderId = { - Slack: "slack", - Discord: "discord", - Msteams: "msteams", - Mattermost: "mattermost", - Ryver: "ryver", - Zulip: "zulip", - GrafanaOnCall: "grafana-on-call", - Getstream: "getstream", - RocketChat: "rocket-chat", - WhatsappBusiness: "whatsapp-business", - Fcm: "fcm", - Apns: "apns", - Expo: "expo", - OneSignal: "one-signal", - Pushpad: "pushpad", - PushWebhook: "push-webhook", - PusherBeams: "pusher-beams", -} as const; -/** - * The provider identifier for the credentials - */ -export type ChannelSettingsProviderId = ClosedEnum; - export type ChannelSettings = { /** * Id of the integration that is used for this channel @@ -50,48 +27,58 @@ export type ChannelSettings = { /** * The provider identifier for the credentials */ - providerId: ChannelSettingsProviderId; + providerId: number; }; /** @internal */ -export namespace ChannelSettingsProviderId$ { - export const inboundSchema: z.ZodNativeEnum = - z.nativeEnum(ChannelSettingsProviderId); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; -} - -/** @internal */ -export namespace ChannelSettings$ { - export const inboundSchema: z.ZodType = z - .object({ - _integrationId: z.string(), - credentials: ChannelCredentials$.inboundSchema, - integrationIdentifier: z.string().optional(), - providerId: ChannelSettingsProviderId$.inboundSchema, - }) - .transform((v) => { - return remap$(v, { - _integrationId: "integrationId", - }); +export const ChannelSettings$inboundSchema: z.ZodType = z + .object({ + _integrationId: z.string(), + credentials: ChannelCredentials$inboundSchema, + integrationIdentifier: z.string().optional(), + providerId: z.number(), + }) + .transform((v) => { + return remap$(v, { + _integrationId: "integrationId", }); + }); - export type Outbound = { - _integrationId: string; - credentials: ChannelCredentials$.Outbound; - integrationIdentifier?: string | undefined; - providerId: string; - }; +/** @internal */ +export type ChannelSettings$Outbound = { + _integrationId: string; + credentials: ChannelCredentials$Outbound; + integrationIdentifier?: string | undefined; + providerId: number; +}; - export const outboundSchema: z.ZodType = z - .object({ - integrationId: z.string(), - credentials: ChannelCredentials$.outboundSchema, - integrationIdentifier: z.string().optional(), - providerId: ChannelSettingsProviderId$.outboundSchema, - }) - .transform((v) => { - return remap$(v, { - integrationId: "_integrationId", - }); +/** @internal */ +export const ChannelSettings$outboundSchema: z.ZodType< + ChannelSettings$Outbound, + z.ZodTypeDef, + ChannelSettings +> = z + .object({ + integrationId: z.string(), + credentials: ChannelCredentials$outboundSchema, + integrationIdentifier: z.string().optional(), + providerId: z.number(), + }) + .transform((v) => { + return remap$(v, { + integrationId: "_integrationId", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ChannelSettings$ { + /** @deprecated use `ChannelSettings$inboundSchema` instead. */ + export const inboundSchema = ChannelSettings$inboundSchema; + /** @deprecated use `ChannelSettings$outboundSchema` instead. */ + export const outboundSchema = ChannelSettings$outboundSchema; + /** @deprecated use `ChannelSettings$Outbound` instead. */ + export type Outbound = ChannelSettings$Outbound; } diff --git a/src/models/components/createfeedrequestdto.ts b/src/models/components/createfeedrequestdto.ts index 8cb175fa..ee24e86a 100644 --- a/src/models/components/createfeedrequestdto.ts +++ b/src/models/components/createfeedrequestdto.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -9,18 +9,37 @@ export type CreateFeedRequestDto = { }; /** @internal */ -export namespace CreateFeedRequestDto$ { - export const inboundSchema: z.ZodType = z.object({ - name: z.string(), - }); +export const CreateFeedRequestDto$inboundSchema: z.ZodType< + CreateFeedRequestDto, + z.ZodTypeDef, + unknown +> = z.object({ + name: z.string(), +}); + +/** @internal */ +export type CreateFeedRequestDto$Outbound = { + name: string; +}; - export type Outbound = { - name: string; - }; +/** @internal */ +export const CreateFeedRequestDto$outboundSchema: z.ZodType< + CreateFeedRequestDto$Outbound, + z.ZodTypeDef, + CreateFeedRequestDto +> = z.object({ + name: z.string(), +}); - export const outboundSchema: z.ZodType = z.object( - { - name: z.string(), - } - ); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateFeedRequestDto$ { + /** @deprecated use `CreateFeedRequestDto$inboundSchema` instead. */ + export const inboundSchema = CreateFeedRequestDto$inboundSchema; + /** @deprecated use `CreateFeedRequestDto$outboundSchema` instead. */ + export const outboundSchema = CreateFeedRequestDto$outboundSchema; + /** @deprecated use `CreateFeedRequestDto$Outbound` instead. */ + export type Outbound = CreateFeedRequestDto$Outbound; } diff --git a/src/models/components/createintegrationrequestdto.ts b/src/models/components/createintegrationrequestdto.ts index 246b3c2b..3d78633a 100644 --- a/src/models/components/createintegrationrequestdto.ts +++ b/src/models/components/createintegrationrequestdto.ts @@ -1,11 +1,21 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; import { ClosedEnum } from "../../types/enums.js"; -import { CredentialsDto, CredentialsDto$ } from "./credentialsdto.js"; -import { StepFilter, StepFilter$ } from "./stepfilter.js"; +import { + CredentialsDto, + CredentialsDto$inboundSchema, + CredentialsDto$Outbound, + CredentialsDto$outboundSchema, +} from "./credentialsdto.js"; +import { + StepFilter, + StepFilter$inboundSchema, + StepFilter$Outbound, + StepFilter$outboundSchema, +} from "./stepfilter.js"; import * as z from "zod"; export const Channel = { @@ -33,58 +43,90 @@ export type CreateIntegrationRequestDto = { }; /** @internal */ +export const Channel$inboundSchema: z.ZodNativeEnum = z.nativeEnum(Channel); + +/** @internal */ +export const Channel$outboundSchema: z.ZodNativeEnum = Channel$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace Channel$ { - export const inboundSchema: z.ZodNativeEnum = z.nativeEnum(Channel); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; + /** @deprecated use `Channel$inboundSchema` instead. */ + export const inboundSchema = Channel$inboundSchema; + /** @deprecated use `Channel$outboundSchema` instead. */ + export const outboundSchema = Channel$outboundSchema; } /** @internal */ -export namespace CreateIntegrationRequestDto$ { - export const inboundSchema: z.ZodType = z - .object({ - _environmentId: z.string().optional(), - active: z.boolean().optional(), - channel: Channel$.inboundSchema, - check: z.boolean().optional(), - conditions: z.array(StepFilter$.inboundSchema).optional(), - credentials: CredentialsDto$.inboundSchema.optional(), - identifier: z.string().optional(), - name: z.string().optional(), - providerId: z.string(), - }) - .transform((v) => { - return remap$(v, { - _environmentId: "environmentId", - }); +export const CreateIntegrationRequestDto$inboundSchema: z.ZodType< + CreateIntegrationRequestDto, + z.ZodTypeDef, + unknown +> = z + .object({ + _environmentId: z.string().optional(), + active: z.boolean().optional(), + channel: Channel$inboundSchema, + check: z.boolean().optional(), + conditions: z.array(StepFilter$inboundSchema).optional(), + credentials: CredentialsDto$inboundSchema.optional(), + identifier: z.string().optional(), + name: z.string().optional(), + providerId: z.string(), + }) + .transform((v) => { + return remap$(v, { + _environmentId: "environmentId", }); + }); - export type Outbound = { - _environmentId?: string | undefined; - active?: boolean | undefined; - channel: string; - check?: boolean | undefined; - conditions?: Array | undefined; - credentials?: CredentialsDto$.Outbound | undefined; - identifier?: string | undefined; - name?: string | undefined; - providerId: string; - }; +/** @internal */ +export type CreateIntegrationRequestDto$Outbound = { + _environmentId?: string | undefined; + active?: boolean | undefined; + channel: string; + check?: boolean | undefined; + conditions?: Array | undefined; + credentials?: CredentialsDto$Outbound | undefined; + identifier?: string | undefined; + name?: string | undefined; + providerId: string; +}; - export const outboundSchema: z.ZodType = z - .object({ - environmentId: z.string().optional(), - active: z.boolean().optional(), - channel: Channel$.outboundSchema, - check: z.boolean().optional(), - conditions: z.array(StepFilter$.outboundSchema).optional(), - credentials: CredentialsDto$.outboundSchema.optional(), - identifier: z.string().optional(), - name: z.string().optional(), - providerId: z.string(), - }) - .transform((v) => { - return remap$(v, { - environmentId: "_environmentId", - }); +/** @internal */ +export const CreateIntegrationRequestDto$outboundSchema: z.ZodType< + CreateIntegrationRequestDto$Outbound, + z.ZodTypeDef, + CreateIntegrationRequestDto +> = z + .object({ + environmentId: z.string().optional(), + active: z.boolean().optional(), + channel: Channel$outboundSchema, + check: z.boolean().optional(), + conditions: z.array(StepFilter$outboundSchema).optional(), + credentials: CredentialsDto$outboundSchema.optional(), + identifier: z.string().optional(), + name: z.string().optional(), + providerId: z.string(), + }) + .transform((v) => { + return remap$(v, { + environmentId: "_environmentId", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateIntegrationRequestDto$ { + /** @deprecated use `CreateIntegrationRequestDto$inboundSchema` instead. */ + export const inboundSchema = CreateIntegrationRequestDto$inboundSchema; + /** @deprecated use `CreateIntegrationRequestDto$outboundSchema` instead. */ + export const outboundSchema = CreateIntegrationRequestDto$outboundSchema; + /** @deprecated use `CreateIntegrationRequestDto$Outbound` instead. */ + export type Outbound = CreateIntegrationRequestDto$Outbound; } diff --git a/src/models/components/createlayoutresponsedto.ts b/src/models/components/createlayoutresponsedto.ts index 66d78d09..cc3e7f4f 100644 --- a/src/models/components/createlayoutresponsedto.ts +++ b/src/models/components/createlayoutresponsedto.ts @@ -1,37 +1,61 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; import * as z from "zod"; export type CreateLayoutResponseDto = { + /** + * The unique identifier for the Layout created. + */ id: string; }; /** @internal */ -export namespace CreateLayoutResponseDto$ { - export const inboundSchema: z.ZodType = z - .object({ - _id: z.string(), - }) - .transform((v) => { - return remap$(v, { - _id: "id", - }); +export const CreateLayoutResponseDto$inboundSchema: z.ZodType< + CreateLayoutResponseDto, + z.ZodTypeDef, + unknown +> = z + .object({ + _id: z.string(), + }) + .transform((v) => { + return remap$(v, { + _id: "id", }); + }); - export type Outbound = { - _id: string; - }; +/** @internal */ +export type CreateLayoutResponseDto$Outbound = { + _id: string; +}; - export const outboundSchema: z.ZodType = z - .object({ - id: z.string(), - }) - .transform((v) => { - return remap$(v, { - id: "_id", - }); +/** @internal */ +export const CreateLayoutResponseDto$outboundSchema: z.ZodType< + CreateLayoutResponseDto$Outbound, + z.ZodTypeDef, + CreateLayoutResponseDto +> = z + .object({ + id: z.string(), + }) + .transform((v) => { + return remap$(v, { + id: "_id", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateLayoutResponseDto$ { + /** @deprecated use `CreateLayoutResponseDto$inboundSchema` instead. */ + export const inboundSchema = CreateLayoutResponseDto$inboundSchema; + /** @deprecated use `CreateLayoutResponseDto$outboundSchema` instead. */ + export const outboundSchema = CreateLayoutResponseDto$outboundSchema; + /** @deprecated use `CreateLayoutResponseDto$Outbound` instead. */ + export type Outbound = CreateLayoutResponseDto$Outbound; } diff --git a/src/models/components/createnotificationgrouprequestdto.ts b/src/models/components/createnotificationgrouprequestdto.ts index b8f59cad..5950429d 100644 --- a/src/models/components/createnotificationgrouprequestdto.ts +++ b/src/models/components/createnotificationgrouprequestdto.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -9,24 +9,37 @@ export type CreateNotificationGroupRequestDto = { }; /** @internal */ -export namespace CreateNotificationGroupRequestDto$ { - export const inboundSchema: z.ZodType< - CreateNotificationGroupRequestDto, - z.ZodTypeDef, - unknown - > = z.object({ - name: z.string(), - }); +export const CreateNotificationGroupRequestDto$inboundSchema: z.ZodType< + CreateNotificationGroupRequestDto, + z.ZodTypeDef, + unknown +> = z.object({ + name: z.string(), +}); + +/** @internal */ +export type CreateNotificationGroupRequestDto$Outbound = { + name: string; +}; - export type Outbound = { - name: string; - }; +/** @internal */ +export const CreateNotificationGroupRequestDto$outboundSchema: z.ZodType< + CreateNotificationGroupRequestDto$Outbound, + z.ZodTypeDef, + CreateNotificationGroupRequestDto +> = z.object({ + name: z.string(), +}); - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - CreateNotificationGroupRequestDto - > = z.object({ - name: z.string(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateNotificationGroupRequestDto$ { + /** @deprecated use `CreateNotificationGroupRequestDto$inboundSchema` instead. */ + export const inboundSchema = CreateNotificationGroupRequestDto$inboundSchema; + /** @deprecated use `CreateNotificationGroupRequestDto$outboundSchema` instead. */ + export const outboundSchema = CreateNotificationGroupRequestDto$outboundSchema; + /** @deprecated use `CreateNotificationGroupRequestDto$Outbound` instead. */ + export type Outbound = CreateNotificationGroupRequestDto$Outbound; } diff --git a/src/models/components/createorganizationdto.ts b/src/models/components/createorganizationdto.ts deleted file mode 100644 index ce9b4499..00000000 --- a/src/models/components/createorganizationdto.ts +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - */ - -import { ClosedEnum } from "../../types/enums.js"; -import * as z from "zod"; - -export const JobTitle = { - Engineer: "engineer", - EngineeringManager: "engineering_manager", - Architect: "architect", - ProductManager: "product_manager", - Designer: "designer", - CxoFounder: "cxo_founder", - MarketingManager: "marketing_manager", - Other: "other", -} as const; -export type JobTitle = ClosedEnum; - -export type ProductUseCases = {}; - -export type CreateOrganizationDto = { - domain?: string | undefined; - jobTitle?: JobTitle | undefined; - logo?: string | undefined; - name: string; - productUseCases?: ProductUseCases | undefined; -}; - -/** @internal */ -export namespace JobTitle$ { - export const inboundSchema: z.ZodNativeEnum = z.nativeEnum(JobTitle); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; -} - -/** @internal */ -export namespace ProductUseCases$ { - export const inboundSchema: z.ZodType = z.object({}); - - export type Outbound = {}; - - export const outboundSchema: z.ZodType = z.object({}); -} - -/** @internal */ -export namespace CreateOrganizationDto$ { - export const inboundSchema: z.ZodType = z.object({ - domain: z.string().optional(), - jobTitle: JobTitle$.inboundSchema.optional(), - logo: z.string().optional(), - name: z.string(), - productUseCases: z.lazy(() => ProductUseCases$.inboundSchema).optional(), - }); - - export type Outbound = { - domain?: string | undefined; - jobTitle?: string | undefined; - logo?: string | undefined; - name: string; - productUseCases?: ProductUseCases$.Outbound | undefined; - }; - - export const outboundSchema: z.ZodType = - z.object({ - domain: z.string().optional(), - jobTitle: JobTitle$.outboundSchema.optional(), - logo: z.string().optional(), - name: z.string(), - productUseCases: z.lazy(() => ProductUseCases$.outboundSchema).optional(), - }); -} diff --git a/src/models/components/createsubscriberrequestdto.ts b/src/models/components/createsubscriberrequestdto.ts index fee23f7c..1f492d13 100644 --- a/src/models/components/createsubscriberrequestdto.ts +++ b/src/models/components/createsubscriberrequestdto.ts @@ -1,8 +1,7 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SubscriberChannelDto, SubscriberChannelDto$ } from "./subscriberchanneldto.js"; import * as z from "zod"; export type Data = {}; @@ -12,7 +11,7 @@ export type CreateSubscriberRequestDto = { * An http url to the profile image of your subscriber */ avatar?: string | undefined; - channels?: Array | undefined; + channels?: Array | undefined; data?: Data | undefined; email?: string | undefined; firstName?: string | undefined; @@ -26,51 +25,83 @@ export type CreateSubscriberRequestDto = { }; /** @internal */ -export namespace Data$ { - export const inboundSchema: z.ZodType = z.object({}); +export const Data$inboundSchema: z.ZodType = z.object({}); - export type Outbound = {}; +/** @internal */ +export type Data$Outbound = {}; - export const outboundSchema: z.ZodType = z.object({}); +/** @internal */ +export const Data$outboundSchema: z.ZodType = z.object({}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Data$ { + /** @deprecated use `Data$inboundSchema` instead. */ + export const inboundSchema = Data$inboundSchema; + /** @deprecated use `Data$outboundSchema` instead. */ + export const outboundSchema = Data$outboundSchema; + /** @deprecated use `Data$Outbound` instead. */ + export type Outbound = Data$Outbound; } /** @internal */ -export namespace CreateSubscriberRequestDto$ { - export const inboundSchema: z.ZodType = - z.object({ - avatar: z.string().optional(), - channels: z.array(SubscriberChannelDto$.inboundSchema).optional(), - data: z.lazy(() => Data$.inboundSchema).optional(), - email: z.string().optional(), - firstName: z.string().optional(), - lastName: z.string().optional(), - locale: z.string().optional(), - phone: z.string().optional(), - subscriberId: z.string(), - }); +export const CreateSubscriberRequestDto$inboundSchema: z.ZodType< + CreateSubscriberRequestDto, + z.ZodTypeDef, + unknown +> = z.object({ + avatar: z.string().optional(), + channels: z.array(z.string()).optional(), + data: z.lazy(() => Data$inboundSchema).optional(), + email: z.string().optional(), + firstName: z.string().optional(), + lastName: z.string().optional(), + locale: z.string().optional(), + phone: z.string().optional(), + subscriberId: z.string(), +}); + +/** @internal */ +export type CreateSubscriberRequestDto$Outbound = { + avatar?: string | undefined; + channels?: Array | undefined; + data?: Data$Outbound | undefined; + email?: string | undefined; + firstName?: string | undefined; + lastName?: string | undefined; + locale?: string | undefined; + phone?: string | undefined; + subscriberId: string; +}; - export type Outbound = { - avatar?: string | undefined; - channels?: Array | undefined; - data?: Data$.Outbound | undefined; - email?: string | undefined; - firstName?: string | undefined; - lastName?: string | undefined; - locale?: string | undefined; - phone?: string | undefined; - subscriberId: string; - }; +/** @internal */ +export const CreateSubscriberRequestDto$outboundSchema: z.ZodType< + CreateSubscriberRequestDto$Outbound, + z.ZodTypeDef, + CreateSubscriberRequestDto +> = z.object({ + avatar: z.string().optional(), + channels: z.array(z.string()).optional(), + data: z.lazy(() => Data$outboundSchema).optional(), + email: z.string().optional(), + firstName: z.string().optional(), + lastName: z.string().optional(), + locale: z.string().optional(), + phone: z.string().optional(), + subscriberId: z.string(), +}); - export const outboundSchema: z.ZodType = - z.object({ - avatar: z.string().optional(), - channels: z.array(SubscriberChannelDto$.outboundSchema).optional(), - data: z.lazy(() => Data$.outboundSchema).optional(), - email: z.string().optional(), - firstName: z.string().optional(), - lastName: z.string().optional(), - locale: z.string().optional(), - phone: z.string().optional(), - subscriberId: z.string(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateSubscriberRequestDto$ { + /** @deprecated use `CreateSubscriberRequestDto$inboundSchema` instead. */ + export const inboundSchema = CreateSubscriberRequestDto$inboundSchema; + /** @deprecated use `CreateSubscriberRequestDto$outboundSchema` instead. */ + export const outboundSchema = CreateSubscriberRequestDto$outboundSchema; + /** @deprecated use `CreateSubscriberRequestDto$Outbound` instead. */ + export type Outbound = CreateSubscriberRequestDto$Outbound; } diff --git a/src/models/components/createtenantrequestdto.ts b/src/models/components/createtenantrequestdto.ts index b9b40ea4..91735ea8 100644 --- a/src/models/components/createtenantrequestdto.ts +++ b/src/models/components/createtenantrequestdto.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -13,36 +13,73 @@ export type CreateTenantRequestDto = { }; /** @internal */ -export namespace CreateTenantRequestDtoData$ { - export const inboundSchema: z.ZodType = - z.object({}); +export const CreateTenantRequestDtoData$inboundSchema: z.ZodType< + CreateTenantRequestDtoData, + z.ZodTypeDef, + unknown +> = z.object({}); + +/** @internal */ +export type CreateTenantRequestDtoData$Outbound = {}; - export type Outbound = {}; +/** @internal */ +export const CreateTenantRequestDtoData$outboundSchema: z.ZodType< + CreateTenantRequestDtoData$Outbound, + z.ZodTypeDef, + CreateTenantRequestDtoData +> = z.object({}); - export const outboundSchema: z.ZodType = - z.object({}); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateTenantRequestDtoData$ { + /** @deprecated use `CreateTenantRequestDtoData$inboundSchema` instead. */ + export const inboundSchema = CreateTenantRequestDtoData$inboundSchema; + /** @deprecated use `CreateTenantRequestDtoData$outboundSchema` instead. */ + export const outboundSchema = CreateTenantRequestDtoData$outboundSchema; + /** @deprecated use `CreateTenantRequestDtoData$Outbound` instead. */ + export type Outbound = CreateTenantRequestDtoData$Outbound; } /** @internal */ +export const CreateTenantRequestDto$inboundSchema: z.ZodType< + CreateTenantRequestDto, + z.ZodTypeDef, + unknown +> = z.object({ + data: z.lazy(() => CreateTenantRequestDtoData$inboundSchema).optional(), + identifier: z.string(), + name: z.string(), +}); + +/** @internal */ +export type CreateTenantRequestDto$Outbound = { + data?: CreateTenantRequestDtoData$Outbound | undefined; + identifier: string; + name: string; +}; + +/** @internal */ +export const CreateTenantRequestDto$outboundSchema: z.ZodType< + CreateTenantRequestDto$Outbound, + z.ZodTypeDef, + CreateTenantRequestDto +> = z.object({ + data: z.lazy(() => CreateTenantRequestDtoData$outboundSchema).optional(), + identifier: z.string(), + name: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace CreateTenantRequestDto$ { - export const inboundSchema: z.ZodType = z.object( - { - data: z.lazy(() => CreateTenantRequestDtoData$.inboundSchema).optional(), - identifier: z.string(), - name: z.string(), - } - ); - - export type Outbound = { - data?: CreateTenantRequestDtoData$.Outbound | undefined; - identifier: string; - name: string; - }; - - export const outboundSchema: z.ZodType = - z.object({ - data: z.lazy(() => CreateTenantRequestDtoData$.outboundSchema).optional(), - identifier: z.string(), - name: z.string(), - }); + /** @deprecated use `CreateTenantRequestDto$inboundSchema` instead. */ + export const inboundSchema = CreateTenantRequestDto$inboundSchema; + /** @deprecated use `CreateTenantRequestDto$outboundSchema` instead. */ + export const outboundSchema = CreateTenantRequestDto$outboundSchema; + /** @deprecated use `CreateTenantRequestDto$Outbound` instead. */ + export type Outbound = CreateTenantRequestDto$Outbound; } diff --git a/src/models/components/createtenantresponsedto.ts b/src/models/components/createtenantresponsedto.ts index 6902ea65..24bf0f98 100644 --- a/src/models/components/createtenantresponsedto.ts +++ b/src/models/components/createtenantresponsedto.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; @@ -18,59 +18,99 @@ export type CreateTenantResponseDto = { }; /** @internal */ -export namespace CreateTenantResponseDtoData$ { - export const inboundSchema: z.ZodType = - z.object({}); +export const CreateTenantResponseDtoData$inboundSchema: z.ZodType< + CreateTenantResponseDtoData, + z.ZodTypeDef, + unknown +> = z.object({}); - export type Outbound = {}; +/** @internal */ +export type CreateTenantResponseDtoData$Outbound = {}; - export const outboundSchema: z.ZodType = - z.object({}); +/** @internal */ +export const CreateTenantResponseDtoData$outboundSchema: z.ZodType< + CreateTenantResponseDtoData$Outbound, + z.ZodTypeDef, + CreateTenantResponseDtoData +> = z.object({}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateTenantResponseDtoData$ { + /** @deprecated use `CreateTenantResponseDtoData$inboundSchema` instead. */ + export const inboundSchema = CreateTenantResponseDtoData$inboundSchema; + /** @deprecated use `CreateTenantResponseDtoData$outboundSchema` instead. */ + export const outboundSchema = CreateTenantResponseDtoData$outboundSchema; + /** @deprecated use `CreateTenantResponseDtoData$Outbound` instead. */ + export type Outbound = CreateTenantResponseDtoData$Outbound; } /** @internal */ -export namespace CreateTenantResponseDto$ { - export const inboundSchema: z.ZodType = z - .object({ - _environmentId: z.string(), - _id: z.string(), - createdAt: z.string(), - data: z.lazy(() => CreateTenantResponseDtoData$.inboundSchema).optional(), - identifier: z.string(), - name: z.string().optional(), - updatedAt: z.string(), - }) - .transform((v) => { - return remap$(v, { - _environmentId: "environmentId", - _id: "id", - }); +export const CreateTenantResponseDto$inboundSchema: z.ZodType< + CreateTenantResponseDto, + z.ZodTypeDef, + unknown +> = z + .object({ + _environmentId: z.string(), + _id: z.string(), + createdAt: z.string(), + data: z.lazy(() => CreateTenantResponseDtoData$inboundSchema).optional(), + identifier: z.string(), + name: z.string().optional(), + updatedAt: z.string(), + }) + .transform((v) => { + return remap$(v, { + _environmentId: "environmentId", + _id: "id", }); + }); - export type Outbound = { - _environmentId: string; - _id: string; - createdAt: string; - data?: CreateTenantResponseDtoData$.Outbound | undefined; - identifier: string; - name?: string | undefined; - updatedAt: string; - }; +/** @internal */ +export type CreateTenantResponseDto$Outbound = { + _environmentId: string; + _id: string; + createdAt: string; + data?: CreateTenantResponseDtoData$Outbound | undefined; + identifier: string; + name?: string | undefined; + updatedAt: string; +}; - export const outboundSchema: z.ZodType = z - .object({ - environmentId: z.string(), - id: z.string(), - createdAt: z.string(), - data: z.lazy(() => CreateTenantResponseDtoData$.outboundSchema).optional(), - identifier: z.string(), - name: z.string().optional(), - updatedAt: z.string(), - }) - .transform((v) => { - return remap$(v, { - environmentId: "_environmentId", - id: "_id", - }); +/** @internal */ +export const CreateTenantResponseDto$outboundSchema: z.ZodType< + CreateTenantResponseDto$Outbound, + z.ZodTypeDef, + CreateTenantResponseDto +> = z + .object({ + environmentId: z.string(), + id: z.string(), + createdAt: z.string(), + data: z.lazy(() => CreateTenantResponseDtoData$outboundSchema).optional(), + identifier: z.string(), + name: z.string().optional(), + updatedAt: z.string(), + }) + .transform((v) => { + return remap$(v, { + environmentId: "_environmentId", + id: "_id", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateTenantResponseDto$ { + /** @deprecated use `CreateTenantResponseDto$inboundSchema` instead. */ + export const inboundSchema = CreateTenantResponseDto$inboundSchema; + /** @deprecated use `CreateTenantResponseDto$outboundSchema` instead. */ + export const outboundSchema = CreateTenantResponseDto$outboundSchema; + /** @deprecated use `CreateTenantResponseDto$Outbound` instead. */ + export type Outbound = CreateTenantResponseDto$Outbound; } diff --git a/src/models/components/createtopicrequestdto.ts b/src/models/components/createtopicrequestdto.ts index 714d43bf..40dba06f 100644 --- a/src/models/components/createtopicrequestdto.ts +++ b/src/models/components/createtopicrequestdto.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -16,20 +16,40 @@ export type CreateTopicRequestDto = { }; /** @internal */ -export namespace CreateTopicRequestDto$ { - export const inboundSchema: z.ZodType = z.object({ - key: z.string(), - name: z.string(), - }); +export const CreateTopicRequestDto$inboundSchema: z.ZodType< + CreateTopicRequestDto, + z.ZodTypeDef, + unknown +> = z.object({ + key: z.string(), + name: z.string(), +}); - export type Outbound = { - key: string; - name: string; - }; +/** @internal */ +export type CreateTopicRequestDto$Outbound = { + key: string; + name: string; +}; - export const outboundSchema: z.ZodType = - z.object({ - key: z.string(), - name: z.string(), - }); +/** @internal */ +export const CreateTopicRequestDto$outboundSchema: z.ZodType< + CreateTopicRequestDto$Outbound, + z.ZodTypeDef, + CreateTopicRequestDto +> = z.object({ + key: z.string(), + name: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateTopicRequestDto$ { + /** @deprecated use `CreateTopicRequestDto$inboundSchema` instead. */ + export const inboundSchema = CreateTopicRequestDto$inboundSchema; + /** @deprecated use `CreateTopicRequestDto$outboundSchema` instead. */ + export const outboundSchema = CreateTopicRequestDto$outboundSchema; + /** @deprecated use `CreateTopicRequestDto$Outbound` instead. */ + export type Outbound = CreateTopicRequestDto$Outbound; } diff --git a/src/models/components/createtopicresponsedto.ts b/src/models/components/createtopicresponsedto.ts index e4348c60..b4725d0d 100644 --- a/src/models/components/createtopicresponsedto.ts +++ b/src/models/components/createtopicresponsedto.ts @@ -1,19 +1,68 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ +import { remap as remap$ } from "../../lib/primitives.js"; import * as z from "zod"; -export type CreateTopicResponseDto = {}; +export type CreateTopicResponseDto = { + /** + * The unique identifier for the Topic created. + */ + id?: string | undefined; + /** + * User defined custom key and provided by the user that will be an unique identifier for the Topic created. + */ + key: string; +}; /** @internal */ -export namespace CreateTopicResponseDto$ { - export const inboundSchema: z.ZodType = z.object( - {} - ); +export const CreateTopicResponseDto$inboundSchema: z.ZodType< + CreateTopicResponseDto, + z.ZodTypeDef, + unknown +> = z + .object({ + _id: z.string().optional(), + key: z.string(), + }) + .transform((v) => { + return remap$(v, { + _id: "id", + }); + }); + +/** @internal */ +export type CreateTopicResponseDto$Outbound = { + _id?: string | undefined; + key: string; +}; - export type Outbound = {}; +/** @internal */ +export const CreateTopicResponseDto$outboundSchema: z.ZodType< + CreateTopicResponseDto$Outbound, + z.ZodTypeDef, + CreateTopicResponseDto +> = z + .object({ + id: z.string().optional(), + key: z.string(), + }) + .transform((v) => { + return remap$(v, { + id: "_id", + }); + }); - export const outboundSchema: z.ZodType = - z.object({}); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateTopicResponseDto$ { + /** @deprecated use `CreateTopicResponseDto$inboundSchema` instead. */ + export const inboundSchema = CreateTopicResponseDto$inboundSchema; + /** @deprecated use `CreateTopicResponseDto$outboundSchema` instead. */ + export const outboundSchema = CreateTopicResponseDto$outboundSchema; + /** @deprecated use `CreateTopicResponseDto$Outbound` instead. */ + export type Outbound = CreateTopicResponseDto$Outbound; } diff --git a/src/models/components/createworkflowrequestdto.ts b/src/models/components/createworkflowrequestdto.ts index 45b30d5a..b45e9d4a 100644 --- a/src/models/components/createworkflowrequestdto.ts +++ b/src/models/components/createworkflowrequestdto.ts @@ -1,9 +1,19 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { NotificationStep, NotificationStep$ } from "./notificationstep.js"; -import { PreferenceChannels, PreferenceChannels$ } from "./preferencechannels.js"; +import { + NotificationStep, + NotificationStep$inboundSchema, + NotificationStep$Outbound, + NotificationStep$outboundSchema, +} from "./notificationstep.js"; +import { + PreferenceChannels, + PreferenceChannels$inboundSchema, + PreferenceChannels$Outbound, + PreferenceChannels$outboundSchema, +} from "./preferencechannels.js"; import * as z from "zod"; export type CreateWorkflowRequestDtoData = {}; @@ -29,83 +39,134 @@ export type CreateWorkflowRequestDto = { }; /** @internal */ -export namespace CreateWorkflowRequestDtoData$ { - export const inboundSchema: z.ZodType = - z.object({}); +export const CreateWorkflowRequestDtoData$inboundSchema: z.ZodType< + CreateWorkflowRequestDtoData, + z.ZodTypeDef, + unknown +> = z.object({}); + +/** @internal */ +export type CreateWorkflowRequestDtoData$Outbound = {}; - export type Outbound = {}; +/** @internal */ +export const CreateWorkflowRequestDtoData$outboundSchema: z.ZodType< + CreateWorkflowRequestDtoData$Outbound, + z.ZodTypeDef, + CreateWorkflowRequestDtoData +> = z.object({}); - export const outboundSchema: z.ZodType = - z.object({}); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateWorkflowRequestDtoData$ { + /** @deprecated use `CreateWorkflowRequestDtoData$inboundSchema` instead. */ + export const inboundSchema = CreateWorkflowRequestDtoData$inboundSchema; + /** @deprecated use `CreateWorkflowRequestDtoData$outboundSchema` instead. */ + export const outboundSchema = CreateWorkflowRequestDtoData$outboundSchema; + /** @deprecated use `CreateWorkflowRequestDtoData$Outbound` instead. */ + export type Outbound = CreateWorkflowRequestDtoData$Outbound; } /** @internal */ +export const CreateWorkflowRequestDtoNotificationGroup$inboundSchema: z.ZodType< + CreateWorkflowRequestDtoNotificationGroup, + z.ZodTypeDef, + unknown +> = z.object({}); + +/** @internal */ +export type CreateWorkflowRequestDtoNotificationGroup$Outbound = {}; + +/** @internal */ +export const CreateWorkflowRequestDtoNotificationGroup$outboundSchema: z.ZodType< + CreateWorkflowRequestDtoNotificationGroup$Outbound, + z.ZodTypeDef, + CreateWorkflowRequestDtoNotificationGroup +> = z.object({}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace CreateWorkflowRequestDtoNotificationGroup$ { - export const inboundSchema: z.ZodType< - CreateWorkflowRequestDtoNotificationGroup, - z.ZodTypeDef, - unknown - > = z.object({}); - - export type Outbound = {}; - - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - CreateWorkflowRequestDtoNotificationGroup - > = z.object({}); + /** @deprecated use `CreateWorkflowRequestDtoNotificationGroup$inboundSchema` instead. */ + export const inboundSchema = CreateWorkflowRequestDtoNotificationGroup$inboundSchema; + /** @deprecated use `CreateWorkflowRequestDtoNotificationGroup$outboundSchema` instead. */ + export const outboundSchema = CreateWorkflowRequestDtoNotificationGroup$outboundSchema; + /** @deprecated use `CreateWorkflowRequestDtoNotificationGroup$Outbound` instead. */ + export type Outbound = CreateWorkflowRequestDtoNotificationGroup$Outbound; } /** @internal */ +export const CreateWorkflowRequestDto$inboundSchema: z.ZodType< + CreateWorkflowRequestDto, + z.ZodTypeDef, + unknown +> = z.object({ + active: z.boolean().optional(), + blueprintId: z.string().optional(), + critical: z.boolean().optional(), + data: z.lazy(() => CreateWorkflowRequestDtoData$inboundSchema).optional(), + description: z.string().optional(), + draft: z.boolean().optional(), + name: z.string(), + notificationGroup: z + .lazy(() => CreateWorkflowRequestDtoNotificationGroup$inboundSchema) + .optional(), + notificationGroupId: z.string(), + preferenceSettings: PreferenceChannels$inboundSchema.optional(), + steps: z.array(NotificationStep$inboundSchema), + tags: z.array(z.string()).optional(), +}); + +/** @internal */ +export type CreateWorkflowRequestDto$Outbound = { + active?: boolean | undefined; + blueprintId?: string | undefined; + critical?: boolean | undefined; + data?: CreateWorkflowRequestDtoData$Outbound | undefined; + description?: string | undefined; + draft?: boolean | undefined; + name: string; + notificationGroup?: CreateWorkflowRequestDtoNotificationGroup$Outbound | undefined; + notificationGroupId: string; + preferenceSettings?: PreferenceChannels$Outbound | undefined; + steps: Array; + tags?: Array | undefined; +}; + +/** @internal */ +export const CreateWorkflowRequestDto$outboundSchema: z.ZodType< + CreateWorkflowRequestDto$Outbound, + z.ZodTypeDef, + CreateWorkflowRequestDto +> = z.object({ + active: z.boolean().optional(), + blueprintId: z.string().optional(), + critical: z.boolean().optional(), + data: z.lazy(() => CreateWorkflowRequestDtoData$outboundSchema).optional(), + description: z.string().optional(), + draft: z.boolean().optional(), + name: z.string(), + notificationGroup: z + .lazy(() => CreateWorkflowRequestDtoNotificationGroup$outboundSchema) + .optional(), + notificationGroupId: z.string(), + preferenceSettings: PreferenceChannels$outboundSchema.optional(), + steps: z.array(NotificationStep$outboundSchema), + tags: z.array(z.string()).optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace CreateWorkflowRequestDto$ { - export const inboundSchema: z.ZodType = - z.object({ - active: z.boolean().optional(), - blueprintId: z.string().optional(), - critical: z.boolean().optional(), - data: z.lazy(() => CreateWorkflowRequestDtoData$.inboundSchema).optional(), - description: z.string().optional(), - draft: z.boolean().optional(), - name: z.string(), - notificationGroup: z - .lazy(() => CreateWorkflowRequestDtoNotificationGroup$.inboundSchema) - .optional(), - notificationGroupId: z.string(), - preferenceSettings: PreferenceChannels$.inboundSchema.optional(), - steps: z.array(NotificationStep$.inboundSchema), - tags: z.array(z.string()).optional(), - }); - - export type Outbound = { - active?: boolean | undefined; - blueprintId?: string | undefined; - critical?: boolean | undefined; - data?: CreateWorkflowRequestDtoData$.Outbound | undefined; - description?: string | undefined; - draft?: boolean | undefined; - name: string; - notificationGroup?: CreateWorkflowRequestDtoNotificationGroup$.Outbound | undefined; - notificationGroupId: string; - preferenceSettings?: PreferenceChannels$.Outbound | undefined; - steps: Array; - tags?: Array | undefined; - }; - - export const outboundSchema: z.ZodType = - z.object({ - active: z.boolean().optional(), - blueprintId: z.string().optional(), - critical: z.boolean().optional(), - data: z.lazy(() => CreateWorkflowRequestDtoData$.outboundSchema).optional(), - description: z.string().optional(), - draft: z.boolean().optional(), - name: z.string(), - notificationGroup: z - .lazy(() => CreateWorkflowRequestDtoNotificationGroup$.outboundSchema) - .optional(), - notificationGroupId: z.string(), - preferenceSettings: PreferenceChannels$.outboundSchema.optional(), - steps: z.array(NotificationStep$.outboundSchema), - tags: z.array(z.string()).optional(), - }); + /** @deprecated use `CreateWorkflowRequestDto$inboundSchema` instead. */ + export const inboundSchema = CreateWorkflowRequestDto$inboundSchema; + /** @deprecated use `CreateWorkflowRequestDto$outboundSchema` instead. */ + export const outboundSchema = CreateWorkflowRequestDto$outboundSchema; + /** @deprecated use `CreateWorkflowRequestDto$Outbound` instead. */ + export type Outbound = CreateWorkflowRequestDto$Outbound; } diff --git a/src/models/components/credentialsdto.ts b/src/models/components/credentialsdto.ts index 96cf7739..ac29f788 100644 --- a/src/models/components/credentialsdto.ts +++ b/src/models/components/credentialsdto.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -7,6 +7,7 @@ import * as z from "zod"; export type TlsOptions = {}; export type CredentialsDto = { + accessKey?: string | undefined; accountSid?: string | undefined; alertUid?: string | undefined; apiKey?: string | undefined; @@ -51,17 +52,32 @@ export type CredentialsDto = { }; /** @internal */ -export namespace TlsOptions$ { - export const inboundSchema: z.ZodType = z.object({}); +export const TlsOptions$inboundSchema: z.ZodType = z.object({}); + +/** @internal */ +export type TlsOptions$Outbound = {}; - export type Outbound = {}; +/** @internal */ +export const TlsOptions$outboundSchema: z.ZodType = + z.object({}); - export const outboundSchema: z.ZodType = z.object({}); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace TlsOptions$ { + /** @deprecated use `TlsOptions$inboundSchema` instead. */ + export const inboundSchema = TlsOptions$inboundSchema; + /** @deprecated use `TlsOptions$outboundSchema` instead. */ + export const outboundSchema = TlsOptions$outboundSchema; + /** @deprecated use `TlsOptions$Outbound` instead. */ + export type Outbound = TlsOptions$Outbound; } /** @internal */ -export namespace CredentialsDto$ { - export const inboundSchema: z.ZodType = z.object({ +export const CredentialsDto$inboundSchema: z.ZodType = + z.object({ + accessKey: z.string().optional(), accountSid: z.string().optional(), alertUid: z.string().optional(), apiKey: z.string().optional(), @@ -99,97 +115,117 @@ export namespace CredentialsDto$ { serviceAccount: z.string().optional(), state: z.string().optional(), title: z.string().optional(), - tlsOptions: z.lazy(() => TlsOptions$.inboundSchema).optional(), + tlsOptions: z.lazy(() => TlsOptions$inboundSchema).optional(), token: z.string().optional(), user: z.string().optional(), webhookUrl: z.string().optional(), }); - export type Outbound = { - accountSid?: string | undefined; - alertUid?: string | undefined; - apiKey?: string | undefined; - apiKeyRequestHeader?: string | undefined; - apiToken?: string | undefined; - applicationId?: string | undefined; - authenticateByToken?: boolean | undefined; - authenticationTokenKey?: string | undefined; - baseUrl?: string | undefined; - channelId?: string | undefined; - clientId?: string | undefined; - datePath?: string | undefined; - domain?: string | undefined; - externalLink?: string | undefined; - from?: string | undefined; - hmac?: boolean | undefined; - host?: string | undefined; - idPath?: string | undefined; - ignoreTls?: boolean | undefined; - imageUrl?: string | undefined; - instanceId?: string | undefined; - ipPoolName?: string | undefined; - messageProfileId?: string | undefined; - password?: string | undefined; - phoneNumberIdentification?: string | undefined; - port?: string | undefined; - projectName?: string | undefined; - redirectUrl?: string | undefined; - region?: string | undefined; - requireTls?: boolean | undefined; - secretKey?: string | undefined; - secretKeyRequestHeader?: string | undefined; - secure?: boolean | undefined; - senderName?: string | undefined; - serviceAccount?: string | undefined; - state?: string | undefined; - title?: string | undefined; - tlsOptions?: TlsOptions$.Outbound | undefined; - token?: string | undefined; - user?: string | undefined; - webhookUrl?: string | undefined; - }; +/** @internal */ +export type CredentialsDto$Outbound = { + accessKey?: string | undefined; + accountSid?: string | undefined; + alertUid?: string | undefined; + apiKey?: string | undefined; + apiKeyRequestHeader?: string | undefined; + apiToken?: string | undefined; + applicationId?: string | undefined; + authenticateByToken?: boolean | undefined; + authenticationTokenKey?: string | undefined; + baseUrl?: string | undefined; + channelId?: string | undefined; + clientId?: string | undefined; + datePath?: string | undefined; + domain?: string | undefined; + externalLink?: string | undefined; + from?: string | undefined; + hmac?: boolean | undefined; + host?: string | undefined; + idPath?: string | undefined; + ignoreTls?: boolean | undefined; + imageUrl?: string | undefined; + instanceId?: string | undefined; + ipPoolName?: string | undefined; + messageProfileId?: string | undefined; + password?: string | undefined; + phoneNumberIdentification?: string | undefined; + port?: string | undefined; + projectName?: string | undefined; + redirectUrl?: string | undefined; + region?: string | undefined; + requireTls?: boolean | undefined; + secretKey?: string | undefined; + secretKeyRequestHeader?: string | undefined; + secure?: boolean | undefined; + senderName?: string | undefined; + serviceAccount?: string | undefined; + state?: string | undefined; + title?: string | undefined; + tlsOptions?: TlsOptions$Outbound | undefined; + token?: string | undefined; + user?: string | undefined; + webhookUrl?: string | undefined; +}; + +/** @internal */ +export const CredentialsDto$outboundSchema: z.ZodType< + CredentialsDto$Outbound, + z.ZodTypeDef, + CredentialsDto +> = z.object({ + accessKey: z.string().optional(), + accountSid: z.string().optional(), + alertUid: z.string().optional(), + apiKey: z.string().optional(), + apiKeyRequestHeader: z.string().optional(), + apiToken: z.string().optional(), + applicationId: z.string().optional(), + authenticateByToken: z.boolean().optional(), + authenticationTokenKey: z.string().optional(), + baseUrl: z.string().optional(), + channelId: z.string().optional(), + clientId: z.string().optional(), + datePath: z.string().optional(), + domain: z.string().optional(), + externalLink: z.string().optional(), + from: z.string().optional(), + hmac: z.boolean().optional(), + host: z.string().optional(), + idPath: z.string().optional(), + ignoreTls: z.boolean().optional(), + imageUrl: z.string().optional(), + instanceId: z.string().optional(), + ipPoolName: z.string().optional(), + messageProfileId: z.string().optional(), + password: z.string().optional(), + phoneNumberIdentification: z.string().optional(), + port: z.string().optional(), + projectName: z.string().optional(), + redirectUrl: z.string().optional(), + region: z.string().optional(), + requireTls: z.boolean().optional(), + secretKey: z.string().optional(), + secretKeyRequestHeader: z.string().optional(), + secure: z.boolean().optional(), + senderName: z.string().optional(), + serviceAccount: z.string().optional(), + state: z.string().optional(), + title: z.string().optional(), + tlsOptions: z.lazy(() => TlsOptions$outboundSchema).optional(), + token: z.string().optional(), + user: z.string().optional(), + webhookUrl: z.string().optional(), +}); - export const outboundSchema: z.ZodType = z.object({ - accountSid: z.string().optional(), - alertUid: z.string().optional(), - apiKey: z.string().optional(), - apiKeyRequestHeader: z.string().optional(), - apiToken: z.string().optional(), - applicationId: z.string().optional(), - authenticateByToken: z.boolean().optional(), - authenticationTokenKey: z.string().optional(), - baseUrl: z.string().optional(), - channelId: z.string().optional(), - clientId: z.string().optional(), - datePath: z.string().optional(), - domain: z.string().optional(), - externalLink: z.string().optional(), - from: z.string().optional(), - hmac: z.boolean().optional(), - host: z.string().optional(), - idPath: z.string().optional(), - ignoreTls: z.boolean().optional(), - imageUrl: z.string().optional(), - instanceId: z.string().optional(), - ipPoolName: z.string().optional(), - messageProfileId: z.string().optional(), - password: z.string().optional(), - phoneNumberIdentification: z.string().optional(), - port: z.string().optional(), - projectName: z.string().optional(), - redirectUrl: z.string().optional(), - region: z.string().optional(), - requireTls: z.boolean().optional(), - secretKey: z.string().optional(), - secretKeyRequestHeader: z.string().optional(), - secure: z.boolean().optional(), - senderName: z.string().optional(), - serviceAccount: z.string().optional(), - state: z.string().optional(), - title: z.string().optional(), - tlsOptions: z.lazy(() => TlsOptions$.outboundSchema).optional(), - token: z.string().optional(), - user: z.string().optional(), - webhookUrl: z.string().optional(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CredentialsDto$ { + /** @deprecated use `CredentialsDto$inboundSchema` instead. */ + export const inboundSchema = CredentialsDto$inboundSchema; + /** @deprecated use `CredentialsDto$outboundSchema` instead. */ + export const outboundSchema = CredentialsDto$outboundSchema; + /** @deprecated use `CredentialsDto$Outbound` instead. */ + export type Outbound = CredentialsDto$Outbound; } diff --git a/src/models/components/databooleandto.ts b/src/models/components/databooleandto.ts index f2fbd0ed..9218aa01 100644 --- a/src/models/components/databooleandto.ts +++ b/src/models/components/databooleandto.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -9,16 +9,34 @@ export type DataBooleanDto = { }; /** @internal */ -export namespace DataBooleanDto$ { - export const inboundSchema: z.ZodType = z.object({ +export const DataBooleanDto$inboundSchema: z.ZodType = + z.object({ data: z.boolean(), }); - export type Outbound = { - data: boolean; - }; +/** @internal */ +export type DataBooleanDto$Outbound = { + data: boolean; +}; - export const outboundSchema: z.ZodType = z.object({ - data: z.boolean(), - }); +/** @internal */ +export const DataBooleanDto$outboundSchema: z.ZodType< + DataBooleanDto$Outbound, + z.ZodTypeDef, + DataBooleanDto +> = z.object({ + data: z.boolean(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace DataBooleanDto$ { + /** @deprecated use `DataBooleanDto$inboundSchema` instead. */ + export const inboundSchema = DataBooleanDto$inboundSchema; + /** @deprecated use `DataBooleanDto$outboundSchema` instead. */ + export const outboundSchema = DataBooleanDto$outboundSchema; + /** @deprecated use `DataBooleanDto$Outbound` instead. */ + export type Outbound = DataBooleanDto$Outbound; } diff --git a/src/models/components/datanumberdto.ts b/src/models/components/datanumberdto.ts index 0f32160e..a43b399f 100644 --- a/src/models/components/datanumberdto.ts +++ b/src/models/components/datanumberdto.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -9,16 +9,34 @@ export type DataNumberDto = { }; /** @internal */ -export namespace DataNumberDto$ { - export const inboundSchema: z.ZodType = z.object({ +export const DataNumberDto$inboundSchema: z.ZodType = + z.object({ data: z.number(), }); - export type Outbound = { - data: number; - }; +/** @internal */ +export type DataNumberDto$Outbound = { + data: number; +}; - export const outboundSchema: z.ZodType = z.object({ - data: z.number(), - }); +/** @internal */ +export const DataNumberDto$outboundSchema: z.ZodType< + DataNumberDto$Outbound, + z.ZodTypeDef, + DataNumberDto +> = z.object({ + data: z.number(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace DataNumberDto$ { + /** @deprecated use `DataNumberDto$inboundSchema` instead. */ + export const inboundSchema = DataNumberDto$inboundSchema; + /** @deprecated use `DataNumberDto$outboundSchema` instead. */ + export const outboundSchema = DataNumberDto$outboundSchema; + /** @deprecated use `DataNumberDto$Outbound` instead. */ + export type Outbound = DataNumberDto$Outbound; } diff --git a/src/models/components/delayregularmetadata.ts b/src/models/components/delayregularmetadata.ts index ebf6e4ca..44c0f71b 100644 --- a/src/models/components/delayregularmetadata.ts +++ b/src/models/components/delayregularmetadata.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { ClosedEnum } from "../../types/enums.js"; @@ -27,37 +27,81 @@ export type DelayRegularMetadata = { }; /** @internal */ +export const DelayRegularMetadataType$inboundSchema: z.ZodNativeEnum< + typeof DelayRegularMetadataType +> = z.nativeEnum(DelayRegularMetadataType); + +/** @internal */ +export const DelayRegularMetadataType$outboundSchema: z.ZodNativeEnum< + typeof DelayRegularMetadataType +> = DelayRegularMetadataType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace DelayRegularMetadataType$ { - export const inboundSchema: z.ZodNativeEnum = - z.nativeEnum(DelayRegularMetadataType); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; + /** @deprecated use `DelayRegularMetadataType$inboundSchema` instead. */ + export const inboundSchema = DelayRegularMetadataType$inboundSchema; + /** @deprecated use `DelayRegularMetadataType$outboundSchema` instead. */ + export const outboundSchema = DelayRegularMetadataType$outboundSchema; } /** @internal */ +export const Unit$inboundSchema: z.ZodNativeEnum = z.nativeEnum(Unit); + +/** @internal */ +export const Unit$outboundSchema: z.ZodNativeEnum = Unit$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace Unit$ { - export const inboundSchema: z.ZodNativeEnum = z.nativeEnum(Unit); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; + /** @deprecated use `Unit$inboundSchema` instead. */ + export const inboundSchema = Unit$inboundSchema; + /** @deprecated use `Unit$outboundSchema` instead. */ + export const outboundSchema = Unit$outboundSchema; } /** @internal */ +export const DelayRegularMetadata$inboundSchema: z.ZodType< + DelayRegularMetadata, + z.ZodTypeDef, + unknown +> = z.object({ + amount: z.number().optional(), + type: DelayRegularMetadataType$inboundSchema, + unit: Unit$inboundSchema.optional(), +}); + +/** @internal */ +export type DelayRegularMetadata$Outbound = { + amount?: number | undefined; + type: string; + unit?: string | undefined; +}; + +/** @internal */ +export const DelayRegularMetadata$outboundSchema: z.ZodType< + DelayRegularMetadata$Outbound, + z.ZodTypeDef, + DelayRegularMetadata +> = z.object({ + amount: z.number().optional(), + type: DelayRegularMetadataType$outboundSchema, + unit: Unit$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace DelayRegularMetadata$ { - export const inboundSchema: z.ZodType = z.object({ - amount: z.number().optional(), - type: DelayRegularMetadataType$.inboundSchema, - unit: Unit$.inboundSchema.optional(), - }); - - export type Outbound = { - amount?: number | undefined; - type: string; - unit?: string | undefined; - }; - - export const outboundSchema: z.ZodType = z.object( - { - amount: z.number().optional(), - type: DelayRegularMetadataType$.outboundSchema, - unit: Unit$.outboundSchema.optional(), - } - ); + /** @deprecated use `DelayRegularMetadata$inboundSchema` instead. */ + export const inboundSchema = DelayRegularMetadata$inboundSchema; + /** @deprecated use `DelayRegularMetadata$outboundSchema` instead. */ + export const outboundSchema = DelayRegularMetadata$outboundSchema; + /** @deprecated use `DelayRegularMetadata$Outbound` instead. */ + export type Outbound = DelayRegularMetadata$Outbound; } diff --git a/src/models/components/delayscheduledmetadata.ts b/src/models/components/delayscheduledmetadata.ts index 01cfd9ac..c2e77e18 100644 --- a/src/models/components/delayscheduledmetadata.ts +++ b/src/models/components/delayscheduledmetadata.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { ClosedEnum } from "../../types/enums.js"; @@ -16,30 +16,61 @@ export type DelayScheduledMetadata = { }; /** @internal */ +export const DelayScheduledMetadataType$inboundSchema: z.ZodNativeEnum< + typeof DelayScheduledMetadataType +> = z.nativeEnum(DelayScheduledMetadataType); + +/** @internal */ +export const DelayScheduledMetadataType$outboundSchema: z.ZodNativeEnum< + typeof DelayScheduledMetadataType +> = DelayScheduledMetadataType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace DelayScheduledMetadataType$ { - export const inboundSchema: z.ZodNativeEnum = z.nativeEnum( - DelayScheduledMetadataType - ); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; + /** @deprecated use `DelayScheduledMetadataType$inboundSchema` instead. */ + export const inboundSchema = DelayScheduledMetadataType$inboundSchema; + /** @deprecated use `DelayScheduledMetadataType$outboundSchema` instead. */ + export const outboundSchema = DelayScheduledMetadataType$outboundSchema; } /** @internal */ +export const DelayScheduledMetadata$inboundSchema: z.ZodType< + DelayScheduledMetadata, + z.ZodTypeDef, + unknown +> = z.object({ + delayPath: z.string(), + type: DelayScheduledMetadataType$inboundSchema, +}); + +/** @internal */ +export type DelayScheduledMetadata$Outbound = { + delayPath: string; + type: string; +}; + +/** @internal */ +export const DelayScheduledMetadata$outboundSchema: z.ZodType< + DelayScheduledMetadata$Outbound, + z.ZodTypeDef, + DelayScheduledMetadata +> = z.object({ + delayPath: z.string(), + type: DelayScheduledMetadataType$outboundSchema, +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace DelayScheduledMetadata$ { - export const inboundSchema: z.ZodType = z.object( - { - delayPath: z.string(), - type: DelayScheduledMetadataType$.inboundSchema, - } - ); - - export type Outbound = { - delayPath: string; - type: string; - }; - - export const outboundSchema: z.ZodType = - z.object({ - delayPath: z.string(), - type: DelayScheduledMetadataType$.outboundSchema, - }); + /** @deprecated use `DelayScheduledMetadata$inboundSchema` instead. */ + export const inboundSchema = DelayScheduledMetadata$inboundSchema; + /** @deprecated use `DelayScheduledMetadata$outboundSchema` instead. */ + export const outboundSchema = DelayScheduledMetadata$outboundSchema; + /** @deprecated use `DelayScheduledMetadata$Outbound` instead. */ + export type Outbound = DelayScheduledMetadata$Outbound; } diff --git a/src/models/components/deletemessageresponsedto.ts b/src/models/components/deletemessageresponsedto.ts index 4c1b672b..1294bf97 100644 --- a/src/models/components/deletemessageresponsedto.ts +++ b/src/models/components/deletemessageresponsedto.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { ClosedEnum } from "../../types/enums.js"; @@ -8,13 +8,13 @@ import * as z from "zod"; /** * The status enum for the performed action */ -export const DeleteMessageResponseDtoStatus = { +export const Status = { Deleted: "deleted", } as const; /** * The status enum for the performed action */ -export type DeleteMessageResponseDtoStatus = ClosedEnum; +export type Status = ClosedEnum; export type DeleteMessageResponseDto = { /** @@ -24,33 +24,61 @@ export type DeleteMessageResponseDto = { /** * The status enum for the performed action */ - status: DeleteMessageResponseDtoStatus; + status: Status; }; /** @internal */ -export namespace DeleteMessageResponseDtoStatus$ { - export const inboundSchema: z.ZodNativeEnum = - z.nativeEnum(DeleteMessageResponseDtoStatus); - export const outboundSchema: z.ZodNativeEnum = - inboundSchema; +export const Status$inboundSchema: z.ZodNativeEnum = z.nativeEnum(Status); + +/** @internal */ +export const Status$outboundSchema: z.ZodNativeEnum = Status$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Status$ { + /** @deprecated use `Status$inboundSchema` instead. */ + export const inboundSchema = Status$inboundSchema; + /** @deprecated use `Status$outboundSchema` instead. */ + export const outboundSchema = Status$outboundSchema; } /** @internal */ +export const DeleteMessageResponseDto$inboundSchema: z.ZodType< + DeleteMessageResponseDto, + z.ZodTypeDef, + unknown +> = z.object({ + acknowledged: z.boolean(), + status: Status$inboundSchema, +}); + +/** @internal */ +export type DeleteMessageResponseDto$Outbound = { + acknowledged: boolean; + status: string; +}; + +/** @internal */ +export const DeleteMessageResponseDto$outboundSchema: z.ZodType< + DeleteMessageResponseDto$Outbound, + z.ZodTypeDef, + DeleteMessageResponseDto +> = z.object({ + acknowledged: z.boolean(), + status: Status$outboundSchema, +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace DeleteMessageResponseDto$ { - export const inboundSchema: z.ZodType = - z.object({ - acknowledged: z.boolean(), - status: DeleteMessageResponseDtoStatus$.inboundSchema, - }); - - export type Outbound = { - acknowledged: boolean; - status: string; - }; - - export const outboundSchema: z.ZodType = - z.object({ - acknowledged: z.boolean(), - status: DeleteMessageResponseDtoStatus$.outboundSchema, - }); + /** @deprecated use `DeleteMessageResponseDto$inboundSchema` instead. */ + export const inboundSchema = DeleteMessageResponseDto$inboundSchema; + /** @deprecated use `DeleteMessageResponseDto$outboundSchema` instead. */ + export const outboundSchema = DeleteMessageResponseDto$outboundSchema; + /** @deprecated use `DeleteMessageResponseDto$Outbound` instead. */ + export type Outbound = DeleteMessageResponseDto$Outbound; } diff --git a/src/models/components/deletenotificationgroupresponsedto.ts b/src/models/components/deletenotificationgroupresponsedto.ts index b6991086..303a95ca 100644 --- a/src/models/components/deletenotificationgroupresponsedto.ts +++ b/src/models/components/deletenotificationgroupresponsedto.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { ClosedEnum } from "../../types/enums.js"; @@ -30,35 +30,61 @@ export type DeleteNotificationGroupResponseDto = { }; /** @internal */ +export const DeleteNotificationGroupResponseDtoStatus$inboundSchema: z.ZodNativeEnum< + typeof DeleteNotificationGroupResponseDtoStatus +> = z.nativeEnum(DeleteNotificationGroupResponseDtoStatus); + +/** @internal */ +export const DeleteNotificationGroupResponseDtoStatus$outboundSchema: z.ZodNativeEnum< + typeof DeleteNotificationGroupResponseDtoStatus +> = DeleteNotificationGroupResponseDtoStatus$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace DeleteNotificationGroupResponseDtoStatus$ { - export const inboundSchema: z.ZodNativeEnum = - z.nativeEnum(DeleteNotificationGroupResponseDtoStatus); - export const outboundSchema: z.ZodNativeEnum = - inboundSchema; + /** @deprecated use `DeleteNotificationGroupResponseDtoStatus$inboundSchema` instead. */ + export const inboundSchema = DeleteNotificationGroupResponseDtoStatus$inboundSchema; + /** @deprecated use `DeleteNotificationGroupResponseDtoStatus$outboundSchema` instead. */ + export const outboundSchema = DeleteNotificationGroupResponseDtoStatus$outboundSchema; } /** @internal */ -export namespace DeleteNotificationGroupResponseDto$ { - export const inboundSchema: z.ZodType< - DeleteNotificationGroupResponseDto, - z.ZodTypeDef, - unknown - > = z.object({ - acknowledged: z.boolean(), - status: DeleteNotificationGroupResponseDtoStatus$.inboundSchema, - }); +export const DeleteNotificationGroupResponseDto$inboundSchema: z.ZodType< + DeleteNotificationGroupResponseDto, + z.ZodTypeDef, + unknown +> = z.object({ + acknowledged: z.boolean(), + status: DeleteNotificationGroupResponseDtoStatus$inboundSchema, +}); - export type Outbound = { - acknowledged: boolean; - status: string; - }; +/** @internal */ +export type DeleteNotificationGroupResponseDto$Outbound = { + acknowledged: boolean; + status: string; +}; + +/** @internal */ +export const DeleteNotificationGroupResponseDto$outboundSchema: z.ZodType< + DeleteNotificationGroupResponseDto$Outbound, + z.ZodTypeDef, + DeleteNotificationGroupResponseDto +> = z.object({ + acknowledged: z.boolean(), + status: DeleteNotificationGroupResponseDtoStatus$outboundSchema, +}); - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - DeleteNotificationGroupResponseDto - > = z.object({ - acknowledged: z.boolean(), - status: DeleteNotificationGroupResponseDtoStatus$.outboundSchema, - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace DeleteNotificationGroupResponseDto$ { + /** @deprecated use `DeleteNotificationGroupResponseDto$inboundSchema` instead. */ + export const inboundSchema = DeleteNotificationGroupResponseDto$inboundSchema; + /** @deprecated use `DeleteNotificationGroupResponseDto$outboundSchema` instead. */ + export const outboundSchema = DeleteNotificationGroupResponseDto$outboundSchema; + /** @deprecated use `DeleteNotificationGroupResponseDto$Outbound` instead. */ + export type Outbound = DeleteNotificationGroupResponseDto$Outbound; } diff --git a/src/models/components/deletesubscriberresponsedto.ts b/src/models/components/deletesubscriberresponsedto.ts index 8b9bd5cc..dfa6c12a 100644 --- a/src/models/components/deletesubscriberresponsedto.ts +++ b/src/models/components/deletesubscriberresponsedto.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { ClosedEnum } from "../../types/enums.js"; @@ -30,29 +30,61 @@ export type DeleteSubscriberResponseDto = { }; /** @internal */ +export const DeleteSubscriberResponseDtoStatus$inboundSchema: z.ZodNativeEnum< + typeof DeleteSubscriberResponseDtoStatus +> = z.nativeEnum(DeleteSubscriberResponseDtoStatus); + +/** @internal */ +export const DeleteSubscriberResponseDtoStatus$outboundSchema: z.ZodNativeEnum< + typeof DeleteSubscriberResponseDtoStatus +> = DeleteSubscriberResponseDtoStatus$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace DeleteSubscriberResponseDtoStatus$ { - export const inboundSchema: z.ZodNativeEnum = - z.nativeEnum(DeleteSubscriberResponseDtoStatus); - export const outboundSchema: z.ZodNativeEnum = - inboundSchema; + /** @deprecated use `DeleteSubscriberResponseDtoStatus$inboundSchema` instead. */ + export const inboundSchema = DeleteSubscriberResponseDtoStatus$inboundSchema; + /** @deprecated use `DeleteSubscriberResponseDtoStatus$outboundSchema` instead. */ + export const outboundSchema = DeleteSubscriberResponseDtoStatus$outboundSchema; } /** @internal */ +export const DeleteSubscriberResponseDto$inboundSchema: z.ZodType< + DeleteSubscriberResponseDto, + z.ZodTypeDef, + unknown +> = z.object({ + acknowledged: z.boolean(), + status: DeleteSubscriberResponseDtoStatus$inboundSchema, +}); + +/** @internal */ +export type DeleteSubscriberResponseDto$Outbound = { + acknowledged: boolean; + status: string; +}; + +/** @internal */ +export const DeleteSubscriberResponseDto$outboundSchema: z.ZodType< + DeleteSubscriberResponseDto$Outbound, + z.ZodTypeDef, + DeleteSubscriberResponseDto +> = z.object({ + acknowledged: z.boolean(), + status: DeleteSubscriberResponseDtoStatus$outboundSchema, +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace DeleteSubscriberResponseDto$ { - export const inboundSchema: z.ZodType = - z.object({ - acknowledged: z.boolean(), - status: DeleteSubscriberResponseDtoStatus$.inboundSchema, - }); - - export type Outbound = { - acknowledged: boolean; - status: string; - }; - - export const outboundSchema: z.ZodType = - z.object({ - acknowledged: z.boolean(), - status: DeleteSubscriberResponseDtoStatus$.outboundSchema, - }); + /** @deprecated use `DeleteSubscriberResponseDto$inboundSchema` instead. */ + export const inboundSchema = DeleteSubscriberResponseDto$inboundSchema; + /** @deprecated use `DeleteSubscriberResponseDto$outboundSchema` instead. */ + export const outboundSchema = DeleteSubscriberResponseDto$outboundSchema; + /** @deprecated use `DeleteSubscriberResponseDto$Outbound` instead. */ + export type Outbound = DeleteSubscriberResponseDto$Outbound; } diff --git a/src/models/components/digestregularmetadata.ts b/src/models/components/digestregularmetadata.ts index 3d0d492f..76f8d1d3 100644 --- a/src/models/components/digestregularmetadata.ts +++ b/src/models/components/digestregularmetadata.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { ClosedEnum } from "../../types/enums.js"; @@ -43,58 +43,119 @@ export type DigestRegularMetadata = { }; /** @internal */ +export const BackoffUnit$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(BackoffUnit); + +/** @internal */ +export const BackoffUnit$outboundSchema: z.ZodNativeEnum = + BackoffUnit$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace BackoffUnit$ { - export const inboundSchema: z.ZodNativeEnum = z.nativeEnum(BackoffUnit); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; + /** @deprecated use `BackoffUnit$inboundSchema` instead. */ + export const inboundSchema = BackoffUnit$inboundSchema; + /** @deprecated use `BackoffUnit$outboundSchema` instead. */ + export const outboundSchema = BackoffUnit$outboundSchema; } /** @internal */ +export const DigestRegularMetadataType$inboundSchema: z.ZodNativeEnum< + typeof DigestRegularMetadataType +> = z.nativeEnum(DigestRegularMetadataType); + +/** @internal */ +export const DigestRegularMetadataType$outboundSchema: z.ZodNativeEnum< + typeof DigestRegularMetadataType +> = DigestRegularMetadataType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace DigestRegularMetadataType$ { - export const inboundSchema: z.ZodNativeEnum = - z.nativeEnum(DigestRegularMetadataType); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; + /** @deprecated use `DigestRegularMetadataType$inboundSchema` instead. */ + export const inboundSchema = DigestRegularMetadataType$inboundSchema; + /** @deprecated use `DigestRegularMetadataType$outboundSchema` instead. */ + export const outboundSchema = DigestRegularMetadataType$outboundSchema; } /** @internal */ +export const DigestRegularMetadataUnit$inboundSchema: z.ZodNativeEnum< + typeof DigestRegularMetadataUnit +> = z.nativeEnum(DigestRegularMetadataUnit); + +/** @internal */ +export const DigestRegularMetadataUnit$outboundSchema: z.ZodNativeEnum< + typeof DigestRegularMetadataUnit +> = DigestRegularMetadataUnit$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace DigestRegularMetadataUnit$ { - export const inboundSchema: z.ZodNativeEnum = - z.nativeEnum(DigestRegularMetadataUnit); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; + /** @deprecated use `DigestRegularMetadataUnit$inboundSchema` instead. */ + export const inboundSchema = DigestRegularMetadataUnit$inboundSchema; + /** @deprecated use `DigestRegularMetadataUnit$outboundSchema` instead. */ + export const outboundSchema = DigestRegularMetadataUnit$outboundSchema; } /** @internal */ +export const DigestRegularMetadata$inboundSchema: z.ZodType< + DigestRegularMetadata, + z.ZodTypeDef, + unknown +> = z.object({ + amount: z.number().optional(), + backoff: z.boolean().optional(), + backoffAmount: z.number().optional(), + backoffUnit: BackoffUnit$inboundSchema.optional(), + digestKey: z.string().optional(), + type: DigestRegularMetadataType$inboundSchema, + unit: DigestRegularMetadataUnit$inboundSchema.optional(), + updateMode: z.boolean().optional(), +}); + +/** @internal */ +export type DigestRegularMetadata$Outbound = { + amount?: number | undefined; + backoff?: boolean | undefined; + backoffAmount?: number | undefined; + backoffUnit?: string | undefined; + digestKey?: string | undefined; + type: string; + unit?: string | undefined; + updateMode?: boolean | undefined; +}; + +/** @internal */ +export const DigestRegularMetadata$outboundSchema: z.ZodType< + DigestRegularMetadata$Outbound, + z.ZodTypeDef, + DigestRegularMetadata +> = z.object({ + amount: z.number().optional(), + backoff: z.boolean().optional(), + backoffAmount: z.number().optional(), + backoffUnit: BackoffUnit$outboundSchema.optional(), + digestKey: z.string().optional(), + type: DigestRegularMetadataType$outboundSchema, + unit: DigestRegularMetadataUnit$outboundSchema.optional(), + updateMode: z.boolean().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace DigestRegularMetadata$ { - export const inboundSchema: z.ZodType = z.object({ - amount: z.number().optional(), - backoff: z.boolean().optional(), - backoffAmount: z.number().optional(), - backoffUnit: BackoffUnit$.inboundSchema.optional(), - digestKey: z.string().optional(), - type: DigestRegularMetadataType$.inboundSchema, - unit: DigestRegularMetadataUnit$.inboundSchema.optional(), - updateMode: z.boolean().optional(), - }); - - export type Outbound = { - amount?: number | undefined; - backoff?: boolean | undefined; - backoffAmount?: number | undefined; - backoffUnit?: string | undefined; - digestKey?: string | undefined; - type: string; - unit?: string | undefined; - updateMode?: boolean | undefined; - }; - - export const outboundSchema: z.ZodType = - z.object({ - amount: z.number().optional(), - backoff: z.boolean().optional(), - backoffAmount: z.number().optional(), - backoffUnit: BackoffUnit$.outboundSchema.optional(), - digestKey: z.string().optional(), - type: DigestRegularMetadataType$.outboundSchema, - unit: DigestRegularMetadataUnit$.outboundSchema.optional(), - updateMode: z.boolean().optional(), - }); + /** @deprecated use `DigestRegularMetadata$inboundSchema` instead. */ + export const inboundSchema = DigestRegularMetadata$inboundSchema; + /** @deprecated use `DigestRegularMetadata$outboundSchema` instead. */ + export const outboundSchema = DigestRegularMetadata$outboundSchema; + /** @deprecated use `DigestRegularMetadata$Outbound` instead. */ + export type Outbound = DigestRegularMetadata$Outbound; } diff --git a/src/models/components/digesttimedmetadata.ts b/src/models/components/digesttimedmetadata.ts index 1b10ce75..85e03f2a 100644 --- a/src/models/components/digesttimedmetadata.ts +++ b/src/models/components/digesttimedmetadata.ts @@ -1,9 +1,14 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { ClosedEnum } from "../../types/enums.js"; -import { TimedConfig, TimedConfig$ } from "./timedconfig.js"; +import { + TimedConfig, + TimedConfig$inboundSchema, + TimedConfig$Outbound, + TimedConfig$outboundSchema, +} from "./timedconfig.js"; import * as z from "zod"; export const DigestTimedMetadataType = { @@ -30,42 +35,91 @@ export type DigestTimedMetadata = { }; /** @internal */ +export const DigestTimedMetadataType$inboundSchema: z.ZodNativeEnum< + typeof DigestTimedMetadataType +> = z.nativeEnum(DigestTimedMetadataType); + +/** @internal */ +export const DigestTimedMetadataType$outboundSchema: z.ZodNativeEnum< + typeof DigestTimedMetadataType +> = DigestTimedMetadataType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace DigestTimedMetadataType$ { - export const inboundSchema: z.ZodNativeEnum = - z.nativeEnum(DigestTimedMetadataType); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; + /** @deprecated use `DigestTimedMetadataType$inboundSchema` instead. */ + export const inboundSchema = DigestTimedMetadataType$inboundSchema; + /** @deprecated use `DigestTimedMetadataType$outboundSchema` instead. */ + export const outboundSchema = DigestTimedMetadataType$outboundSchema; } /** @internal */ +export const DigestTimedMetadataUnit$inboundSchema: z.ZodNativeEnum< + typeof DigestTimedMetadataUnit +> = z.nativeEnum(DigestTimedMetadataUnit); + +/** @internal */ +export const DigestTimedMetadataUnit$outboundSchema: z.ZodNativeEnum< + typeof DigestTimedMetadataUnit +> = DigestTimedMetadataUnit$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace DigestTimedMetadataUnit$ { - export const inboundSchema: z.ZodNativeEnum = - z.nativeEnum(DigestTimedMetadataUnit); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; + /** @deprecated use `DigestTimedMetadataUnit$inboundSchema` instead. */ + export const inboundSchema = DigestTimedMetadataUnit$inboundSchema; + /** @deprecated use `DigestTimedMetadataUnit$outboundSchema` instead. */ + export const outboundSchema = DigestTimedMetadataUnit$outboundSchema; } /** @internal */ -export namespace DigestTimedMetadata$ { - export const inboundSchema: z.ZodType = z.object({ - amount: z.number().optional(), - digestKey: z.string().optional(), - timed: TimedConfig$.inboundSchema.optional(), - type: DigestTimedMetadataType$.inboundSchema, - unit: DigestTimedMetadataUnit$.inboundSchema.optional(), - }); +export const DigestTimedMetadata$inboundSchema: z.ZodType< + DigestTimedMetadata, + z.ZodTypeDef, + unknown +> = z.object({ + amount: z.number().optional(), + digestKey: z.string().optional(), + timed: TimedConfig$inboundSchema.optional(), + type: DigestTimedMetadataType$inboundSchema, + unit: DigestTimedMetadataUnit$inboundSchema.optional(), +}); - export type Outbound = { - amount?: number | undefined; - digestKey?: string | undefined; - timed?: TimedConfig$.Outbound | undefined; - type: string; - unit?: string | undefined; - }; +/** @internal */ +export type DigestTimedMetadata$Outbound = { + amount?: number | undefined; + digestKey?: string | undefined; + timed?: TimedConfig$Outbound | undefined; + type: string; + unit?: string | undefined; +}; - export const outboundSchema: z.ZodType = z.object({ - amount: z.number().optional(), - digestKey: z.string().optional(), - timed: TimedConfig$.outboundSchema.optional(), - type: DigestTimedMetadataType$.outboundSchema, - unit: DigestTimedMetadataUnit$.outboundSchema.optional(), - }); +/** @internal */ +export const DigestTimedMetadata$outboundSchema: z.ZodType< + DigestTimedMetadata$Outbound, + z.ZodTypeDef, + DigestTimedMetadata +> = z.object({ + amount: z.number().optional(), + digestKey: z.string().optional(), + timed: TimedConfig$outboundSchema.optional(), + type: DigestTimedMetadataType$outboundSchema, + unit: DigestTimedMetadataUnit$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace DigestTimedMetadata$ { + /** @deprecated use `DigestTimedMetadata$inboundSchema` instead. */ + export const inboundSchema = DigestTimedMetadata$inboundSchema; + /** @deprecated use `DigestTimedMetadata$outboundSchema` instead. */ + export const outboundSchema = DigestTimedMetadata$outboundSchema; + /** @deprecated use `DigestTimedMetadata$Outbound` instead. */ + export type Outbound = DigestTimedMetadata$Outbound; } diff --git a/src/models/components/emailblock.ts b/src/models/components/emailblock.ts index e47a7d83..d500abd1 100644 --- a/src/models/components/emailblock.ts +++ b/src/models/components/emailblock.ts @@ -1,14 +1,19 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { ClosedEnum } from "../../types/enums.js"; -import { EmailBlockStyles, EmailBlockStyles$ } from "./emailblockstyles.js"; +import { + EmailBlockStyles, + EmailBlockStyles$inboundSchema, + EmailBlockStyles$Outbound, + EmailBlockStyles$outboundSchema, +} from "./emailblockstyles.js"; import * as z from "zod"; export const EmailBlockType = { - Text: "text", Button: "button", + Text: "text", } as const; export type EmailBlockType = ClosedEnum; @@ -20,32 +25,58 @@ export type EmailBlock = { }; /** @internal */ +export const EmailBlockType$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(EmailBlockType); + +/** @internal */ +export const EmailBlockType$outboundSchema: z.ZodNativeEnum = + EmailBlockType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace EmailBlockType$ { - export const inboundSchema: z.ZodNativeEnum = - z.nativeEnum(EmailBlockType); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; + /** @deprecated use `EmailBlockType$inboundSchema` instead. */ + export const inboundSchema = EmailBlockType$inboundSchema; + /** @deprecated use `EmailBlockType$outboundSchema` instead. */ + export const outboundSchema = EmailBlockType$outboundSchema; } /** @internal */ -export namespace EmailBlock$ { - export const inboundSchema: z.ZodType = z.object({ - content: z.string(), - styles: EmailBlockStyles$.inboundSchema.optional(), - type: EmailBlockType$.inboundSchema, - url: z.string().optional(), - }); +export const EmailBlock$inboundSchema: z.ZodType = z.object({ + content: z.string(), + styles: EmailBlockStyles$inboundSchema.optional(), + type: EmailBlockType$inboundSchema, + url: z.string().optional(), +}); - export type Outbound = { - content: string; - styles?: EmailBlockStyles$.Outbound | undefined; - type: string; - url?: string | undefined; - }; +/** @internal */ +export type EmailBlock$Outbound = { + content: string; + styles?: EmailBlockStyles$Outbound | undefined; + type: string; + url?: string | undefined; +}; - export const outboundSchema: z.ZodType = z.object({ +/** @internal */ +export const EmailBlock$outboundSchema: z.ZodType = + z.object({ content: z.string(), - styles: EmailBlockStyles$.outboundSchema.optional(), - type: EmailBlockType$.outboundSchema, + styles: EmailBlockStyles$outboundSchema.optional(), + type: EmailBlockType$outboundSchema, url: z.string().optional(), }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace EmailBlock$ { + /** @deprecated use `EmailBlock$inboundSchema` instead. */ + export const inboundSchema = EmailBlock$inboundSchema; + /** @deprecated use `EmailBlock$outboundSchema` instead. */ + export const outboundSchema = EmailBlock$outboundSchema; + /** @deprecated use `EmailBlock$Outbound` instead. */ + export type Outbound = EmailBlock$Outbound; } diff --git a/src/models/components/emailblockstyles.ts b/src/models/components/emailblockstyles.ts index 80beb217..5f23b4f4 100644 --- a/src/models/components/emailblockstyles.ts +++ b/src/models/components/emailblockstyles.ts @@ -1,38 +1,67 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { ClosedEnum } from "../../types/enums.js"; import * as z from "zod"; export const TextAlign = { + Center: "center", Left: "left", Right: "right", - Center: "center", } as const; export type TextAlign = ClosedEnum; export type EmailBlockStyles = { - textAlign?: TextAlign | undefined; + textAlign: TextAlign; }; /** @internal */ +export const TextAlign$inboundSchema: z.ZodNativeEnum = z.nativeEnum(TextAlign); + +/** @internal */ +export const TextAlign$outboundSchema: z.ZodNativeEnum = TextAlign$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace TextAlign$ { - export const inboundSchema: z.ZodNativeEnum = z.nativeEnum(TextAlign); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; + /** @deprecated use `TextAlign$inboundSchema` instead. */ + export const inboundSchema = TextAlign$inboundSchema; + /** @deprecated use `TextAlign$outboundSchema` instead. */ + export const outboundSchema = TextAlign$outboundSchema; } /** @internal */ -export namespace EmailBlockStyles$ { - export const inboundSchema: z.ZodType = z.object({ - textAlign: TextAlign$.inboundSchema.optional(), +export const EmailBlockStyles$inboundSchema: z.ZodType = + z.object({ + textAlign: TextAlign$inboundSchema, }); - export type Outbound = { - textAlign?: string | undefined; - }; +/** @internal */ +export type EmailBlockStyles$Outbound = { + textAlign: string; +}; - export const outboundSchema: z.ZodType = z.object({ - textAlign: TextAlign$.outboundSchema.optional(), - }); +/** @internal */ +export const EmailBlockStyles$outboundSchema: z.ZodType< + EmailBlockStyles$Outbound, + z.ZodTypeDef, + EmailBlockStyles +> = z.object({ + textAlign: TextAlign$outboundSchema, +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace EmailBlockStyles$ { + /** @deprecated use `EmailBlockStyles$inboundSchema` instead. */ + export const inboundSchema = EmailBlockStyles$inboundSchema; + /** @deprecated use `EmailBlockStyles$outboundSchema` instead. */ + export const outboundSchema = EmailBlockStyles$outboundSchema; + /** @deprecated use `EmailBlockStyles$Outbound` instead. */ + export type Outbound = EmailBlockStyles$Outbound; } diff --git a/src/models/components/environmentresponsedto.ts b/src/models/components/environmentresponsedto.ts index 0e88f6f7..fa8c3ec2 100644 --- a/src/models/components/environmentresponsedto.ts +++ b/src/models/components/environmentresponsedto.ts @@ -1,72 +1,82 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; import * as z from "zod"; -export type ApiKeys = {}; - export type EnvironmentResponseDto = { id?: string | undefined; organizationId: string; parentId: string; - apiKeys?: Array | undefined; + apiKeys?: Array | undefined; identifier: string; name: string; }; /** @internal */ -export namespace ApiKeys$ { - export const inboundSchema: z.ZodType = z.object({}); - - export type Outbound = {}; +export const EnvironmentResponseDto$inboundSchema: z.ZodType< + EnvironmentResponseDto, + z.ZodTypeDef, + unknown +> = z + .object({ + _id: z.string().optional(), + _organizationId: z.string(), + _parentId: z.string(), + apiKeys: z.array(z.string()).optional(), + identifier: z.string(), + name: z.string(), + }) + .transform((v) => { + return remap$(v, { + _id: "id", + _organizationId: "organizationId", + _parentId: "parentId", + }); + }); - export const outboundSchema: z.ZodType = z.object({}); -} +/** @internal */ +export type EnvironmentResponseDto$Outbound = { + _id?: string | undefined; + _organizationId: string; + _parentId: string; + apiKeys?: Array | undefined; + identifier: string; + name: string; +}; /** @internal */ -export namespace EnvironmentResponseDto$ { - export const inboundSchema: z.ZodType = z - .object({ - _id: z.string().optional(), - _organizationId: z.string(), - _parentId: z.string(), - apiKeys: z.array(z.lazy(() => ApiKeys$.inboundSchema)).optional(), - identifier: z.string(), - name: z.string(), - }) - .transform((v) => { - return remap$(v, { - _id: "id", - _organizationId: "organizationId", - _parentId: "parentId", - }); +export const EnvironmentResponseDto$outboundSchema: z.ZodType< + EnvironmentResponseDto$Outbound, + z.ZodTypeDef, + EnvironmentResponseDto +> = z + .object({ + id: z.string().optional(), + organizationId: z.string(), + parentId: z.string(), + apiKeys: z.array(z.string()).optional(), + identifier: z.string(), + name: z.string(), + }) + .transform((v) => { + return remap$(v, { + id: "_id", + organizationId: "_organizationId", + parentId: "_parentId", }); + }); - export type Outbound = { - _id?: string | undefined; - _organizationId: string; - _parentId: string; - apiKeys?: Array | undefined; - identifier: string; - name: string; - }; - - export const outboundSchema: z.ZodType = z - .object({ - id: z.string().optional(), - organizationId: z.string(), - parentId: z.string(), - apiKeys: z.array(z.lazy(() => ApiKeys$.outboundSchema)).optional(), - identifier: z.string(), - name: z.string(), - }) - .transform((v) => { - return remap$(v, { - id: "_id", - organizationId: "_organizationId", - parentId: "_parentId", - }); - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace EnvironmentResponseDto$ { + /** @deprecated use `EnvironmentResponseDto$inboundSchema` instead. */ + export const inboundSchema = EnvironmentResponseDto$inboundSchema; + /** @deprecated use `EnvironmentResponseDto$outboundSchema` instead. */ + export const outboundSchema = EnvironmentResponseDto$outboundSchema; + /** @deprecated use `EnvironmentResponseDto$Outbound` instead. */ + export type Outbound = EnvironmentResponseDto$Outbound; } diff --git a/src/models/components/executiondetailsresponsedto.ts b/src/models/components/executiondetailsresponsedto.ts index 8530adbb..1d4aff56 100644 --- a/src/models/components/executiondetailsresponsedto.ts +++ b/src/models/components/executiondetailsresponsedto.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; @@ -21,15 +21,13 @@ export type ExecutionDetailsResponseDtoChannel = ClosedEnum< typeof ExecutionDetailsResponseDtoChannel >; -export const ExecutionDetailsResponseDtoSource = { +export const Source = { Credentials: "Credentials", Internal: "Internal", Payload: "Payload", Webhook: "Webhook", } as const; -export type ExecutionDetailsResponseDtoSource = ClosedEnum< - typeof ExecutionDetailsResponseDtoSource ->; +export type Source = ClosedEnum; export const ExecutionDetailsResponseDtoStatus = { Success: "Success", @@ -58,120 +56,176 @@ export type ExecutionDetailsResponseDto = { isRetry: boolean; isTest: boolean; providerId?: string | undefined; - source: ExecutionDetailsResponseDtoSource; + source: Source; status: ExecutionDetailsResponseDtoStatus; transactionId: string; }; /** @internal */ +export const ExecutionDetailsResponseDtoChannel$inboundSchema: z.ZodNativeEnum< + typeof ExecutionDetailsResponseDtoChannel +> = z.nativeEnum(ExecutionDetailsResponseDtoChannel); + +/** @internal */ +export const ExecutionDetailsResponseDtoChannel$outboundSchema: z.ZodNativeEnum< + typeof ExecutionDetailsResponseDtoChannel +> = ExecutionDetailsResponseDtoChannel$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace ExecutionDetailsResponseDtoChannel$ { - export const inboundSchema: z.ZodNativeEnum = - z.nativeEnum(ExecutionDetailsResponseDtoChannel); - export const outboundSchema: z.ZodNativeEnum = - inboundSchema; + /** @deprecated use `ExecutionDetailsResponseDtoChannel$inboundSchema` instead. */ + export const inboundSchema = ExecutionDetailsResponseDtoChannel$inboundSchema; + /** @deprecated use `ExecutionDetailsResponseDtoChannel$outboundSchema` instead. */ + export const outboundSchema = ExecutionDetailsResponseDtoChannel$outboundSchema; } /** @internal */ -export namespace ExecutionDetailsResponseDtoSource$ { - export const inboundSchema: z.ZodNativeEnum = - z.nativeEnum(ExecutionDetailsResponseDtoSource); - export const outboundSchema: z.ZodNativeEnum = - inboundSchema; +export const Source$inboundSchema: z.ZodNativeEnum = z.nativeEnum(Source); + +/** @internal */ +export const Source$outboundSchema: z.ZodNativeEnum = Source$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Source$ { + /** @deprecated use `Source$inboundSchema` instead. */ + export const inboundSchema = Source$inboundSchema; + /** @deprecated use `Source$outboundSchema` instead. */ + export const outboundSchema = Source$outboundSchema; } /** @internal */ +export const ExecutionDetailsResponseDtoStatus$inboundSchema: z.ZodNativeEnum< + typeof ExecutionDetailsResponseDtoStatus +> = z.nativeEnum(ExecutionDetailsResponseDtoStatus); + +/** @internal */ +export const ExecutionDetailsResponseDtoStatus$outboundSchema: z.ZodNativeEnum< + typeof ExecutionDetailsResponseDtoStatus +> = ExecutionDetailsResponseDtoStatus$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace ExecutionDetailsResponseDtoStatus$ { - export const inboundSchema: z.ZodNativeEnum = - z.nativeEnum(ExecutionDetailsResponseDtoStatus); - export const outboundSchema: z.ZodNativeEnum = - inboundSchema; + /** @deprecated use `ExecutionDetailsResponseDtoStatus$inboundSchema` instead. */ + export const inboundSchema = ExecutionDetailsResponseDtoStatus$inboundSchema; + /** @deprecated use `ExecutionDetailsResponseDtoStatus$outboundSchema` instead. */ + export const outboundSchema = ExecutionDetailsResponseDtoStatus$outboundSchema; } /** @internal */ -export namespace ExecutionDetailsResponseDto$ { - export const inboundSchema: z.ZodType = z - .object({ - _environmentId: z.string(), - _id: z.string().optional(), - _jobId: z.string(), - _messageId: z.string().optional(), - _notificationId: z.string(), - _notificationTemplateId: z.string(), - _organizationId: z.string(), - _subscriberId: z.string(), - channel: ExecutionDetailsResponseDtoChannel$.inboundSchema, - createdAt: z.string().optional(), - detail: z.string(), - isRetry: z.boolean(), - isTest: z.boolean(), - providerId: z.string().optional(), - source: ExecutionDetailsResponseDtoSource$.inboundSchema, - status: ExecutionDetailsResponseDtoStatus$.inboundSchema, - transactionId: z.string(), - }) - .transform((v) => { - return remap$(v, { - _environmentId: "environmentId", - _id: "id", - _jobId: "jobId", - _messageId: "messageId", - _notificationId: "notificationId", - _notificationTemplateId: "notificationTemplateId", - _organizationId: "organizationId", - _subscriberId: "subscriberId", - }); +export const ExecutionDetailsResponseDto$inboundSchema: z.ZodType< + ExecutionDetailsResponseDto, + z.ZodTypeDef, + unknown +> = z + .object({ + _environmentId: z.string(), + _id: z.string().optional(), + _jobId: z.string(), + _messageId: z.string().optional(), + _notificationId: z.string(), + _notificationTemplateId: z.string(), + _organizationId: z.string(), + _subscriberId: z.string(), + channel: ExecutionDetailsResponseDtoChannel$inboundSchema, + createdAt: z.string().optional(), + detail: z.string(), + isRetry: z.boolean(), + isTest: z.boolean(), + providerId: z.string().optional(), + source: Source$inboundSchema, + status: ExecutionDetailsResponseDtoStatus$inboundSchema, + transactionId: z.string(), + }) + .transform((v) => { + return remap$(v, { + _environmentId: "environmentId", + _id: "id", + _jobId: "jobId", + _messageId: "messageId", + _notificationId: "notificationId", + _notificationTemplateId: "notificationTemplateId", + _organizationId: "organizationId", + _subscriberId: "subscriberId", }); + }); - export type Outbound = { - _environmentId: string; - _id?: string | undefined; - _jobId: string; - _messageId?: string | undefined; - _notificationId: string; - _notificationTemplateId: string; - _organizationId: string; - _subscriberId: string; - channel: string; - createdAt?: string | undefined; - detail: string; - isRetry: boolean; - isTest: boolean; - providerId?: string | undefined; - source: string; - status: string; - transactionId: string; - }; - - export const outboundSchema: z.ZodType = z - .object({ - environmentId: z.string(), - id: z.string().optional(), - jobId: z.string(), - messageId: z.string().optional(), - notificationId: z.string(), - notificationTemplateId: z.string(), - organizationId: z.string(), - subscriberId: z.string(), - channel: ExecutionDetailsResponseDtoChannel$.outboundSchema, - createdAt: z.string().optional(), - detail: z.string(), - isRetry: z.boolean(), - isTest: z.boolean(), - providerId: z.string().optional(), - source: ExecutionDetailsResponseDtoSource$.outboundSchema, - status: ExecutionDetailsResponseDtoStatus$.outboundSchema, - transactionId: z.string(), - }) - .transform((v) => { - return remap$(v, { - environmentId: "_environmentId", - id: "_id", - jobId: "_jobId", - messageId: "_messageId", - notificationId: "_notificationId", - notificationTemplateId: "_notificationTemplateId", - organizationId: "_organizationId", - subscriberId: "_subscriberId", - }); +/** @internal */ +export type ExecutionDetailsResponseDto$Outbound = { + _environmentId: string; + _id?: string | undefined; + _jobId: string; + _messageId?: string | undefined; + _notificationId: string; + _notificationTemplateId: string; + _organizationId: string; + _subscriberId: string; + channel: string; + createdAt?: string | undefined; + detail: string; + isRetry: boolean; + isTest: boolean; + providerId?: string | undefined; + source: string; + status: string; + transactionId: string; +}; + +/** @internal */ +export const ExecutionDetailsResponseDto$outboundSchema: z.ZodType< + ExecutionDetailsResponseDto$Outbound, + z.ZodTypeDef, + ExecutionDetailsResponseDto +> = z + .object({ + environmentId: z.string(), + id: z.string().optional(), + jobId: z.string(), + messageId: z.string().optional(), + notificationId: z.string(), + notificationTemplateId: z.string(), + organizationId: z.string(), + subscriberId: z.string(), + channel: ExecutionDetailsResponseDtoChannel$outboundSchema, + createdAt: z.string().optional(), + detail: z.string(), + isRetry: z.boolean(), + isTest: z.boolean(), + providerId: z.string().optional(), + source: Source$outboundSchema, + status: ExecutionDetailsResponseDtoStatus$outboundSchema, + transactionId: z.string(), + }) + .transform((v) => { + return remap$(v, { + environmentId: "_environmentId", + id: "_id", + jobId: "_jobId", + messageId: "_messageId", + notificationId: "_notificationId", + notificationTemplateId: "_notificationTemplateId", + organizationId: "_organizationId", + subscriberId: "_subscriberId", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ExecutionDetailsResponseDto$ { + /** @deprecated use `ExecutionDetailsResponseDto$inboundSchema` instead. */ + export const inboundSchema = ExecutionDetailsResponseDto$inboundSchema; + /** @deprecated use `ExecutionDetailsResponseDto$outboundSchema` instead. */ + export const outboundSchema = ExecutionDetailsResponseDto$outboundSchema; + /** @deprecated use `ExecutionDetailsResponseDto$Outbound` instead. */ + export type Outbound = ExecutionDetailsResponseDto$Outbound; } diff --git a/src/models/components/feedresponsedto.ts b/src/models/components/feedresponsedto.ts index 6b712fd3..57e523dc 100644 --- a/src/models/components/feedresponsedto.ts +++ b/src/models/components/feedresponsedto.ts @@ -1,57 +1,58 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { remap as remap$ } from "../../lib/primitives.js"; import * as z from "zod"; export type FeedResponseDto = { - environmentId: string; - id?: string | undefined; - organizationId: string; - identifier: string; - name: string; + data: Array; + hasMore: boolean; + page: number; + pageSize: number; + totalCount?: number | undefined; }; /** @internal */ -export namespace FeedResponseDto$ { - export const inboundSchema: z.ZodType = z - .object({ - _environmentId: z.string(), - _id: z.string().optional(), - _organizationId: z.string(), - identifier: z.string(), - name: z.string(), - }) - .transform((v) => { - return remap$(v, { - _environmentId: "environmentId", - _id: "id", - _organizationId: "organizationId", - }); - }); +export const FeedResponseDto$inboundSchema: z.ZodType = + z.object({ + data: z.array(z.string()), + hasMore: z.boolean(), + page: z.number(), + pageSize: z.number(), + totalCount: z.number().optional(), + }); - export type Outbound = { - _environmentId: string; - _id?: string | undefined; - _organizationId: string; - identifier: string; - name: string; - }; +/** @internal */ +export type FeedResponseDto$Outbound = { + data: Array; + hasMore: boolean; + page: number; + pageSize: number; + totalCount?: number | undefined; +}; - export const outboundSchema: z.ZodType = z - .object({ - environmentId: z.string(), - id: z.string().optional(), - organizationId: z.string(), - identifier: z.string(), - name: z.string(), - }) - .transform((v) => { - return remap$(v, { - environmentId: "_environmentId", - id: "_id", - organizationId: "_organizationId", - }); - }); +/** @internal */ +export const FeedResponseDto$outboundSchema: z.ZodType< + FeedResponseDto$Outbound, + z.ZodTypeDef, + FeedResponseDto +> = z.object({ + data: z.array(z.string()), + hasMore: z.boolean(), + page: z.number(), + pageSize: z.number(), + totalCount: z.number().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace FeedResponseDto$ { + /** @deprecated use `FeedResponseDto$inboundSchema` instead. */ + export const inboundSchema = FeedResponseDto$inboundSchema; + /** @deprecated use `FeedResponseDto$outboundSchema` instead. */ + export const outboundSchema = FeedResponseDto$outboundSchema; + /** @deprecated use `FeedResponseDto$Outbound` instead. */ + export type Outbound = FeedResponseDto$Outbound; } diff --git a/src/models/components/fieldfilterpart.ts b/src/models/components/fieldfilterpart.ts index 6a72c63d..810fa30c 100644 --- a/src/models/components/fieldfilterpart.ts +++ b/src/models/components/fieldfilterpart.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { ClosedEnum } from "../../types/enums.js"; @@ -37,37 +37,77 @@ export type FieldFilterPart = { }; /** @internal */ +export const On$inboundSchema: z.ZodNativeEnum = z.nativeEnum(On); + +/** @internal */ +export const On$outboundSchema: z.ZodNativeEnum = On$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace On$ { - export const inboundSchema: z.ZodNativeEnum = z.nativeEnum(On); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; + /** @deprecated use `On$inboundSchema` instead. */ + export const inboundSchema = On$inboundSchema; + /** @deprecated use `On$outboundSchema` instead. */ + export const outboundSchema = On$outboundSchema; } /** @internal */ +export const Operator$inboundSchema: z.ZodNativeEnum = z.nativeEnum(Operator); + +/** @internal */ +export const Operator$outboundSchema: z.ZodNativeEnum = Operator$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace Operator$ { - export const inboundSchema: z.ZodNativeEnum = z.nativeEnum(Operator); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; + /** @deprecated use `Operator$inboundSchema` instead. */ + export const inboundSchema = Operator$inboundSchema; + /** @deprecated use `Operator$outboundSchema` instead. */ + export const outboundSchema = Operator$outboundSchema; } /** @internal */ -export namespace FieldFilterPart$ { - export const inboundSchema: z.ZodType = z.object({ +export const FieldFilterPart$inboundSchema: z.ZodType = + z.object({ field: z.string(), - on: On$.inboundSchema, - operator: Operator$.inboundSchema, + on: On$inboundSchema, + operator: Operator$inboundSchema, value: z.string(), }); - export type Outbound = { - field: string; - on: string; - operator: string; - value: string; - }; +/** @internal */ +export type FieldFilterPart$Outbound = { + field: string; + on: string; + operator: string; + value: string; +}; + +/** @internal */ +export const FieldFilterPart$outboundSchema: z.ZodType< + FieldFilterPart$Outbound, + z.ZodTypeDef, + FieldFilterPart +> = z.object({ + field: z.string(), + on: On$outboundSchema, + operator: Operator$outboundSchema, + value: z.string(), +}); - export const outboundSchema: z.ZodType = z.object({ - field: z.string(), - on: On$.outboundSchema, - operator: Operator$.outboundSchema, - value: z.string(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace FieldFilterPart$ { + /** @deprecated use `FieldFilterPart$inboundSchema` instead. */ + export const inboundSchema = FieldFilterPart$inboundSchema; + /** @deprecated use `FieldFilterPart$outboundSchema` instead. */ + export const outboundSchema = FieldFilterPart$outboundSchema; + /** @deprecated use `FieldFilterPart$Outbound` instead. */ + export type Outbound = FieldFilterPart$Outbound; } diff --git a/src/models/components/filtertopicsresponsedto.ts b/src/models/components/filtertopicsresponsedto.ts index 0b5a4844..bb73539e 100644 --- a/src/models/components/filtertopicsresponsedto.ts +++ b/src/models/components/filtertopicsresponsedto.ts @@ -1,8 +1,13 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { TopicDto, TopicDto$ } from "./topicdto.js"; +import { + TopicDto, + TopicDto$inboundSchema, + TopicDto$Outbound, + TopicDto$outboundSchema, +} from "./topicdto.js"; import * as z from "zod"; export type FilterTopicsResponseDto = { @@ -13,27 +18,46 @@ export type FilterTopicsResponseDto = { }; /** @internal */ -export namespace FilterTopicsResponseDto$ { - export const inboundSchema: z.ZodType = - z.object({ - data: z.array(TopicDto$.inboundSchema), - page: z.number(), - pageSize: z.number(), - totalCount: z.number(), - }); +export const FilterTopicsResponseDto$inboundSchema: z.ZodType< + FilterTopicsResponseDto, + z.ZodTypeDef, + unknown +> = z.object({ + data: z.array(TopicDto$inboundSchema), + page: z.number(), + pageSize: z.number(), + totalCount: z.number(), +}); + +/** @internal */ +export type FilterTopicsResponseDto$Outbound = { + data: Array; + page: number; + pageSize: number; + totalCount: number; +}; - export type Outbound = { - data: Array; - page: number; - pageSize: number; - totalCount: number; - }; +/** @internal */ +export const FilterTopicsResponseDto$outboundSchema: z.ZodType< + FilterTopicsResponseDto$Outbound, + z.ZodTypeDef, + FilterTopicsResponseDto +> = z.object({ + data: z.array(TopicDto$outboundSchema), + page: z.number(), + pageSize: z.number(), + totalCount: z.number(), +}); - export const outboundSchema: z.ZodType = - z.object({ - data: z.array(TopicDto$.outboundSchema), - page: z.number(), - pageSize: z.number(), - totalCount: z.number(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace FilterTopicsResponseDto$ { + /** @deprecated use `FilterTopicsResponseDto$inboundSchema` instead. */ + export const inboundSchema = FilterTopicsResponseDto$inboundSchema; + /** @deprecated use `FilterTopicsResponseDto$outboundSchema` instead. */ + export const outboundSchema = FilterTopicsResponseDto$outboundSchema; + /** @deprecated use `FilterTopicsResponseDto$Outbound` instead. */ + export type Outbound = FilterTopicsResponseDto$Outbound; } diff --git a/src/models/components/getlayoutresponsedto.ts b/src/models/components/getlayoutresponsedto.ts index a8361e13..0777aa01 100644 --- a/src/models/components/getlayoutresponsedto.ts +++ b/src/models/components/getlayoutresponsedto.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; @@ -15,8 +15,6 @@ export const GetLayoutResponseDtoChannel = { } as const; export type GetLayoutResponseDtoChannel = ClosedEnum; -export type Variables = {}; - export type GetLayoutResponseDto = { creatorId: string; environmentId: string; @@ -33,103 +31,127 @@ export type GetLayoutResponseDto = { isDeleted: boolean; name: string; updatedAt?: string | undefined; - variables?: Array | undefined; + variables?: Array | undefined; }; /** @internal */ -export namespace GetLayoutResponseDtoChannel$ { - export const inboundSchema: z.ZodNativeEnum = z.nativeEnum( - GetLayoutResponseDtoChannel - ); - export const outboundSchema: z.ZodNativeEnum = - inboundSchema; -} +export const GetLayoutResponseDtoChannel$inboundSchema: z.ZodNativeEnum< + typeof GetLayoutResponseDtoChannel +> = z.nativeEnum(GetLayoutResponseDtoChannel); /** @internal */ -export namespace Variables$ { - export const inboundSchema: z.ZodType = z.object({}); +export const GetLayoutResponseDtoChannel$outboundSchema: z.ZodNativeEnum< + typeof GetLayoutResponseDtoChannel +> = GetLayoutResponseDtoChannel$inboundSchema; - export type Outbound = {}; - - export const outboundSchema: z.ZodType = z.object({}); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetLayoutResponseDtoChannel$ { + /** @deprecated use `GetLayoutResponseDtoChannel$inboundSchema` instead. */ + export const inboundSchema = GetLayoutResponseDtoChannel$inboundSchema; + /** @deprecated use `GetLayoutResponseDtoChannel$outboundSchema` instead. */ + export const outboundSchema = GetLayoutResponseDtoChannel$outboundSchema; } /** @internal */ -export namespace GetLayoutResponseDto$ { - export const inboundSchema: z.ZodType = z - .object({ - _creatorId: z.string(), - _environmentId: z.string(), - _id: z.string().optional(), - _organizationId: z.string(), - _parentId: z.string().optional(), - channel: GetLayoutResponseDtoChannel$.inboundSchema, - content: z.string(), - contentType: z.string(), - createdAt: z.string().optional(), - description: z.string().optional(), - identifier: z.string(), - isDefault: z.boolean(), - isDeleted: z.boolean(), - name: z.string(), - updatedAt: z.string().optional(), - variables: z.array(z.lazy(() => Variables$.inboundSchema)).optional(), - }) - .transform((v) => { - return remap$(v, { - _creatorId: "creatorId", - _environmentId: "environmentId", - _id: "id", - _organizationId: "organizationId", - _parentId: "parentId", - }); +export const GetLayoutResponseDto$inboundSchema: z.ZodType< + GetLayoutResponseDto, + z.ZodTypeDef, + unknown +> = z + .object({ + _creatorId: z.string(), + _environmentId: z.string(), + _id: z.string().optional(), + _organizationId: z.string(), + _parentId: z.string().optional(), + channel: GetLayoutResponseDtoChannel$inboundSchema, + content: z.string(), + contentType: z.string(), + createdAt: z.string().optional(), + description: z.string().optional(), + identifier: z.string(), + isDefault: z.boolean(), + isDeleted: z.boolean(), + name: z.string(), + updatedAt: z.string().optional(), + variables: z.array(z.string()).optional(), + }) + .transform((v) => { + return remap$(v, { + _creatorId: "creatorId", + _environmentId: "environmentId", + _id: "id", + _organizationId: "organizationId", + _parentId: "parentId", }); + }); - export type Outbound = { - _creatorId: string; - _environmentId: string; - _id?: string | undefined; - _organizationId: string; - _parentId?: string | undefined; - channel: string; - content: string; - contentType: string; - createdAt?: string | undefined; - description?: string | undefined; - identifier: string; - isDefault: boolean; - isDeleted: boolean; - name: string; - updatedAt?: string | undefined; - variables?: Array | undefined; - }; +/** @internal */ +export type GetLayoutResponseDto$Outbound = { + _creatorId: string; + _environmentId: string; + _id?: string | undefined; + _organizationId: string; + _parentId?: string | undefined; + channel: string; + content: string; + contentType: string; + createdAt?: string | undefined; + description?: string | undefined; + identifier: string; + isDefault: boolean; + isDeleted: boolean; + name: string; + updatedAt?: string | undefined; + variables?: Array | undefined; +}; - export const outboundSchema: z.ZodType = z - .object({ - creatorId: z.string(), - environmentId: z.string(), - id: z.string().optional(), - organizationId: z.string(), - parentId: z.string().optional(), - channel: GetLayoutResponseDtoChannel$.outboundSchema, - content: z.string(), - contentType: z.string(), - createdAt: z.string().optional(), - description: z.string().optional(), - identifier: z.string(), - isDefault: z.boolean(), - isDeleted: z.boolean(), - name: z.string(), - updatedAt: z.string().optional(), - variables: z.array(z.lazy(() => Variables$.outboundSchema)).optional(), - }) - .transform((v) => { - return remap$(v, { - creatorId: "_creatorId", - environmentId: "_environmentId", - id: "_id", - organizationId: "_organizationId", - parentId: "_parentId", - }); +/** @internal */ +export const GetLayoutResponseDto$outboundSchema: z.ZodType< + GetLayoutResponseDto$Outbound, + z.ZodTypeDef, + GetLayoutResponseDto +> = z + .object({ + creatorId: z.string(), + environmentId: z.string(), + id: z.string().optional(), + organizationId: z.string(), + parentId: z.string().optional(), + channel: GetLayoutResponseDtoChannel$outboundSchema, + content: z.string(), + contentType: z.string(), + createdAt: z.string().optional(), + description: z.string().optional(), + identifier: z.string(), + isDefault: z.boolean(), + isDeleted: z.boolean(), + name: z.string(), + updatedAt: z.string().optional(), + variables: z.array(z.string()).optional(), + }) + .transform((v) => { + return remap$(v, { + creatorId: "_creatorId", + environmentId: "_environmentId", + id: "_id", + organizationId: "_organizationId", + parentId: "_parentId", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetLayoutResponseDto$ { + /** @deprecated use `GetLayoutResponseDto$inboundSchema` instead. */ + export const inboundSchema = GetLayoutResponseDto$inboundSchema; + /** @deprecated use `GetLayoutResponseDto$outboundSchema` instead. */ + export const outboundSchema = GetLayoutResponseDto$outboundSchema; + /** @deprecated use `GetLayoutResponseDto$Outbound` instead. */ + export type Outbound = GetLayoutResponseDto$Outbound; } diff --git a/src/models/components/getsubscriberpreferencesresponsedto.ts b/src/models/components/getsubscriberpreferencesresponsedto.ts index b482d26e..915182ce 100644 --- a/src/models/components/getsubscriberpreferencesresponsedto.ts +++ b/src/models/components/getsubscriberpreferencesresponsedto.ts @@ -1,9 +1,19 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { Preference, Preference$ } from "./preference.js"; -import { TemplateResponse, TemplateResponse$ } from "./templateresponse.js"; +import { + Preference, + Preference$inboundSchema, + Preference$Outbound, + Preference$outboundSchema, +} from "./preference.js"; +import { + TemplateResponse, + TemplateResponse$inboundSchema, + TemplateResponse$Outbound, + TemplateResponse$outboundSchema, +} from "./templateresponse.js"; import * as z from "zod"; export type GetSubscriberPreferencesResponseDto = { @@ -18,27 +28,40 @@ export type GetSubscriberPreferencesResponseDto = { }; /** @internal */ -export namespace GetSubscriberPreferencesResponseDto$ { - export const inboundSchema: z.ZodType< - GetSubscriberPreferencesResponseDto, - z.ZodTypeDef, - unknown - > = z.object({ - preference: Preference$.inboundSchema, - template: TemplateResponse$.inboundSchema.optional(), - }); +export const GetSubscriberPreferencesResponseDto$inboundSchema: z.ZodType< + GetSubscriberPreferencesResponseDto, + z.ZodTypeDef, + unknown +> = z.object({ + preference: Preference$inboundSchema, + template: TemplateResponse$inboundSchema.optional(), +}); - export type Outbound = { - preference: Preference$.Outbound; - template?: TemplateResponse$.Outbound | undefined; - }; +/** @internal */ +export type GetSubscriberPreferencesResponseDto$Outbound = { + preference: Preference$Outbound; + template?: TemplateResponse$Outbound | undefined; +}; - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - GetSubscriberPreferencesResponseDto - > = z.object({ - preference: Preference$.outboundSchema, - template: TemplateResponse$.outboundSchema.optional(), - }); +/** @internal */ +export const GetSubscriberPreferencesResponseDto$outboundSchema: z.ZodType< + GetSubscriberPreferencesResponseDto$Outbound, + z.ZodTypeDef, + GetSubscriberPreferencesResponseDto +> = z.object({ + preference: Preference$outboundSchema, + template: TemplateResponse$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetSubscriberPreferencesResponseDto$ { + /** @deprecated use `GetSubscriberPreferencesResponseDto$inboundSchema` instead. */ + export const inboundSchema = GetSubscriberPreferencesResponseDto$inboundSchema; + /** @deprecated use `GetSubscriberPreferencesResponseDto$outboundSchema` instead. */ + export const outboundSchema = GetSubscriberPreferencesResponseDto$outboundSchema; + /** @deprecated use `GetSubscriberPreferencesResponseDto$Outbound` instead. */ + export type Outbound = GetSubscriberPreferencesResponseDto$Outbound; } diff --git a/src/models/components/gettenantresponsedto.ts b/src/models/components/gettenantresponsedto.ts index 45d97488..22d6a082 100644 --- a/src/models/components/gettenantresponsedto.ts +++ b/src/models/components/gettenantresponsedto.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; @@ -18,59 +18,99 @@ export type GetTenantResponseDto = { }; /** @internal */ -export namespace GetTenantResponseDtoData$ { - export const inboundSchema: z.ZodType = - z.object({}); +export const GetTenantResponseDtoData$inboundSchema: z.ZodType< + GetTenantResponseDtoData, + z.ZodTypeDef, + unknown +> = z.object({}); - export type Outbound = {}; +/** @internal */ +export type GetTenantResponseDtoData$Outbound = {}; - export const outboundSchema: z.ZodType = - z.object({}); +/** @internal */ +export const GetTenantResponseDtoData$outboundSchema: z.ZodType< + GetTenantResponseDtoData$Outbound, + z.ZodTypeDef, + GetTenantResponseDtoData +> = z.object({}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetTenantResponseDtoData$ { + /** @deprecated use `GetTenantResponseDtoData$inboundSchema` instead. */ + export const inboundSchema = GetTenantResponseDtoData$inboundSchema; + /** @deprecated use `GetTenantResponseDtoData$outboundSchema` instead. */ + export const outboundSchema = GetTenantResponseDtoData$outboundSchema; + /** @deprecated use `GetTenantResponseDtoData$Outbound` instead. */ + export type Outbound = GetTenantResponseDtoData$Outbound; } /** @internal */ -export namespace GetTenantResponseDto$ { - export const inboundSchema: z.ZodType = z - .object({ - _environmentId: z.string(), - _id: z.string(), - createdAt: z.string(), - data: z.lazy(() => GetTenantResponseDtoData$.inboundSchema).optional(), - identifier: z.string(), - name: z.string().optional(), - updatedAt: z.string(), - }) - .transform((v) => { - return remap$(v, { - _environmentId: "environmentId", - _id: "id", - }); +export const GetTenantResponseDto$inboundSchema: z.ZodType< + GetTenantResponseDto, + z.ZodTypeDef, + unknown +> = z + .object({ + _environmentId: z.string(), + _id: z.string(), + createdAt: z.string(), + data: z.lazy(() => GetTenantResponseDtoData$inboundSchema).optional(), + identifier: z.string(), + name: z.string().optional(), + updatedAt: z.string(), + }) + .transform((v) => { + return remap$(v, { + _environmentId: "environmentId", + _id: "id", }); + }); - export type Outbound = { - _environmentId: string; - _id: string; - createdAt: string; - data?: GetTenantResponseDtoData$.Outbound | undefined; - identifier: string; - name?: string | undefined; - updatedAt: string; - }; +/** @internal */ +export type GetTenantResponseDto$Outbound = { + _environmentId: string; + _id: string; + createdAt: string; + data?: GetTenantResponseDtoData$Outbound | undefined; + identifier: string; + name?: string | undefined; + updatedAt: string; +}; - export const outboundSchema: z.ZodType = z - .object({ - environmentId: z.string(), - id: z.string(), - createdAt: z.string(), - data: z.lazy(() => GetTenantResponseDtoData$.outboundSchema).optional(), - identifier: z.string(), - name: z.string().optional(), - updatedAt: z.string(), - }) - .transform((v) => { - return remap$(v, { - environmentId: "_environmentId", - id: "_id", - }); +/** @internal */ +export const GetTenantResponseDto$outboundSchema: z.ZodType< + GetTenantResponseDto$Outbound, + z.ZodTypeDef, + GetTenantResponseDto +> = z + .object({ + environmentId: z.string(), + id: z.string(), + createdAt: z.string(), + data: z.lazy(() => GetTenantResponseDtoData$outboundSchema).optional(), + identifier: z.string(), + name: z.string().optional(), + updatedAt: z.string(), + }) + .transform((v) => { + return remap$(v, { + environmentId: "_environmentId", + id: "_id", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetTenantResponseDto$ { + /** @deprecated use `GetTenantResponseDto$inboundSchema` instead. */ + export const inboundSchema = GetTenantResponseDto$inboundSchema; + /** @deprecated use `GetTenantResponseDto$outboundSchema` instead. */ + export const outboundSchema = GetTenantResponseDto$outboundSchema; + /** @deprecated use `GetTenantResponseDto$Outbound` instead. */ + export type Outbound = GetTenantResponseDto$Outbound; } diff --git a/src/models/components/gettopicresponsedto.ts b/src/models/components/gettopicresponsedto.ts index c199731a..8e8b447c 100644 --- a/src/models/components/gettopicresponsedto.ts +++ b/src/models/components/gettopicresponsedto.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; @@ -15,47 +15,68 @@ export type GetTopicResponseDto = { }; /** @internal */ -export namespace GetTopicResponseDto$ { - export const inboundSchema: z.ZodType = z - .object({ - _environmentId: z.string(), - _id: z.string().optional(), - _organizationId: z.string(), - key: z.string(), - name: z.string(), - subscribers: z.array(z.string()), - }) - .transform((v) => { - return remap$(v, { - _environmentId: "environmentId", - _id: "id", - _organizationId: "organizationId", - }); +export const GetTopicResponseDto$inboundSchema: z.ZodType< + GetTopicResponseDto, + z.ZodTypeDef, + unknown +> = z + .object({ + _environmentId: z.string(), + _id: z.string().optional(), + _organizationId: z.string(), + key: z.string(), + name: z.string(), + subscribers: z.array(z.string()), + }) + .transform((v) => { + return remap$(v, { + _environmentId: "environmentId", + _id: "id", + _organizationId: "organizationId", }); + }); - export type Outbound = { - _environmentId: string; - _id?: string | undefined; - _organizationId: string; - key: string; - name: string; - subscribers: Array; - }; +/** @internal */ +export type GetTopicResponseDto$Outbound = { + _environmentId: string; + _id?: string | undefined; + _organizationId: string; + key: string; + name: string; + subscribers: Array; +}; - export const outboundSchema: z.ZodType = z - .object({ - environmentId: z.string(), - id: z.string().optional(), - organizationId: z.string(), - key: z.string(), - name: z.string(), - subscribers: z.array(z.string()), - }) - .transform((v) => { - return remap$(v, { - environmentId: "_environmentId", - id: "_id", - organizationId: "_organizationId", - }); +/** @internal */ +export const GetTopicResponseDto$outboundSchema: z.ZodType< + GetTopicResponseDto$Outbound, + z.ZodTypeDef, + GetTopicResponseDto +> = z + .object({ + environmentId: z.string(), + id: z.string().optional(), + organizationId: z.string(), + key: z.string(), + name: z.string(), + subscribers: z.array(z.string()), + }) + .transform((v) => { + return remap$(v, { + environmentId: "_environmentId", + id: "_id", + organizationId: "_organizationId", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetTopicResponseDto$ { + /** @deprecated use `GetTopicResponseDto$inboundSchema` instead. */ + export const inboundSchema = GetTopicResponseDto$inboundSchema; + /** @deprecated use `GetTopicResponseDto$outboundSchema` instead. */ + export const outboundSchema = GetTopicResponseDto$outboundSchema; + /** @deprecated use `GetTopicResponseDto$Outbound` instead. */ + export type Outbound = GetTopicResponseDto$Outbound; } diff --git a/src/models/components/index.ts b/src/models/components/index.ts index d665bb5e..74ba9aa3 100644 --- a/src/models/components/index.ts +++ b/src/models/components/index.ts @@ -1,13 +1,10 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ export * from "./activitiesresponsedto.js"; export * from "./activitygraphstatesresponse.js"; -export * from "./activitynotificationexecutiondetailresponsedto.js"; -export * from "./activitynotificationjobresponsedto.js"; export * from "./activitynotificationresponsedto.js"; -export * from "./activitynotificationstepresponsedto.js"; export * from "./activitynotificationsubscriberresponsedto.js"; export * from "./activitynotificationtemplateresponsedto.js"; export * from "./activitystatsresponsedto.js"; @@ -20,14 +17,12 @@ export * from "./changeresponsedto.js"; export * from "./changesresponsedto.js"; export * from "./changeworkflowstatusrequestdto.js"; export * from "./channelcredentials.js"; -export * from "./channelcredentialsdto.js"; export * from "./channelpreference.js"; export * from "./channelsettings.js"; export * from "./createfeedrequestdto.js"; export * from "./createintegrationrequestdto.js"; export * from "./createlayoutresponsedto.js"; export * from "./createnotificationgrouprequestdto.js"; -export * from "./createorganizationdto.js"; export * from "./createsubscriberrequestdto.js"; export * from "./createtenantrequestdto.js"; export * from "./createtenantresponsedto.js"; @@ -56,12 +51,8 @@ export * from "./getsubscriberpreferencesresponsedto.js"; export * from "./gettenantresponsedto.js"; export * from "./gettopicresponsedto.js"; export * from "./integrationresponsedto.js"; -export * from "./ipartnerconfigurationresponsedto.js"; export * from "./markallmessageasrequestdto.js"; export * from "./markmessageactionasseendto.js"; -export * from "./memberinvitedto.js"; -export * from "./memberresponsedto.js"; -export * from "./memberuserdto.js"; export * from "./messageaction.js"; export * from "./messageactionresult.js"; export * from "./messagebutton.js"; @@ -71,7 +62,6 @@ export * from "./messageentity.js"; export * from "./messagemarkasrequestdto.js"; export * from "./messageresponsedto.js"; export * from "./messagetemplate.js"; -export * from "./messagetemplatedto.js"; export * from "./notificationgroup.js"; export * from "./notificationgroupresponsedto.js"; export * from "./notificationstep.js"; @@ -88,7 +78,6 @@ export * from "./renametopicrequestdto.js"; export * from "./renametopicresponsedto.js"; export * from "./security.js"; export * from "./stepfilter.js"; -export * from "./subscriberchanneldto.js"; export * from "./subscriberpayloaddto.js"; export * from "./subscriberresponsedto.js"; export * from "./templateresponse.js"; diff --git a/src/models/components/integrationresponsedto.ts b/src/models/components/integrationresponsedto.ts index 5aa3c9a3..1996f418 100644 --- a/src/models/components/integrationresponsedto.ts +++ b/src/models/components/integrationresponsedto.ts @@ -1,11 +1,21 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; import { ClosedEnum } from "../../types/enums.js"; -import { CredentialsDto, CredentialsDto$ } from "./credentialsdto.js"; -import { StepFilter, StepFilter$ } from "./stepfilter.js"; +import { + CredentialsDto, + CredentialsDto$inboundSchema, + CredentialsDto$Outbound, + CredentialsDto$outboundSchema, +} from "./credentialsdto.js"; +import { + StepFilter, + StepFilter$inboundSchema, + StepFilter$Outbound, + StepFilter$outboundSchema, +} from "./stepfilter.js"; import * as z from "zod"; export const IntegrationResponseDtoChannel = { @@ -35,79 +45,113 @@ export type IntegrationResponseDto = { }; /** @internal */ +export const IntegrationResponseDtoChannel$inboundSchema: z.ZodNativeEnum< + typeof IntegrationResponseDtoChannel +> = z.nativeEnum(IntegrationResponseDtoChannel); + +/** @internal */ +export const IntegrationResponseDtoChannel$outboundSchema: z.ZodNativeEnum< + typeof IntegrationResponseDtoChannel +> = IntegrationResponseDtoChannel$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace IntegrationResponseDtoChannel$ { - export const inboundSchema: z.ZodNativeEnum = - z.nativeEnum(IntegrationResponseDtoChannel); - export const outboundSchema: z.ZodNativeEnum = - inboundSchema; + /** @deprecated use `IntegrationResponseDtoChannel$inboundSchema` instead. */ + export const inboundSchema = IntegrationResponseDtoChannel$inboundSchema; + /** @deprecated use `IntegrationResponseDtoChannel$outboundSchema` instead. */ + export const outboundSchema = IntegrationResponseDtoChannel$outboundSchema; } /** @internal */ -export namespace IntegrationResponseDto$ { - export const inboundSchema: z.ZodType = z - .object({ - _environmentId: z.string(), - _id: z.string().optional(), - _organizationId: z.string(), - active: z.boolean(), - channel: IntegrationResponseDtoChannel$.inboundSchema, - conditions: z.array(StepFilter$.inboundSchema).optional(), - credentials: CredentialsDto$.inboundSchema, - deleted: z.boolean(), - deletedAt: z.string(), - deletedBy: z.string(), - identifier: z.string(), - name: z.string(), - primary: z.boolean(), - providerId: z.string(), - }) - .transform((v) => { - return remap$(v, { - _environmentId: "environmentId", - _id: "id", - _organizationId: "organizationId", - }); +export const IntegrationResponseDto$inboundSchema: z.ZodType< + IntegrationResponseDto, + z.ZodTypeDef, + unknown +> = z + .object({ + _environmentId: z.string(), + _id: z.string().optional(), + _organizationId: z.string(), + active: z.boolean(), + channel: IntegrationResponseDtoChannel$inboundSchema, + conditions: z.array(StepFilter$inboundSchema).optional(), + credentials: CredentialsDto$inboundSchema, + deleted: z.boolean(), + deletedAt: z.string(), + deletedBy: z.string(), + identifier: z.string(), + name: z.string(), + primary: z.boolean(), + providerId: z.string(), + }) + .transform((v) => { + return remap$(v, { + _environmentId: "environmentId", + _id: "id", + _organizationId: "organizationId", }); + }); - export type Outbound = { - _environmentId: string; - _id?: string | undefined; - _organizationId: string; - active: boolean; - channel: string; - conditions?: Array | undefined; - credentials: CredentialsDto$.Outbound; - deleted: boolean; - deletedAt: string; - deletedBy: string; - identifier: string; - name: string; - primary: boolean; - providerId: string; - }; +/** @internal */ +export type IntegrationResponseDto$Outbound = { + _environmentId: string; + _id?: string | undefined; + _organizationId: string; + active: boolean; + channel: string; + conditions?: Array | undefined; + credentials: CredentialsDto$Outbound; + deleted: boolean; + deletedAt: string; + deletedBy: string; + identifier: string; + name: string; + primary: boolean; + providerId: string; +}; - export const outboundSchema: z.ZodType = z - .object({ - environmentId: z.string(), - id: z.string().optional(), - organizationId: z.string(), - active: z.boolean(), - channel: IntegrationResponseDtoChannel$.outboundSchema, - conditions: z.array(StepFilter$.outboundSchema).optional(), - credentials: CredentialsDto$.outboundSchema, - deleted: z.boolean(), - deletedAt: z.string(), - deletedBy: z.string(), - identifier: z.string(), - name: z.string(), - primary: z.boolean(), - providerId: z.string(), - }) - .transform((v) => { - return remap$(v, { - environmentId: "_environmentId", - id: "_id", - organizationId: "_organizationId", - }); +/** @internal */ +export const IntegrationResponseDto$outboundSchema: z.ZodType< + IntegrationResponseDto$Outbound, + z.ZodTypeDef, + IntegrationResponseDto +> = z + .object({ + environmentId: z.string(), + id: z.string().optional(), + organizationId: z.string(), + active: z.boolean(), + channel: IntegrationResponseDtoChannel$outboundSchema, + conditions: z.array(StepFilter$outboundSchema).optional(), + credentials: CredentialsDto$outboundSchema, + deleted: z.boolean(), + deletedAt: z.string(), + deletedBy: z.string(), + identifier: z.string(), + name: z.string(), + primary: z.boolean(), + providerId: z.string(), + }) + .transform((v) => { + return remap$(v, { + environmentId: "_environmentId", + id: "_id", + organizationId: "_organizationId", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace IntegrationResponseDto$ { + /** @deprecated use `IntegrationResponseDto$inboundSchema` instead. */ + export const inboundSchema = IntegrationResponseDto$inboundSchema; + /** @deprecated use `IntegrationResponseDto$outboundSchema` instead. */ + export const outboundSchema = IntegrationResponseDto$outboundSchema; + /** @deprecated use `IntegrationResponseDto$Outbound` instead. */ + export type Outbound = IntegrationResponseDto$Outbound; } diff --git a/src/models/components/ipartnerconfigurationresponsedto.ts b/src/models/components/ipartnerconfigurationresponsedto.ts deleted file mode 100644 index 76d2b95b..00000000 --- a/src/models/components/ipartnerconfigurationresponsedto.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - */ - -import { ClosedEnum } from "../../types/enums.js"; -import * as z from "zod"; - -/** - * Partner Type Enum - */ -export const PartnerType = { - Vercel: "vercel", -} as const; -/** - * Partner Type Enum - */ -export type PartnerType = ClosedEnum; - -export type IPartnerConfigurationResponseDto = { - accessToken: string; - configurationId: string; - /** - * Partner Type Enum - */ - partnerType: PartnerType; - projectIds?: Array | undefined; - teamId?: string | undefined; -}; - -/** @internal */ -export namespace PartnerType$ { - export const inboundSchema: z.ZodNativeEnum = z.nativeEnum(PartnerType); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; -} - -/** @internal */ -export namespace IPartnerConfigurationResponseDto$ { - export const inboundSchema: z.ZodType = - z.object({ - accessToken: z.string(), - configurationId: z.string(), - partnerType: PartnerType$.inboundSchema, - projectIds: z.array(z.string()).optional(), - teamId: z.string().optional(), - }); - - export type Outbound = { - accessToken: string; - configurationId: string; - partnerType: string; - projectIds?: Array | undefined; - teamId?: string | undefined; - }; - - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - IPartnerConfigurationResponseDto - > = z.object({ - accessToken: z.string(), - configurationId: z.string(), - partnerType: PartnerType$.outboundSchema, - projectIds: z.array(z.string()).optional(), - teamId: z.string().optional(), - }); -} diff --git a/src/models/components/markallmessageasrequestdto.ts b/src/models/components/markallmessageasrequestdto.ts index 164b08cc..86a3c3c0 100644 --- a/src/models/components/markallmessageasrequestdto.ts +++ b/src/models/components/markallmessageasrequestdto.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { ClosedEnum } from "../../types/enums.js"; @@ -36,41 +36,84 @@ export type MarkAllMessageAsRequestDto = { }; /** @internal */ -export namespace FeedIdentifier$ { - export const inboundSchema: z.ZodType = z.union([ - z.string(), - z.array(z.string()), - ]); +export const FeedIdentifier$inboundSchema: z.ZodType = + z.union([z.string(), z.array(z.string())]); + +/** @internal */ +export type FeedIdentifier$Outbound = string | Array; - export type Outbound = string | Array; - export const outboundSchema: z.ZodType = z.union([ - z.string(), - z.array(z.string()), - ]); +/** @internal */ +export const FeedIdentifier$outboundSchema: z.ZodType< + FeedIdentifier$Outbound, + z.ZodTypeDef, + FeedIdentifier +> = z.union([z.string(), z.array(z.string())]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace FeedIdentifier$ { + /** @deprecated use `FeedIdentifier$inboundSchema` instead. */ + export const inboundSchema = FeedIdentifier$inboundSchema; + /** @deprecated use `FeedIdentifier$outboundSchema` instead. */ + export const outboundSchema = FeedIdentifier$outboundSchema; + /** @deprecated use `FeedIdentifier$Outbound` instead. */ + export type Outbound = FeedIdentifier$Outbound; } /** @internal */ +export const MarkAs$inboundSchema: z.ZodNativeEnum = z.nativeEnum(MarkAs); + +/** @internal */ +export const MarkAs$outboundSchema: z.ZodNativeEnum = MarkAs$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace MarkAs$ { - export const inboundSchema: z.ZodNativeEnum = z.nativeEnum(MarkAs); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; + /** @deprecated use `MarkAs$inboundSchema` instead. */ + export const inboundSchema = MarkAs$inboundSchema; + /** @deprecated use `MarkAs$outboundSchema` instead. */ + export const outboundSchema = MarkAs$outboundSchema; } /** @internal */ -export namespace MarkAllMessageAsRequestDto$ { - export const inboundSchema: z.ZodType = - z.object({ - feedIdentifier: z.union([z.string(), z.array(z.string())]).optional(), - markAs: MarkAs$.inboundSchema, - }); +export const MarkAllMessageAsRequestDto$inboundSchema: z.ZodType< + MarkAllMessageAsRequestDto, + z.ZodTypeDef, + unknown +> = z.object({ + feedIdentifier: z.union([z.string(), z.array(z.string())]).optional(), + markAs: MarkAs$inboundSchema, +}); - export type Outbound = { - feedIdentifier?: string | Array | undefined; - markAs: string; - }; +/** @internal */ +export type MarkAllMessageAsRequestDto$Outbound = { + feedIdentifier?: string | Array | undefined; + markAs: string; +}; - export const outboundSchema: z.ZodType = - z.object({ - feedIdentifier: z.union([z.string(), z.array(z.string())]).optional(), - markAs: MarkAs$.outboundSchema, - }); +/** @internal */ +export const MarkAllMessageAsRequestDto$outboundSchema: z.ZodType< + MarkAllMessageAsRequestDto$Outbound, + z.ZodTypeDef, + MarkAllMessageAsRequestDto +> = z.object({ + feedIdentifier: z.union([z.string(), z.array(z.string())]).optional(), + markAs: MarkAs$outboundSchema, +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace MarkAllMessageAsRequestDto$ { + /** @deprecated use `MarkAllMessageAsRequestDto$inboundSchema` instead. */ + export const inboundSchema = MarkAllMessageAsRequestDto$inboundSchema; + /** @deprecated use `MarkAllMessageAsRequestDto$outboundSchema` instead. */ + export const outboundSchema = MarkAllMessageAsRequestDto$outboundSchema; + /** @deprecated use `MarkAllMessageAsRequestDto$Outbound` instead. */ + export type Outbound = MarkAllMessageAsRequestDto$Outbound; } diff --git a/src/models/components/markmessageactionasseendto.ts b/src/models/components/markmessageactionasseendto.ts index a8dd9be3..6409519e 100644 --- a/src/models/components/markmessageactionasseendto.ts +++ b/src/models/components/markmessageactionasseendto.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { ClosedEnum } from "../../types/enums.js"; @@ -8,7 +8,7 @@ import * as z from "zod"; /** * Message action payload */ -export type MarkMessageActionAsSeenDtoPayload = {}; +export type Payload = {}; /** * Message action status @@ -26,7 +26,7 @@ export type MarkMessageActionAsSeenDto = { /** * Message action payload */ - payload?: MarkMessageActionAsSeenDtoPayload | undefined; + payload?: Payload | undefined; /** * Message action status */ @@ -34,46 +34,85 @@ export type MarkMessageActionAsSeenDto = { }; /** @internal */ -export namespace MarkMessageActionAsSeenDtoPayload$ { - export const inboundSchema: z.ZodType< - MarkMessageActionAsSeenDtoPayload, - z.ZodTypeDef, - unknown - > = z.object({}); +export const Payload$inboundSchema: z.ZodType = z.object({}); - export type Outbound = {}; +/** @internal */ +export type Payload$Outbound = {}; + +/** @internal */ +export const Payload$outboundSchema: z.ZodType = z.object( + {} +); - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - MarkMessageActionAsSeenDtoPayload - > = z.object({}); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Payload$ { + /** @deprecated use `Payload$inboundSchema` instead. */ + export const inboundSchema = Payload$inboundSchema; + /** @deprecated use `Payload$outboundSchema` instead. */ + export const outboundSchema = Payload$outboundSchema; + /** @deprecated use `Payload$Outbound` instead. */ + export type Outbound = Payload$Outbound; } /** @internal */ +export const MarkMessageActionAsSeenDtoStatus$inboundSchema: z.ZodNativeEnum< + typeof MarkMessageActionAsSeenDtoStatus +> = z.nativeEnum(MarkMessageActionAsSeenDtoStatus); + +/** @internal */ +export const MarkMessageActionAsSeenDtoStatus$outboundSchema: z.ZodNativeEnum< + typeof MarkMessageActionAsSeenDtoStatus +> = MarkMessageActionAsSeenDtoStatus$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace MarkMessageActionAsSeenDtoStatus$ { - export const inboundSchema: z.ZodNativeEnum = - z.nativeEnum(MarkMessageActionAsSeenDtoStatus); - export const outboundSchema: z.ZodNativeEnum = - inboundSchema; + /** @deprecated use `MarkMessageActionAsSeenDtoStatus$inboundSchema` instead. */ + export const inboundSchema = MarkMessageActionAsSeenDtoStatus$inboundSchema; + /** @deprecated use `MarkMessageActionAsSeenDtoStatus$outboundSchema` instead. */ + export const outboundSchema = MarkMessageActionAsSeenDtoStatus$outboundSchema; } /** @internal */ -export namespace MarkMessageActionAsSeenDto$ { - export const inboundSchema: z.ZodType = - z.object({ - payload: z.lazy(() => MarkMessageActionAsSeenDtoPayload$.inboundSchema).optional(), - status: MarkMessageActionAsSeenDtoStatus$.inboundSchema, - }); +export const MarkMessageActionAsSeenDto$inboundSchema: z.ZodType< + MarkMessageActionAsSeenDto, + z.ZodTypeDef, + unknown +> = z.object({ + payload: z.lazy(() => Payload$inboundSchema).optional(), + status: MarkMessageActionAsSeenDtoStatus$inboundSchema, +}); - export type Outbound = { - payload?: MarkMessageActionAsSeenDtoPayload$.Outbound | undefined; - status: string; - }; +/** @internal */ +export type MarkMessageActionAsSeenDto$Outbound = { + payload?: Payload$Outbound | undefined; + status: string; +}; - export const outboundSchema: z.ZodType = - z.object({ - payload: z.lazy(() => MarkMessageActionAsSeenDtoPayload$.outboundSchema).optional(), - status: MarkMessageActionAsSeenDtoStatus$.outboundSchema, - }); +/** @internal */ +export const MarkMessageActionAsSeenDto$outboundSchema: z.ZodType< + MarkMessageActionAsSeenDto$Outbound, + z.ZodTypeDef, + MarkMessageActionAsSeenDto +> = z.object({ + payload: z.lazy(() => Payload$outboundSchema).optional(), + status: MarkMessageActionAsSeenDtoStatus$outboundSchema, +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace MarkMessageActionAsSeenDto$ { + /** @deprecated use `MarkMessageActionAsSeenDto$inboundSchema` instead. */ + export const inboundSchema = MarkMessageActionAsSeenDto$inboundSchema; + /** @deprecated use `MarkMessageActionAsSeenDto$outboundSchema` instead. */ + export const outboundSchema = MarkMessageActionAsSeenDto$outboundSchema; + /** @deprecated use `MarkMessageActionAsSeenDto$Outbound` instead. */ + export type Outbound = MarkMessageActionAsSeenDto$Outbound; } diff --git a/src/models/components/memberinvitedto.ts b/src/models/components/memberinvitedto.ts deleted file mode 100644 index 08dfc734..00000000 --- a/src/models/components/memberinvitedto.ts +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - */ - -import { remap as remap$ } from "../../lib/primitives.js"; -import * as z from "zod"; - -export type MemberInviteDTO = { - inviterId: string; - answerDate?: Date | undefined; - email: string; - invitationDate: Date; - token: string; -}; - -/** @internal */ -export namespace MemberInviteDTO$ { - export const inboundSchema: z.ZodType = z - .object({ - _inviterId: z.string(), - answerDate: z - .string() - .datetime({ offset: true }) - .transform((v) => new Date(v)) - .optional(), - email: z.string(), - invitationDate: z - .string() - .datetime({ offset: true }) - .transform((v) => new Date(v)), - token: z.string(), - }) - .transform((v) => { - return remap$(v, { - _inviterId: "inviterId", - }); - }); - - export type Outbound = { - _inviterId: string; - answerDate?: string | undefined; - email: string; - invitationDate: string; - token: string; - }; - - export const outboundSchema: z.ZodType = z - .object({ - inviterId: z.string(), - answerDate: z - .date() - .transform((v) => v.toISOString()) - .optional(), - email: z.string(), - invitationDate: z.date().transform((v) => v.toISOString()), - token: z.string(), - }) - .transform((v) => { - return remap$(v, { - inviterId: "_inviterId", - }); - }); -} diff --git a/src/models/components/memberresponsedto.ts b/src/models/components/memberresponsedto.ts deleted file mode 100644 index e34c7cad..00000000 --- a/src/models/components/memberresponsedto.ts +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - */ - -import { remap as remap$ } from "../../lib/primitives.js"; -import { ClosedEnum } from "../../types/enums.js"; -import { MemberInviteDTO, MemberInviteDTO$ } from "./memberinvitedto.js"; -import { MemberUserDto, MemberUserDto$ } from "./memberuserdto.js"; -import * as z from "zod"; - -export const MemberStatus = { - New: "new", - Active: "active", - Invited: "invited", -} as const; -export type MemberStatus = ClosedEnum; - -export const Roles = { - Admin: "admin", - Member: "member", -} as const; -export type Roles = ClosedEnum; - -export type MemberResponseDto = { - id: string; - organizationId: string; - userId: string; - invite?: MemberInviteDTO | undefined; - memberStatus?: MemberStatus | undefined; - roles?: Roles | undefined; - user?: MemberUserDto | undefined; -}; - -/** @internal */ -export namespace MemberStatus$ { - export const inboundSchema: z.ZodNativeEnum = z.nativeEnum(MemberStatus); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; -} - -/** @internal */ -export namespace Roles$ { - export const inboundSchema: z.ZodNativeEnum = z.nativeEnum(Roles); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; -} - -/** @internal */ -export namespace MemberResponseDto$ { - export const inboundSchema: z.ZodType = z - .object({ - _id: z.string(), - _organizationId: z.string(), - _userId: z.string(), - invite: MemberInviteDTO$.inboundSchema.optional(), - memberStatus: MemberStatus$.inboundSchema.optional(), - roles: Roles$.inboundSchema.optional(), - user: MemberUserDto$.inboundSchema.optional(), - }) - .transform((v) => { - return remap$(v, { - _id: "id", - _organizationId: "organizationId", - _userId: "userId", - }); - }); - - export type Outbound = { - _id: string; - _organizationId: string; - _userId: string; - invite?: MemberInviteDTO$.Outbound | undefined; - memberStatus?: string | undefined; - roles?: string | undefined; - user?: MemberUserDto$.Outbound | undefined; - }; - - export const outboundSchema: z.ZodType = z - .object({ - id: z.string(), - organizationId: z.string(), - userId: z.string(), - invite: MemberInviteDTO$.outboundSchema.optional(), - memberStatus: MemberStatus$.outboundSchema.optional(), - roles: Roles$.outboundSchema.optional(), - user: MemberUserDto$.outboundSchema.optional(), - }) - .transform((v) => { - return remap$(v, { - id: "_id", - organizationId: "_organizationId", - userId: "_userId", - }); - }); -} diff --git a/src/models/components/memberuserdto.ts b/src/models/components/memberuserdto.ts deleted file mode 100644 index 0d3f5c07..00000000 --- a/src/models/components/memberuserdto.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - */ - -import { remap as remap$ } from "../../lib/primitives.js"; -import * as z from "zod"; - -export type MemberUserDto = { - id: string; - email: string; - firstName: string; - lastName: string; -}; - -/** @internal */ -export namespace MemberUserDto$ { - export const inboundSchema: z.ZodType = z - .object({ - _id: z.string(), - email: z.string(), - firstName: z.string(), - lastName: z.string(), - }) - .transform((v) => { - return remap$(v, { - _id: "id", - }); - }); - - export type Outbound = { - _id: string; - email: string; - firstName: string; - lastName: string; - }; - - export const outboundSchema: z.ZodType = z - .object({ - id: z.string(), - email: z.string(), - firstName: z.string(), - lastName: z.string(), - }) - .transform((v) => { - return remap$(v, { - id: "_id", - }); - }); -} diff --git a/src/models/components/messageaction.ts b/src/models/components/messageaction.ts index ef18198a..ab483e7e 100644 --- a/src/models/components/messageaction.ts +++ b/src/models/components/messageaction.ts @@ -1,10 +1,20 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { ClosedEnum } from "../../types/enums.js"; -import { MessageActionResult, MessageActionResult$ } from "./messageactionresult.js"; -import { MessageButton, MessageButton$ } from "./messagebutton.js"; +import { + MessageActionResult, + MessageActionResult$inboundSchema, + MessageActionResult$Outbound, + MessageActionResult$outboundSchema, +} from "./messageactionresult.js"; +import { + MessageButton, + MessageButton$inboundSchema, + MessageButton$Outbound, + MessageButton$outboundSchema, +} from "./messagebutton.js"; import * as z from "zod"; export const MessageActionStatus = { @@ -20,29 +30,59 @@ export type MessageAction = { }; /** @internal */ +export const MessageActionStatus$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(MessageActionStatus); + +/** @internal */ +export const MessageActionStatus$outboundSchema: z.ZodNativeEnum = + MessageActionStatus$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace MessageActionStatus$ { - export const inboundSchema: z.ZodNativeEnum = - z.nativeEnum(MessageActionStatus); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; + /** @deprecated use `MessageActionStatus$inboundSchema` instead. */ + export const inboundSchema = MessageActionStatus$inboundSchema; + /** @deprecated use `MessageActionStatus$outboundSchema` instead. */ + export const outboundSchema = MessageActionStatus$outboundSchema; } /** @internal */ -export namespace MessageAction$ { - export const inboundSchema: z.ZodType = z.object({ - buttons: z.array(MessageButton$.inboundSchema).optional(), - result: MessageActionResult$.inboundSchema.optional(), - status: MessageActionStatus$.inboundSchema.optional(), +export const MessageAction$inboundSchema: z.ZodType = + z.object({ + buttons: z.array(MessageButton$inboundSchema).optional(), + result: MessageActionResult$inboundSchema.optional(), + status: MessageActionStatus$inboundSchema.optional(), }); - export type Outbound = { - buttons?: Array | undefined; - result?: MessageActionResult$.Outbound | undefined; - status?: string | undefined; - }; +/** @internal */ +export type MessageAction$Outbound = { + buttons?: Array | undefined; + result?: MessageActionResult$Outbound | undefined; + status?: string | undefined; +}; + +/** @internal */ +export const MessageAction$outboundSchema: z.ZodType< + MessageAction$Outbound, + z.ZodTypeDef, + MessageAction +> = z.object({ + buttons: z.array(MessageButton$outboundSchema).optional(), + result: MessageActionResult$outboundSchema.optional(), + status: MessageActionStatus$outboundSchema.optional(), +}); - export const outboundSchema: z.ZodType = z.object({ - buttons: z.array(MessageButton$.outboundSchema).optional(), - result: MessageActionResult$.outboundSchema.optional(), - status: MessageActionStatus$.outboundSchema.optional(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace MessageAction$ { + /** @deprecated use `MessageAction$inboundSchema` instead. */ + export const inboundSchema = MessageAction$inboundSchema; + /** @deprecated use `MessageAction$outboundSchema` instead. */ + export const outboundSchema = MessageAction$outboundSchema; + /** @deprecated use `MessageAction$Outbound` instead. */ + export type Outbound = MessageAction$Outbound; } diff --git a/src/models/components/messageactionresult.ts b/src/models/components/messageactionresult.ts index e950fb97..51465d35 100644 --- a/src/models/components/messageactionresult.ts +++ b/src/models/components/messageactionresult.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { ClosedEnum } from "../../types/enums.js"; @@ -19,37 +19,91 @@ export type MessageActionResult = { }; /** @internal */ -export namespace MessageActionResultPayload$ { - export const inboundSchema: z.ZodType = - z.object({}); +export const MessageActionResultPayload$inboundSchema: z.ZodType< + MessageActionResultPayload, + z.ZodTypeDef, + unknown +> = z.object({}); - export type Outbound = {}; +/** @internal */ +export type MessageActionResultPayload$Outbound = {}; - export const outboundSchema: z.ZodType = - z.object({}); +/** @internal */ +export const MessageActionResultPayload$outboundSchema: z.ZodType< + MessageActionResultPayload$Outbound, + z.ZodTypeDef, + MessageActionResultPayload +> = z.object({}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace MessageActionResultPayload$ { + /** @deprecated use `MessageActionResultPayload$inboundSchema` instead. */ + export const inboundSchema = MessageActionResultPayload$inboundSchema; + /** @deprecated use `MessageActionResultPayload$outboundSchema` instead. */ + export const outboundSchema = MessageActionResultPayload$outboundSchema; + /** @deprecated use `MessageActionResultPayload$Outbound` instead. */ + export type Outbound = MessageActionResultPayload$Outbound; } /** @internal */ +export const MessageActionResultType$inboundSchema: z.ZodNativeEnum< + typeof MessageActionResultType +> = z.nativeEnum(MessageActionResultType); + +/** @internal */ +export const MessageActionResultType$outboundSchema: z.ZodNativeEnum< + typeof MessageActionResultType +> = MessageActionResultType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace MessageActionResultType$ { - export const inboundSchema: z.ZodNativeEnum = - z.nativeEnum(MessageActionResultType); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; + /** @deprecated use `MessageActionResultType$inboundSchema` instead. */ + export const inboundSchema = MessageActionResultType$inboundSchema; + /** @deprecated use `MessageActionResultType$outboundSchema` instead. */ + export const outboundSchema = MessageActionResultType$outboundSchema; } /** @internal */ +export const MessageActionResult$inboundSchema: z.ZodType< + MessageActionResult, + z.ZodTypeDef, + unknown +> = z.object({ + payload: z.lazy(() => MessageActionResultPayload$inboundSchema).optional(), + type: MessageActionResultType$inboundSchema.optional(), +}); + +/** @internal */ +export type MessageActionResult$Outbound = { + payload?: MessageActionResultPayload$Outbound | undefined; + type?: string | undefined; +}; + +/** @internal */ +export const MessageActionResult$outboundSchema: z.ZodType< + MessageActionResult$Outbound, + z.ZodTypeDef, + MessageActionResult +> = z.object({ + payload: z.lazy(() => MessageActionResultPayload$outboundSchema).optional(), + type: MessageActionResultType$outboundSchema.optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace MessageActionResult$ { - export const inboundSchema: z.ZodType = z.object({ - payload: z.lazy(() => MessageActionResultPayload$.inboundSchema).optional(), - type: MessageActionResultType$.inboundSchema.optional(), - }); - - export type Outbound = { - payload?: MessageActionResultPayload$.Outbound | undefined; - type?: string | undefined; - }; - - export const outboundSchema: z.ZodType = z.object({ - payload: z.lazy(() => MessageActionResultPayload$.outboundSchema).optional(), - type: MessageActionResultType$.outboundSchema.optional(), - }); + /** @deprecated use `MessageActionResult$inboundSchema` instead. */ + export const inboundSchema = MessageActionResult$inboundSchema; + /** @deprecated use `MessageActionResult$outboundSchema` instead. */ + export const outboundSchema = MessageActionResult$outboundSchema; + /** @deprecated use `MessageActionResult$Outbound` instead. */ + export type Outbound = MessageActionResult$Outbound; } diff --git a/src/models/components/messagebutton.ts b/src/models/components/messagebutton.ts index 5971e05c..4b78de6c 100644 --- a/src/models/components/messagebutton.ts +++ b/src/models/components/messagebutton.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { ClosedEnum } from "../../types/enums.js"; @@ -18,29 +18,59 @@ export type MessageButton = { }; /** @internal */ +export const MessageButtonType$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(MessageButtonType); + +/** @internal */ +export const MessageButtonType$outboundSchema: z.ZodNativeEnum = + MessageButtonType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace MessageButtonType$ { - export const inboundSchema: z.ZodNativeEnum = - z.nativeEnum(MessageButtonType); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; + /** @deprecated use `MessageButtonType$inboundSchema` instead. */ + export const inboundSchema = MessageButtonType$inboundSchema; + /** @deprecated use `MessageButtonType$outboundSchema` instead. */ + export const outboundSchema = MessageButtonType$outboundSchema; } /** @internal */ -export namespace MessageButton$ { - export const inboundSchema: z.ZodType = z.object({ +export const MessageButton$inboundSchema: z.ZodType = + z.object({ content: z.string(), resultContent: z.string().optional(), - type: MessageButtonType$.inboundSchema, + type: MessageButtonType$inboundSchema, }); - export type Outbound = { - content: string; - resultContent?: string | undefined; - type: string; - }; +/** @internal */ +export type MessageButton$Outbound = { + content: string; + resultContent?: string | undefined; + type: string; +}; + +/** @internal */ +export const MessageButton$outboundSchema: z.ZodType< + MessageButton$Outbound, + z.ZodTypeDef, + MessageButton +> = z.object({ + content: z.string(), + resultContent: z.string().optional(), + type: MessageButtonType$outboundSchema, +}); - export const outboundSchema: z.ZodType = z.object({ - content: z.string(), - resultContent: z.string().optional(), - type: MessageButtonType$.outboundSchema, - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace MessageButton$ { + /** @deprecated use `MessageButton$inboundSchema` instead. */ + export const inboundSchema = MessageButton$inboundSchema; + /** @deprecated use `MessageButton$outboundSchema` instead. */ + export const outboundSchema = MessageButton$outboundSchema; + /** @deprecated use `MessageButton$Outbound` instead. */ + export type Outbound = MessageButton$Outbound; } diff --git a/src/models/components/messagecta.ts b/src/models/components/messagecta.ts index 88a0cfe6..d16973fb 100644 --- a/src/models/components/messagecta.ts +++ b/src/models/components/messagecta.ts @@ -1,10 +1,20 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { ClosedEnum } from "../../types/enums.js"; -import { MessageAction, MessageAction$ } from "./messageaction.js"; -import { MessageCTAData, MessageCTAData$ } from "./messagectadata.js"; +import { + MessageAction, + MessageAction$inboundSchema, + MessageAction$Outbound, + MessageAction$outboundSchema, +} from "./messageaction.js"; +import { + MessageCTAData, + MessageCTAData$inboundSchema, + MessageCTAData$Outbound, + MessageCTAData$outboundSchema, +} from "./messagectadata.js"; import * as z from "zod"; export const MessageCTAType = { @@ -19,29 +29,55 @@ export type MessageCTA = { }; /** @internal */ +export const MessageCTAType$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(MessageCTAType); + +/** @internal */ +export const MessageCTAType$outboundSchema: z.ZodNativeEnum = + MessageCTAType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace MessageCTAType$ { - export const inboundSchema: z.ZodNativeEnum = - z.nativeEnum(MessageCTAType); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; + /** @deprecated use `MessageCTAType$inboundSchema` instead. */ + export const inboundSchema = MessageCTAType$inboundSchema; + /** @deprecated use `MessageCTAType$outboundSchema` instead. */ + export const outboundSchema = MessageCTAType$outboundSchema; } /** @internal */ -export namespace MessageCTA$ { - export const inboundSchema: z.ZodType = z.object({ - action: MessageAction$.inboundSchema.optional(), - data: MessageCTAData$.inboundSchema, - type: MessageCTAType$.inboundSchema.optional(), - }); +export const MessageCTA$inboundSchema: z.ZodType = z.object({ + action: MessageAction$inboundSchema.optional(), + data: MessageCTAData$inboundSchema, + type: MessageCTAType$inboundSchema.optional(), +}); - export type Outbound = { - action?: MessageAction$.Outbound | undefined; - data: MessageCTAData$.Outbound; - type?: string | undefined; - }; +/** @internal */ +export type MessageCTA$Outbound = { + action?: MessageAction$Outbound | undefined; + data: MessageCTAData$Outbound; + type?: string | undefined; +}; - export const outboundSchema: z.ZodType = z.object({ - action: MessageAction$.outboundSchema.optional(), - data: MessageCTAData$.outboundSchema, - type: MessageCTAType$.outboundSchema.optional(), +/** @internal */ +export const MessageCTA$outboundSchema: z.ZodType = + z.object({ + action: MessageAction$outboundSchema.optional(), + data: MessageCTAData$outboundSchema, + type: MessageCTAType$outboundSchema.optional(), }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace MessageCTA$ { + /** @deprecated use `MessageCTA$inboundSchema` instead. */ + export const inboundSchema = MessageCTA$inboundSchema; + /** @deprecated use `MessageCTA$outboundSchema` instead. */ + export const outboundSchema = MessageCTA$outboundSchema; + /** @deprecated use `MessageCTA$Outbound` instead. */ + export type Outbound = MessageCTA$Outbound; } diff --git a/src/models/components/messagectadata.ts b/src/models/components/messagectadata.ts index 105a74cd..2c522707 100644 --- a/src/models/components/messagectadata.ts +++ b/src/models/components/messagectadata.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -9,16 +9,34 @@ export type MessageCTAData = { }; /** @internal */ -export namespace MessageCTAData$ { - export const inboundSchema: z.ZodType = z.object({ +export const MessageCTAData$inboundSchema: z.ZodType = + z.object({ url: z.string().optional(), }); - export type Outbound = { - url?: string | undefined; - }; +/** @internal */ +export type MessageCTAData$Outbound = { + url?: string | undefined; +}; - export const outboundSchema: z.ZodType = z.object({ - url: z.string().optional(), - }); +/** @internal */ +export const MessageCTAData$outboundSchema: z.ZodType< + MessageCTAData$Outbound, + z.ZodTypeDef, + MessageCTAData +> = z.object({ + url: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace MessageCTAData$ { + /** @deprecated use `MessageCTAData$inboundSchema` instead. */ + export const inboundSchema = MessageCTAData$inboundSchema; + /** @deprecated use `MessageCTAData$outboundSchema` instead. */ + export const outboundSchema = MessageCTAData$outboundSchema; + /** @deprecated use `MessageCTAData$Outbound` instead. */ + export type Outbound = MessageCTAData$Outbound; } diff --git a/src/models/components/messageentity.ts b/src/models/components/messageentity.ts index 4f9dc765..5276b962 100644 --- a/src/models/components/messageentity.ts +++ b/src/models/components/messageentity.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -7,10 +7,28 @@ import * as z from "zod"; export type MessageEntity = {}; /** @internal */ -export namespace MessageEntity$ { - export const inboundSchema: z.ZodType = z.object({}); +export const MessageEntity$inboundSchema: z.ZodType = + z.object({}); + +/** @internal */ +export type MessageEntity$Outbound = {}; - export type Outbound = {}; +/** @internal */ +export const MessageEntity$outboundSchema: z.ZodType< + MessageEntity$Outbound, + z.ZodTypeDef, + MessageEntity +> = z.object({}); - export const outboundSchema: z.ZodType = z.object({}); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace MessageEntity$ { + /** @deprecated use `MessageEntity$inboundSchema` instead. */ + export const inboundSchema = MessageEntity$inboundSchema; + /** @deprecated use `MessageEntity$outboundSchema` instead. */ + export const outboundSchema = MessageEntity$outboundSchema; + /** @deprecated use `MessageEntity$Outbound` instead. */ + export type Outbound = MessageEntity$Outbound; } diff --git a/src/models/components/messagemarkasrequestdto.ts b/src/models/components/messagemarkasrequestdto.ts index 4ee0202c..ba47924e 100644 --- a/src/models/components/messagemarkasrequestdto.ts +++ b/src/models/components/messagemarkasrequestdto.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { ClosedEnum } from "../../types/enums.js"; @@ -21,43 +21,87 @@ export type MessageMarkAsRequestDto = { }; /** @internal */ +export const MessageMarkAsRequestDtoMarkAs$inboundSchema: z.ZodNativeEnum< + typeof MessageMarkAsRequestDtoMarkAs +> = z.nativeEnum(MessageMarkAsRequestDtoMarkAs); + +/** @internal */ +export const MessageMarkAsRequestDtoMarkAs$outboundSchema: z.ZodNativeEnum< + typeof MessageMarkAsRequestDtoMarkAs +> = MessageMarkAsRequestDtoMarkAs$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace MessageMarkAsRequestDtoMarkAs$ { - export const inboundSchema: z.ZodNativeEnum = - z.nativeEnum(MessageMarkAsRequestDtoMarkAs); - export const outboundSchema: z.ZodNativeEnum = - inboundSchema; + /** @deprecated use `MessageMarkAsRequestDtoMarkAs$inboundSchema` instead. */ + export const inboundSchema = MessageMarkAsRequestDtoMarkAs$inboundSchema; + /** @deprecated use `MessageMarkAsRequestDtoMarkAs$outboundSchema` instead. */ + export const outboundSchema = MessageMarkAsRequestDtoMarkAs$outboundSchema; } /** @internal */ +export const MessageId$inboundSchema: z.ZodType = z.union([ + z.string(), + z.array(z.string()), +]); + +/** @internal */ +export type MessageId$Outbound = string | Array; + +/** @internal */ +export const MessageId$outboundSchema: z.ZodType = + z.union([z.string(), z.array(z.string())]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace MessageId$ { - export const inboundSchema: z.ZodType = z.union([ - z.string(), - z.array(z.string()), - ]); - - export type Outbound = string | Array; - export const outboundSchema: z.ZodType = z.union([ - z.string(), - z.array(z.string()), - ]); + /** @deprecated use `MessageId$inboundSchema` instead. */ + export const inboundSchema = MessageId$inboundSchema; + /** @deprecated use `MessageId$outboundSchema` instead. */ + export const outboundSchema = MessageId$outboundSchema; + /** @deprecated use `MessageId$Outbound` instead. */ + export type Outbound = MessageId$Outbound; } /** @internal */ +export const MessageMarkAsRequestDto$inboundSchema: z.ZodType< + MessageMarkAsRequestDto, + z.ZodTypeDef, + unknown +> = z.object({ + markAs: MessageMarkAsRequestDtoMarkAs$inboundSchema, + messageId: z.union([z.string(), z.array(z.string())]), +}); + +/** @internal */ +export type MessageMarkAsRequestDto$Outbound = { + markAs: string; + messageId: string | Array; +}; + +/** @internal */ +export const MessageMarkAsRequestDto$outboundSchema: z.ZodType< + MessageMarkAsRequestDto$Outbound, + z.ZodTypeDef, + MessageMarkAsRequestDto +> = z.object({ + markAs: MessageMarkAsRequestDtoMarkAs$outboundSchema, + messageId: z.union([z.string(), z.array(z.string())]), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace MessageMarkAsRequestDto$ { - export const inboundSchema: z.ZodType = - z.object({ - markAs: MessageMarkAsRequestDtoMarkAs$.inboundSchema, - messageId: z.union([z.string(), z.array(z.string())]), - }); - - export type Outbound = { - markAs: string; - messageId: string | Array; - }; - - export const outboundSchema: z.ZodType = - z.object({ - markAs: MessageMarkAsRequestDtoMarkAs$.outboundSchema, - messageId: z.union([z.string(), z.array(z.string())]), - }); + /** @deprecated use `MessageMarkAsRequestDto$inboundSchema` instead. */ + export const inboundSchema = MessageMarkAsRequestDto$inboundSchema; + /** @deprecated use `MessageMarkAsRequestDto$outboundSchema` instead. */ + export const outboundSchema = MessageMarkAsRequestDto$outboundSchema; + /** @deprecated use `MessageMarkAsRequestDto$Outbound` instead. */ + export type Outbound = MessageMarkAsRequestDto$Outbound; } diff --git a/src/models/components/messageresponsedto.ts b/src/models/components/messageresponsedto.ts index cb9c1226..4b33c2e3 100644 --- a/src/models/components/messageresponsedto.ts +++ b/src/models/components/messageresponsedto.ts @@ -1,15 +1,37 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; import { ClosedEnum } from "../../types/enums.js"; -import { EmailBlock, EmailBlock$ } from "./emailblock.js"; -import { MessageCTA, MessageCTA$ } from "./messagecta.js"; -import { SubscriberResponseDto, SubscriberResponseDto$ } from "./subscriberresponsedto.js"; -import { WorkflowResponse, WorkflowResponse$ } from "./workflowresponse.js"; +import { + EmailBlock, + EmailBlock$inboundSchema, + EmailBlock$Outbound, + EmailBlock$outboundSchema, +} from "./emailblock.js"; +import { + MessageCTA, + MessageCTA$inboundSchema, + MessageCTA$Outbound, + MessageCTA$outboundSchema, +} from "./messagecta.js"; +import { + SubscriberResponseDto, + SubscriberResponseDto$inboundSchema, + SubscriberResponseDto$Outbound, + SubscriberResponseDto$outboundSchema, +} from "./subscriberresponsedto.js"; +import { + WorkflowResponse, + WorkflowResponse$inboundSchema, + WorkflowResponse$Outbound, + WorkflowResponse$outboundSchema, +} from "./workflowresponse.js"; import * as z from "zod"; +export type FeedId = {}; + export const MessageResponseDtoChannel = { InApp: "in_app", Email: "email", @@ -40,7 +62,7 @@ export type MessageResponseDtoStatus = ClosedEnum = z.object({}); + +/** @internal */ +export type FeedId$Outbound = {}; + +/** @internal */ +export const FeedId$outboundSchema: z.ZodType = z.object({}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace FeedId$ { + /** @deprecated use `FeedId$inboundSchema` instead. */ + export const inboundSchema = FeedId$inboundSchema; + /** @deprecated use `FeedId$outboundSchema` instead. */ + export const outboundSchema = FeedId$outboundSchema; + /** @deprecated use `FeedId$Outbound` instead. */ + export type Outbound = FeedId$Outbound; +} + +/** @internal */ +export const MessageResponseDtoChannel$inboundSchema: z.ZodNativeEnum< + typeof MessageResponseDtoChannel +> = z.nativeEnum(MessageResponseDtoChannel); + +/** @internal */ +export const MessageResponseDtoChannel$outboundSchema: z.ZodNativeEnum< + typeof MessageResponseDtoChannel +> = MessageResponseDtoChannel$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace MessageResponseDtoChannel$ { - export const inboundSchema: z.ZodNativeEnum = - z.nativeEnum(MessageResponseDtoChannel); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; + /** @deprecated use `MessageResponseDtoChannel$inboundSchema` instead. */ + export const inboundSchema = MessageResponseDtoChannel$inboundSchema; + /** @deprecated use `MessageResponseDtoChannel$outboundSchema` instead. */ + export const outboundSchema = MessageResponseDtoChannel$outboundSchema; } /** @internal */ +export const Content$inboundSchema: z.ZodType = z.union([ + EmailBlock$inboundSchema, + z.string(), +]); + +/** @internal */ +export type Content$Outbound = EmailBlock$Outbound | string; + +/** @internal */ +export const Content$outboundSchema: z.ZodType = z.union([ + EmailBlock$outboundSchema, + z.string(), +]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace Content$ { - export const inboundSchema: z.ZodType = z.union([ - EmailBlock$.inboundSchema, - z.string(), - ]); - - export type Outbound = EmailBlock$.Outbound | string; - export const outboundSchema: z.ZodType = z.union([ - EmailBlock$.outboundSchema, - z.string(), - ]); + /** @deprecated use `Content$inboundSchema` instead. */ + export const inboundSchema = Content$inboundSchema; + /** @deprecated use `Content$outboundSchema` instead. */ + export const outboundSchema = Content$outboundSchema; + /** @deprecated use `Content$Outbound` instead. */ + export type Outbound = Content$Outbound; } /** @internal */ -export namespace Overrides$ { - export const inboundSchema: z.ZodType = z.object({}); +export const Overrides$inboundSchema: z.ZodType = z.object({}); - export type Outbound = {}; +/** @internal */ +export type Overrides$Outbound = {}; - export const outboundSchema: z.ZodType = z.object({}); +/** @internal */ +export const Overrides$outboundSchema: z.ZodType = + z.object({}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Overrides$ { + /** @deprecated use `Overrides$inboundSchema` instead. */ + export const inboundSchema = Overrides$inboundSchema; + /** @deprecated use `Overrides$outboundSchema` instead. */ + export const outboundSchema = Overrides$outboundSchema; + /** @deprecated use `Overrides$Outbound` instead. */ + export type Outbound = Overrides$Outbound; } /** @internal */ -export namespace MessageResponseDtoPayload$ { - export const inboundSchema: z.ZodType = - z.object({}); +export const MessageResponseDtoPayload$inboundSchema: z.ZodType< + MessageResponseDtoPayload, + z.ZodTypeDef, + unknown +> = z.object({}); + +/** @internal */ +export type MessageResponseDtoPayload$Outbound = {}; - export type Outbound = {}; +/** @internal */ +export const MessageResponseDtoPayload$outboundSchema: z.ZodType< + MessageResponseDtoPayload$Outbound, + z.ZodTypeDef, + MessageResponseDtoPayload +> = z.object({}); - export const outboundSchema: z.ZodType = - z.object({}); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace MessageResponseDtoPayload$ { + /** @deprecated use `MessageResponseDtoPayload$inboundSchema` instead. */ + export const inboundSchema = MessageResponseDtoPayload$inboundSchema; + /** @deprecated use `MessageResponseDtoPayload$outboundSchema` instead. */ + export const outboundSchema = MessageResponseDtoPayload$outboundSchema; + /** @deprecated use `MessageResponseDtoPayload$Outbound` instead. */ + export type Outbound = MessageResponseDtoPayload$Outbound; } /** @internal */ +export const MessageResponseDtoStatus$inboundSchema: z.ZodNativeEnum< + typeof MessageResponseDtoStatus +> = z.nativeEnum(MessageResponseDtoStatus); + +/** @internal */ +export const MessageResponseDtoStatus$outboundSchema: z.ZodNativeEnum< + typeof MessageResponseDtoStatus +> = MessageResponseDtoStatus$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace MessageResponseDtoStatus$ { - export const inboundSchema: z.ZodNativeEnum = - z.nativeEnum(MessageResponseDtoStatus); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; + /** @deprecated use `MessageResponseDtoStatus$inboundSchema` instead. */ + export const inboundSchema = MessageResponseDtoStatus$inboundSchema; + /** @deprecated use `MessageResponseDtoStatus$outboundSchema` instead. */ + export const outboundSchema = MessageResponseDtoStatus$outboundSchema; } /** @internal */ -export namespace MessageResponseDto$ { - export const inboundSchema: z.ZodType = z - .object({ - _environmentId: z.string(), - _feedId: z.nullable(z.string()).optional(), - _id: z.string().optional(), - _messageTemplateId: z.string(), - _notificationId: z.string(), - _organizationId: z.string(), - _subscriberId: z.string(), - _templateId: z.string(), - channel: MessageResponseDtoChannel$.inboundSchema, - content: z.union([EmailBlock$.inboundSchema, z.string()]), - createdAt: z.string(), - cta: MessageCTA$.inboundSchema, - deviceTokens: z.array(z.string()).optional(), - directWebhookUrl: z.string().optional(), - email: z.string().optional(), - errorId: z.string(), - errorText: z.string(), - lastReadDate: z.string().optional(), - lastSeenDate: z.string().optional(), - overrides: z.lazy(() => Overrides$.inboundSchema), - payload: z.lazy(() => MessageResponseDtoPayload$.inboundSchema), - phone: z.string().optional(), - providerId: z.string().optional(), - read: z.boolean(), - seen: z.boolean(), - status: MessageResponseDtoStatus$.inboundSchema, - subject: z.string().optional(), - subscriber: SubscriberResponseDto$.inboundSchema.optional(), - template: WorkflowResponse$.inboundSchema.optional(), - templateIdentifier: z.string().optional(), - title: z.string().optional(), - transactionId: z.string(), - }) - .transform((v) => { - return remap$(v, { - _environmentId: "environmentId", - _feedId: "feedId", - _id: "id", - _messageTemplateId: "messageTemplateId", - _notificationId: "notificationId", - _organizationId: "organizationId", - _subscriberId: "subscriberId", - _templateId: "templateId", - }); +export const MessageResponseDto$inboundSchema: z.ZodType< + MessageResponseDto, + z.ZodTypeDef, + unknown +> = z + .object({ + _environmentId: z.string(), + _feedId: z.nullable(z.lazy(() => FeedId$inboundSchema)).optional(), + _id: z.string().optional(), + _messageTemplateId: z.string(), + _notificationId: z.string(), + _organizationId: z.string(), + _subscriberId: z.string(), + _templateId: z.string(), + channel: MessageResponseDtoChannel$inboundSchema, + content: z.union([EmailBlock$inboundSchema, z.string()]), + createdAt: z.string(), + cta: MessageCTA$inboundSchema, + deviceTokens: z.array(z.string()).optional(), + directWebhookUrl: z.string().optional(), + email: z.string().optional(), + errorId: z.string(), + errorText: z.string(), + lastReadDate: z.string().optional(), + lastSeenDate: z.string().optional(), + overrides: z.lazy(() => Overrides$inboundSchema), + payload: z.lazy(() => MessageResponseDtoPayload$inboundSchema), + phone: z.string().optional(), + providerId: z.string().optional(), + read: z.boolean(), + seen: z.boolean(), + status: MessageResponseDtoStatus$inboundSchema, + subject: z.string().optional(), + subscriber: SubscriberResponseDto$inboundSchema.optional(), + template: WorkflowResponse$inboundSchema.optional(), + templateIdentifier: z.string().optional(), + title: z.string().optional(), + transactionId: z.string(), + }) + .transform((v) => { + return remap$(v, { + _environmentId: "environmentId", + _feedId: "feedId", + _id: "id", + _messageTemplateId: "messageTemplateId", + _notificationId: "notificationId", + _organizationId: "organizationId", + _subscriberId: "subscriberId", + _templateId: "templateId", }); + }); - export type Outbound = { - _environmentId: string; - _feedId?: string | null | undefined; - _id?: string | undefined; - _messageTemplateId: string; - _notificationId: string; - _organizationId: string; - _subscriberId: string; - _templateId: string; - channel: string; - content: EmailBlock$.Outbound | string; - createdAt: string; - cta: MessageCTA$.Outbound; - deviceTokens?: Array | undefined; - directWebhookUrl?: string | undefined; - email?: string | undefined; - errorId: string; - errorText: string; - lastReadDate?: string | undefined; - lastSeenDate?: string | undefined; - overrides: Overrides$.Outbound; - payload: MessageResponseDtoPayload$.Outbound; - phone?: string | undefined; - providerId?: string | undefined; - read: boolean; - seen: boolean; - status: string; - subject?: string | undefined; - subscriber?: SubscriberResponseDto$.Outbound | undefined; - template?: WorkflowResponse$.Outbound | undefined; - templateIdentifier?: string | undefined; - title?: string | undefined; - transactionId: string; - }; - - export const outboundSchema: z.ZodType = z - .object({ - environmentId: z.string(), - feedId: z.nullable(z.string()).optional(), - id: z.string().optional(), - messageTemplateId: z.string(), - notificationId: z.string(), - organizationId: z.string(), - subscriberId: z.string(), - templateId: z.string(), - channel: MessageResponseDtoChannel$.outboundSchema, - content: z.union([EmailBlock$.outboundSchema, z.string()]), - createdAt: z.string(), - cta: MessageCTA$.outboundSchema, - deviceTokens: z.array(z.string()).optional(), - directWebhookUrl: z.string().optional(), - email: z.string().optional(), - errorId: z.string(), - errorText: z.string(), - lastReadDate: z.string().optional(), - lastSeenDate: z.string().optional(), - overrides: z.lazy(() => Overrides$.outboundSchema), - payload: z.lazy(() => MessageResponseDtoPayload$.outboundSchema), - phone: z.string().optional(), - providerId: z.string().optional(), - read: z.boolean(), - seen: z.boolean(), - status: MessageResponseDtoStatus$.outboundSchema, - subject: z.string().optional(), - subscriber: SubscriberResponseDto$.outboundSchema.optional(), - template: WorkflowResponse$.outboundSchema.optional(), - templateIdentifier: z.string().optional(), - title: z.string().optional(), - transactionId: z.string(), - }) - .transform((v) => { - return remap$(v, { - environmentId: "_environmentId", - feedId: "_feedId", - id: "_id", - messageTemplateId: "_messageTemplateId", - notificationId: "_notificationId", - organizationId: "_organizationId", - subscriberId: "_subscriberId", - templateId: "_templateId", - }); +/** @internal */ +export type MessageResponseDto$Outbound = { + _environmentId: string; + _feedId?: FeedId$Outbound | null | undefined; + _id?: string | undefined; + _messageTemplateId: string; + _notificationId: string; + _organizationId: string; + _subscriberId: string; + _templateId: string; + channel: string; + content: EmailBlock$Outbound | string; + createdAt: string; + cta: MessageCTA$Outbound; + deviceTokens?: Array | undefined; + directWebhookUrl?: string | undefined; + email?: string | undefined; + errorId: string; + errorText: string; + lastReadDate?: string | undefined; + lastSeenDate?: string | undefined; + overrides: Overrides$Outbound; + payload: MessageResponseDtoPayload$Outbound; + phone?: string | undefined; + providerId?: string | undefined; + read: boolean; + seen: boolean; + status: string; + subject?: string | undefined; + subscriber?: SubscriberResponseDto$Outbound | undefined; + template?: WorkflowResponse$Outbound | undefined; + templateIdentifier?: string | undefined; + title?: string | undefined; + transactionId: string; +}; + +/** @internal */ +export const MessageResponseDto$outboundSchema: z.ZodType< + MessageResponseDto$Outbound, + z.ZodTypeDef, + MessageResponseDto +> = z + .object({ + environmentId: z.string(), + feedId: z.nullable(z.lazy(() => FeedId$outboundSchema)).optional(), + id: z.string().optional(), + messageTemplateId: z.string(), + notificationId: z.string(), + organizationId: z.string(), + subscriberId: z.string(), + templateId: z.string(), + channel: MessageResponseDtoChannel$outboundSchema, + content: z.union([EmailBlock$outboundSchema, z.string()]), + createdAt: z.string(), + cta: MessageCTA$outboundSchema, + deviceTokens: z.array(z.string()).optional(), + directWebhookUrl: z.string().optional(), + email: z.string().optional(), + errorId: z.string(), + errorText: z.string(), + lastReadDate: z.string().optional(), + lastSeenDate: z.string().optional(), + overrides: z.lazy(() => Overrides$outboundSchema), + payload: z.lazy(() => MessageResponseDtoPayload$outboundSchema), + phone: z.string().optional(), + providerId: z.string().optional(), + read: z.boolean(), + seen: z.boolean(), + status: MessageResponseDtoStatus$outboundSchema, + subject: z.string().optional(), + subscriber: SubscriberResponseDto$outboundSchema.optional(), + template: WorkflowResponse$outboundSchema.optional(), + templateIdentifier: z.string().optional(), + title: z.string().optional(), + transactionId: z.string(), + }) + .transform((v) => { + return remap$(v, { + environmentId: "_environmentId", + feedId: "_feedId", + id: "_id", + messageTemplateId: "_messageTemplateId", + notificationId: "_notificationId", + organizationId: "_organizationId", + subscriberId: "_subscriberId", + templateId: "_templateId", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace MessageResponseDto$ { + /** @deprecated use `MessageResponseDto$inboundSchema` instead. */ + export const inboundSchema = MessageResponseDto$inboundSchema; + /** @deprecated use `MessageResponseDto$outboundSchema` instead. */ + export const outboundSchema = MessageResponseDto$outboundSchema; + /** @deprecated use `MessageResponseDto$Outbound` instead. */ + export type Outbound = MessageResponseDto$Outbound; } diff --git a/src/models/components/messagetemplate.ts b/src/models/components/messagetemplate.ts index 67f205c4..f8ba81c1 100644 --- a/src/models/components/messagetemplate.ts +++ b/src/models/components/messagetemplate.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -7,10 +7,28 @@ import * as z from "zod"; export type MessageTemplate = {}; /** @internal */ -export namespace MessageTemplate$ { - export const inboundSchema: z.ZodType = z.object({}); +export const MessageTemplate$inboundSchema: z.ZodType = + z.object({}); + +/** @internal */ +export type MessageTemplate$Outbound = {}; - export type Outbound = {}; +/** @internal */ +export const MessageTemplate$outboundSchema: z.ZodType< + MessageTemplate$Outbound, + z.ZodTypeDef, + MessageTemplate +> = z.object({}); - export const outboundSchema: z.ZodType = z.object({}); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace MessageTemplate$ { + /** @deprecated use `MessageTemplate$inboundSchema` instead. */ + export const inboundSchema = MessageTemplate$inboundSchema; + /** @deprecated use `MessageTemplate$outboundSchema` instead. */ + export const outboundSchema = MessageTemplate$outboundSchema; + /** @deprecated use `MessageTemplate$Outbound` instead. */ + export type Outbound = MessageTemplate$Outbound; } diff --git a/src/models/components/messagetemplatedto.ts b/src/models/components/messagetemplatedto.ts deleted file mode 100644 index 2a51ebc9..00000000 --- a/src/models/components/messagetemplatedto.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - */ - -import * as z from "zod"; - -export type MessageTemplateDto = {}; - -/** @internal */ -export namespace MessageTemplateDto$ { - export const inboundSchema: z.ZodType = z.object({}); - - export type Outbound = {}; - - export const outboundSchema: z.ZodType = z.object( - {} - ); -} diff --git a/src/models/components/notificationgroup.ts b/src/models/components/notificationgroup.ts index 340832f7..9e16c31a 100644 --- a/src/models/components/notificationgroup.ts +++ b/src/models/components/notificationgroup.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; @@ -14,8 +14,8 @@ export type NotificationGroup = { }; /** @internal */ -export namespace NotificationGroup$ { - export const inboundSchema: z.ZodType = z +export const NotificationGroup$inboundSchema: z.ZodType = + z .object({ _environmentId: z.string(), _id: z.string().optional(), @@ -32,28 +32,46 @@ export namespace NotificationGroup$ { }); }); - export type Outbound = { - _environmentId: string; - _id?: string | undefined; - _organizationId: string; - _parentId?: string | undefined; - name: string; - }; +/** @internal */ +export type NotificationGroup$Outbound = { + _environmentId: string; + _id?: string | undefined; + _organizationId: string; + _parentId?: string | undefined; + name: string; +}; - export const outboundSchema: z.ZodType = z - .object({ - environmentId: z.string(), - id: z.string().optional(), - organizationId: z.string(), - parentId: z.string().optional(), - name: z.string(), - }) - .transform((v) => { - return remap$(v, { - environmentId: "_environmentId", - id: "_id", - organizationId: "_organizationId", - parentId: "_parentId", - }); +/** @internal */ +export const NotificationGroup$outboundSchema: z.ZodType< + NotificationGroup$Outbound, + z.ZodTypeDef, + NotificationGroup +> = z + .object({ + environmentId: z.string(), + id: z.string().optional(), + organizationId: z.string(), + parentId: z.string().optional(), + name: z.string(), + }) + .transform((v) => { + return remap$(v, { + environmentId: "_environmentId", + id: "_id", + organizationId: "_organizationId", + parentId: "_parentId", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace NotificationGroup$ { + /** @deprecated use `NotificationGroup$inboundSchema` instead. */ + export const inboundSchema = NotificationGroup$inboundSchema; + /** @deprecated use `NotificationGroup$outboundSchema` instead. */ + export const outboundSchema = NotificationGroup$outboundSchema; + /** @deprecated use `NotificationGroup$Outbound` instead. */ + export type Outbound = NotificationGroup$Outbound; } diff --git a/src/models/components/notificationgroupresponsedto.ts b/src/models/components/notificationgroupresponsedto.ts index c964a8de..b36a6ad2 100644 --- a/src/models/components/notificationgroupresponsedto.ts +++ b/src/models/components/notificationgroupresponsedto.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; @@ -14,46 +14,67 @@ export type NotificationGroupResponseDto = { }; /** @internal */ -export namespace NotificationGroupResponseDto$ { - export const inboundSchema: z.ZodType = z - .object({ - _environmentId: z.string(), - _id: z.string().optional(), - _organizationId: z.string(), - _parentId: z.string().optional(), - name: z.string(), - }) - .transform((v) => { - return remap$(v, { - _environmentId: "environmentId", - _id: "id", - _organizationId: "organizationId", - _parentId: "parentId", - }); +export const NotificationGroupResponseDto$inboundSchema: z.ZodType< + NotificationGroupResponseDto, + z.ZodTypeDef, + unknown +> = z + .object({ + _environmentId: z.string(), + _id: z.string().optional(), + _organizationId: z.string(), + _parentId: z.string().optional(), + name: z.string(), + }) + .transform((v) => { + return remap$(v, { + _environmentId: "environmentId", + _id: "id", + _organizationId: "organizationId", + _parentId: "parentId", }); + }); - export type Outbound = { - _environmentId: string; - _id?: string | undefined; - _organizationId: string; - _parentId?: string | undefined; - name: string; - }; +/** @internal */ +export type NotificationGroupResponseDto$Outbound = { + _environmentId: string; + _id?: string | undefined; + _organizationId: string; + _parentId?: string | undefined; + name: string; +}; - export const outboundSchema: z.ZodType = z - .object({ - environmentId: z.string(), - id: z.string().optional(), - organizationId: z.string(), - parentId: z.string().optional(), - name: z.string(), - }) - .transform((v) => { - return remap$(v, { - environmentId: "_environmentId", - id: "_id", - organizationId: "_organizationId", - parentId: "_parentId", - }); +/** @internal */ +export const NotificationGroupResponseDto$outboundSchema: z.ZodType< + NotificationGroupResponseDto$Outbound, + z.ZodTypeDef, + NotificationGroupResponseDto +> = z + .object({ + environmentId: z.string(), + id: z.string().optional(), + organizationId: z.string(), + parentId: z.string().optional(), + name: z.string(), + }) + .transform((v) => { + return remap$(v, { + environmentId: "_environmentId", + id: "_id", + organizationId: "_organizationId", + parentId: "_parentId", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace NotificationGroupResponseDto$ { + /** @deprecated use `NotificationGroupResponseDto$inboundSchema` instead. */ + export const inboundSchema = NotificationGroupResponseDto$inboundSchema; + /** @deprecated use `NotificationGroupResponseDto$outboundSchema` instead. */ + export const outboundSchema = NotificationGroupResponseDto$outboundSchema; + /** @deprecated use `NotificationGroupResponseDto$Outbound` instead. */ + export type Outbound = NotificationGroupResponseDto$Outbound; } diff --git a/src/models/components/notificationstep.ts b/src/models/components/notificationstep.ts index dabae958..91b366f3 100644 --- a/src/models/components/notificationstep.ts +++ b/src/models/components/notificationstep.ts @@ -1,15 +1,50 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; -import { DelayRegularMetadata, DelayRegularMetadata$ } from "./delayregularmetadata.js"; -import { DelayScheduledMetadata, DelayScheduledMetadata$ } from "./delayscheduledmetadata.js"; -import { DigestRegularMetadata, DigestRegularMetadata$ } from "./digestregularmetadata.js"; -import { DigestTimedMetadata, DigestTimedMetadata$ } from "./digesttimedmetadata.js"; -import { MessageTemplate, MessageTemplate$ } from "./messagetemplate.js"; -import { NotificationStepVariant, NotificationStepVariant$ } from "./notificationstepvariant.js"; -import { StepFilter, StepFilter$ } from "./stepfilter.js"; +import { + DelayRegularMetadata, + DelayRegularMetadata$inboundSchema, + DelayRegularMetadata$Outbound, + DelayRegularMetadata$outboundSchema, +} from "./delayregularmetadata.js"; +import { + DelayScheduledMetadata, + DelayScheduledMetadata$inboundSchema, + DelayScheduledMetadata$Outbound, + DelayScheduledMetadata$outboundSchema, +} from "./delayscheduledmetadata.js"; +import { + DigestRegularMetadata, + DigestRegularMetadata$inboundSchema, + DigestRegularMetadata$Outbound, + DigestRegularMetadata$outboundSchema, +} from "./digestregularmetadata.js"; +import { + DigestTimedMetadata, + DigestTimedMetadata$inboundSchema, + DigestTimedMetadata$Outbound, + DigestTimedMetadata$outboundSchema, +} from "./digesttimedmetadata.js"; +import { + MessageTemplate, + MessageTemplate$inboundSchema, + MessageTemplate$Outbound, + MessageTemplate$outboundSchema, +} from "./messagetemplate.js"; +import { + NotificationStepVariant, + NotificationStepVariant$inboundSchema, + NotificationStepVariant$Outbound, + NotificationStepVariant$outboundSchema, +} from "./notificationstepvariant.js"; +import { + StepFilter, + StepFilter$inboundSchema, + StepFilter$Outbound, + StepFilter$outboundSchema, +} from "./stepfilter.js"; import * as z from "zod"; export type ParentId = {}; @@ -43,124 +78,188 @@ export type NotificationStep = { }; /** @internal */ -export namespace ParentId$ { - export const inboundSchema: z.ZodType = z.object({}); +export const ParentId$inboundSchema: z.ZodType = z.object({}); - export type Outbound = {}; +/** @internal */ +export type ParentId$Outbound = {}; - export const outboundSchema: z.ZodType = z.object({}); +/** @internal */ +export const ParentId$outboundSchema: z.ZodType = + z.object({}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ParentId$ { + /** @deprecated use `ParentId$inboundSchema` instead. */ + export const inboundSchema = ParentId$inboundSchema; + /** @deprecated use `ParentId$outboundSchema` instead. */ + export const outboundSchema = ParentId$outboundSchema; + /** @deprecated use `ParentId$Outbound` instead. */ + export type Outbound = ParentId$Outbound; } /** @internal */ -export namespace Metadata$ { - export const inboundSchema: z.ZodType = z.union([ - DelayScheduledMetadata$.inboundSchema, - DelayRegularMetadata$.inboundSchema, - DigestTimedMetadata$.inboundSchema, - DigestRegularMetadata$.inboundSchema, - ]); +export const Metadata$inboundSchema: z.ZodType = z.union([ + DelayScheduledMetadata$inboundSchema, + DelayRegularMetadata$inboundSchema, + DigestTimedMetadata$inboundSchema, + DigestRegularMetadata$inboundSchema, +]); - export type Outbound = - | DelayScheduledMetadata$.Outbound - | DelayRegularMetadata$.Outbound - | DigestTimedMetadata$.Outbound - | DigestRegularMetadata$.Outbound; - export const outboundSchema: z.ZodType = z.union([ - DelayScheduledMetadata$.outboundSchema, - DelayRegularMetadata$.outboundSchema, - DigestTimedMetadata$.outboundSchema, - DigestRegularMetadata$.outboundSchema, +/** @internal */ +export type Metadata$Outbound = + | DelayScheduledMetadata$Outbound + | DelayRegularMetadata$Outbound + | DigestTimedMetadata$Outbound + | DigestRegularMetadata$Outbound; + +/** @internal */ +export const Metadata$outboundSchema: z.ZodType = + z.union([ + DelayScheduledMetadata$outboundSchema, + DelayRegularMetadata$outboundSchema, + DigestTimedMetadata$outboundSchema, + DigestRegularMetadata$outboundSchema, ]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Metadata$ { + /** @deprecated use `Metadata$inboundSchema` instead. */ + export const inboundSchema = Metadata$inboundSchema; + /** @deprecated use `Metadata$outboundSchema` instead. */ + export const outboundSchema = Metadata$outboundSchema; + /** @deprecated use `Metadata$Outbound` instead. */ + export type Outbound = Metadata$Outbound; } /** @internal */ -export namespace ReplyCallback$ { - export const inboundSchema: z.ZodType = z.object({}); +export const ReplyCallback$inboundSchema: z.ZodType = + z.object({}); + +/** @internal */ +export type ReplyCallback$Outbound = {}; - export type Outbound = {}; +/** @internal */ +export const ReplyCallback$outboundSchema: z.ZodType< + ReplyCallback$Outbound, + z.ZodTypeDef, + ReplyCallback +> = z.object({}); - export const outboundSchema: z.ZodType = z.object({}); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ReplyCallback$ { + /** @deprecated use `ReplyCallback$inboundSchema` instead. */ + export const inboundSchema = ReplyCallback$inboundSchema; + /** @deprecated use `ReplyCallback$outboundSchema` instead. */ + export const outboundSchema = ReplyCallback$outboundSchema; + /** @deprecated use `ReplyCallback$Outbound` instead. */ + export type Outbound = ReplyCallback$Outbound; } /** @internal */ -export namespace NotificationStep$ { - export const inboundSchema: z.ZodType = z - .object({ - _id: z.string().optional(), - _parentId: z.lazy(() => ParentId$.inboundSchema).optional(), - _templateId: z.string().optional(), - active: z.boolean().optional(), - filters: z.array(StepFilter$.inboundSchema).optional(), - metadata: z - .union([ - DelayScheduledMetadata$.inboundSchema, - DelayRegularMetadata$.inboundSchema, - DigestTimedMetadata$.inboundSchema, - DigestRegularMetadata$.inboundSchema, - ]) - .optional(), - name: z.string().optional(), - replyCallback: z.lazy(() => ReplyCallback$.inboundSchema).optional(), - shouldStopOnFail: z.boolean().optional(), - template: MessageTemplate$.inboundSchema.optional(), - uuid: z.string().optional(), - variants: NotificationStepVariant$.inboundSchema.optional(), - }) - .transform((v) => { - return remap$(v, { - _id: "id", - _parentId: "parentId", - _templateId: "templateId", - }); +export const NotificationStep$inboundSchema: z.ZodType = z + .object({ + _id: z.string().optional(), + _parentId: z.lazy(() => ParentId$inboundSchema).optional(), + _templateId: z.string().optional(), + active: z.boolean().optional(), + filters: z.array(StepFilter$inboundSchema).optional(), + metadata: z + .union([ + DelayScheduledMetadata$inboundSchema, + DelayRegularMetadata$inboundSchema, + DigestTimedMetadata$inboundSchema, + DigestRegularMetadata$inboundSchema, + ]) + .optional(), + name: z.string().optional(), + replyCallback: z.lazy(() => ReplyCallback$inboundSchema).optional(), + shouldStopOnFail: z.boolean().optional(), + template: MessageTemplate$inboundSchema.optional(), + uuid: z.string().optional(), + variants: NotificationStepVariant$inboundSchema.optional(), + }) + .transform((v) => { + return remap$(v, { + _id: "id", + _parentId: "parentId", + _templateId: "templateId", }); + }); - export type Outbound = { - _id?: string | undefined; - _parentId?: ParentId$.Outbound | undefined; - _templateId?: string | undefined; - active?: boolean | undefined; - filters?: Array | undefined; - metadata?: - | DelayScheduledMetadata$.Outbound - | DelayRegularMetadata$.Outbound - | DigestTimedMetadata$.Outbound - | DigestRegularMetadata$.Outbound - | undefined; - name?: string | undefined; - replyCallback?: ReplyCallback$.Outbound | undefined; - shouldStopOnFail?: boolean | undefined; - template?: MessageTemplate$.Outbound | undefined; - uuid?: string | undefined; - variants?: NotificationStepVariant$.Outbound | undefined; - }; - - export const outboundSchema: z.ZodType = z - .object({ - id: z.string().optional(), - parentId: z.lazy(() => ParentId$.outboundSchema).optional(), - templateId: z.string().optional(), - active: z.boolean().optional(), - filters: z.array(StepFilter$.outboundSchema).optional(), - metadata: z - .union([ - DelayScheduledMetadata$.outboundSchema, - DelayRegularMetadata$.outboundSchema, - DigestTimedMetadata$.outboundSchema, - DigestRegularMetadata$.outboundSchema, - ]) - .optional(), - name: z.string().optional(), - replyCallback: z.lazy(() => ReplyCallback$.outboundSchema).optional(), - shouldStopOnFail: z.boolean().optional(), - template: MessageTemplate$.outboundSchema.optional(), - uuid: z.string().optional(), - variants: NotificationStepVariant$.outboundSchema.optional(), - }) - .transform((v) => { - return remap$(v, { - id: "_id", - parentId: "_parentId", - templateId: "_templateId", - }); +/** @internal */ +export type NotificationStep$Outbound = { + _id?: string | undefined; + _parentId?: ParentId$Outbound | undefined; + _templateId?: string | undefined; + active?: boolean | undefined; + filters?: Array | undefined; + metadata?: + | DelayScheduledMetadata$Outbound + | DelayRegularMetadata$Outbound + | DigestTimedMetadata$Outbound + | DigestRegularMetadata$Outbound + | undefined; + name?: string | undefined; + replyCallback?: ReplyCallback$Outbound | undefined; + shouldStopOnFail?: boolean | undefined; + template?: MessageTemplate$Outbound | undefined; + uuid?: string | undefined; + variants?: NotificationStepVariant$Outbound | undefined; +}; + +/** @internal */ +export const NotificationStep$outboundSchema: z.ZodType< + NotificationStep$Outbound, + z.ZodTypeDef, + NotificationStep +> = z + .object({ + id: z.string().optional(), + parentId: z.lazy(() => ParentId$outboundSchema).optional(), + templateId: z.string().optional(), + active: z.boolean().optional(), + filters: z.array(StepFilter$outboundSchema).optional(), + metadata: z + .union([ + DelayScheduledMetadata$outboundSchema, + DelayRegularMetadata$outboundSchema, + DigestTimedMetadata$outboundSchema, + DigestRegularMetadata$outboundSchema, + ]) + .optional(), + name: z.string().optional(), + replyCallback: z.lazy(() => ReplyCallback$outboundSchema).optional(), + shouldStopOnFail: z.boolean().optional(), + template: MessageTemplate$outboundSchema.optional(), + uuid: z.string().optional(), + variants: NotificationStepVariant$outboundSchema.optional(), + }) + .transform((v) => { + return remap$(v, { + id: "_id", + parentId: "_parentId", + templateId: "_templateId", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace NotificationStep$ { + /** @deprecated use `NotificationStep$inboundSchema` instead. */ + export const inboundSchema = NotificationStep$inboundSchema; + /** @deprecated use `NotificationStep$outboundSchema` instead. */ + export const outboundSchema = NotificationStep$outboundSchema; + /** @deprecated use `NotificationStep$Outbound` instead. */ + export type Outbound = NotificationStep$Outbound; } diff --git a/src/models/components/notificationstepvariant.ts b/src/models/components/notificationstepvariant.ts index 2108eb00..1f1088a5 100644 --- a/src/models/components/notificationstepvariant.ts +++ b/src/models/components/notificationstepvariant.ts @@ -1,14 +1,44 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; -import { DelayRegularMetadata, DelayRegularMetadata$ } from "./delayregularmetadata.js"; -import { DelayScheduledMetadata, DelayScheduledMetadata$ } from "./delayscheduledmetadata.js"; -import { DigestRegularMetadata, DigestRegularMetadata$ } from "./digestregularmetadata.js"; -import { DigestTimedMetadata, DigestTimedMetadata$ } from "./digesttimedmetadata.js"; -import { MessageTemplate, MessageTemplate$ } from "./messagetemplate.js"; -import { StepFilter, StepFilter$ } from "./stepfilter.js"; +import { + DelayRegularMetadata, + DelayRegularMetadata$inboundSchema, + DelayRegularMetadata$Outbound, + DelayRegularMetadata$outboundSchema, +} from "./delayregularmetadata.js"; +import { + DelayScheduledMetadata, + DelayScheduledMetadata$inboundSchema, + DelayScheduledMetadata$Outbound, + DelayScheduledMetadata$outboundSchema, +} from "./delayscheduledmetadata.js"; +import { + DigestRegularMetadata, + DigestRegularMetadata$inboundSchema, + DigestRegularMetadata$Outbound, + DigestRegularMetadata$outboundSchema, +} from "./digestregularmetadata.js"; +import { + DigestTimedMetadata, + DigestTimedMetadata$inboundSchema, + DigestTimedMetadata$Outbound, + DigestTimedMetadata$outboundSchema, +} from "./digesttimedmetadata.js"; +import { + MessageTemplate, + MessageTemplate$inboundSchema, + MessageTemplate$Outbound, + MessageTemplate$outboundSchema, +} from "./messagetemplate.js"; +import { + StepFilter, + StepFilter$inboundSchema, + StepFilter$Outbound, + StepFilter$outboundSchema, +} from "./stepfilter.js"; import * as z from "zod"; export type NotificationStepVariantParentId = {}; @@ -41,143 +71,206 @@ export type NotificationStepVariant = { }; /** @internal */ -export namespace NotificationStepVariantParentId$ { - export const inboundSchema: z.ZodType = - z.object({}); +export const NotificationStepVariantParentId$inboundSchema: z.ZodType< + NotificationStepVariantParentId, + z.ZodTypeDef, + unknown +> = z.object({}); + +/** @internal */ +export type NotificationStepVariantParentId$Outbound = {}; - export type Outbound = {}; +/** @internal */ +export const NotificationStepVariantParentId$outboundSchema: z.ZodType< + NotificationStepVariantParentId$Outbound, + z.ZodTypeDef, + NotificationStepVariantParentId +> = z.object({}); - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - NotificationStepVariantParentId - > = z.object({}); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace NotificationStepVariantParentId$ { + /** @deprecated use `NotificationStepVariantParentId$inboundSchema` instead. */ + export const inboundSchema = NotificationStepVariantParentId$inboundSchema; + /** @deprecated use `NotificationStepVariantParentId$outboundSchema` instead. */ + export const outboundSchema = NotificationStepVariantParentId$outboundSchema; + /** @deprecated use `NotificationStepVariantParentId$Outbound` instead. */ + export type Outbound = NotificationStepVariantParentId$Outbound; } /** @internal */ +export const NotificationStepVariantMetadata$inboundSchema: z.ZodType< + NotificationStepVariantMetadata, + z.ZodTypeDef, + unknown +> = z.union([ + DelayScheduledMetadata$inboundSchema, + DelayRegularMetadata$inboundSchema, + DigestTimedMetadata$inboundSchema, + DigestRegularMetadata$inboundSchema, +]); + +/** @internal */ +export type NotificationStepVariantMetadata$Outbound = + | DelayScheduledMetadata$Outbound + | DelayRegularMetadata$Outbound + | DigestTimedMetadata$Outbound + | DigestRegularMetadata$Outbound; + +/** @internal */ +export const NotificationStepVariantMetadata$outboundSchema: z.ZodType< + NotificationStepVariantMetadata$Outbound, + z.ZodTypeDef, + NotificationStepVariantMetadata +> = z.union([ + DelayScheduledMetadata$outboundSchema, + DelayRegularMetadata$outboundSchema, + DigestTimedMetadata$outboundSchema, + DigestRegularMetadata$outboundSchema, +]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace NotificationStepVariantMetadata$ { - export const inboundSchema: z.ZodType = - z.union([ - DelayScheduledMetadata$.inboundSchema, - DelayRegularMetadata$.inboundSchema, - DigestTimedMetadata$.inboundSchema, - DigestRegularMetadata$.inboundSchema, - ]); - - export type Outbound = - | DelayScheduledMetadata$.Outbound - | DelayRegularMetadata$.Outbound - | DigestTimedMetadata$.Outbound - | DigestRegularMetadata$.Outbound; - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - NotificationStepVariantMetadata - > = z.union([ - DelayScheduledMetadata$.outboundSchema, - DelayRegularMetadata$.outboundSchema, - DigestTimedMetadata$.outboundSchema, - DigestRegularMetadata$.outboundSchema, - ]); + /** @deprecated use `NotificationStepVariantMetadata$inboundSchema` instead. */ + export const inboundSchema = NotificationStepVariantMetadata$inboundSchema; + /** @deprecated use `NotificationStepVariantMetadata$outboundSchema` instead. */ + export const outboundSchema = NotificationStepVariantMetadata$outboundSchema; + /** @deprecated use `NotificationStepVariantMetadata$Outbound` instead. */ + export type Outbound = NotificationStepVariantMetadata$Outbound; } /** @internal */ +export const NotificationStepVariantReplyCallback$inboundSchema: z.ZodType< + NotificationStepVariantReplyCallback, + z.ZodTypeDef, + unknown +> = z.object({}); + +/** @internal */ +export type NotificationStepVariantReplyCallback$Outbound = {}; + +/** @internal */ +export const NotificationStepVariantReplyCallback$outboundSchema: z.ZodType< + NotificationStepVariantReplyCallback$Outbound, + z.ZodTypeDef, + NotificationStepVariantReplyCallback +> = z.object({}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace NotificationStepVariantReplyCallback$ { - export const inboundSchema: z.ZodType< - NotificationStepVariantReplyCallback, - z.ZodTypeDef, - unknown - > = z.object({}); - - export type Outbound = {}; - - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - NotificationStepVariantReplyCallback - > = z.object({}); + /** @deprecated use `NotificationStepVariantReplyCallback$inboundSchema` instead. */ + export const inboundSchema = NotificationStepVariantReplyCallback$inboundSchema; + /** @deprecated use `NotificationStepVariantReplyCallback$outboundSchema` instead. */ + export const outboundSchema = NotificationStepVariantReplyCallback$outboundSchema; + /** @deprecated use `NotificationStepVariantReplyCallback$Outbound` instead. */ + export type Outbound = NotificationStepVariantReplyCallback$Outbound; } /** @internal */ -export namespace NotificationStepVariant$ { - export const inboundSchema: z.ZodType = z - .object({ - _id: z.string().optional(), - _parentId: z.lazy(() => NotificationStepVariantParentId$.inboundSchema).optional(), - _templateId: z.string().optional(), - active: z.boolean().optional(), - filters: z.array(StepFilter$.inboundSchema).optional(), - metadata: z - .union([ - DelayScheduledMetadata$.inboundSchema, - DelayRegularMetadata$.inboundSchema, - DigestTimedMetadata$.inboundSchema, - DigestRegularMetadata$.inboundSchema, - ]) - .optional(), - name: z.string().optional(), - replyCallback: z - .lazy(() => NotificationStepVariantReplyCallback$.inboundSchema) - .optional(), - shouldStopOnFail: z.boolean().optional(), - template: MessageTemplate$.inboundSchema.optional(), - uuid: z.string().optional(), - }) - .transform((v) => { - return remap$(v, { - _id: "id", - _parentId: "parentId", - _templateId: "templateId", - }); +export const NotificationStepVariant$inboundSchema: z.ZodType< + NotificationStepVariant, + z.ZodTypeDef, + unknown +> = z + .object({ + _id: z.string().optional(), + _parentId: z.lazy(() => NotificationStepVariantParentId$inboundSchema).optional(), + _templateId: z.string().optional(), + active: z.boolean().optional(), + filters: z.array(StepFilter$inboundSchema).optional(), + metadata: z + .union([ + DelayScheduledMetadata$inboundSchema, + DelayRegularMetadata$inboundSchema, + DigestTimedMetadata$inboundSchema, + DigestRegularMetadata$inboundSchema, + ]) + .optional(), + name: z.string().optional(), + replyCallback: z.lazy(() => NotificationStepVariantReplyCallback$inboundSchema).optional(), + shouldStopOnFail: z.boolean().optional(), + template: MessageTemplate$inboundSchema.optional(), + uuid: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + _id: "id", + _parentId: "parentId", + _templateId: "templateId", }); + }); + +/** @internal */ +export type NotificationStepVariant$Outbound = { + _id?: string | undefined; + _parentId?: NotificationStepVariantParentId$Outbound | undefined; + _templateId?: string | undefined; + active?: boolean | undefined; + filters?: Array | undefined; + metadata?: + | DelayScheduledMetadata$Outbound + | DelayRegularMetadata$Outbound + | DigestTimedMetadata$Outbound + | DigestRegularMetadata$Outbound + | undefined; + name?: string | undefined; + replyCallback?: NotificationStepVariantReplyCallback$Outbound | undefined; + shouldStopOnFail?: boolean | undefined; + template?: MessageTemplate$Outbound | undefined; + uuid?: string | undefined; +}; - export type Outbound = { - _id?: string | undefined; - _parentId?: NotificationStepVariantParentId$.Outbound | undefined; - _templateId?: string | undefined; - active?: boolean | undefined; - filters?: Array | undefined; - metadata?: - | DelayScheduledMetadata$.Outbound - | DelayRegularMetadata$.Outbound - | DigestTimedMetadata$.Outbound - | DigestRegularMetadata$.Outbound - | undefined; - name?: string | undefined; - replyCallback?: NotificationStepVariantReplyCallback$.Outbound | undefined; - shouldStopOnFail?: boolean | undefined; - template?: MessageTemplate$.Outbound | undefined; - uuid?: string | undefined; - }; - - export const outboundSchema: z.ZodType = z - .object({ - id: z.string().optional(), - parentId: z.lazy(() => NotificationStepVariantParentId$.outboundSchema).optional(), - templateId: z.string().optional(), - active: z.boolean().optional(), - filters: z.array(StepFilter$.outboundSchema).optional(), - metadata: z - .union([ - DelayScheduledMetadata$.outboundSchema, - DelayRegularMetadata$.outboundSchema, - DigestTimedMetadata$.outboundSchema, - DigestRegularMetadata$.outboundSchema, - ]) - .optional(), - name: z.string().optional(), - replyCallback: z - .lazy(() => NotificationStepVariantReplyCallback$.outboundSchema) - .optional(), - shouldStopOnFail: z.boolean().optional(), - template: MessageTemplate$.outboundSchema.optional(), - uuid: z.string().optional(), - }) - .transform((v) => { - return remap$(v, { - id: "_id", - parentId: "_parentId", - templateId: "_templateId", - }); +/** @internal */ +export const NotificationStepVariant$outboundSchema: z.ZodType< + NotificationStepVariant$Outbound, + z.ZodTypeDef, + NotificationStepVariant +> = z + .object({ + id: z.string().optional(), + parentId: z.lazy(() => NotificationStepVariantParentId$outboundSchema).optional(), + templateId: z.string().optional(), + active: z.boolean().optional(), + filters: z.array(StepFilter$outboundSchema).optional(), + metadata: z + .union([ + DelayScheduledMetadata$outboundSchema, + DelayRegularMetadata$outboundSchema, + DigestTimedMetadata$outboundSchema, + DigestRegularMetadata$outboundSchema, + ]) + .optional(), + name: z.string().optional(), + replyCallback: z.lazy(() => NotificationStepVariantReplyCallback$outboundSchema).optional(), + shouldStopOnFail: z.boolean().optional(), + template: MessageTemplate$outboundSchema.optional(), + uuid: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + id: "_id", + parentId: "_parentId", + templateId: "_templateId", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace NotificationStepVariant$ { + /** @deprecated use `NotificationStepVariant$inboundSchema` instead. */ + export const inboundSchema = NotificationStepVariant$inboundSchema; + /** @deprecated use `NotificationStepVariant$outboundSchema` instead. */ + export const outboundSchema = NotificationStepVariant$outboundSchema; + /** @deprecated use `NotificationStepVariant$Outbound` instead. */ + export type Outbound = NotificationStepVariant$Outbound; } diff --git a/src/models/components/notificationtrigger.ts b/src/models/components/notificationtrigger.ts index 864a37b0..11d936ce 100644 --- a/src/models/components/notificationtrigger.ts +++ b/src/models/components/notificationtrigger.ts @@ -1,11 +1,13 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { ClosedEnum } from "../../types/enums.js"; import { NotificationTriggerVariable, - NotificationTriggerVariable$, + NotificationTriggerVariable$inboundSchema, + NotificationTriggerVariable$Outbound, + NotificationTriggerVariable$outboundSchema, } from "./notificationtriggervariable.js"; import * as z from "zod"; @@ -22,32 +24,67 @@ export type NotificationTrigger = { }; /** @internal */ +export const NotificationTriggerType$inboundSchema: z.ZodNativeEnum< + typeof NotificationTriggerType +> = z.nativeEnum(NotificationTriggerType); + +/** @internal */ +export const NotificationTriggerType$outboundSchema: z.ZodNativeEnum< + typeof NotificationTriggerType +> = NotificationTriggerType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace NotificationTriggerType$ { - export const inboundSchema: z.ZodNativeEnum = - z.nativeEnum(NotificationTriggerType); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; + /** @deprecated use `NotificationTriggerType$inboundSchema` instead. */ + export const inboundSchema = NotificationTriggerType$inboundSchema; + /** @deprecated use `NotificationTriggerType$outboundSchema` instead. */ + export const outboundSchema = NotificationTriggerType$outboundSchema; } /** @internal */ +export const NotificationTrigger$inboundSchema: z.ZodType< + NotificationTrigger, + z.ZodTypeDef, + unknown +> = z.object({ + identifier: z.string(), + subscriberVariables: z.array(NotificationTriggerVariable$inboundSchema).optional(), + type: NotificationTriggerType$inboundSchema, + variables: z.array(NotificationTriggerVariable$inboundSchema), +}); + +/** @internal */ +export type NotificationTrigger$Outbound = { + identifier: string; + subscriberVariables?: Array | undefined; + type: string; + variables: Array; +}; + +/** @internal */ +export const NotificationTrigger$outboundSchema: z.ZodType< + NotificationTrigger$Outbound, + z.ZodTypeDef, + NotificationTrigger +> = z.object({ + identifier: z.string(), + subscriberVariables: z.array(NotificationTriggerVariable$outboundSchema).optional(), + type: NotificationTriggerType$outboundSchema, + variables: z.array(NotificationTriggerVariable$outboundSchema), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace NotificationTrigger$ { - export const inboundSchema: z.ZodType = z.object({ - identifier: z.string(), - subscriberVariables: z.array(NotificationTriggerVariable$.inboundSchema).optional(), - type: NotificationTriggerType$.inboundSchema, - variables: z.array(NotificationTriggerVariable$.inboundSchema), - }); - - export type Outbound = { - identifier: string; - subscriberVariables?: Array | undefined; - type: string; - variables: Array; - }; - - export const outboundSchema: z.ZodType = z.object({ - identifier: z.string(), - subscriberVariables: z.array(NotificationTriggerVariable$.outboundSchema).optional(), - type: NotificationTriggerType$.outboundSchema, - variables: z.array(NotificationTriggerVariable$.outboundSchema), - }); + /** @deprecated use `NotificationTrigger$inboundSchema` instead. */ + export const inboundSchema = NotificationTrigger$inboundSchema; + /** @deprecated use `NotificationTrigger$outboundSchema` instead. */ + export const outboundSchema = NotificationTrigger$outboundSchema; + /** @deprecated use `NotificationTrigger$Outbound` instead. */ + export type Outbound = NotificationTrigger$Outbound; } diff --git a/src/models/components/notificationtriggervariable.ts b/src/models/components/notificationtriggervariable.ts index 8a1ace4c..47ec7cd3 100644 --- a/src/models/components/notificationtriggervariable.ts +++ b/src/models/components/notificationtriggervariable.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -9,18 +9,37 @@ export type NotificationTriggerVariable = { }; /** @internal */ -export namespace NotificationTriggerVariable$ { - export const inboundSchema: z.ZodType = - z.object({ - name: z.string(), - }); +export const NotificationTriggerVariable$inboundSchema: z.ZodType< + NotificationTriggerVariable, + z.ZodTypeDef, + unknown +> = z.object({ + name: z.string(), +}); + +/** @internal */ +export type NotificationTriggerVariable$Outbound = { + name: string; +}; - export type Outbound = { - name: string; - }; +/** @internal */ +export const NotificationTriggerVariable$outboundSchema: z.ZodType< + NotificationTriggerVariable$Outbound, + z.ZodTypeDef, + NotificationTriggerVariable +> = z.object({ + name: z.string(), +}); - export const outboundSchema: z.ZodType = - z.object({ - name: z.string(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace NotificationTriggerVariable$ { + /** @deprecated use `NotificationTriggerVariable$inboundSchema` instead. */ + export const inboundSchema = NotificationTriggerVariable$inboundSchema; + /** @deprecated use `NotificationTriggerVariable$outboundSchema` instead. */ + export const outboundSchema = NotificationTriggerVariable$outboundSchema; + /** @deprecated use `NotificationTriggerVariable$Outbound` instead. */ + export type Outbound = NotificationTriggerVariable$Outbound; } diff --git a/src/models/components/organizationbrandingresponsedto.ts b/src/models/components/organizationbrandingresponsedto.ts index 6b13b473..fbd72221 100644 --- a/src/models/components/organizationbrandingresponsedto.ts +++ b/src/models/components/organizationbrandingresponsedto.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { ClosedEnum } from "../../types/enums.js"; @@ -21,42 +21,69 @@ export type OrganizationBrandingResponseDto = { }; /** @internal */ +export const Direction$inboundSchema: z.ZodNativeEnum = z.nativeEnum(Direction); + +/** @internal */ +export const Direction$outboundSchema: z.ZodNativeEnum = Direction$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace Direction$ { - export const inboundSchema: z.ZodNativeEnum = z.nativeEnum(Direction); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; + /** @deprecated use `Direction$inboundSchema` instead. */ + export const inboundSchema = Direction$inboundSchema; + /** @deprecated use `Direction$outboundSchema` instead. */ + export const outboundSchema = Direction$outboundSchema; } /** @internal */ +export const OrganizationBrandingResponseDto$inboundSchema: z.ZodType< + OrganizationBrandingResponseDto, + z.ZodTypeDef, + unknown +> = z.object({ + color: z.string(), + contentBackground: z.string(), + direction: Direction$inboundSchema.optional(), + fontColor: z.string(), + fontFamily: z.string().optional(), + logo: z.string(), +}); + +/** @internal */ +export type OrganizationBrandingResponseDto$Outbound = { + color: string; + contentBackground: string; + direction?: string | undefined; + fontColor: string; + fontFamily?: string | undefined; + logo: string; +}; + +/** @internal */ +export const OrganizationBrandingResponseDto$outboundSchema: z.ZodType< + OrganizationBrandingResponseDto$Outbound, + z.ZodTypeDef, + OrganizationBrandingResponseDto +> = z.object({ + color: z.string(), + contentBackground: z.string(), + direction: Direction$outboundSchema.optional(), + fontColor: z.string(), + fontFamily: z.string().optional(), + logo: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace OrganizationBrandingResponseDto$ { - export const inboundSchema: z.ZodType = - z.object({ - color: z.string(), - contentBackground: z.string(), - direction: Direction$.inboundSchema.optional(), - fontColor: z.string(), - fontFamily: z.string().optional(), - logo: z.string(), - }); - - export type Outbound = { - color: string; - contentBackground: string; - direction?: string | undefined; - fontColor: string; - fontFamily?: string | undefined; - logo: string; - }; - - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - OrganizationBrandingResponseDto - > = z.object({ - color: z.string(), - contentBackground: z.string(), - direction: Direction$.outboundSchema.optional(), - fontColor: z.string(), - fontFamily: z.string().optional(), - logo: z.string(), - }); + /** @deprecated use `OrganizationBrandingResponseDto$inboundSchema` instead. */ + export const inboundSchema = OrganizationBrandingResponseDto$inboundSchema; + /** @deprecated use `OrganizationBrandingResponseDto$outboundSchema` instead. */ + export const outboundSchema = OrganizationBrandingResponseDto$outboundSchema; + /** @deprecated use `OrganizationBrandingResponseDto$Outbound` instead. */ + export type Outbound = OrganizationBrandingResponseDto$Outbound; } diff --git a/src/models/components/organizationresponsedto.ts b/src/models/components/organizationresponsedto.ts index 9eae2b1f..a0d51a43 100644 --- a/src/models/components/organizationresponsedto.ts +++ b/src/models/components/organizationresponsedto.ts @@ -1,14 +1,12 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { - IPartnerConfigurationResponseDto, - IPartnerConfigurationResponseDto$, -} from "./ipartnerconfigurationresponsedto.js"; import { OrganizationBrandingResponseDto, - OrganizationBrandingResponseDto$, + OrganizationBrandingResponseDto$inboundSchema, + OrganizationBrandingResponseDto$Outbound, + OrganizationBrandingResponseDto$outboundSchema, } from "./organizationbrandingresponsedto.js"; import * as z from "zod"; @@ -16,35 +14,50 @@ export type OrganizationResponseDto = { branding: OrganizationBrandingResponseDto; logo?: string | undefined; name: string; - partnerConfigurations?: Array | undefined; + partnerConfigurations?: Array | undefined; }; /** @internal */ -export namespace OrganizationResponseDto$ { - export const inboundSchema: z.ZodType = - z.object({ - branding: OrganizationBrandingResponseDto$.inboundSchema, - logo: z.string().optional(), - name: z.string(), - partnerConfigurations: z - .array(IPartnerConfigurationResponseDto$.inboundSchema) - .optional(), - }); +export const OrganizationResponseDto$inboundSchema: z.ZodType< + OrganizationResponseDto, + z.ZodTypeDef, + unknown +> = z.object({ + branding: OrganizationBrandingResponseDto$inboundSchema, + logo: z.string().optional(), + name: z.string(), + partnerConfigurations: z.array(z.string()).optional(), +}); + +/** @internal */ +export type OrganizationResponseDto$Outbound = { + branding: OrganizationBrandingResponseDto$Outbound; + logo?: string | undefined; + name: string; + partnerConfigurations?: Array | undefined; +}; - export type Outbound = { - branding: OrganizationBrandingResponseDto$.Outbound; - logo?: string | undefined; - name: string; - partnerConfigurations?: Array | undefined; - }; +/** @internal */ +export const OrganizationResponseDto$outboundSchema: z.ZodType< + OrganizationResponseDto$Outbound, + z.ZodTypeDef, + OrganizationResponseDto +> = z.object({ + branding: OrganizationBrandingResponseDto$outboundSchema, + logo: z.string().optional(), + name: z.string(), + partnerConfigurations: z.array(z.string()).optional(), +}); - export const outboundSchema: z.ZodType = - z.object({ - branding: OrganizationBrandingResponseDto$.outboundSchema, - logo: z.string().optional(), - name: z.string(), - partnerConfigurations: z - .array(IPartnerConfigurationResponseDto$.outboundSchema) - .optional(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace OrganizationResponseDto$ { + /** @deprecated use `OrganizationResponseDto$inboundSchema` instead. */ + export const inboundSchema = OrganizationResponseDto$inboundSchema; + /** @deprecated use `OrganizationResponseDto$outboundSchema` instead. */ + export const outboundSchema = OrganizationResponseDto$outboundSchema; + /** @deprecated use `OrganizationResponseDto$Outbound` instead. */ + export type Outbound = OrganizationResponseDto$Outbound; } diff --git a/src/models/components/preference.ts b/src/models/components/preference.ts index ebe9970b..48187f49 100644 --- a/src/models/components/preference.ts +++ b/src/models/components/preference.ts @@ -1,8 +1,13 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { PreferenceChannels, PreferenceChannels$ } from "./preferencechannels.js"; +import { + PreferenceChannels, + PreferenceChannels$inboundSchema, + PreferenceChannels$Outbound, + PreferenceChannels$outboundSchema, +} from "./preferencechannels.js"; import * as z from "zod"; export type Preference = { @@ -17,19 +22,33 @@ export type Preference = { }; /** @internal */ -export namespace Preference$ { - export const inboundSchema: z.ZodType = z.object({ - channels: PreferenceChannels$.inboundSchema, - enabled: z.boolean(), - }); +export const Preference$inboundSchema: z.ZodType = z.object({ + channels: PreferenceChannels$inboundSchema, + enabled: z.boolean(), +}); - export type Outbound = { - channels: PreferenceChannels$.Outbound; - enabled: boolean; - }; +/** @internal */ +export type Preference$Outbound = { + channels: PreferenceChannels$Outbound; + enabled: boolean; +}; - export const outboundSchema: z.ZodType = z.object({ - channels: PreferenceChannels$.outboundSchema, +/** @internal */ +export const Preference$outboundSchema: z.ZodType = + z.object({ + channels: PreferenceChannels$outboundSchema, enabled: z.boolean(), }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Preference$ { + /** @deprecated use `Preference$inboundSchema` instead. */ + export const inboundSchema = Preference$inboundSchema; + /** @deprecated use `Preference$outboundSchema` instead. */ + export const outboundSchema = Preference$outboundSchema; + /** @deprecated use `Preference$Outbound` instead. */ + export type Outbound = Preference$Outbound; } diff --git a/src/models/components/preferencechannels.ts b/src/models/components/preferencechannels.ts index 00c3c09d..2d473208 100644 --- a/src/models/components/preferencechannels.ts +++ b/src/models/components/preferencechannels.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; @@ -14,40 +14,61 @@ export type PreferenceChannels = { }; /** @internal */ -export namespace PreferenceChannels$ { - export const inboundSchema: z.ZodType = z - .object({ - chat: z.boolean().optional(), - email: z.boolean().optional(), - in_app: z.boolean().optional(), - push: z.boolean().optional(), - sms: z.boolean().optional(), - }) - .transform((v) => { - return remap$(v, { - in_app: "inApp", - }); +export const PreferenceChannels$inboundSchema: z.ZodType< + PreferenceChannels, + z.ZodTypeDef, + unknown +> = z + .object({ + chat: z.boolean().optional(), + email: z.boolean().optional(), + in_app: z.boolean().optional(), + push: z.boolean().optional(), + sms: z.boolean().optional(), + }) + .transform((v) => { + return remap$(v, { + in_app: "inApp", }); + }); - export type Outbound = { - chat?: boolean | undefined; - email?: boolean | undefined; - in_app?: boolean | undefined; - push?: boolean | undefined; - sms?: boolean | undefined; - }; +/** @internal */ +export type PreferenceChannels$Outbound = { + chat?: boolean | undefined; + email?: boolean | undefined; + in_app?: boolean | undefined; + push?: boolean | undefined; + sms?: boolean | undefined; +}; - export const outboundSchema: z.ZodType = z - .object({ - chat: z.boolean().optional(), - email: z.boolean().optional(), - inApp: z.boolean().optional(), - push: z.boolean().optional(), - sms: z.boolean().optional(), - }) - .transform((v) => { - return remap$(v, { - inApp: "in_app", - }); +/** @internal */ +export const PreferenceChannels$outboundSchema: z.ZodType< + PreferenceChannels$Outbound, + z.ZodTypeDef, + PreferenceChannels +> = z + .object({ + chat: z.boolean().optional(), + email: z.boolean().optional(), + inApp: z.boolean().optional(), + push: z.boolean().optional(), + sms: z.boolean().optional(), + }) + .transform((v) => { + return remap$(v, { + inApp: "in_app", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace PreferenceChannels$ { + /** @deprecated use `PreferenceChannels$inboundSchema` instead. */ + export const inboundSchema = PreferenceChannels$inboundSchema; + /** @deprecated use `PreferenceChannels$outboundSchema` instead. */ + export const outboundSchema = PreferenceChannels$outboundSchema; + /** @deprecated use `PreferenceChannels$Outbound` instead. */ + export type Outbound = PreferenceChannels$Outbound; } diff --git a/src/models/components/removesubscribersrequestdto.ts b/src/models/components/removesubscribersrequestdto.ts index 3a85c72c..b178d683 100644 --- a/src/models/components/removesubscribersrequestdto.ts +++ b/src/models/components/removesubscribersrequestdto.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -12,18 +12,37 @@ export type RemoveSubscribersRequestDto = { }; /** @internal */ -export namespace RemoveSubscribersRequestDto$ { - export const inboundSchema: z.ZodType = - z.object({ - subscribers: z.array(z.string()), - }); +export const RemoveSubscribersRequestDto$inboundSchema: z.ZodType< + RemoveSubscribersRequestDto, + z.ZodTypeDef, + unknown +> = z.object({ + subscribers: z.array(z.string()), +}); + +/** @internal */ +export type RemoveSubscribersRequestDto$Outbound = { + subscribers: Array; +}; - export type Outbound = { - subscribers: Array; - }; +/** @internal */ +export const RemoveSubscribersRequestDto$outboundSchema: z.ZodType< + RemoveSubscribersRequestDto$Outbound, + z.ZodTypeDef, + RemoveSubscribersRequestDto +> = z.object({ + subscribers: z.array(z.string()), +}); - export const outboundSchema: z.ZodType = - z.object({ - subscribers: z.array(z.string()), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace RemoveSubscribersRequestDto$ { + /** @deprecated use `RemoveSubscribersRequestDto$inboundSchema` instead. */ + export const inboundSchema = RemoveSubscribersRequestDto$inboundSchema; + /** @deprecated use `RemoveSubscribersRequestDto$outboundSchema` instead. */ + export const outboundSchema = RemoveSubscribersRequestDto$outboundSchema; + /** @deprecated use `RemoveSubscribersRequestDto$Outbound` instead. */ + export type Outbound = RemoveSubscribersRequestDto$Outbound; } diff --git a/src/models/components/renameorganizationdto.ts b/src/models/components/renameorganizationdto.ts index 6b953b4e..c1f37216 100644 --- a/src/models/components/renameorganizationdto.ts +++ b/src/models/components/renameorganizationdto.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -9,17 +9,37 @@ export type RenameOrganizationDto = { }; /** @internal */ -export namespace RenameOrganizationDto$ { - export const inboundSchema: z.ZodType = z.object({ - name: z.string(), - }); +export const RenameOrganizationDto$inboundSchema: z.ZodType< + RenameOrganizationDto, + z.ZodTypeDef, + unknown +> = z.object({ + name: z.string(), +}); + +/** @internal */ +export type RenameOrganizationDto$Outbound = { + name: string; +}; - export type Outbound = { - name: string; - }; +/** @internal */ +export const RenameOrganizationDto$outboundSchema: z.ZodType< + RenameOrganizationDto$Outbound, + z.ZodTypeDef, + RenameOrganizationDto +> = z.object({ + name: z.string(), +}); - export const outboundSchema: z.ZodType = - z.object({ - name: z.string(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace RenameOrganizationDto$ { + /** @deprecated use `RenameOrganizationDto$inboundSchema` instead. */ + export const inboundSchema = RenameOrganizationDto$inboundSchema; + /** @deprecated use `RenameOrganizationDto$outboundSchema` instead. */ + export const outboundSchema = RenameOrganizationDto$outboundSchema; + /** @deprecated use `RenameOrganizationDto$Outbound` instead. */ + export type Outbound = RenameOrganizationDto$Outbound; } diff --git a/src/models/components/renametopicrequestdto.ts b/src/models/components/renametopicrequestdto.ts index 20a58747..13c4635c 100644 --- a/src/models/components/renametopicrequestdto.ts +++ b/src/models/components/renametopicrequestdto.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -12,17 +12,37 @@ export type RenameTopicRequestDto = { }; /** @internal */ -export namespace RenameTopicRequestDto$ { - export const inboundSchema: z.ZodType = z.object({ - name: z.string(), - }); +export const RenameTopicRequestDto$inboundSchema: z.ZodType< + RenameTopicRequestDto, + z.ZodTypeDef, + unknown +> = z.object({ + name: z.string(), +}); + +/** @internal */ +export type RenameTopicRequestDto$Outbound = { + name: string; +}; - export type Outbound = { - name: string; - }; +/** @internal */ +export const RenameTopicRequestDto$outboundSchema: z.ZodType< + RenameTopicRequestDto$Outbound, + z.ZodTypeDef, + RenameTopicRequestDto +> = z.object({ + name: z.string(), +}); - export const outboundSchema: z.ZodType = - z.object({ - name: z.string(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace RenameTopicRequestDto$ { + /** @deprecated use `RenameTopicRequestDto$inboundSchema` instead. */ + export const inboundSchema = RenameTopicRequestDto$inboundSchema; + /** @deprecated use `RenameTopicRequestDto$outboundSchema` instead. */ + export const outboundSchema = RenameTopicRequestDto$outboundSchema; + /** @deprecated use `RenameTopicRequestDto$Outbound` instead. */ + export type Outbound = RenameTopicRequestDto$Outbound; } diff --git a/src/models/components/renametopicresponsedto.ts b/src/models/components/renametopicresponsedto.ts index 63b0227a..cddcdad9 100644 --- a/src/models/components/renametopicresponsedto.ts +++ b/src/models/components/renametopicresponsedto.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; @@ -15,47 +15,68 @@ export type RenameTopicResponseDto = { }; /** @internal */ -export namespace RenameTopicResponseDto$ { - export const inboundSchema: z.ZodType = z - .object({ - _environmentId: z.string(), - _id: z.string().optional(), - _organizationId: z.string(), - key: z.string(), - name: z.string(), - subscribers: z.array(z.string()), - }) - .transform((v) => { - return remap$(v, { - _environmentId: "environmentId", - _id: "id", - _organizationId: "organizationId", - }); +export const RenameTopicResponseDto$inboundSchema: z.ZodType< + RenameTopicResponseDto, + z.ZodTypeDef, + unknown +> = z + .object({ + _environmentId: z.string(), + _id: z.string().optional(), + _organizationId: z.string(), + key: z.string(), + name: z.string(), + subscribers: z.array(z.string()), + }) + .transform((v) => { + return remap$(v, { + _environmentId: "environmentId", + _id: "id", + _organizationId: "organizationId", }); + }); - export type Outbound = { - _environmentId: string; - _id?: string | undefined; - _organizationId: string; - key: string; - name: string; - subscribers: Array; - }; +/** @internal */ +export type RenameTopicResponseDto$Outbound = { + _environmentId: string; + _id?: string | undefined; + _organizationId: string; + key: string; + name: string; + subscribers: Array; +}; - export const outboundSchema: z.ZodType = z - .object({ - environmentId: z.string(), - id: z.string().optional(), - organizationId: z.string(), - key: z.string(), - name: z.string(), - subscribers: z.array(z.string()), - }) - .transform((v) => { - return remap$(v, { - environmentId: "_environmentId", - id: "_id", - organizationId: "_organizationId", - }); +/** @internal */ +export const RenameTopicResponseDto$outboundSchema: z.ZodType< + RenameTopicResponseDto$Outbound, + z.ZodTypeDef, + RenameTopicResponseDto +> = z + .object({ + environmentId: z.string(), + id: z.string().optional(), + organizationId: z.string(), + key: z.string(), + name: z.string(), + subscribers: z.array(z.string()), + }) + .transform((v) => { + return remap$(v, { + environmentId: "_environmentId", + id: "_id", + organizationId: "_organizationId", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace RenameTopicResponseDto$ { + /** @deprecated use `RenameTopicResponseDto$inboundSchema` instead. */ + export const inboundSchema = RenameTopicResponseDto$inboundSchema; + /** @deprecated use `RenameTopicResponseDto$outboundSchema` instead. */ + export const outboundSchema = RenameTopicResponseDto$outboundSchema; + /** @deprecated use `RenameTopicResponseDto$Outbound` instead. */ + export type Outbound = RenameTopicResponseDto$Outbound; } diff --git a/src/models/components/security.ts b/src/models/components/security.ts index 7b98e384..c269daed 100644 --- a/src/models/components/security.ts +++ b/src/models/components/security.ts @@ -1,37 +1,50 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; import * as z from "zod"; export type Security = { - apiKey?: string | undefined; + apiKey: string; }; /** @internal */ -export namespace Security$ { - export const inboundSchema: z.ZodType = z - .object({ - "api-key": z.string().optional(), - }) - .transform((v) => { - return remap$(v, { - "api-key": "apiKey", - }); +export const Security$inboundSchema: z.ZodType = z + .object({ + "api-key": z.string(), + }) + .transform((v) => { + return remap$(v, { + "api-key": "apiKey", }); + }); - export type Outbound = { - "api-key"?: string | undefined; - }; +/** @internal */ +export type Security$Outbound = { + "api-key": string; +}; - export const outboundSchema: z.ZodType = z - .object({ - apiKey: z.string().optional(), - }) - .transform((v) => { - return remap$(v, { - apiKey: "api-key", - }); +/** @internal */ +export const Security$outboundSchema: z.ZodType = z + .object({ + apiKey: z.string(), + }) + .transform((v) => { + return remap$(v, { + apiKey: "api-key", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Security$ { + /** @deprecated use `Security$inboundSchema` instead. */ + export const inboundSchema = Security$inboundSchema; + /** @deprecated use `Security$outboundSchema` instead. */ + export const outboundSchema = Security$outboundSchema; + /** @deprecated use `Security$Outbound` instead. */ + export type Outbound = Security$Outbound; } diff --git a/src/models/components/stepfilter.ts b/src/models/components/stepfilter.ts index a541bcb7..ee267718 100644 --- a/src/models/components/stepfilter.ts +++ b/src/models/components/stepfilter.ts @@ -1,9 +1,14 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { ClosedEnum } from "../../types/enums.js"; -import { FieldFilterPart, FieldFilterPart$ } from "./fieldfilterpart.js"; +import { + FieldFilterPart, + FieldFilterPart$inboundSchema, + FieldFilterPart$Outbound, + FieldFilterPart$outboundSchema, +} from "./fieldfilterpart.js"; import * as z from "zod"; export const StepFilterType = { @@ -32,38 +37,75 @@ export type StepFilter = { }; /** @internal */ +export const StepFilterType$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(StepFilterType); + +/** @internal */ +export const StepFilterType$outboundSchema: z.ZodNativeEnum = + StepFilterType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace StepFilterType$ { - export const inboundSchema: z.ZodNativeEnum = - z.nativeEnum(StepFilterType); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; + /** @deprecated use `StepFilterType$inboundSchema` instead. */ + export const inboundSchema = StepFilterType$inboundSchema; + /** @deprecated use `StepFilterType$outboundSchema` instead. */ + export const outboundSchema = StepFilterType$outboundSchema; } /** @internal */ +export const Value$inboundSchema: z.ZodNativeEnum = z.nativeEnum(Value); + +/** @internal */ +export const Value$outboundSchema: z.ZodNativeEnum = Value$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace Value$ { - export const inboundSchema: z.ZodNativeEnum = z.nativeEnum(Value); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; + /** @deprecated use `Value$inboundSchema` instead. */ + export const inboundSchema = Value$inboundSchema; + /** @deprecated use `Value$outboundSchema` instead. */ + export const outboundSchema = Value$outboundSchema; } /** @internal */ -export namespace StepFilter$ { - export const inboundSchema: z.ZodType = z.object({ - children: z.array(FieldFilterPart$.inboundSchema), - isNegated: z.boolean(), - type: StepFilterType$.inboundSchema, - value: Value$.inboundSchema, - }); +export const StepFilter$inboundSchema: z.ZodType = z.object({ + children: z.array(FieldFilterPart$inboundSchema), + isNegated: z.boolean(), + type: StepFilterType$inboundSchema, + value: Value$inboundSchema, +}); - export type Outbound = { - children: Array; - isNegated: boolean; - type: string; - value: string; - }; +/** @internal */ +export type StepFilter$Outbound = { + children: Array; + isNegated: boolean; + type: string; + value: string; +}; - export const outboundSchema: z.ZodType = z.object({ - children: z.array(FieldFilterPart$.outboundSchema), +/** @internal */ +export const StepFilter$outboundSchema: z.ZodType = + z.object({ + children: z.array(FieldFilterPart$outboundSchema), isNegated: z.boolean(), - type: StepFilterType$.outboundSchema, - value: Value$.outboundSchema, + type: StepFilterType$outboundSchema, + value: Value$outboundSchema, }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace StepFilter$ { + /** @deprecated use `StepFilter$inboundSchema` instead. */ + export const inboundSchema = StepFilter$inboundSchema; + /** @deprecated use `StepFilter$outboundSchema` instead. */ + export const outboundSchema = StepFilter$outboundSchema; + /** @deprecated use `StepFilter$Outbound` instead. */ + export type Outbound = StepFilter$Outbound; } diff --git a/src/models/components/subscriberchanneldto.ts b/src/models/components/subscriberchanneldto.ts deleted file mode 100644 index 3bffa525..00000000 --- a/src/models/components/subscriberchanneldto.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - */ - -import { ChannelCredentialsDto, ChannelCredentialsDto$ } from "./channelcredentialsdto.js"; -import * as z from "zod"; - -export type SubscriberChannelDtoProviderId = {}; - -export type SubscriberChannelDto = { - credentials: ChannelCredentialsDto; - integrationIdentifier?: string | undefined; - providerId: SubscriberChannelDtoProviderId; -}; - -/** @internal */ -export namespace SubscriberChannelDtoProviderId$ { - export const inboundSchema: z.ZodType = - z.object({}); - - export type Outbound = {}; - - export const outboundSchema: z.ZodType = - z.object({}); -} - -/** @internal */ -export namespace SubscriberChannelDto$ { - export const inboundSchema: z.ZodType = z.object({ - credentials: ChannelCredentialsDto$.inboundSchema, - integrationIdentifier: z.string().optional(), - providerId: z.lazy(() => SubscriberChannelDtoProviderId$.inboundSchema), - }); - - export type Outbound = { - credentials: ChannelCredentialsDto$.Outbound; - integrationIdentifier?: string | undefined; - providerId: SubscriberChannelDtoProviderId$.Outbound; - }; - - export const outboundSchema: z.ZodType = z.object( - { - credentials: ChannelCredentialsDto$.outboundSchema, - integrationIdentifier: z.string().optional(), - providerId: z.lazy(() => SubscriberChannelDtoProviderId$.outboundSchema), - } - ); -} diff --git a/src/models/components/subscriberpayloaddto.ts b/src/models/components/subscriberpayloaddto.ts index 83e25356..079fb0b3 100644 --- a/src/models/components/subscriberpayloaddto.ts +++ b/src/models/components/subscriberpayloaddto.ts @@ -1,8 +1,7 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SubscriberChannelDto, SubscriberChannelDto$ } from "./subscriberchanneldto.js"; import * as z from "zod"; export type SubscriberPayloadDtoData = {}; @@ -12,7 +11,7 @@ export type SubscriberPayloadDto = { * An http url to the profile image of your subscriber */ avatar?: string | undefined; - channels?: Array | undefined; + channels?: Array | undefined; data?: SubscriberPayloadDtoData | undefined; email?: string | undefined; firstName?: string | undefined; @@ -26,53 +25,91 @@ export type SubscriberPayloadDto = { }; /** @internal */ -export namespace SubscriberPayloadDtoData$ { - export const inboundSchema: z.ZodType = - z.object({}); +export const SubscriberPayloadDtoData$inboundSchema: z.ZodType< + SubscriberPayloadDtoData, + z.ZodTypeDef, + unknown +> = z.object({}); - export type Outbound = {}; +/** @internal */ +export type SubscriberPayloadDtoData$Outbound = {}; - export const outboundSchema: z.ZodType = - z.object({}); +/** @internal */ +export const SubscriberPayloadDtoData$outboundSchema: z.ZodType< + SubscriberPayloadDtoData$Outbound, + z.ZodTypeDef, + SubscriberPayloadDtoData +> = z.object({}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SubscriberPayloadDtoData$ { + /** @deprecated use `SubscriberPayloadDtoData$inboundSchema` instead. */ + export const inboundSchema = SubscriberPayloadDtoData$inboundSchema; + /** @deprecated use `SubscriberPayloadDtoData$outboundSchema` instead. */ + export const outboundSchema = SubscriberPayloadDtoData$outboundSchema; + /** @deprecated use `SubscriberPayloadDtoData$Outbound` instead. */ + export type Outbound = SubscriberPayloadDtoData$Outbound; } /** @internal */ -export namespace SubscriberPayloadDto$ { - export const inboundSchema: z.ZodType = z.object({ - avatar: z.string().optional(), - channels: z.array(SubscriberChannelDto$.inboundSchema).optional(), - data: z.lazy(() => SubscriberPayloadDtoData$.inboundSchema).optional(), - email: z.string().optional(), - firstName: z.string().optional(), - lastName: z.string().optional(), - locale: z.string().optional(), - phone: z.string().optional(), - subscriberId: z.string(), - }); +export const SubscriberPayloadDto$inboundSchema: z.ZodType< + SubscriberPayloadDto, + z.ZodTypeDef, + unknown +> = z.object({ + avatar: z.string().optional(), + channels: z.array(z.string()).optional(), + data: z.lazy(() => SubscriberPayloadDtoData$inboundSchema).optional(), + email: z.string().optional(), + firstName: z.string().optional(), + lastName: z.string().optional(), + locale: z.string().optional(), + phone: z.string().optional(), + subscriberId: z.string(), +}); + +/** @internal */ +export type SubscriberPayloadDto$Outbound = { + avatar?: string | undefined; + channels?: Array | undefined; + data?: SubscriberPayloadDtoData$Outbound | undefined; + email?: string | undefined; + firstName?: string | undefined; + lastName?: string | undefined; + locale?: string | undefined; + phone?: string | undefined; + subscriberId: string; +}; - export type Outbound = { - avatar?: string | undefined; - channels?: Array | undefined; - data?: SubscriberPayloadDtoData$.Outbound | undefined; - email?: string | undefined; - firstName?: string | undefined; - lastName?: string | undefined; - locale?: string | undefined; - phone?: string | undefined; - subscriberId: string; - }; +/** @internal */ +export const SubscriberPayloadDto$outboundSchema: z.ZodType< + SubscriberPayloadDto$Outbound, + z.ZodTypeDef, + SubscriberPayloadDto +> = z.object({ + avatar: z.string().optional(), + channels: z.array(z.string()).optional(), + data: z.lazy(() => SubscriberPayloadDtoData$outboundSchema).optional(), + email: z.string().optional(), + firstName: z.string().optional(), + lastName: z.string().optional(), + locale: z.string().optional(), + phone: z.string().optional(), + subscriberId: z.string(), +}); - export const outboundSchema: z.ZodType = z.object( - { - avatar: z.string().optional(), - channels: z.array(SubscriberChannelDto$.outboundSchema).optional(), - data: z.lazy(() => SubscriberPayloadDtoData$.outboundSchema).optional(), - email: z.string().optional(), - firstName: z.string().optional(), - lastName: z.string().optional(), - locale: z.string().optional(), - phone: z.string().optional(), - subscriberId: z.string(), - } - ); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SubscriberPayloadDto$ { + /** @deprecated use `SubscriberPayloadDto$inboundSchema` instead. */ + export const inboundSchema = SubscriberPayloadDto$inboundSchema; + /** @deprecated use `SubscriberPayloadDto$outboundSchema` instead. */ + export const outboundSchema = SubscriberPayloadDto$outboundSchema; + /** @deprecated use `SubscriberPayloadDto$Outbound` instead. */ + export type Outbound = SubscriberPayloadDto$Outbound; } diff --git a/src/models/components/subscriberresponsedto.ts b/src/models/components/subscriberresponsedto.ts index a003e400..fdba4975 100644 --- a/src/models/components/subscriberresponsedto.ts +++ b/src/models/components/subscriberresponsedto.ts @@ -1,9 +1,14 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; -import { ChannelSettings, ChannelSettings$ } from "./channelsettings.js"; +import { + ChannelSettings, + ChannelSettings$inboundSchema, + ChannelSettings$Outbound, + ChannelSettings$outboundSchema, +} from "./channelsettings.js"; import * as z from "zod"; export type SubscriberResponseDto = { @@ -36,82 +41,103 @@ export type SubscriberResponseDto = { }; /** @internal */ -export namespace SubscriberResponseDto$ { - export const inboundSchema: z.ZodType = z - .object({ - __v: z.number().optional(), - _environmentId: z.string(), - _id: z.string().optional(), - _organizationId: z.string(), - avatar: z.string().optional(), - channels: z.array(ChannelSettings$.inboundSchema).optional(), - createdAt: z.string(), - deleted: z.boolean(), - email: z.string().optional(), - firstName: z.string().optional(), - isOnline: z.boolean().optional(), - lastName: z.string().optional(), - lastOnlineAt: z.string().optional(), - locale: z.string().optional(), - phone: z.string().optional(), - subscriberId: z.string(), - updatedAt: z.string(), - }) - .transform((v) => { - return remap$(v, { - __v: "v", - _environmentId: "environmentId", - _id: "id", - _organizationId: "organizationId", - }); +export const SubscriberResponseDto$inboundSchema: z.ZodType< + SubscriberResponseDto, + z.ZodTypeDef, + unknown +> = z + .object({ + __v: z.number().optional(), + _environmentId: z.string(), + _id: z.string().optional(), + _organizationId: z.string(), + avatar: z.string().optional(), + channels: z.array(ChannelSettings$inboundSchema).optional(), + createdAt: z.string(), + deleted: z.boolean(), + email: z.string().optional(), + firstName: z.string().optional(), + isOnline: z.boolean().optional(), + lastName: z.string().optional(), + lastOnlineAt: z.string().optional(), + locale: z.string().optional(), + phone: z.string().optional(), + subscriberId: z.string(), + updatedAt: z.string(), + }) + .transform((v) => { + return remap$(v, { + __v: "v", + _environmentId: "environmentId", + _id: "id", + _organizationId: "organizationId", }); + }); - export type Outbound = { - __v?: number | undefined; - _environmentId: string; - _id?: string | undefined; - _organizationId: string; - avatar?: string | undefined; - channels?: Array | undefined; - createdAt: string; - deleted: boolean; - email?: string | undefined; - firstName?: string | undefined; - isOnline?: boolean | undefined; - lastName?: string | undefined; - lastOnlineAt?: string | undefined; - locale?: string | undefined; - phone?: string | undefined; - subscriberId: string; - updatedAt: string; - }; +/** @internal */ +export type SubscriberResponseDto$Outbound = { + __v?: number | undefined; + _environmentId: string; + _id?: string | undefined; + _organizationId: string; + avatar?: string | undefined; + channels?: Array | undefined; + createdAt: string; + deleted: boolean; + email?: string | undefined; + firstName?: string | undefined; + isOnline?: boolean | undefined; + lastName?: string | undefined; + lastOnlineAt?: string | undefined; + locale?: string | undefined; + phone?: string | undefined; + subscriberId: string; + updatedAt: string; +}; - export const outboundSchema: z.ZodType = z - .object({ - v: z.number().optional(), - environmentId: z.string(), - id: z.string().optional(), - organizationId: z.string(), - avatar: z.string().optional(), - channels: z.array(ChannelSettings$.outboundSchema).optional(), - createdAt: z.string(), - deleted: z.boolean(), - email: z.string().optional(), - firstName: z.string().optional(), - isOnline: z.boolean().optional(), - lastName: z.string().optional(), - lastOnlineAt: z.string().optional(), - locale: z.string().optional(), - phone: z.string().optional(), - subscriberId: z.string(), - updatedAt: z.string(), - }) - .transform((v) => { - return remap$(v, { - v: "__v", - environmentId: "_environmentId", - id: "_id", - organizationId: "_organizationId", - }); +/** @internal */ +export const SubscriberResponseDto$outboundSchema: z.ZodType< + SubscriberResponseDto$Outbound, + z.ZodTypeDef, + SubscriberResponseDto +> = z + .object({ + v: z.number().optional(), + environmentId: z.string(), + id: z.string().optional(), + organizationId: z.string(), + avatar: z.string().optional(), + channels: z.array(ChannelSettings$outboundSchema).optional(), + createdAt: z.string(), + deleted: z.boolean(), + email: z.string().optional(), + firstName: z.string().optional(), + isOnline: z.boolean().optional(), + lastName: z.string().optional(), + lastOnlineAt: z.string().optional(), + locale: z.string().optional(), + phone: z.string().optional(), + subscriberId: z.string(), + updatedAt: z.string(), + }) + .transform((v) => { + return remap$(v, { + v: "__v", + environmentId: "_environmentId", + id: "_id", + organizationId: "_organizationId", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SubscriberResponseDto$ { + /** @deprecated use `SubscriberResponseDto$inboundSchema` instead. */ + export const inboundSchema = SubscriberResponseDto$inboundSchema; + /** @deprecated use `SubscriberResponseDto$outboundSchema` instead. */ + export const outboundSchema = SubscriberResponseDto$outboundSchema; + /** @deprecated use `SubscriberResponseDto$Outbound` instead. */ + export type Outbound = SubscriberResponseDto$Outbound; } diff --git a/src/models/components/templateresponse.ts b/src/models/components/templateresponse.ts index c317dffd..dba76a14 100644 --- a/src/models/components/templateresponse.ts +++ b/src/models/components/templateresponse.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; @@ -25,37 +25,54 @@ export type TemplateResponse = { }; /** @internal */ -export namespace TemplateResponse$ { - export const inboundSchema: z.ZodType = z - .object({ - _id: z.string(), - critical: z.boolean(), - name: z.string(), - triggers: z.array(z.string()), - }) - .transform((v) => { - return remap$(v, { - _id: "id", - }); +export const TemplateResponse$inboundSchema: z.ZodType = z + .object({ + _id: z.string(), + critical: z.boolean(), + name: z.string(), + triggers: z.array(z.string()), + }) + .transform((v) => { + return remap$(v, { + _id: "id", }); + }); - export type Outbound = { - _id: string; - critical: boolean; - name: string; - triggers: Array; - }; +/** @internal */ +export type TemplateResponse$Outbound = { + _id: string; + critical: boolean; + name: string; + triggers: Array; +}; - export const outboundSchema: z.ZodType = z - .object({ - id: z.string(), - critical: z.boolean(), - name: z.string(), - triggers: z.array(z.string()), - }) - .transform((v) => { - return remap$(v, { - id: "_id", - }); +/** @internal */ +export const TemplateResponse$outboundSchema: z.ZodType< + TemplateResponse$Outbound, + z.ZodTypeDef, + TemplateResponse +> = z + .object({ + id: z.string(), + critical: z.boolean(), + name: z.string(), + triggers: z.array(z.string()), + }) + .transform((v) => { + return remap$(v, { + id: "_id", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace TemplateResponse$ { + /** @deprecated use `TemplateResponse$inboundSchema` instead. */ + export const inboundSchema = TemplateResponse$inboundSchema; + /** @deprecated use `TemplateResponse$outboundSchema` instead. */ + export const outboundSchema = TemplateResponse$outboundSchema; + /** @deprecated use `TemplateResponse$Outbound` instead. */ + export type Outbound = TemplateResponse$Outbound; } diff --git a/src/models/components/tenantpayloaddto.ts b/src/models/components/tenantpayloaddto.ts index b15bcf56..af4b9052 100644 --- a/src/models/components/tenantpayloaddto.ts +++ b/src/models/components/tenantpayloaddto.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -13,35 +13,70 @@ export type TenantPayloadDto = { }; /** @internal */ -export namespace TenantPayloadDtoData$ { - export const inboundSchema: z.ZodType = z.object( - {} - ); +export const TenantPayloadDtoData$inboundSchema: z.ZodType< + TenantPayloadDtoData, + z.ZodTypeDef, + unknown +> = z.object({}); - export type Outbound = {}; +/** @internal */ +export type TenantPayloadDtoData$Outbound = {}; - export const outboundSchema: z.ZodType = z.object( - {} - ); +/** @internal */ +export const TenantPayloadDtoData$outboundSchema: z.ZodType< + TenantPayloadDtoData$Outbound, + z.ZodTypeDef, + TenantPayloadDtoData +> = z.object({}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace TenantPayloadDtoData$ { + /** @deprecated use `TenantPayloadDtoData$inboundSchema` instead. */ + export const inboundSchema = TenantPayloadDtoData$inboundSchema; + /** @deprecated use `TenantPayloadDtoData$outboundSchema` instead. */ + export const outboundSchema = TenantPayloadDtoData$outboundSchema; + /** @deprecated use `TenantPayloadDtoData$Outbound` instead. */ + export type Outbound = TenantPayloadDtoData$Outbound; } /** @internal */ -export namespace TenantPayloadDto$ { - export const inboundSchema: z.ZodType = z.object({ - data: z.lazy(() => TenantPayloadDtoData$.inboundSchema).optional(), +export const TenantPayloadDto$inboundSchema: z.ZodType = + z.object({ + data: z.lazy(() => TenantPayloadDtoData$inboundSchema).optional(), identifier: z.string().optional(), name: z.string().optional(), }); - export type Outbound = { - data?: TenantPayloadDtoData$.Outbound | undefined; - identifier?: string | undefined; - name?: string | undefined; - }; +/** @internal */ +export type TenantPayloadDto$Outbound = { + data?: TenantPayloadDtoData$Outbound | undefined; + identifier?: string | undefined; + name?: string | undefined; +}; + +/** @internal */ +export const TenantPayloadDto$outboundSchema: z.ZodType< + TenantPayloadDto$Outbound, + z.ZodTypeDef, + TenantPayloadDto +> = z.object({ + data: z.lazy(() => TenantPayloadDtoData$outboundSchema).optional(), + identifier: z.string().optional(), + name: z.string().optional(), +}); - export const outboundSchema: z.ZodType = z.object({ - data: z.lazy(() => TenantPayloadDtoData$.outboundSchema).optional(), - identifier: z.string().optional(), - name: z.string().optional(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace TenantPayloadDto$ { + /** @deprecated use `TenantPayloadDto$inboundSchema` instead. */ + export const inboundSchema = TenantPayloadDto$inboundSchema; + /** @deprecated use `TenantPayloadDto$outboundSchema` instead. */ + export const outboundSchema = TenantPayloadDto$outboundSchema; + /** @deprecated use `TenantPayloadDto$Outbound` instead. */ + export type Outbound = TenantPayloadDto$Outbound; } diff --git a/src/models/components/timedconfig.ts b/src/models/components/timedconfig.ts index 13abc33e..efd70d80 100644 --- a/src/models/components/timedconfig.ts +++ b/src/models/components/timedconfig.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { ClosedEnum } from "../../types/enums.js"; @@ -56,55 +56,120 @@ export type TimedConfig = { }; /** @internal */ +export const MonthlyType$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(MonthlyType); + +/** @internal */ +export const MonthlyType$outboundSchema: z.ZodNativeEnum = + MonthlyType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace MonthlyType$ { - export const inboundSchema: z.ZodNativeEnum = z.nativeEnum(MonthlyType); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; + /** @deprecated use `MonthlyType$inboundSchema` instead. */ + export const inboundSchema = MonthlyType$inboundSchema; + /** @deprecated use `MonthlyType$outboundSchema` instead. */ + export const outboundSchema = MonthlyType$outboundSchema; } /** @internal */ +export const Ordinal$inboundSchema: z.ZodNativeEnum = z.nativeEnum(Ordinal); + +/** @internal */ +export const Ordinal$outboundSchema: z.ZodNativeEnum = Ordinal$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace Ordinal$ { - export const inboundSchema: z.ZodNativeEnum = z.nativeEnum(Ordinal); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; + /** @deprecated use `Ordinal$inboundSchema` instead. */ + export const inboundSchema = Ordinal$inboundSchema; + /** @deprecated use `Ordinal$outboundSchema` instead. */ + export const outboundSchema = Ordinal$outboundSchema; } /** @internal */ +export const OrdinalValue$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(OrdinalValue); + +/** @internal */ +export const OrdinalValue$outboundSchema: z.ZodNativeEnum = + OrdinalValue$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace OrdinalValue$ { - export const inboundSchema: z.ZodNativeEnum = z.nativeEnum(OrdinalValue); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; + /** @deprecated use `OrdinalValue$inboundSchema` instead. */ + export const inboundSchema = OrdinalValue$inboundSchema; + /** @deprecated use `OrdinalValue$outboundSchema` instead. */ + export const outboundSchema = OrdinalValue$outboundSchema; } /** @internal */ +export const WeekDays$inboundSchema: z.ZodNativeEnum = z.nativeEnum(WeekDays); + +/** @internal */ +export const WeekDays$outboundSchema: z.ZodNativeEnum = WeekDays$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace WeekDays$ { - export const inboundSchema: z.ZodNativeEnum = z.nativeEnum(WeekDays); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; + /** @deprecated use `WeekDays$inboundSchema` instead. */ + export const inboundSchema = WeekDays$inboundSchema; + /** @deprecated use `WeekDays$outboundSchema` instead. */ + export const outboundSchema = WeekDays$outboundSchema; } /** @internal */ +export const TimedConfig$inboundSchema: z.ZodType = z.object({ + atTime: z.string().optional(), + monthDays: z.array(z.string()).optional(), + monthlyType: MonthlyType$inboundSchema.optional(), + ordinal: Ordinal$inboundSchema.optional(), + ordinalValue: OrdinalValue$inboundSchema.optional(), + weekDays: z.array(WeekDays$inboundSchema).optional(), +}); + +/** @internal */ +export type TimedConfig$Outbound = { + atTime?: string | undefined; + monthDays?: Array | undefined; + monthlyType?: string | undefined; + ordinal?: string | undefined; + ordinalValue?: string | undefined; + weekDays?: Array | undefined; +}; + +/** @internal */ +export const TimedConfig$outboundSchema: z.ZodType< + TimedConfig$Outbound, + z.ZodTypeDef, + TimedConfig +> = z.object({ + atTime: z.string().optional(), + monthDays: z.array(z.string()).optional(), + monthlyType: MonthlyType$outboundSchema.optional(), + ordinal: Ordinal$outboundSchema.optional(), + ordinalValue: OrdinalValue$outboundSchema.optional(), + weekDays: z.array(WeekDays$outboundSchema).optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace TimedConfig$ { - export const inboundSchema: z.ZodType = z.object({ - atTime: z.string().optional(), - monthDays: z.array(z.string()).optional(), - monthlyType: MonthlyType$.inboundSchema.optional(), - ordinal: Ordinal$.inboundSchema.optional(), - ordinalValue: OrdinalValue$.inboundSchema.optional(), - weekDays: z.array(WeekDays$.inboundSchema).optional(), - }); - - export type Outbound = { - atTime?: string | undefined; - monthDays?: Array | undefined; - monthlyType?: string | undefined; - ordinal?: string | undefined; - ordinalValue?: string | undefined; - weekDays?: Array | undefined; - }; - - export const outboundSchema: z.ZodType = z.object({ - atTime: z.string().optional(), - monthDays: z.array(z.string()).optional(), - monthlyType: MonthlyType$.outboundSchema.optional(), - ordinal: Ordinal$.outboundSchema.optional(), - ordinalValue: OrdinalValue$.outboundSchema.optional(), - weekDays: z.array(WeekDays$.outboundSchema).optional(), - }); + /** @deprecated use `TimedConfig$inboundSchema` instead. */ + export const inboundSchema = TimedConfig$inboundSchema; + /** @deprecated use `TimedConfig$outboundSchema` instead. */ + export const outboundSchema = TimedConfig$outboundSchema; + /** @deprecated use `TimedConfig$Outbound` instead. */ + export type Outbound = TimedConfig$Outbound; } diff --git a/src/models/components/topicdto.ts b/src/models/components/topicdto.ts index 08022ca9..01f85036 100644 --- a/src/models/components/topicdto.ts +++ b/src/models/components/topicdto.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; @@ -15,47 +15,60 @@ export type TopicDto = { }; /** @internal */ -export namespace TopicDto$ { - export const inboundSchema: z.ZodType = z - .object({ - _environmentId: z.string(), - _id: z.string().optional(), - _organizationId: z.string(), - key: z.string(), - name: z.string(), - subscribers: z.array(z.string()), - }) - .transform((v) => { - return remap$(v, { - _environmentId: "environmentId", - _id: "id", - _organizationId: "organizationId", - }); +export const TopicDto$inboundSchema: z.ZodType = z + .object({ + _environmentId: z.string(), + _id: z.string().optional(), + _organizationId: z.string(), + key: z.string(), + name: z.string(), + subscribers: z.array(z.string()), + }) + .transform((v) => { + return remap$(v, { + _environmentId: "environmentId", + _id: "id", + _organizationId: "organizationId", }); + }); - export type Outbound = { - _environmentId: string; - _id?: string | undefined; - _organizationId: string; - key: string; - name: string; - subscribers: Array; - }; +/** @internal */ +export type TopicDto$Outbound = { + _environmentId: string; + _id?: string | undefined; + _organizationId: string; + key: string; + name: string; + subscribers: Array; +}; - export const outboundSchema: z.ZodType = z - .object({ - environmentId: z.string(), - id: z.string().optional(), - organizationId: z.string(), - key: z.string(), - name: z.string(), - subscribers: z.array(z.string()), - }) - .transform((v) => { - return remap$(v, { - environmentId: "_environmentId", - id: "_id", - organizationId: "_organizationId", - }); +/** @internal */ +export const TopicDto$outboundSchema: z.ZodType = z + .object({ + environmentId: z.string(), + id: z.string().optional(), + organizationId: z.string(), + key: z.string(), + name: z.string(), + subscribers: z.array(z.string()), + }) + .transform((v) => { + return remap$(v, { + environmentId: "_environmentId", + id: "_id", + organizationId: "_organizationId", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace TopicDto$ { + /** @deprecated use `TopicDto$inboundSchema` instead. */ + export const inboundSchema = TopicDto$inboundSchema; + /** @deprecated use `TopicDto$outboundSchema` instead. */ + export const outboundSchema = TopicDto$outboundSchema; + /** @deprecated use `TopicDto$Outbound` instead. */ + export type Outbound = TopicDto$Outbound; } diff --git a/src/models/components/topicpayloaddto.ts b/src/models/components/topicpayloaddto.ts index ee4af330..0a00e899 100644 --- a/src/models/components/topicpayloaddto.ts +++ b/src/models/components/topicpayloaddto.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { ClosedEnum } from "../../types/enums.js"; @@ -17,26 +17,56 @@ export type TopicPayloadDto = { }; /** @internal */ +export const TopicPayloadDtoType$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(TopicPayloadDtoType); + +/** @internal */ +export const TopicPayloadDtoType$outboundSchema: z.ZodNativeEnum = + TopicPayloadDtoType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace TopicPayloadDtoType$ { - export const inboundSchema: z.ZodNativeEnum = - z.nativeEnum(TopicPayloadDtoType); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; + /** @deprecated use `TopicPayloadDtoType$inboundSchema` instead. */ + export const inboundSchema = TopicPayloadDtoType$inboundSchema; + /** @deprecated use `TopicPayloadDtoType$outboundSchema` instead. */ + export const outboundSchema = TopicPayloadDtoType$outboundSchema; } /** @internal */ -export namespace TopicPayloadDto$ { - export const inboundSchema: z.ZodType = z.object({ +export const TopicPayloadDto$inboundSchema: z.ZodType = + z.object({ topicKey: z.string(), - type: TopicPayloadDtoType$.inboundSchema, + type: TopicPayloadDtoType$inboundSchema, }); - export type Outbound = { - topicKey: string; - type: string; - }; +/** @internal */ +export type TopicPayloadDto$Outbound = { + topicKey: string; + type: string; +}; + +/** @internal */ +export const TopicPayloadDto$outboundSchema: z.ZodType< + TopicPayloadDto$Outbound, + z.ZodTypeDef, + TopicPayloadDto +> = z.object({ + topicKey: z.string(), + type: TopicPayloadDtoType$outboundSchema, +}); - export const outboundSchema: z.ZodType = z.object({ - topicKey: z.string(), - type: TopicPayloadDtoType$.outboundSchema, - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace TopicPayloadDto$ { + /** @deprecated use `TopicPayloadDto$inboundSchema` instead. */ + export const inboundSchema = TopicPayloadDto$inboundSchema; + /** @deprecated use `TopicPayloadDto$outboundSchema` instead. */ + export const outboundSchema = TopicPayloadDto$outboundSchema; + /** @deprecated use `TopicPayloadDto$Outbound` instead. */ + export type Outbound = TopicPayloadDto$Outbound; } diff --git a/src/models/components/topicsubscriberdto.ts b/src/models/components/topicsubscriberdto.ts index e690ad6c..25629e24 100644 --- a/src/models/components/topicsubscriberdto.ts +++ b/src/models/components/topicsubscriberdto.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; @@ -15,49 +15,70 @@ export type TopicSubscriberDto = { }; /** @internal */ -export namespace TopicSubscriberDto$ { - export const inboundSchema: z.ZodType = z - .object({ - _environmentId: z.string(), - _organizationId: z.string(), - _subscriberId: z.string(), - _topicId: z.string(), - externalSubscriberId: z.string(), - topicKey: z.string(), - }) - .transform((v) => { - return remap$(v, { - _environmentId: "environmentId", - _organizationId: "organizationId", - _subscriberId: "subscriberId", - _topicId: "topicId", - }); +export const TopicSubscriberDto$inboundSchema: z.ZodType< + TopicSubscriberDto, + z.ZodTypeDef, + unknown +> = z + .object({ + _environmentId: z.string(), + _organizationId: z.string(), + _subscriberId: z.string(), + _topicId: z.string(), + externalSubscriberId: z.string(), + topicKey: z.string(), + }) + .transform((v) => { + return remap$(v, { + _environmentId: "environmentId", + _organizationId: "organizationId", + _subscriberId: "subscriberId", + _topicId: "topicId", }); + }); - export type Outbound = { - _environmentId: string; - _organizationId: string; - _subscriberId: string; - _topicId: string; - externalSubscriberId: string; - topicKey: string; - }; +/** @internal */ +export type TopicSubscriberDto$Outbound = { + _environmentId: string; + _organizationId: string; + _subscriberId: string; + _topicId: string; + externalSubscriberId: string; + topicKey: string; +}; - export const outboundSchema: z.ZodType = z - .object({ - environmentId: z.string(), - organizationId: z.string(), - subscriberId: z.string(), - topicId: z.string(), - externalSubscriberId: z.string(), - topicKey: z.string(), - }) - .transform((v) => { - return remap$(v, { - environmentId: "_environmentId", - organizationId: "_organizationId", - subscriberId: "_subscriberId", - topicId: "_topicId", - }); +/** @internal */ +export const TopicSubscriberDto$outboundSchema: z.ZodType< + TopicSubscriberDto$Outbound, + z.ZodTypeDef, + TopicSubscriberDto +> = z + .object({ + environmentId: z.string(), + organizationId: z.string(), + subscriberId: z.string(), + topicId: z.string(), + externalSubscriberId: z.string(), + topicKey: z.string(), + }) + .transform((v) => { + return remap$(v, { + environmentId: "_environmentId", + organizationId: "_organizationId", + subscriberId: "_subscriberId", + topicId: "_topicId", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace TopicSubscriberDto$ { + /** @deprecated use `TopicSubscriberDto$inboundSchema` instead. */ + export const inboundSchema = TopicSubscriberDto$inboundSchema; + /** @deprecated use `TopicSubscriberDto$outboundSchema` instead. */ + export const outboundSchema = TopicSubscriberDto$outboundSchema; + /** @deprecated use `TopicSubscriberDto$Outbound` instead. */ + export type Outbound = TopicSubscriberDto$Outbound; } diff --git a/src/models/components/triggereventrequestdto.ts b/src/models/components/triggereventrequestdto.ts index d7e299ec..37e53078 100644 --- a/src/models/components/triggereventrequestdto.ts +++ b/src/models/components/triggereventrequestdto.ts @@ -1,10 +1,25 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SubscriberPayloadDto, SubscriberPayloadDto$ } from "./subscriberpayloaddto.js"; -import { TenantPayloadDto, TenantPayloadDto$ } from "./tenantpayloaddto.js"; -import { TopicPayloadDto, TopicPayloadDto$ } from "./topicpayloaddto.js"; +import { + SubscriberPayloadDto, + SubscriberPayloadDto$inboundSchema, + SubscriberPayloadDto$Outbound, + SubscriberPayloadDto$outboundSchema, +} from "./subscriberpayloaddto.js"; +import { + TenantPayloadDto, + TenantPayloadDto$inboundSchema, + TenantPayloadDto$Outbound, + TenantPayloadDto$outboundSchema, +} from "./tenantpayloaddto.js"; +import { + TopicPayloadDto, + TopicPayloadDto$inboundSchema, + TopicPayloadDto$Outbound, + TopicPayloadDto$outboundSchema, +} from "./topicpayloaddto.js"; import * as z from "zod"; /** @@ -16,6 +31,8 @@ import * as z from "zod"; */ export type Actor = SubscriberPayloadDto | string; +export type Controls = {}; + /** * This could be used to override provider specific configurations */ @@ -49,6 +66,8 @@ export type TriggerEventRequestDto = { * */ actor?: SubscriberPayloadDto | string | undefined; + bridgeUrl?: string | undefined; + controls?: Controls | undefined; /** * The trigger identifier of the workflow you wish to send. This identifier can be found on the workflow page. */ @@ -83,118 +102,234 @@ export type TriggerEventRequestDto = { }; /** @internal */ +export const Actor$inboundSchema: z.ZodType = z.union([ + SubscriberPayloadDto$inboundSchema, + z.string(), +]); + +/** @internal */ +export type Actor$Outbound = SubscriberPayloadDto$Outbound | string; + +/** @internal */ +export const Actor$outboundSchema: z.ZodType = z.union([ + SubscriberPayloadDto$outboundSchema, + z.string(), +]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace Actor$ { - export const inboundSchema: z.ZodType = z.union([ - SubscriberPayloadDto$.inboundSchema, - z.string(), - ]); - - export type Outbound = SubscriberPayloadDto$.Outbound | string; - export const outboundSchema: z.ZodType = z.union([ - SubscriberPayloadDto$.outboundSchema, - z.string(), - ]); + /** @deprecated use `Actor$inboundSchema` instead. */ + export const inboundSchema = Actor$inboundSchema; + /** @deprecated use `Actor$outboundSchema` instead. */ + export const outboundSchema = Actor$outboundSchema; + /** @deprecated use `Actor$Outbound` instead. */ + export type Outbound = Actor$Outbound; } /** @internal */ -export namespace TriggerEventRequestDtoOverrides$ { - export const inboundSchema: z.ZodType = - z.object({}); +export const Controls$inboundSchema: z.ZodType = z.object({}); + +/** @internal */ +export type Controls$Outbound = {}; + +/** @internal */ +export const Controls$outboundSchema: z.ZodType = + z.object({}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Controls$ { + /** @deprecated use `Controls$inboundSchema` instead. */ + export const inboundSchema = Controls$inboundSchema; + /** @deprecated use `Controls$outboundSchema` instead. */ + export const outboundSchema = Controls$outboundSchema; + /** @deprecated use `Controls$Outbound` instead. */ + export type Outbound = Controls$Outbound; +} + +/** @internal */ +export const TriggerEventRequestDtoOverrides$inboundSchema: z.ZodType< + TriggerEventRequestDtoOverrides, + z.ZodTypeDef, + unknown +> = z.object({}); + +/** @internal */ +export type TriggerEventRequestDtoOverrides$Outbound = {}; - export type Outbound = {}; +/** @internal */ +export const TriggerEventRequestDtoOverrides$outboundSchema: z.ZodType< + TriggerEventRequestDtoOverrides$Outbound, + z.ZodTypeDef, + TriggerEventRequestDtoOverrides +> = z.object({}); - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - TriggerEventRequestDtoOverrides - > = z.object({}); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace TriggerEventRequestDtoOverrides$ { + /** @deprecated use `TriggerEventRequestDtoOverrides$inboundSchema` instead. */ + export const inboundSchema = TriggerEventRequestDtoOverrides$inboundSchema; + /** @deprecated use `TriggerEventRequestDtoOverrides$outboundSchema` instead. */ + export const outboundSchema = TriggerEventRequestDtoOverrides$outboundSchema; + /** @deprecated use `TriggerEventRequestDtoOverrides$Outbound` instead. */ + export type Outbound = TriggerEventRequestDtoOverrides$Outbound; } /** @internal */ -export namespace TriggerEventRequestDtoPayload$ { - export const inboundSchema: z.ZodType = - z.object({}); +export const TriggerEventRequestDtoPayload$inboundSchema: z.ZodType< + TriggerEventRequestDtoPayload, + z.ZodTypeDef, + unknown +> = z.object({}); + +/** @internal */ +export type TriggerEventRequestDtoPayload$Outbound = {}; - export type Outbound = {}; +/** @internal */ +export const TriggerEventRequestDtoPayload$outboundSchema: z.ZodType< + TriggerEventRequestDtoPayload$Outbound, + z.ZodTypeDef, + TriggerEventRequestDtoPayload +> = z.object({}); - export const outboundSchema: z.ZodType = - z.object({}); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace TriggerEventRequestDtoPayload$ { + /** @deprecated use `TriggerEventRequestDtoPayload$inboundSchema` instead. */ + export const inboundSchema = TriggerEventRequestDtoPayload$inboundSchema; + /** @deprecated use `TriggerEventRequestDtoPayload$outboundSchema` instead. */ + export const outboundSchema = TriggerEventRequestDtoPayload$outboundSchema; + /** @deprecated use `TriggerEventRequestDtoPayload$Outbound` instead. */ + export type Outbound = TriggerEventRequestDtoPayload$Outbound; } /** @internal */ +export const Tenant$inboundSchema: z.ZodType = z.union([ + TenantPayloadDto$inboundSchema, + z.string(), +]); + +/** @internal */ +export type Tenant$Outbound = TenantPayloadDto$Outbound | string; + +/** @internal */ +export const Tenant$outboundSchema: z.ZodType = z.union([ + TenantPayloadDto$outboundSchema, + z.string(), +]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace Tenant$ { - export const inboundSchema: z.ZodType = z.union([ - TenantPayloadDto$.inboundSchema, - z.string(), - ]); - - export type Outbound = TenantPayloadDto$.Outbound | string; - export const outboundSchema: z.ZodType = z.union([ - TenantPayloadDto$.outboundSchema, - z.string(), - ]); + /** @deprecated use `Tenant$inboundSchema` instead. */ + export const inboundSchema = Tenant$inboundSchema; + /** @deprecated use `Tenant$outboundSchema` instead. */ + export const outboundSchema = Tenant$outboundSchema; + /** @deprecated use `Tenant$Outbound` instead. */ + export type Outbound = Tenant$Outbound; } /** @internal */ +export const To$inboundSchema: z.ZodType = z.union([ + TopicPayloadDto$inboundSchema, + SubscriberPayloadDto$inboundSchema, + z.string(), +]); + +/** @internal */ +export type To$Outbound = TopicPayloadDto$Outbound | SubscriberPayloadDto$Outbound | string; + +/** @internal */ +export const To$outboundSchema: z.ZodType = z.union([ + TopicPayloadDto$outboundSchema, + SubscriberPayloadDto$outboundSchema, + z.string(), +]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace To$ { - export const inboundSchema: z.ZodType = z.union([ - TopicPayloadDto$.inboundSchema, - SubscriberPayloadDto$.inboundSchema, - z.string(), - ]); - - export type Outbound = TopicPayloadDto$.Outbound | SubscriberPayloadDto$.Outbound | string; - export const outboundSchema: z.ZodType = z.union([ - TopicPayloadDto$.outboundSchema, - SubscriberPayloadDto$.outboundSchema, - z.string(), - ]); + /** @deprecated use `To$inboundSchema` instead. */ + export const inboundSchema = To$inboundSchema; + /** @deprecated use `To$outboundSchema` instead. */ + export const outboundSchema = To$outboundSchema; + /** @deprecated use `To$Outbound` instead. */ + export type Outbound = To$Outbound; } /** @internal */ +export const TriggerEventRequestDto$inboundSchema: z.ZodType< + TriggerEventRequestDto, + z.ZodTypeDef, + unknown +> = z.object({ + actor: z.union([SubscriberPayloadDto$inboundSchema, z.string()]).optional(), + bridgeUrl: z.string().optional(), + controls: z.lazy(() => Controls$inboundSchema).optional(), + name: z.string(), + overrides: z.lazy(() => TriggerEventRequestDtoOverrides$inboundSchema).optional(), + payload: z.lazy(() => TriggerEventRequestDtoPayload$inboundSchema).optional(), + tenant: z.union([TenantPayloadDto$inboundSchema, z.string()]).optional(), + to: z.array( + z.union([TopicPayloadDto$inboundSchema, SubscriberPayloadDto$inboundSchema, z.string()]) + ), + transactionId: z.string().optional(), +}); + +/** @internal */ +export type TriggerEventRequestDto$Outbound = { + actor?: SubscriberPayloadDto$Outbound | string | undefined; + bridgeUrl?: string | undefined; + controls?: Controls$Outbound | undefined; + name: string; + overrides?: TriggerEventRequestDtoOverrides$Outbound | undefined; + payload?: TriggerEventRequestDtoPayload$Outbound | undefined; + tenant?: TenantPayloadDto$Outbound | string | undefined; + to: Array; + transactionId?: string | undefined; +}; + +/** @internal */ +export const TriggerEventRequestDto$outboundSchema: z.ZodType< + TriggerEventRequestDto$Outbound, + z.ZodTypeDef, + TriggerEventRequestDto +> = z.object({ + actor: z.union([SubscriberPayloadDto$outboundSchema, z.string()]).optional(), + bridgeUrl: z.string().optional(), + controls: z.lazy(() => Controls$outboundSchema).optional(), + name: z.string(), + overrides: z.lazy(() => TriggerEventRequestDtoOverrides$outboundSchema).optional(), + payload: z.lazy(() => TriggerEventRequestDtoPayload$outboundSchema).optional(), + tenant: z.union([TenantPayloadDto$outboundSchema, z.string()]).optional(), + to: z.array( + z.union([TopicPayloadDto$outboundSchema, SubscriberPayloadDto$outboundSchema, z.string()]) + ), + transactionId: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace TriggerEventRequestDto$ { - export const inboundSchema: z.ZodType = z.object( - { - actor: z.union([SubscriberPayloadDto$.inboundSchema, z.string()]).optional(), - name: z.string(), - overrides: z.lazy(() => TriggerEventRequestDtoOverrides$.inboundSchema).optional(), - payload: z.lazy(() => TriggerEventRequestDtoPayload$.inboundSchema).optional(), - tenant: z.union([TenantPayloadDto$.inboundSchema, z.string()]).optional(), - to: z.array( - z.union([ - TopicPayloadDto$.inboundSchema, - SubscriberPayloadDto$.inboundSchema, - z.string(), - ]) - ), - transactionId: z.string().optional(), - } - ); - - export type Outbound = { - actor?: SubscriberPayloadDto$.Outbound | string | undefined; - name: string; - overrides?: TriggerEventRequestDtoOverrides$.Outbound | undefined; - payload?: TriggerEventRequestDtoPayload$.Outbound | undefined; - tenant?: TenantPayloadDto$.Outbound | string | undefined; - to: Array; - transactionId?: string | undefined; - }; - - export const outboundSchema: z.ZodType = - z.object({ - actor: z.union([SubscriberPayloadDto$.outboundSchema, z.string()]).optional(), - name: z.string(), - overrides: z.lazy(() => TriggerEventRequestDtoOverrides$.outboundSchema).optional(), - payload: z.lazy(() => TriggerEventRequestDtoPayload$.outboundSchema).optional(), - tenant: z.union([TenantPayloadDto$.outboundSchema, z.string()]).optional(), - to: z.array( - z.union([ - TopicPayloadDto$.outboundSchema, - SubscriberPayloadDto$.outboundSchema, - z.string(), - ]) - ), - transactionId: z.string().optional(), - }); + /** @deprecated use `TriggerEventRequestDto$inboundSchema` instead. */ + export const inboundSchema = TriggerEventRequestDto$inboundSchema; + /** @deprecated use `TriggerEventRequestDto$outboundSchema` instead. */ + export const outboundSchema = TriggerEventRequestDto$outboundSchema; + /** @deprecated use `TriggerEventRequestDto$Outbound` instead. */ + export type Outbound = TriggerEventRequestDto$Outbound; } diff --git a/src/models/components/triggereventresponsedto.ts b/src/models/components/triggereventresponsedto.ts index 6fa7892e..b005a7e0 100644 --- a/src/models/components/triggereventresponsedto.ts +++ b/src/models/components/triggereventresponsedto.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { ClosedEnum } from "../../types/enums.js"; @@ -42,35 +42,67 @@ export type TriggerEventResponseDto = { }; /** @internal */ +export const TriggerEventResponseDtoStatus$inboundSchema: z.ZodNativeEnum< + typeof TriggerEventResponseDtoStatus +> = z.nativeEnum(TriggerEventResponseDtoStatus); + +/** @internal */ +export const TriggerEventResponseDtoStatus$outboundSchema: z.ZodNativeEnum< + typeof TriggerEventResponseDtoStatus +> = TriggerEventResponseDtoStatus$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace TriggerEventResponseDtoStatus$ { - export const inboundSchema: z.ZodNativeEnum = - z.nativeEnum(TriggerEventResponseDtoStatus); - export const outboundSchema: z.ZodNativeEnum = - inboundSchema; + /** @deprecated use `TriggerEventResponseDtoStatus$inboundSchema` instead. */ + export const inboundSchema = TriggerEventResponseDtoStatus$inboundSchema; + /** @deprecated use `TriggerEventResponseDtoStatus$outboundSchema` instead. */ + export const outboundSchema = TriggerEventResponseDtoStatus$outboundSchema; } /** @internal */ -export namespace TriggerEventResponseDto$ { - export const inboundSchema: z.ZodType = - z.object({ - acknowledged: z.boolean(), - error: z.array(z.string()).optional(), - status: TriggerEventResponseDtoStatus$.inboundSchema, - transactionId: z.string().optional(), - }); +export const TriggerEventResponseDto$inboundSchema: z.ZodType< + TriggerEventResponseDto, + z.ZodTypeDef, + unknown +> = z.object({ + acknowledged: z.boolean(), + error: z.array(z.string()).optional(), + status: TriggerEventResponseDtoStatus$inboundSchema, + transactionId: z.string().optional(), +}); + +/** @internal */ +export type TriggerEventResponseDto$Outbound = { + acknowledged: boolean; + error?: Array | undefined; + status: string; + transactionId?: string | undefined; +}; - export type Outbound = { - acknowledged: boolean; - error?: Array | undefined; - status: string; - transactionId?: string | undefined; - }; +/** @internal */ +export const TriggerEventResponseDto$outboundSchema: z.ZodType< + TriggerEventResponseDto$Outbound, + z.ZodTypeDef, + TriggerEventResponseDto +> = z.object({ + acknowledged: z.boolean(), + error: z.array(z.string()).optional(), + status: TriggerEventResponseDtoStatus$outboundSchema, + transactionId: z.string().optional(), +}); - export const outboundSchema: z.ZodType = - z.object({ - acknowledged: z.boolean(), - error: z.array(z.string()).optional(), - status: TriggerEventResponseDtoStatus$.outboundSchema, - transactionId: z.string().optional(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace TriggerEventResponseDto$ { + /** @deprecated use `TriggerEventResponseDto$inboundSchema` instead. */ + export const inboundSchema = TriggerEventResponseDto$inboundSchema; + /** @deprecated use `TriggerEventResponseDto$outboundSchema` instead. */ + export const outboundSchema = TriggerEventResponseDto$outboundSchema; + /** @deprecated use `TriggerEventResponseDto$Outbound` instead. */ + export type Outbound = TriggerEventResponseDto$Outbound; } diff --git a/src/models/components/triggereventtoallrequestdto.ts b/src/models/components/triggereventtoallrequestdto.ts index 2d47bf02..0791b9f0 100644 --- a/src/models/components/triggereventtoallrequestdto.ts +++ b/src/models/components/triggereventtoallrequestdto.ts @@ -1,9 +1,19 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SubscriberPayloadDto, SubscriberPayloadDto$ } from "./subscriberpayloaddto.js"; -import { TenantPayloadDto, TenantPayloadDto$ } from "./tenantpayloaddto.js"; +import { + SubscriberPayloadDto, + SubscriberPayloadDto$inboundSchema, + SubscriberPayloadDto$Outbound, + SubscriberPayloadDto$outboundSchema, +} from "./subscriberpayloaddto.js"; +import { + TenantPayloadDto, + TenantPayloadDto$inboundSchema, + TenantPayloadDto$Outbound, + TenantPayloadDto$outboundSchema, +} from "./tenantpayloaddto.js"; import * as z from "zod"; /** @@ -76,98 +86,172 @@ export type TriggerEventToAllRequestDto = { }; /** @internal */ +export const TriggerEventToAllRequestDtoActor$inboundSchema: z.ZodType< + TriggerEventToAllRequestDtoActor, + z.ZodTypeDef, + unknown +> = z.union([SubscriberPayloadDto$inboundSchema, z.string()]); + +/** @internal */ +export type TriggerEventToAllRequestDtoActor$Outbound = SubscriberPayloadDto$Outbound | string; + +/** @internal */ +export const TriggerEventToAllRequestDtoActor$outboundSchema: z.ZodType< + TriggerEventToAllRequestDtoActor$Outbound, + z.ZodTypeDef, + TriggerEventToAllRequestDtoActor +> = z.union([SubscriberPayloadDto$outboundSchema, z.string()]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace TriggerEventToAllRequestDtoActor$ { - export const inboundSchema: z.ZodType = - z.union([SubscriberPayloadDto$.inboundSchema, z.string()]); - - export type Outbound = SubscriberPayloadDto$.Outbound | string; - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - TriggerEventToAllRequestDtoActor - > = z.union([SubscriberPayloadDto$.outboundSchema, z.string()]); + /** @deprecated use `TriggerEventToAllRequestDtoActor$inboundSchema` instead. */ + export const inboundSchema = TriggerEventToAllRequestDtoActor$inboundSchema; + /** @deprecated use `TriggerEventToAllRequestDtoActor$outboundSchema` instead. */ + export const outboundSchema = TriggerEventToAllRequestDtoActor$outboundSchema; + /** @deprecated use `TriggerEventToAllRequestDtoActor$Outbound` instead. */ + export type Outbound = TriggerEventToAllRequestDtoActor$Outbound; } /** @internal */ +export const TriggerEventToAllRequestDtoOverrides$inboundSchema: z.ZodType< + TriggerEventToAllRequestDtoOverrides, + z.ZodTypeDef, + unknown +> = z.object({}); + +/** @internal */ +export type TriggerEventToAllRequestDtoOverrides$Outbound = {}; + +/** @internal */ +export const TriggerEventToAllRequestDtoOverrides$outboundSchema: z.ZodType< + TriggerEventToAllRequestDtoOverrides$Outbound, + z.ZodTypeDef, + TriggerEventToAllRequestDtoOverrides +> = z.object({}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace TriggerEventToAllRequestDtoOverrides$ { - export const inboundSchema: z.ZodType< - TriggerEventToAllRequestDtoOverrides, - z.ZodTypeDef, - unknown - > = z.object({}); - - export type Outbound = {}; - - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - TriggerEventToAllRequestDtoOverrides - > = z.object({}); + /** @deprecated use `TriggerEventToAllRequestDtoOverrides$inboundSchema` instead. */ + export const inboundSchema = TriggerEventToAllRequestDtoOverrides$inboundSchema; + /** @deprecated use `TriggerEventToAllRequestDtoOverrides$outboundSchema` instead. */ + export const outboundSchema = TriggerEventToAllRequestDtoOverrides$outboundSchema; + /** @deprecated use `TriggerEventToAllRequestDtoOverrides$Outbound` instead. */ + export type Outbound = TriggerEventToAllRequestDtoOverrides$Outbound; } /** @internal */ +export const TriggerEventToAllRequestDtoPayload$inboundSchema: z.ZodType< + TriggerEventToAllRequestDtoPayload, + z.ZodTypeDef, + unknown +> = z.object({}); + +/** @internal */ +export type TriggerEventToAllRequestDtoPayload$Outbound = {}; + +/** @internal */ +export const TriggerEventToAllRequestDtoPayload$outboundSchema: z.ZodType< + TriggerEventToAllRequestDtoPayload$Outbound, + z.ZodTypeDef, + TriggerEventToAllRequestDtoPayload +> = z.object({}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace TriggerEventToAllRequestDtoPayload$ { - export const inboundSchema: z.ZodType< - TriggerEventToAllRequestDtoPayload, - z.ZodTypeDef, - unknown - > = z.object({}); - - export type Outbound = {}; - - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - TriggerEventToAllRequestDtoPayload - > = z.object({}); + /** @deprecated use `TriggerEventToAllRequestDtoPayload$inboundSchema` instead. */ + export const inboundSchema = TriggerEventToAllRequestDtoPayload$inboundSchema; + /** @deprecated use `TriggerEventToAllRequestDtoPayload$outboundSchema` instead. */ + export const outboundSchema = TriggerEventToAllRequestDtoPayload$outboundSchema; + /** @deprecated use `TriggerEventToAllRequestDtoPayload$Outbound` instead. */ + export type Outbound = TriggerEventToAllRequestDtoPayload$Outbound; } /** @internal */ +export const TriggerEventToAllRequestDtoTenant$inboundSchema: z.ZodType< + TriggerEventToAllRequestDtoTenant, + z.ZodTypeDef, + unknown +> = z.union([TenantPayloadDto$inboundSchema, z.string()]); + +/** @internal */ +export type TriggerEventToAllRequestDtoTenant$Outbound = TenantPayloadDto$Outbound | string; + +/** @internal */ +export const TriggerEventToAllRequestDtoTenant$outboundSchema: z.ZodType< + TriggerEventToAllRequestDtoTenant$Outbound, + z.ZodTypeDef, + TriggerEventToAllRequestDtoTenant +> = z.union([TenantPayloadDto$outboundSchema, z.string()]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace TriggerEventToAllRequestDtoTenant$ { - export const inboundSchema: z.ZodType< - TriggerEventToAllRequestDtoTenant, - z.ZodTypeDef, - unknown - > = z.union([TenantPayloadDto$.inboundSchema, z.string()]); - - export type Outbound = TenantPayloadDto$.Outbound | string; - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - TriggerEventToAllRequestDtoTenant - > = z.union([TenantPayloadDto$.outboundSchema, z.string()]); + /** @deprecated use `TriggerEventToAllRequestDtoTenant$inboundSchema` instead. */ + export const inboundSchema = TriggerEventToAllRequestDtoTenant$inboundSchema; + /** @deprecated use `TriggerEventToAllRequestDtoTenant$outboundSchema` instead. */ + export const outboundSchema = TriggerEventToAllRequestDtoTenant$outboundSchema; + /** @deprecated use `TriggerEventToAllRequestDtoTenant$Outbound` instead. */ + export type Outbound = TriggerEventToAllRequestDtoTenant$Outbound; } /** @internal */ +export const TriggerEventToAllRequestDto$inboundSchema: z.ZodType< + TriggerEventToAllRequestDto, + z.ZodTypeDef, + unknown +> = z.object({ + actor: z.union([SubscriberPayloadDto$inboundSchema, z.string()]).optional(), + name: z.string(), + overrides: z.lazy(() => TriggerEventToAllRequestDtoOverrides$inboundSchema).optional(), + payload: z.lazy(() => TriggerEventToAllRequestDtoPayload$inboundSchema), + tenant: z.union([TenantPayloadDto$inboundSchema, z.string()]).optional(), + transactionId: z.string().optional(), +}); + +/** @internal */ +export type TriggerEventToAllRequestDto$Outbound = { + actor?: SubscriberPayloadDto$Outbound | string | undefined; + name: string; + overrides?: TriggerEventToAllRequestDtoOverrides$Outbound | undefined; + payload: TriggerEventToAllRequestDtoPayload$Outbound; + tenant?: TenantPayloadDto$Outbound | string | undefined; + transactionId?: string | undefined; +}; + +/** @internal */ +export const TriggerEventToAllRequestDto$outboundSchema: z.ZodType< + TriggerEventToAllRequestDto$Outbound, + z.ZodTypeDef, + TriggerEventToAllRequestDto +> = z.object({ + actor: z.union([SubscriberPayloadDto$outboundSchema, z.string()]).optional(), + name: z.string(), + overrides: z.lazy(() => TriggerEventToAllRequestDtoOverrides$outboundSchema).optional(), + payload: z.lazy(() => TriggerEventToAllRequestDtoPayload$outboundSchema), + tenant: z.union([TenantPayloadDto$outboundSchema, z.string()]).optional(), + transactionId: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace TriggerEventToAllRequestDto$ { - export const inboundSchema: z.ZodType = - z.object({ - actor: z.union([SubscriberPayloadDto$.inboundSchema, z.string()]).optional(), - name: z.string(), - overrides: z.lazy(() => TriggerEventToAllRequestDtoOverrides$.inboundSchema).optional(), - payload: z.lazy(() => TriggerEventToAllRequestDtoPayload$.inboundSchema), - tenant: z.union([TenantPayloadDto$.inboundSchema, z.string()]).optional(), - transactionId: z.string().optional(), - }); - - export type Outbound = { - actor?: SubscriberPayloadDto$.Outbound | string | undefined; - name: string; - overrides?: TriggerEventToAllRequestDtoOverrides$.Outbound | undefined; - payload: TriggerEventToAllRequestDtoPayload$.Outbound; - tenant?: TenantPayloadDto$.Outbound | string | undefined; - transactionId?: string | undefined; - }; - - export const outboundSchema: z.ZodType = - z.object({ - actor: z.union([SubscriberPayloadDto$.outboundSchema, z.string()]).optional(), - name: z.string(), - overrides: z - .lazy(() => TriggerEventToAllRequestDtoOverrides$.outboundSchema) - .optional(), - payload: z.lazy(() => TriggerEventToAllRequestDtoPayload$.outboundSchema), - tenant: z.union([TenantPayloadDto$.outboundSchema, z.string()]).optional(), - transactionId: z.string().optional(), - }); + /** @deprecated use `TriggerEventToAllRequestDto$inboundSchema` instead. */ + export const inboundSchema = TriggerEventToAllRequestDto$inboundSchema; + /** @deprecated use `TriggerEventToAllRequestDto$outboundSchema` instead. */ + export const outboundSchema = TriggerEventToAllRequestDto$outboundSchema; + /** @deprecated use `TriggerEventToAllRequestDto$Outbound` instead. */ + export type Outbound = TriggerEventToAllRequestDto$Outbound; } diff --git a/src/models/components/unseencountresponse.ts b/src/models/components/unseencountresponse.ts index f32923d9..e0510748 100644 --- a/src/models/components/unseencountresponse.ts +++ b/src/models/components/unseencountresponse.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -9,16 +9,37 @@ export type UnseenCountResponse = { }; /** @internal */ -export namespace UnseenCountResponse$ { - export const inboundSchema: z.ZodType = z.object({ - count: z.number(), - }); +export const UnseenCountResponse$inboundSchema: z.ZodType< + UnseenCountResponse, + z.ZodTypeDef, + unknown +> = z.object({ + count: z.number(), +}); + +/** @internal */ +export type UnseenCountResponse$Outbound = { + count: number; +}; - export type Outbound = { - count: number; - }; +/** @internal */ +export const UnseenCountResponse$outboundSchema: z.ZodType< + UnseenCountResponse$Outbound, + z.ZodTypeDef, + UnseenCountResponse +> = z.object({ + count: z.number(), +}); - export const outboundSchema: z.ZodType = z.object({ - count: z.number(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UnseenCountResponse$ { + /** @deprecated use `UnseenCountResponse$inboundSchema` instead. */ + export const inboundSchema = UnseenCountResponse$inboundSchema; + /** @deprecated use `UnseenCountResponse$outboundSchema` instead. */ + export const outboundSchema = UnseenCountResponse$outboundSchema; + /** @deprecated use `UnseenCountResponse$Outbound` instead. */ + export type Outbound = UnseenCountResponse$Outbound; } diff --git a/src/models/components/updatebrandingdetailsdto.ts b/src/models/components/updatebrandingdetailsdto.ts index 044d5abd..fe8dffae 100644 --- a/src/models/components/updatebrandingdetailsdto.ts +++ b/src/models/components/updatebrandingdetailsdto.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -13,30 +13,49 @@ export type UpdateBrandingDetailsDto = { }; /** @internal */ -export namespace UpdateBrandingDetailsDto$ { - export const inboundSchema: z.ZodType = - z.object({ - color: z.string(), - contentBackground: z.string(), - fontColor: z.string(), - fontFamily: z.string().optional(), - logo: z.string(), - }); +export const UpdateBrandingDetailsDto$inboundSchema: z.ZodType< + UpdateBrandingDetailsDto, + z.ZodTypeDef, + unknown +> = z.object({ + color: z.string(), + contentBackground: z.string(), + fontColor: z.string(), + fontFamily: z.string().optional(), + logo: z.string(), +}); + +/** @internal */ +export type UpdateBrandingDetailsDto$Outbound = { + color: string; + contentBackground: string; + fontColor: string; + fontFamily?: string | undefined; + logo: string; +}; - export type Outbound = { - color: string; - contentBackground: string; - fontColor: string; - fontFamily?: string | undefined; - logo: string; - }; +/** @internal */ +export const UpdateBrandingDetailsDto$outboundSchema: z.ZodType< + UpdateBrandingDetailsDto$Outbound, + z.ZodTypeDef, + UpdateBrandingDetailsDto +> = z.object({ + color: z.string(), + contentBackground: z.string(), + fontColor: z.string(), + fontFamily: z.string().optional(), + logo: z.string(), +}); - export const outboundSchema: z.ZodType = - z.object({ - color: z.string(), - contentBackground: z.string(), - fontColor: z.string(), - fontFamily: z.string().optional(), - logo: z.string(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateBrandingDetailsDto$ { + /** @deprecated use `UpdateBrandingDetailsDto$inboundSchema` instead. */ + export const inboundSchema = UpdateBrandingDetailsDto$inboundSchema; + /** @deprecated use `UpdateBrandingDetailsDto$outboundSchema` instead. */ + export const outboundSchema = UpdateBrandingDetailsDto$outboundSchema; + /** @deprecated use `UpdateBrandingDetailsDto$Outbound` instead. */ + export type Outbound = UpdateBrandingDetailsDto$Outbound; } diff --git a/src/models/components/updateintegrationrequestdto.ts b/src/models/components/updateintegrationrequestdto.ts index 65b932ab..c4a2c810 100644 --- a/src/models/components/updateintegrationrequestdto.ts +++ b/src/models/components/updateintegrationrequestdto.ts @@ -1,10 +1,20 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; -import { CredentialsDto, CredentialsDto$ } from "./credentialsdto.js"; -import { StepFilter, StepFilter$ } from "./stepfilter.js"; +import { + CredentialsDto, + CredentialsDto$inboundSchema, + CredentialsDto$Outbound, + CredentialsDto$outboundSchema, +} from "./credentialsdto.js"; +import { + StepFilter, + StepFilter$inboundSchema, + StepFilter$Outbound, + StepFilter$outboundSchema, +} from "./stepfilter.js"; import * as z from "zod"; export type UpdateIntegrationRequestDto = { @@ -21,46 +31,67 @@ export type UpdateIntegrationRequestDto = { }; /** @internal */ -export namespace UpdateIntegrationRequestDto$ { - export const inboundSchema: z.ZodType = z - .object({ - _environmentId: z.string().optional(), - active: z.boolean().optional(), - check: z.boolean().optional(), - conditions: z.array(StepFilter$.inboundSchema).optional(), - credentials: CredentialsDto$.inboundSchema.optional(), - identifier: z.string().optional(), - name: z.string().optional(), - }) - .transform((v) => { - return remap$(v, { - _environmentId: "environmentId", - }); +export const UpdateIntegrationRequestDto$inboundSchema: z.ZodType< + UpdateIntegrationRequestDto, + z.ZodTypeDef, + unknown +> = z + .object({ + _environmentId: z.string().optional(), + active: z.boolean().optional(), + check: z.boolean().optional(), + conditions: z.array(StepFilter$inboundSchema).optional(), + credentials: CredentialsDto$inboundSchema.optional(), + identifier: z.string().optional(), + name: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + _environmentId: "environmentId", }); + }); - export type Outbound = { - _environmentId?: string | undefined; - active?: boolean | undefined; - check?: boolean | undefined; - conditions?: Array | undefined; - credentials?: CredentialsDto$.Outbound | undefined; - identifier?: string | undefined; - name?: string | undefined; - }; +/** @internal */ +export type UpdateIntegrationRequestDto$Outbound = { + _environmentId?: string | undefined; + active?: boolean | undefined; + check?: boolean | undefined; + conditions?: Array | undefined; + credentials?: CredentialsDto$Outbound | undefined; + identifier?: string | undefined; + name?: string | undefined; +}; - export const outboundSchema: z.ZodType = z - .object({ - environmentId: z.string().optional(), - active: z.boolean().optional(), - check: z.boolean().optional(), - conditions: z.array(StepFilter$.outboundSchema).optional(), - credentials: CredentialsDto$.outboundSchema.optional(), - identifier: z.string().optional(), - name: z.string().optional(), - }) - .transform((v) => { - return remap$(v, { - environmentId: "_environmentId", - }); +/** @internal */ +export const UpdateIntegrationRequestDto$outboundSchema: z.ZodType< + UpdateIntegrationRequestDto$Outbound, + z.ZodTypeDef, + UpdateIntegrationRequestDto +> = z + .object({ + environmentId: z.string().optional(), + active: z.boolean().optional(), + check: z.boolean().optional(), + conditions: z.array(StepFilter$outboundSchema).optional(), + credentials: CredentialsDto$outboundSchema.optional(), + identifier: z.string().optional(), + name: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + environmentId: "_environmentId", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateIntegrationRequestDto$ { + /** @deprecated use `UpdateIntegrationRequestDto$inboundSchema` instead. */ + export const inboundSchema = UpdateIntegrationRequestDto$inboundSchema; + /** @deprecated use `UpdateIntegrationRequestDto$outboundSchema` instead. */ + export const outboundSchema = UpdateIntegrationRequestDto$outboundSchema; + /** @deprecated use `UpdateIntegrationRequestDto$Outbound` instead. */ + export type Outbound = UpdateIntegrationRequestDto$Outbound; } diff --git a/src/models/components/updatelayoutrequestdto.ts b/src/models/components/updatelayoutrequestdto.ts index 0e56677f..b93132c7 100644 --- a/src/models/components/updatelayoutrequestdto.ts +++ b/src/models/components/updatelayoutrequestdto.ts @@ -1,10 +1,13 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; -export type UpdateLayoutRequestDtoVariables = {}; +/** + * User defined variables to render in the layout placeholders. + */ +export type Variables = {}; export type UpdateLayoutRequestDto = { /** @@ -30,56 +33,79 @@ export type UpdateLayoutRequestDto = { /** * User defined variables to render in the layout placeholders. */ - variables?: Array | undefined; + variables?: Variables | undefined; }; /** @internal */ -export namespace UpdateLayoutRequestDtoVariables$ { - export const inboundSchema: z.ZodType = - z.object({}); +export const Variables$inboundSchema: z.ZodType = z.object({}); - export type Outbound = {}; +/** @internal */ +export type Variables$Outbound = {}; - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - UpdateLayoutRequestDtoVariables - > = z.object({}); +/** @internal */ +export const Variables$outboundSchema: z.ZodType = + z.object({}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Variables$ { + /** @deprecated use `Variables$inboundSchema` instead. */ + export const inboundSchema = Variables$inboundSchema; + /** @deprecated use `Variables$outboundSchema` instead. */ + export const outboundSchema = Variables$outboundSchema; + /** @deprecated use `Variables$Outbound` instead. */ + export type Outbound = Variables$Outbound; } /** @internal */ -export namespace UpdateLayoutRequestDto$ { - export const inboundSchema: z.ZodType = z.object( - { - content: z.string().optional(), - description: z.string().optional(), - identifier: z.string(), - isDefault: z.boolean().optional(), - name: z.string().optional(), - variables: z - .array(z.lazy(() => UpdateLayoutRequestDtoVariables$.inboundSchema)) - .optional(), - } - ); +export const UpdateLayoutRequestDto$inboundSchema: z.ZodType< + UpdateLayoutRequestDto, + z.ZodTypeDef, + unknown +> = z.object({ + content: z.string().optional(), + description: z.string().optional(), + identifier: z.string(), + isDefault: z.boolean().optional(), + name: z.string().optional(), + variables: z.lazy(() => Variables$inboundSchema).optional(), +}); - export type Outbound = { - content?: string | undefined; - description?: string | undefined; - identifier: string; - isDefault?: boolean | undefined; - name?: string | undefined; - variables?: Array | undefined; - }; +/** @internal */ +export type UpdateLayoutRequestDto$Outbound = { + content?: string | undefined; + description?: string | undefined; + identifier: string; + isDefault?: boolean | undefined; + name?: string | undefined; + variables?: Variables$Outbound | undefined; +}; - export const outboundSchema: z.ZodType = - z.object({ - content: z.string().optional(), - description: z.string().optional(), - identifier: z.string(), - isDefault: z.boolean().optional(), - name: z.string().optional(), - variables: z - .array(z.lazy(() => UpdateLayoutRequestDtoVariables$.outboundSchema)) - .optional(), - }); +/** @internal */ +export const UpdateLayoutRequestDto$outboundSchema: z.ZodType< + UpdateLayoutRequestDto$Outbound, + z.ZodTypeDef, + UpdateLayoutRequestDto +> = z.object({ + content: z.string().optional(), + description: z.string().optional(), + identifier: z.string(), + isDefault: z.boolean().optional(), + name: z.string().optional(), + variables: z.lazy(() => Variables$outboundSchema).optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateLayoutRequestDto$ { + /** @deprecated use `UpdateLayoutRequestDto$inboundSchema` instead. */ + export const inboundSchema = UpdateLayoutRequestDto$inboundSchema; + /** @deprecated use `UpdateLayoutRequestDto$outboundSchema` instead. */ + export const outboundSchema = UpdateLayoutRequestDto$outboundSchema; + /** @deprecated use `UpdateLayoutRequestDto$Outbound` instead. */ + export type Outbound = UpdateLayoutRequestDto$Outbound; } diff --git a/src/models/components/updatelayoutresponsedto.ts b/src/models/components/updatelayoutresponsedto.ts index 65c4bbbb..85af2031 100644 --- a/src/models/components/updatelayoutresponsedto.ts +++ b/src/models/components/updatelayoutresponsedto.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; @@ -15,8 +15,6 @@ export const UpdateLayoutResponseDtoChannel = { } as const; export type UpdateLayoutResponseDtoChannel = ClosedEnum; -export type UpdateLayoutResponseDtoVariables = {}; - export type UpdateLayoutResponseDto = { creatorId: string; environmentId: string; @@ -33,111 +31,127 @@ export type UpdateLayoutResponseDto = { isDeleted: boolean; name: string; updatedAt?: string | undefined; - variables?: Array | undefined; + variables?: Array | undefined; }; /** @internal */ -export namespace UpdateLayoutResponseDtoChannel$ { - export const inboundSchema: z.ZodNativeEnum = - z.nativeEnum(UpdateLayoutResponseDtoChannel); - export const outboundSchema: z.ZodNativeEnum = - inboundSchema; -} +export const UpdateLayoutResponseDtoChannel$inboundSchema: z.ZodNativeEnum< + typeof UpdateLayoutResponseDtoChannel +> = z.nativeEnum(UpdateLayoutResponseDtoChannel); /** @internal */ -export namespace UpdateLayoutResponseDtoVariables$ { - export const inboundSchema: z.ZodType = - z.object({}); +export const UpdateLayoutResponseDtoChannel$outboundSchema: z.ZodNativeEnum< + typeof UpdateLayoutResponseDtoChannel +> = UpdateLayoutResponseDtoChannel$inboundSchema; - export type Outbound = {}; - - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - UpdateLayoutResponseDtoVariables - > = z.object({}); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateLayoutResponseDtoChannel$ { + /** @deprecated use `UpdateLayoutResponseDtoChannel$inboundSchema` instead. */ + export const inboundSchema = UpdateLayoutResponseDtoChannel$inboundSchema; + /** @deprecated use `UpdateLayoutResponseDtoChannel$outboundSchema` instead. */ + export const outboundSchema = UpdateLayoutResponseDtoChannel$outboundSchema; } /** @internal */ -export namespace UpdateLayoutResponseDto$ { - export const inboundSchema: z.ZodType = z - .object({ - _creatorId: z.string(), - _environmentId: z.string(), - _id: z.string().optional(), - _organizationId: z.string(), - _parentId: z.string().optional(), - channel: UpdateLayoutResponseDtoChannel$.inboundSchema, - content: z.string(), - contentType: z.string(), - createdAt: z.string().optional(), - description: z.string().optional(), - identifier: z.string(), - isDefault: z.boolean(), - isDeleted: z.boolean(), - name: z.string(), - updatedAt: z.string().optional(), - variables: z - .array(z.lazy(() => UpdateLayoutResponseDtoVariables$.inboundSchema)) - .optional(), - }) - .transform((v) => { - return remap$(v, { - _creatorId: "creatorId", - _environmentId: "environmentId", - _id: "id", - _organizationId: "organizationId", - _parentId: "parentId", - }); +export const UpdateLayoutResponseDto$inboundSchema: z.ZodType< + UpdateLayoutResponseDto, + z.ZodTypeDef, + unknown +> = z + .object({ + _creatorId: z.string(), + _environmentId: z.string(), + _id: z.string().optional(), + _organizationId: z.string(), + _parentId: z.string().optional(), + channel: UpdateLayoutResponseDtoChannel$inboundSchema, + content: z.string(), + contentType: z.string(), + createdAt: z.string().optional(), + description: z.string().optional(), + identifier: z.string(), + isDefault: z.boolean(), + isDeleted: z.boolean(), + name: z.string(), + updatedAt: z.string().optional(), + variables: z.array(z.string()).optional(), + }) + .transform((v) => { + return remap$(v, { + _creatorId: "creatorId", + _environmentId: "environmentId", + _id: "id", + _organizationId: "organizationId", + _parentId: "parentId", }); + }); - export type Outbound = { - _creatorId: string; - _environmentId: string; - _id?: string | undefined; - _organizationId: string; - _parentId?: string | undefined; - channel: string; - content: string; - contentType: string; - createdAt?: string | undefined; - description?: string | undefined; - identifier: string; - isDefault: boolean; - isDeleted: boolean; - name: string; - updatedAt?: string | undefined; - variables?: Array | undefined; - }; +/** @internal */ +export type UpdateLayoutResponseDto$Outbound = { + _creatorId: string; + _environmentId: string; + _id?: string | undefined; + _organizationId: string; + _parentId?: string | undefined; + channel: string; + content: string; + contentType: string; + createdAt?: string | undefined; + description?: string | undefined; + identifier: string; + isDefault: boolean; + isDeleted: boolean; + name: string; + updatedAt?: string | undefined; + variables?: Array | undefined; +}; - export const outboundSchema: z.ZodType = z - .object({ - creatorId: z.string(), - environmentId: z.string(), - id: z.string().optional(), - organizationId: z.string(), - parentId: z.string().optional(), - channel: UpdateLayoutResponseDtoChannel$.outboundSchema, - content: z.string(), - contentType: z.string(), - createdAt: z.string().optional(), - description: z.string().optional(), - identifier: z.string(), - isDefault: z.boolean(), - isDeleted: z.boolean(), - name: z.string(), - updatedAt: z.string().optional(), - variables: z - .array(z.lazy(() => UpdateLayoutResponseDtoVariables$.outboundSchema)) - .optional(), - }) - .transform((v) => { - return remap$(v, { - creatorId: "_creatorId", - environmentId: "_environmentId", - id: "_id", - organizationId: "_organizationId", - parentId: "_parentId", - }); +/** @internal */ +export const UpdateLayoutResponseDto$outboundSchema: z.ZodType< + UpdateLayoutResponseDto$Outbound, + z.ZodTypeDef, + UpdateLayoutResponseDto +> = z + .object({ + creatorId: z.string(), + environmentId: z.string(), + id: z.string().optional(), + organizationId: z.string(), + parentId: z.string().optional(), + channel: UpdateLayoutResponseDtoChannel$outboundSchema, + content: z.string(), + contentType: z.string(), + createdAt: z.string().optional(), + description: z.string().optional(), + identifier: z.string(), + isDefault: z.boolean(), + isDeleted: z.boolean(), + name: z.string(), + updatedAt: z.string().optional(), + variables: z.array(z.string()).optional(), + }) + .transform((v) => { + return remap$(v, { + creatorId: "_creatorId", + environmentId: "_environmentId", + id: "_id", + organizationId: "_organizationId", + parentId: "_parentId", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateLayoutResponseDto$ { + /** @deprecated use `UpdateLayoutResponseDto$inboundSchema` instead. */ + export const inboundSchema = UpdateLayoutResponseDto$inboundSchema; + /** @deprecated use `UpdateLayoutResponseDto$outboundSchema` instead. */ + export const outboundSchema = UpdateLayoutResponseDto$outboundSchema; + /** @deprecated use `UpdateLayoutResponseDto$Outbound` instead. */ + export type Outbound = UpdateLayoutResponseDto$Outbound; } diff --git a/src/models/components/updatesubscriberchannelrequestdto.ts b/src/models/components/updatesubscriberchannelrequestdto.ts index 709053ba..f0af1ea6 100644 --- a/src/models/components/updatesubscriberchannelrequestdto.ts +++ b/src/models/components/updatesubscriberchannelrequestdto.ts @@ -1,40 +1,15 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { ClosedEnum } from "../../types/enums.js"; -import { ChannelCredentials, ChannelCredentials$ } from "./channelcredentials.js"; +import { + ChannelCredentials, + ChannelCredentials$inboundSchema, + ChannelCredentials$Outbound, + ChannelCredentials$outboundSchema, +} from "./channelcredentials.js"; import * as z from "zod"; -/** - * The provider identifier for the credentials - */ -export const UpdateSubscriberChannelRequestDtoProviderId = { - Slack: "slack", - Discord: "discord", - Msteams: "msteams", - Mattermost: "mattermost", - Ryver: "ryver", - Zulip: "zulip", - GrafanaOnCall: "grafana-on-call", - Getstream: "getstream", - RocketChat: "rocket-chat", - WhatsappBusiness: "whatsapp-business", - Fcm: "fcm", - Apns: "apns", - Expo: "expo", - OneSignal: "one-signal", - Pushpad: "pushpad", - PushWebhook: "push-webhook", - PusherBeams: "pusher-beams", -} as const; -/** - * The provider identifier for the credentials - */ -export type UpdateSubscriberChannelRequestDtoProviderId = ClosedEnum< - typeof UpdateSubscriberChannelRequestDtoProviderId ->; - export type UpdateSubscriberChannelRequestDto = { /** * Credentials payload for the specified provider @@ -47,44 +22,47 @@ export type UpdateSubscriberChannelRequestDto = { /** * The provider identifier for the credentials */ - providerId: UpdateSubscriberChannelRequestDtoProviderId; + providerId: number; }; /** @internal */ -export namespace UpdateSubscriberChannelRequestDtoProviderId$ { - export const inboundSchema: z.ZodNativeEnum< - typeof UpdateSubscriberChannelRequestDtoProviderId - > = z.nativeEnum(UpdateSubscriberChannelRequestDtoProviderId); - export const outboundSchema: z.ZodNativeEnum< - typeof UpdateSubscriberChannelRequestDtoProviderId - > = inboundSchema; -} +export const UpdateSubscriberChannelRequestDto$inboundSchema: z.ZodType< + UpdateSubscriberChannelRequestDto, + z.ZodTypeDef, + unknown +> = z.object({ + credentials: ChannelCredentials$inboundSchema, + integrationIdentifier: z.string().optional(), + providerId: z.number(), +}); /** @internal */ -export namespace UpdateSubscriberChannelRequestDto$ { - export const inboundSchema: z.ZodType< - UpdateSubscriberChannelRequestDto, - z.ZodTypeDef, - unknown - > = z.object({ - credentials: ChannelCredentials$.inboundSchema, - integrationIdentifier: z.string().optional(), - providerId: UpdateSubscriberChannelRequestDtoProviderId$.inboundSchema, - }); +export type UpdateSubscriberChannelRequestDto$Outbound = { + credentials: ChannelCredentials$Outbound; + integrationIdentifier?: string | undefined; + providerId: number; +}; - export type Outbound = { - credentials: ChannelCredentials$.Outbound; - integrationIdentifier?: string | undefined; - providerId: string; - }; +/** @internal */ +export const UpdateSubscriberChannelRequestDto$outboundSchema: z.ZodType< + UpdateSubscriberChannelRequestDto$Outbound, + z.ZodTypeDef, + UpdateSubscriberChannelRequestDto +> = z.object({ + credentials: ChannelCredentials$outboundSchema, + integrationIdentifier: z.string().optional(), + providerId: z.number(), +}); - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - UpdateSubscriberChannelRequestDto - > = z.object({ - credentials: ChannelCredentials$.outboundSchema, - integrationIdentifier: z.string().optional(), - providerId: UpdateSubscriberChannelRequestDtoProviderId$.outboundSchema, - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateSubscriberChannelRequestDto$ { + /** @deprecated use `UpdateSubscriberChannelRequestDto$inboundSchema` instead. */ + export const inboundSchema = UpdateSubscriberChannelRequestDto$inboundSchema; + /** @deprecated use `UpdateSubscriberChannelRequestDto$outboundSchema` instead. */ + export const outboundSchema = UpdateSubscriberChannelRequestDto$outboundSchema; + /** @deprecated use `UpdateSubscriberChannelRequestDto$Outbound` instead. */ + export type Outbound = UpdateSubscriberChannelRequestDto$Outbound; } diff --git a/src/models/components/updatesubscriberglobalpreferencesrequestdto.ts b/src/models/components/updatesubscriberglobalpreferencesrequestdto.ts index 0969c859..ecff7af3 100644 --- a/src/models/components/updatesubscriberglobalpreferencesrequestdto.ts +++ b/src/models/components/updatesubscriberglobalpreferencesrequestdto.ts @@ -1,8 +1,13 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { ChannelPreference, ChannelPreference$ } from "./channelpreference.js"; +import { + ChannelPreference, + ChannelPreference$inboundSchema, + ChannelPreference$Outbound, + ChannelPreference$outboundSchema, +} from "./channelpreference.js"; import * as z from "zod"; export type UpdateSubscriberGlobalPreferencesRequestDto = { @@ -17,27 +22,40 @@ export type UpdateSubscriberGlobalPreferencesRequestDto = { }; /** @internal */ -export namespace UpdateSubscriberGlobalPreferencesRequestDto$ { - export const inboundSchema: z.ZodType< - UpdateSubscriberGlobalPreferencesRequestDto, - z.ZodTypeDef, - unknown - > = z.object({ - enabled: z.boolean().optional(), - preferences: z.array(ChannelPreference$.inboundSchema).optional(), - }); +export const UpdateSubscriberGlobalPreferencesRequestDto$inboundSchema: z.ZodType< + UpdateSubscriberGlobalPreferencesRequestDto, + z.ZodTypeDef, + unknown +> = z.object({ + enabled: z.boolean().optional(), + preferences: z.array(ChannelPreference$inboundSchema).optional(), +}); + +/** @internal */ +export type UpdateSubscriberGlobalPreferencesRequestDto$Outbound = { + enabled?: boolean | undefined; + preferences?: Array | undefined; +}; - export type Outbound = { - enabled?: boolean | undefined; - preferences?: Array | undefined; - }; +/** @internal */ +export const UpdateSubscriberGlobalPreferencesRequestDto$outboundSchema: z.ZodType< + UpdateSubscriberGlobalPreferencesRequestDto$Outbound, + z.ZodTypeDef, + UpdateSubscriberGlobalPreferencesRequestDto +> = z.object({ + enabled: z.boolean().optional(), + preferences: z.array(ChannelPreference$outboundSchema).optional(), +}); - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - UpdateSubscriberGlobalPreferencesRequestDto - > = z.object({ - enabled: z.boolean().optional(), - preferences: z.array(ChannelPreference$.outboundSchema).optional(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateSubscriberGlobalPreferencesRequestDto$ { + /** @deprecated use `UpdateSubscriberGlobalPreferencesRequestDto$inboundSchema` instead. */ + export const inboundSchema = UpdateSubscriberGlobalPreferencesRequestDto$inboundSchema; + /** @deprecated use `UpdateSubscriberGlobalPreferencesRequestDto$outboundSchema` instead. */ + export const outboundSchema = UpdateSubscriberGlobalPreferencesRequestDto$outboundSchema; + /** @deprecated use `UpdateSubscriberGlobalPreferencesRequestDto$Outbound` instead. */ + export type Outbound = UpdateSubscriberGlobalPreferencesRequestDto$Outbound; } diff --git a/src/models/components/updatesubscriberonlineflagrequestdto.ts b/src/models/components/updatesubscriberonlineflagrequestdto.ts index bb255d47..05b2912b 100644 --- a/src/models/components/updatesubscriberonlineflagrequestdto.ts +++ b/src/models/components/updatesubscriberonlineflagrequestdto.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -9,24 +9,37 @@ export type UpdateSubscriberOnlineFlagRequestDto = { }; /** @internal */ -export namespace UpdateSubscriberOnlineFlagRequestDto$ { - export const inboundSchema: z.ZodType< - UpdateSubscriberOnlineFlagRequestDto, - z.ZodTypeDef, - unknown - > = z.object({ - isOnline: z.boolean(), - }); +export const UpdateSubscriberOnlineFlagRequestDto$inboundSchema: z.ZodType< + UpdateSubscriberOnlineFlagRequestDto, + z.ZodTypeDef, + unknown +> = z.object({ + isOnline: z.boolean(), +}); + +/** @internal */ +export type UpdateSubscriberOnlineFlagRequestDto$Outbound = { + isOnline: boolean; +}; - export type Outbound = { - isOnline: boolean; - }; +/** @internal */ +export const UpdateSubscriberOnlineFlagRequestDto$outboundSchema: z.ZodType< + UpdateSubscriberOnlineFlagRequestDto$Outbound, + z.ZodTypeDef, + UpdateSubscriberOnlineFlagRequestDto +> = z.object({ + isOnline: z.boolean(), +}); - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - UpdateSubscriberOnlineFlagRequestDto - > = z.object({ - isOnline: z.boolean(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateSubscriberOnlineFlagRequestDto$ { + /** @deprecated use `UpdateSubscriberOnlineFlagRequestDto$inboundSchema` instead. */ + export const inboundSchema = UpdateSubscriberOnlineFlagRequestDto$inboundSchema; + /** @deprecated use `UpdateSubscriberOnlineFlagRequestDto$outboundSchema` instead. */ + export const outboundSchema = UpdateSubscriberOnlineFlagRequestDto$outboundSchema; + /** @deprecated use `UpdateSubscriberOnlineFlagRequestDto$Outbound` instead. */ + export type Outbound = UpdateSubscriberOnlineFlagRequestDto$Outbound; } diff --git a/src/models/components/updatesubscriberpreferencerequestdto.ts b/src/models/components/updatesubscriberpreferencerequestdto.ts index 9ba6edbf..32c868c0 100644 --- a/src/models/components/updatesubscriberpreferencerequestdto.ts +++ b/src/models/components/updatesubscriberpreferencerequestdto.ts @@ -1,8 +1,13 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { ChannelPreference, ChannelPreference$ } from "./channelpreference.js"; +import { + ChannelPreference, + ChannelPreference$inboundSchema, + ChannelPreference$Outbound, + ChannelPreference$outboundSchema, +} from "./channelpreference.js"; import * as z from "zod"; export type UpdateSubscriberPreferenceRequestDto = { @@ -17,27 +22,40 @@ export type UpdateSubscriberPreferenceRequestDto = { }; /** @internal */ -export namespace UpdateSubscriberPreferenceRequestDto$ { - export const inboundSchema: z.ZodType< - UpdateSubscriberPreferenceRequestDto, - z.ZodTypeDef, - unknown - > = z.object({ - channel: ChannelPreference$.inboundSchema.optional(), - enabled: z.boolean().optional(), - }); +export const UpdateSubscriberPreferenceRequestDto$inboundSchema: z.ZodType< + UpdateSubscriberPreferenceRequestDto, + z.ZodTypeDef, + unknown +> = z.object({ + channel: ChannelPreference$inboundSchema.optional(), + enabled: z.boolean().optional(), +}); + +/** @internal */ +export type UpdateSubscriberPreferenceRequestDto$Outbound = { + channel?: ChannelPreference$Outbound | undefined; + enabled?: boolean | undefined; +}; - export type Outbound = { - channel?: ChannelPreference$.Outbound | undefined; - enabled?: boolean | undefined; - }; +/** @internal */ +export const UpdateSubscriberPreferenceRequestDto$outboundSchema: z.ZodType< + UpdateSubscriberPreferenceRequestDto$Outbound, + z.ZodTypeDef, + UpdateSubscriberPreferenceRequestDto +> = z.object({ + channel: ChannelPreference$outboundSchema.optional(), + enabled: z.boolean().optional(), +}); - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - UpdateSubscriberPreferenceRequestDto - > = z.object({ - channel: ChannelPreference$.outboundSchema.optional(), - enabled: z.boolean().optional(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateSubscriberPreferenceRequestDto$ { + /** @deprecated use `UpdateSubscriberPreferenceRequestDto$inboundSchema` instead. */ + export const inboundSchema = UpdateSubscriberPreferenceRequestDto$inboundSchema; + /** @deprecated use `UpdateSubscriberPreferenceRequestDto$outboundSchema` instead. */ + export const outboundSchema = UpdateSubscriberPreferenceRequestDto$outboundSchema; + /** @deprecated use `UpdateSubscriberPreferenceRequestDto$Outbound` instead. */ + export type Outbound = UpdateSubscriberPreferenceRequestDto$Outbound; } diff --git a/src/models/components/updatesubscriberpreferenceresponsedto.ts b/src/models/components/updatesubscriberpreferenceresponsedto.ts index c904d780..dbdec0db 100644 --- a/src/models/components/updatesubscriberpreferenceresponsedto.ts +++ b/src/models/components/updatesubscriberpreferenceresponsedto.ts @@ -1,9 +1,19 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { Preference, Preference$ } from "./preference.js"; -import { TemplateResponse, TemplateResponse$ } from "./templateresponse.js"; +import { + Preference, + Preference$inboundSchema, + Preference$Outbound, + Preference$outboundSchema, +} from "./preference.js"; +import { + TemplateResponse, + TemplateResponse$inboundSchema, + TemplateResponse$Outbound, + TemplateResponse$outboundSchema, +} from "./templateresponse.js"; import * as z from "zod"; export type UpdateSubscriberPreferenceResponseDto = { @@ -18,27 +28,40 @@ export type UpdateSubscriberPreferenceResponseDto = { }; /** @internal */ -export namespace UpdateSubscriberPreferenceResponseDto$ { - export const inboundSchema: z.ZodType< - UpdateSubscriberPreferenceResponseDto, - z.ZodTypeDef, - unknown - > = z.object({ - preference: Preference$.inboundSchema, - template: TemplateResponse$.inboundSchema, - }); +export const UpdateSubscriberPreferenceResponseDto$inboundSchema: z.ZodType< + UpdateSubscriberPreferenceResponseDto, + z.ZodTypeDef, + unknown +> = z.object({ + preference: Preference$inboundSchema, + template: TemplateResponse$inboundSchema, +}); - export type Outbound = { - preference: Preference$.Outbound; - template: TemplateResponse$.Outbound; - }; +/** @internal */ +export type UpdateSubscriberPreferenceResponseDto$Outbound = { + preference: Preference$Outbound; + template: TemplateResponse$Outbound; +}; - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - UpdateSubscriberPreferenceResponseDto - > = z.object({ - preference: Preference$.outboundSchema, - template: TemplateResponse$.outboundSchema, - }); +/** @internal */ +export const UpdateSubscriberPreferenceResponseDto$outboundSchema: z.ZodType< + UpdateSubscriberPreferenceResponseDto$Outbound, + z.ZodTypeDef, + UpdateSubscriberPreferenceResponseDto +> = z.object({ + preference: Preference$outboundSchema, + template: TemplateResponse$outboundSchema, +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateSubscriberPreferenceResponseDto$ { + /** @deprecated use `UpdateSubscriberPreferenceResponseDto$inboundSchema` instead. */ + export const inboundSchema = UpdateSubscriberPreferenceResponseDto$inboundSchema; + /** @deprecated use `UpdateSubscriberPreferenceResponseDto$outboundSchema` instead. */ + export const outboundSchema = UpdateSubscriberPreferenceResponseDto$outboundSchema; + /** @deprecated use `UpdateSubscriberPreferenceResponseDto$Outbound` instead. */ + export type Outbound = UpdateSubscriberPreferenceResponseDto$Outbound; } diff --git a/src/models/components/updatesubscriberrequestdto.ts b/src/models/components/updatesubscriberrequestdto.ts index f8819f8c..90f7e686 100644 --- a/src/models/components/updatesubscriberrequestdto.ts +++ b/src/models/components/updatesubscriberrequestdto.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -17,47 +17,85 @@ export type UpdateSubscriberRequestDto = { }; /** @internal */ -export namespace UpdateSubscriberRequestDtoData$ { - export const inboundSchema: z.ZodType = - z.object({}); +export const UpdateSubscriberRequestDtoData$inboundSchema: z.ZodType< + UpdateSubscriberRequestDtoData, + z.ZodTypeDef, + unknown +> = z.object({}); - export type Outbound = {}; +/** @internal */ +export type UpdateSubscriberRequestDtoData$Outbound = {}; - export const outboundSchema: z.ZodType = - z.object({}); +/** @internal */ +export const UpdateSubscriberRequestDtoData$outboundSchema: z.ZodType< + UpdateSubscriberRequestDtoData$Outbound, + z.ZodTypeDef, + UpdateSubscriberRequestDtoData +> = z.object({}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateSubscriberRequestDtoData$ { + /** @deprecated use `UpdateSubscriberRequestDtoData$inboundSchema` instead. */ + export const inboundSchema = UpdateSubscriberRequestDtoData$inboundSchema; + /** @deprecated use `UpdateSubscriberRequestDtoData$outboundSchema` instead. */ + export const outboundSchema = UpdateSubscriberRequestDtoData$outboundSchema; + /** @deprecated use `UpdateSubscriberRequestDtoData$Outbound` instead. */ + export type Outbound = UpdateSubscriberRequestDtoData$Outbound; } /** @internal */ +export const UpdateSubscriberRequestDto$inboundSchema: z.ZodType< + UpdateSubscriberRequestDto, + z.ZodTypeDef, + unknown +> = z.object({ + avatar: z.string().optional(), + data: z.lazy(() => UpdateSubscriberRequestDtoData$inboundSchema).optional(), + email: z.string().optional(), + firstName: z.string().optional(), + lastName: z.string().optional(), + locale: z.string().optional(), + phone: z.string().optional(), +}); + +/** @internal */ +export type UpdateSubscriberRequestDto$Outbound = { + avatar?: string | undefined; + data?: UpdateSubscriberRequestDtoData$Outbound | undefined; + email?: string | undefined; + firstName?: string | undefined; + lastName?: string | undefined; + locale?: string | undefined; + phone?: string | undefined; +}; + +/** @internal */ +export const UpdateSubscriberRequestDto$outboundSchema: z.ZodType< + UpdateSubscriberRequestDto$Outbound, + z.ZodTypeDef, + UpdateSubscriberRequestDto +> = z.object({ + avatar: z.string().optional(), + data: z.lazy(() => UpdateSubscriberRequestDtoData$outboundSchema).optional(), + email: z.string().optional(), + firstName: z.string().optional(), + lastName: z.string().optional(), + locale: z.string().optional(), + phone: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace UpdateSubscriberRequestDto$ { - export const inboundSchema: z.ZodType = - z.object({ - avatar: z.string().optional(), - data: z.lazy(() => UpdateSubscriberRequestDtoData$.inboundSchema).optional(), - email: z.string().optional(), - firstName: z.string().optional(), - lastName: z.string().optional(), - locale: z.string().optional(), - phone: z.string().optional(), - }); - - export type Outbound = { - avatar?: string | undefined; - data?: UpdateSubscriberRequestDtoData$.Outbound | undefined; - email?: string | undefined; - firstName?: string | undefined; - lastName?: string | undefined; - locale?: string | undefined; - phone?: string | undefined; - }; - - export const outboundSchema: z.ZodType = - z.object({ - avatar: z.string().optional(), - data: z.lazy(() => UpdateSubscriberRequestDtoData$.outboundSchema).optional(), - email: z.string().optional(), - firstName: z.string().optional(), - lastName: z.string().optional(), - locale: z.string().optional(), - phone: z.string().optional(), - }); + /** @deprecated use `UpdateSubscriberRequestDto$inboundSchema` instead. */ + export const inboundSchema = UpdateSubscriberRequestDto$inboundSchema; + /** @deprecated use `UpdateSubscriberRequestDto$outboundSchema` instead. */ + export const outboundSchema = UpdateSubscriberRequestDto$outboundSchema; + /** @deprecated use `UpdateSubscriberRequestDto$Outbound` instead. */ + export type Outbound = UpdateSubscriberRequestDto$Outbound; } diff --git a/src/models/components/updatetenantrequestdto.ts b/src/models/components/updatetenantrequestdto.ts index 24fdf1b7..8cddbf69 100644 --- a/src/models/components/updatetenantrequestdto.ts +++ b/src/models/components/updatetenantrequestdto.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -13,36 +13,73 @@ export type UpdateTenantRequestDto = { }; /** @internal */ -export namespace UpdateTenantRequestDtoData$ { - export const inboundSchema: z.ZodType = - z.object({}); +export const UpdateTenantRequestDtoData$inboundSchema: z.ZodType< + UpdateTenantRequestDtoData, + z.ZodTypeDef, + unknown +> = z.object({}); + +/** @internal */ +export type UpdateTenantRequestDtoData$Outbound = {}; - export type Outbound = {}; +/** @internal */ +export const UpdateTenantRequestDtoData$outboundSchema: z.ZodType< + UpdateTenantRequestDtoData$Outbound, + z.ZodTypeDef, + UpdateTenantRequestDtoData +> = z.object({}); - export const outboundSchema: z.ZodType = - z.object({}); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateTenantRequestDtoData$ { + /** @deprecated use `UpdateTenantRequestDtoData$inboundSchema` instead. */ + export const inboundSchema = UpdateTenantRequestDtoData$inboundSchema; + /** @deprecated use `UpdateTenantRequestDtoData$outboundSchema` instead. */ + export const outboundSchema = UpdateTenantRequestDtoData$outboundSchema; + /** @deprecated use `UpdateTenantRequestDtoData$Outbound` instead. */ + export type Outbound = UpdateTenantRequestDtoData$Outbound; } /** @internal */ +export const UpdateTenantRequestDto$inboundSchema: z.ZodType< + UpdateTenantRequestDto, + z.ZodTypeDef, + unknown +> = z.object({ + data: z.lazy(() => UpdateTenantRequestDtoData$inboundSchema).optional(), + identifier: z.string().optional(), + name: z.string().optional(), +}); + +/** @internal */ +export type UpdateTenantRequestDto$Outbound = { + data?: UpdateTenantRequestDtoData$Outbound | undefined; + identifier?: string | undefined; + name?: string | undefined; +}; + +/** @internal */ +export const UpdateTenantRequestDto$outboundSchema: z.ZodType< + UpdateTenantRequestDto$Outbound, + z.ZodTypeDef, + UpdateTenantRequestDto +> = z.object({ + data: z.lazy(() => UpdateTenantRequestDtoData$outboundSchema).optional(), + identifier: z.string().optional(), + name: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace UpdateTenantRequestDto$ { - export const inboundSchema: z.ZodType = z.object( - { - data: z.lazy(() => UpdateTenantRequestDtoData$.inboundSchema).optional(), - identifier: z.string().optional(), - name: z.string().optional(), - } - ); - - export type Outbound = { - data?: UpdateTenantRequestDtoData$.Outbound | undefined; - identifier?: string | undefined; - name?: string | undefined; - }; - - export const outboundSchema: z.ZodType = - z.object({ - data: z.lazy(() => UpdateTenantRequestDtoData$.outboundSchema).optional(), - identifier: z.string().optional(), - name: z.string().optional(), - }); + /** @deprecated use `UpdateTenantRequestDto$inboundSchema` instead. */ + export const inboundSchema = UpdateTenantRequestDto$inboundSchema; + /** @deprecated use `UpdateTenantRequestDto$outboundSchema` instead. */ + export const outboundSchema = UpdateTenantRequestDto$outboundSchema; + /** @deprecated use `UpdateTenantRequestDto$Outbound` instead. */ + export type Outbound = UpdateTenantRequestDto$Outbound; } diff --git a/src/models/components/updatetenantresponsedto.ts b/src/models/components/updatetenantresponsedto.ts index e049ba17..671a0ad7 100644 --- a/src/models/components/updatetenantresponsedto.ts +++ b/src/models/components/updatetenantresponsedto.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; @@ -18,59 +18,99 @@ export type UpdateTenantResponseDto = { }; /** @internal */ -export namespace UpdateTenantResponseDtoData$ { - export const inboundSchema: z.ZodType = - z.object({}); +export const UpdateTenantResponseDtoData$inboundSchema: z.ZodType< + UpdateTenantResponseDtoData, + z.ZodTypeDef, + unknown +> = z.object({}); - export type Outbound = {}; +/** @internal */ +export type UpdateTenantResponseDtoData$Outbound = {}; - export const outboundSchema: z.ZodType = - z.object({}); +/** @internal */ +export const UpdateTenantResponseDtoData$outboundSchema: z.ZodType< + UpdateTenantResponseDtoData$Outbound, + z.ZodTypeDef, + UpdateTenantResponseDtoData +> = z.object({}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateTenantResponseDtoData$ { + /** @deprecated use `UpdateTenantResponseDtoData$inboundSchema` instead. */ + export const inboundSchema = UpdateTenantResponseDtoData$inboundSchema; + /** @deprecated use `UpdateTenantResponseDtoData$outboundSchema` instead. */ + export const outboundSchema = UpdateTenantResponseDtoData$outboundSchema; + /** @deprecated use `UpdateTenantResponseDtoData$Outbound` instead. */ + export type Outbound = UpdateTenantResponseDtoData$Outbound; } /** @internal */ -export namespace UpdateTenantResponseDto$ { - export const inboundSchema: z.ZodType = z - .object({ - _environmentId: z.string(), - _id: z.string(), - createdAt: z.string(), - data: z.lazy(() => UpdateTenantResponseDtoData$.inboundSchema).optional(), - identifier: z.string(), - name: z.string().optional(), - updatedAt: z.string(), - }) - .transform((v) => { - return remap$(v, { - _environmentId: "environmentId", - _id: "id", - }); +export const UpdateTenantResponseDto$inboundSchema: z.ZodType< + UpdateTenantResponseDto, + z.ZodTypeDef, + unknown +> = z + .object({ + _environmentId: z.string(), + _id: z.string(), + createdAt: z.string(), + data: z.lazy(() => UpdateTenantResponseDtoData$inboundSchema).optional(), + identifier: z.string(), + name: z.string().optional(), + updatedAt: z.string(), + }) + .transform((v) => { + return remap$(v, { + _environmentId: "environmentId", + _id: "id", }); + }); - export type Outbound = { - _environmentId: string; - _id: string; - createdAt: string; - data?: UpdateTenantResponseDtoData$.Outbound | undefined; - identifier: string; - name?: string | undefined; - updatedAt: string; - }; +/** @internal */ +export type UpdateTenantResponseDto$Outbound = { + _environmentId: string; + _id: string; + createdAt: string; + data?: UpdateTenantResponseDtoData$Outbound | undefined; + identifier: string; + name?: string | undefined; + updatedAt: string; +}; - export const outboundSchema: z.ZodType = z - .object({ - environmentId: z.string(), - id: z.string(), - createdAt: z.string(), - data: z.lazy(() => UpdateTenantResponseDtoData$.outboundSchema).optional(), - identifier: z.string(), - name: z.string().optional(), - updatedAt: z.string(), - }) - .transform((v) => { - return remap$(v, { - environmentId: "_environmentId", - id: "_id", - }); +/** @internal */ +export const UpdateTenantResponseDto$outboundSchema: z.ZodType< + UpdateTenantResponseDto$Outbound, + z.ZodTypeDef, + UpdateTenantResponseDto +> = z + .object({ + environmentId: z.string(), + id: z.string(), + createdAt: z.string(), + data: z.lazy(() => UpdateTenantResponseDtoData$outboundSchema).optional(), + identifier: z.string(), + name: z.string().optional(), + updatedAt: z.string(), + }) + .transform((v) => { + return remap$(v, { + environmentId: "_environmentId", + id: "_id", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateTenantResponseDto$ { + /** @deprecated use `UpdateTenantResponseDto$inboundSchema` instead. */ + export const inboundSchema = UpdateTenantResponseDto$inboundSchema; + /** @deprecated use `UpdateTenantResponseDto$outboundSchema` instead. */ + export const outboundSchema = UpdateTenantResponseDto$outboundSchema; + /** @deprecated use `UpdateTenantResponseDto$Outbound` instead. */ + export type Outbound = UpdateTenantResponseDto$Outbound; } diff --git a/src/models/components/updateworkflowrequestdto.ts b/src/models/components/updateworkflowrequestdto.ts index ec132324..dfe4d280 100644 --- a/src/models/components/updateworkflowrequestdto.ts +++ b/src/models/components/updateworkflowrequestdto.ts @@ -1,9 +1,13 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { NotificationStep, NotificationStep$ } from "./notificationstep.js"; -import { PreferenceChannels, PreferenceChannels$ } from "./preferencechannels.js"; +import { + PreferenceChannels, + PreferenceChannels$inboundSchema, + PreferenceChannels$Outbound, + PreferenceChannels$outboundSchema, +} from "./preferencechannels.js"; import * as z from "zod"; export type UpdateWorkflowRequestDtoData = {}; @@ -16,58 +20,96 @@ export type UpdateWorkflowRequestDto = { name: string; notificationGroupId: string; preferenceSettings?: PreferenceChannels | undefined; - steps?: Array | undefined; + steps?: Array | undefined; tags?: Array | undefined; }; /** @internal */ -export namespace UpdateWorkflowRequestDtoData$ { - export const inboundSchema: z.ZodType = - z.object({}); +export const UpdateWorkflowRequestDtoData$inboundSchema: z.ZodType< + UpdateWorkflowRequestDtoData, + z.ZodTypeDef, + unknown +> = z.object({}); - export type Outbound = {}; +/** @internal */ +export type UpdateWorkflowRequestDtoData$Outbound = {}; - export const outboundSchema: z.ZodType = - z.object({}); +/** @internal */ +export const UpdateWorkflowRequestDtoData$outboundSchema: z.ZodType< + UpdateWorkflowRequestDtoData$Outbound, + z.ZodTypeDef, + UpdateWorkflowRequestDtoData +> = z.object({}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateWorkflowRequestDtoData$ { + /** @deprecated use `UpdateWorkflowRequestDtoData$inboundSchema` instead. */ + export const inboundSchema = UpdateWorkflowRequestDtoData$inboundSchema; + /** @deprecated use `UpdateWorkflowRequestDtoData$outboundSchema` instead. */ + export const outboundSchema = UpdateWorkflowRequestDtoData$outboundSchema; + /** @deprecated use `UpdateWorkflowRequestDtoData$Outbound` instead. */ + export type Outbound = UpdateWorkflowRequestDtoData$Outbound; } /** @internal */ -export namespace UpdateWorkflowRequestDto$ { - export const inboundSchema: z.ZodType = - z.object({ - critical: z.boolean().optional(), - data: z.lazy(() => UpdateWorkflowRequestDtoData$.inboundSchema).optional(), - description: z.string().optional(), - identifier: z.string().optional(), - name: z.string(), - notificationGroupId: z.string(), - preferenceSettings: PreferenceChannels$.inboundSchema.optional(), - steps: z.array(NotificationStep$.inboundSchema).optional(), - tags: z.array(z.string()).optional(), - }); +export const UpdateWorkflowRequestDto$inboundSchema: z.ZodType< + UpdateWorkflowRequestDto, + z.ZodTypeDef, + unknown +> = z.object({ + critical: z.boolean().optional(), + data: z.lazy(() => UpdateWorkflowRequestDtoData$inboundSchema).optional(), + description: z.string().optional(), + identifier: z.string().optional(), + name: z.string(), + notificationGroupId: z.string(), + preferenceSettings: PreferenceChannels$inboundSchema.optional(), + steps: z.array(z.string()).optional(), + tags: z.array(z.string()).optional(), +}); - export type Outbound = { - critical?: boolean | undefined; - data?: UpdateWorkflowRequestDtoData$.Outbound | undefined; - description?: string | undefined; - identifier?: string | undefined; - name: string; - notificationGroupId: string; - preferenceSettings?: PreferenceChannels$.Outbound | undefined; - steps?: Array | undefined; - tags?: Array | undefined; - }; +/** @internal */ +export type UpdateWorkflowRequestDto$Outbound = { + critical?: boolean | undefined; + data?: UpdateWorkflowRequestDtoData$Outbound | undefined; + description?: string | undefined; + identifier?: string | undefined; + name: string; + notificationGroupId: string; + preferenceSettings?: PreferenceChannels$Outbound | undefined; + steps?: Array | undefined; + tags?: Array | undefined; +}; - export const outboundSchema: z.ZodType = - z.object({ - critical: z.boolean().optional(), - data: z.lazy(() => UpdateWorkflowRequestDtoData$.outboundSchema).optional(), - description: z.string().optional(), - identifier: z.string().optional(), - name: z.string(), - notificationGroupId: z.string(), - preferenceSettings: PreferenceChannels$.outboundSchema.optional(), - steps: z.array(NotificationStep$.outboundSchema).optional(), - tags: z.array(z.string()).optional(), - }); +/** @internal */ +export const UpdateWorkflowRequestDto$outboundSchema: z.ZodType< + UpdateWorkflowRequestDto$Outbound, + z.ZodTypeDef, + UpdateWorkflowRequestDto +> = z.object({ + critical: z.boolean().optional(), + data: z.lazy(() => UpdateWorkflowRequestDtoData$outboundSchema).optional(), + description: z.string().optional(), + identifier: z.string().optional(), + name: z.string(), + notificationGroupId: z.string(), + preferenceSettings: PreferenceChannels$outboundSchema.optional(), + steps: z.array(z.string()).optional(), + tags: z.array(z.string()).optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateWorkflowRequestDto$ { + /** @deprecated use `UpdateWorkflowRequestDto$inboundSchema` instead. */ + export const inboundSchema = UpdateWorkflowRequestDto$inboundSchema; + /** @deprecated use `UpdateWorkflowRequestDto$outboundSchema` instead. */ + export const outboundSchema = UpdateWorkflowRequestDto$outboundSchema; + /** @deprecated use `UpdateWorkflowRequestDto$Outbound` instead. */ + export type Outbound = UpdateWorkflowRequestDto$Outbound; } diff --git a/src/models/components/variablesresponsedto.ts b/src/models/components/variablesresponsedto.ts index fe354d85..0f044d87 100644 --- a/src/models/components/variablesresponsedto.ts +++ b/src/models/components/variablesresponsedto.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -14,39 +14,90 @@ export type VariablesResponseDto = { }; /** @internal */ -export namespace System$ { - export const inboundSchema: z.ZodType = z.object({}); +export const System$inboundSchema: z.ZodType = z.object({}); - export type Outbound = {}; +/** @internal */ +export type System$Outbound = {}; - export const outboundSchema: z.ZodType = z.object({}); +/** @internal */ +export const System$outboundSchema: z.ZodType = z.object({}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace System$ { + /** @deprecated use `System$inboundSchema` instead. */ + export const inboundSchema = System$inboundSchema; + /** @deprecated use `System$outboundSchema` instead. */ + export const outboundSchema = System$outboundSchema; + /** @deprecated use `System$Outbound` instead. */ + export type Outbound = System$Outbound; } /** @internal */ -export namespace Translations$ { - export const inboundSchema: z.ZodType = z.object({}); +export const Translations$inboundSchema: z.ZodType = z.object( + {} +); - export type Outbound = {}; +/** @internal */ +export type Translations$Outbound = {}; + +/** @internal */ +export const Translations$outboundSchema: z.ZodType< + Translations$Outbound, + z.ZodTypeDef, + Translations +> = z.object({}); - export const outboundSchema: z.ZodType = z.object({}); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Translations$ { + /** @deprecated use `Translations$inboundSchema` instead. */ + export const inboundSchema = Translations$inboundSchema; + /** @deprecated use `Translations$outboundSchema` instead. */ + export const outboundSchema = Translations$outboundSchema; + /** @deprecated use `Translations$Outbound` instead. */ + export type Outbound = Translations$Outbound; } /** @internal */ +export const VariablesResponseDto$inboundSchema: z.ZodType< + VariablesResponseDto, + z.ZodTypeDef, + unknown +> = z.object({ + system: z.lazy(() => System$inboundSchema), + translations: z.lazy(() => Translations$inboundSchema), +}); + +/** @internal */ +export type VariablesResponseDto$Outbound = { + system: System$Outbound; + translations: Translations$Outbound; +}; + +/** @internal */ +export const VariablesResponseDto$outboundSchema: z.ZodType< + VariablesResponseDto$Outbound, + z.ZodTypeDef, + VariablesResponseDto +> = z.object({ + system: z.lazy(() => System$outboundSchema), + translations: z.lazy(() => Translations$outboundSchema), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace VariablesResponseDto$ { - export const inboundSchema: z.ZodType = z.object({ - system: z.lazy(() => System$.inboundSchema), - translations: z.lazy(() => Translations$.inboundSchema), - }); - - export type Outbound = { - system: System$.Outbound; - translations: Translations$.Outbound; - }; - - export const outboundSchema: z.ZodType = z.object( - { - system: z.lazy(() => System$.outboundSchema), - translations: z.lazy(() => Translations$.outboundSchema), - } - ); + /** @deprecated use `VariablesResponseDto$inboundSchema` instead. */ + export const inboundSchema = VariablesResponseDto$inboundSchema; + /** @deprecated use `VariablesResponseDto$outboundSchema` instead. */ + export const outboundSchema = VariablesResponseDto$outboundSchema; + /** @deprecated use `VariablesResponseDto$Outbound` instead. */ + export type Outbound = VariablesResponseDto$Outbound; } diff --git a/src/models/components/workflowresponse.ts b/src/models/components/workflowresponse.ts index d96887ca..d542f511 100644 --- a/src/models/components/workflowresponse.ts +++ b/src/models/components/workflowresponse.ts @@ -1,12 +1,32 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; -import { NotificationGroup, NotificationGroup$ } from "./notificationgroup.js"; -import { NotificationStep, NotificationStep$ } from "./notificationstep.js"; -import { NotificationTrigger, NotificationTrigger$ } from "./notificationtrigger.js"; -import { PreferenceChannels, PreferenceChannels$ } from "./preferencechannels.js"; +import { + NotificationGroup, + NotificationGroup$inboundSchema, + NotificationGroup$Outbound, + NotificationGroup$outboundSchema, +} from "./notificationgroup.js"; +import { + NotificationStep, + NotificationStep$inboundSchema, + NotificationStep$Outbound, + NotificationStep$outboundSchema, +} from "./notificationstep.js"; +import { + NotificationTrigger, + NotificationTrigger$inboundSchema, + NotificationTrigger$Outbound, + NotificationTrigger$outboundSchema, +} from "./notificationtrigger.js"; +import { + PreferenceChannels, + PreferenceChannels$inboundSchema, + PreferenceChannels$Outbound, + PreferenceChannels$outboundSchema, +} from "./preferencechannels.js"; import * as z from "zod"; export type WorkflowResponseData = {}; @@ -38,126 +58,177 @@ export type WorkflowResponse = { }; /** @internal */ -export namespace WorkflowResponseData$ { - export const inboundSchema: z.ZodType = z.object( - {} - ); +export const WorkflowResponseData$inboundSchema: z.ZodType< + WorkflowResponseData, + z.ZodTypeDef, + unknown +> = z.object({}); + +/** @internal */ +export type WorkflowResponseData$Outbound = {}; - export type Outbound = {}; +/** @internal */ +export const WorkflowResponseData$outboundSchema: z.ZodType< + WorkflowResponseData$Outbound, + z.ZodTypeDef, + WorkflowResponseData +> = z.object({}); - export const outboundSchema: z.ZodType = z.object( - {} - ); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace WorkflowResponseData$ { + /** @deprecated use `WorkflowResponseData$inboundSchema` instead. */ + export const inboundSchema = WorkflowResponseData$inboundSchema; + /** @deprecated use `WorkflowResponseData$outboundSchema` instead. */ + export const outboundSchema = WorkflowResponseData$outboundSchema; + /** @deprecated use `WorkflowResponseData$Outbound` instead. */ + export type Outbound = WorkflowResponseData$Outbound; } /** @internal */ -export namespace WorkflowIntegrationStatus$ { - export const inboundSchema: z.ZodType = - z.object({}); +export const WorkflowIntegrationStatus$inboundSchema: z.ZodType< + WorkflowIntegrationStatus, + z.ZodTypeDef, + unknown +> = z.object({}); - export type Outbound = {}; +/** @internal */ +export type WorkflowIntegrationStatus$Outbound = {}; - export const outboundSchema: z.ZodType = - z.object({}); +/** @internal */ +export const WorkflowIntegrationStatus$outboundSchema: z.ZodType< + WorkflowIntegrationStatus$Outbound, + z.ZodTypeDef, + WorkflowIntegrationStatus +> = z.object({}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace WorkflowIntegrationStatus$ { + /** @deprecated use `WorkflowIntegrationStatus$inboundSchema` instead. */ + export const inboundSchema = WorkflowIntegrationStatus$inboundSchema; + /** @deprecated use `WorkflowIntegrationStatus$outboundSchema` instead. */ + export const outboundSchema = WorkflowIntegrationStatus$outboundSchema; + /** @deprecated use `WorkflowIntegrationStatus$Outbound` instead. */ + export type Outbound = WorkflowIntegrationStatus$Outbound; } /** @internal */ -export namespace WorkflowResponse$ { - export const inboundSchema: z.ZodType = z - .object({ - _creatorId: z.string(), - _environmentId: z.string(), - _id: z.string().optional(), - _notificationGroupId: z.string(), - _organizationId: z.string(), - _parentId: z.string().optional(), - active: z.boolean(), - critical: z.boolean(), - data: z.lazy(() => WorkflowResponseData$.inboundSchema).optional(), - deleted: z.boolean(), - deletedAt: z.string(), - deletedBy: z.string(), - description: z.string(), - draft: z.boolean(), - name: z.string(), - notificationGroup: NotificationGroup$.inboundSchema.optional(), - preferenceSettings: PreferenceChannels$.inboundSchema, - steps: z.array(NotificationStep$.inboundSchema), - tags: z.array(z.string()), - triggers: z.array(NotificationTrigger$.inboundSchema), - workflowIntegrationStatus: z - .lazy(() => WorkflowIntegrationStatus$.inboundSchema) - .optional(), - }) - .transform((v) => { - return remap$(v, { - _creatorId: "creatorId", - _environmentId: "environmentId", - _id: "id", - _notificationGroupId: "notificationGroupId", - _organizationId: "organizationId", - _parentId: "parentId", - }); +export const WorkflowResponse$inboundSchema: z.ZodType = z + .object({ + _creatorId: z.string(), + _environmentId: z.string(), + _id: z.string().optional(), + _notificationGroupId: z.string(), + _organizationId: z.string(), + _parentId: z.string().optional(), + active: z.boolean(), + critical: z.boolean(), + data: z.lazy(() => WorkflowResponseData$inboundSchema).optional(), + deleted: z.boolean(), + deletedAt: z.string(), + deletedBy: z.string(), + description: z.string(), + draft: z.boolean(), + name: z.string(), + notificationGroup: NotificationGroup$inboundSchema.optional(), + preferenceSettings: PreferenceChannels$inboundSchema, + steps: z.array(NotificationStep$inboundSchema), + tags: z.array(z.string()), + triggers: z.array(NotificationTrigger$inboundSchema), + workflowIntegrationStatus: z.lazy(() => WorkflowIntegrationStatus$inboundSchema).optional(), + }) + .transform((v) => { + return remap$(v, { + _creatorId: "creatorId", + _environmentId: "environmentId", + _id: "id", + _notificationGroupId: "notificationGroupId", + _organizationId: "organizationId", + _parentId: "parentId", }); + }); - export type Outbound = { - _creatorId: string; - _environmentId: string; - _id?: string | undefined; - _notificationGroupId: string; - _organizationId: string; - _parentId?: string | undefined; - active: boolean; - critical: boolean; - data?: WorkflowResponseData$.Outbound | undefined; - deleted: boolean; - deletedAt: string; - deletedBy: string; - description: string; - draft: boolean; - name: string; - notificationGroup?: NotificationGroup$.Outbound | undefined; - preferenceSettings: PreferenceChannels$.Outbound; - steps: Array; - tags: Array; - triggers: Array; - workflowIntegrationStatus?: WorkflowIntegrationStatus$.Outbound | undefined; - }; - - export const outboundSchema: z.ZodType = z - .object({ - creatorId: z.string(), - environmentId: z.string(), - id: z.string().optional(), - notificationGroupId: z.string(), - organizationId: z.string(), - parentId: z.string().optional(), - active: z.boolean(), - critical: z.boolean(), - data: z.lazy(() => WorkflowResponseData$.outboundSchema).optional(), - deleted: z.boolean(), - deletedAt: z.string(), - deletedBy: z.string(), - description: z.string(), - draft: z.boolean(), - name: z.string(), - notificationGroup: NotificationGroup$.outboundSchema.optional(), - preferenceSettings: PreferenceChannels$.outboundSchema, - steps: z.array(NotificationStep$.outboundSchema), - tags: z.array(z.string()), - triggers: z.array(NotificationTrigger$.outboundSchema), - workflowIntegrationStatus: z - .lazy(() => WorkflowIntegrationStatus$.outboundSchema) - .optional(), - }) - .transform((v) => { - return remap$(v, { - creatorId: "_creatorId", - environmentId: "_environmentId", - id: "_id", - notificationGroupId: "_notificationGroupId", - organizationId: "_organizationId", - parentId: "_parentId", - }); +/** @internal */ +export type WorkflowResponse$Outbound = { + _creatorId: string; + _environmentId: string; + _id?: string | undefined; + _notificationGroupId: string; + _organizationId: string; + _parentId?: string | undefined; + active: boolean; + critical: boolean; + data?: WorkflowResponseData$Outbound | undefined; + deleted: boolean; + deletedAt: string; + deletedBy: string; + description: string; + draft: boolean; + name: string; + notificationGroup?: NotificationGroup$Outbound | undefined; + preferenceSettings: PreferenceChannels$Outbound; + steps: Array; + tags: Array; + triggers: Array; + workflowIntegrationStatus?: WorkflowIntegrationStatus$Outbound | undefined; +}; + +/** @internal */ +export const WorkflowResponse$outboundSchema: z.ZodType< + WorkflowResponse$Outbound, + z.ZodTypeDef, + WorkflowResponse +> = z + .object({ + creatorId: z.string(), + environmentId: z.string(), + id: z.string().optional(), + notificationGroupId: z.string(), + organizationId: z.string(), + parentId: z.string().optional(), + active: z.boolean(), + critical: z.boolean(), + data: z.lazy(() => WorkflowResponseData$outboundSchema).optional(), + deleted: z.boolean(), + deletedAt: z.string(), + deletedBy: z.string(), + description: z.string(), + draft: z.boolean(), + name: z.string(), + notificationGroup: NotificationGroup$outboundSchema.optional(), + preferenceSettings: PreferenceChannels$outboundSchema, + steps: z.array(NotificationStep$outboundSchema), + tags: z.array(z.string()), + triggers: z.array(NotificationTrigger$outboundSchema), + workflowIntegrationStatus: z + .lazy(() => WorkflowIntegrationStatus$outboundSchema) + .optional(), + }) + .transform((v) => { + return remap$(v, { + creatorId: "_creatorId", + environmentId: "_environmentId", + id: "_id", + notificationGroupId: "_notificationGroupId", + organizationId: "_organizationId", + parentId: "_parentId", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace WorkflowResponse$ { + /** @deprecated use `WorkflowResponse$inboundSchema` instead. */ + export const inboundSchema = WorkflowResponse$inboundSchema; + /** @deprecated use `WorkflowResponse$outboundSchema` instead. */ + export const outboundSchema = WorkflowResponse$outboundSchema; + /** @deprecated use `WorkflowResponse$Outbound` instead. */ + export type Outbound = WorkflowResponse$Outbound; } diff --git a/src/models/components/workflowsresponsedto.ts b/src/models/components/workflowsresponsedto.ts index 2b8c0f17..a66893e8 100644 --- a/src/models/components/workflowsresponsedto.ts +++ b/src/models/components/workflowsresponsedto.ts @@ -1,39 +1,57 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { WorkflowResponse, WorkflowResponse$ } from "./workflowresponse.js"; import * as z from "zod"; export type WorkflowsResponseDto = { - data: Array; + data: Array; page: number; pageSize: number; totalCount: number; }; /** @internal */ -export namespace WorkflowsResponseDto$ { - export const inboundSchema: z.ZodType = z.object({ - data: z.array(WorkflowResponse$.inboundSchema), - page: z.number(), - pageSize: z.number(), - totalCount: z.number(), - }); +export const WorkflowsResponseDto$inboundSchema: z.ZodType< + WorkflowsResponseDto, + z.ZodTypeDef, + unknown +> = z.object({ + data: z.array(z.string()), + page: z.number(), + pageSize: z.number(), + totalCount: z.number(), +}); + +/** @internal */ +export type WorkflowsResponseDto$Outbound = { + data: Array; + page: number; + pageSize: number; + totalCount: number; +}; - export type Outbound = { - data: Array; - page: number; - pageSize: number; - totalCount: number; - }; +/** @internal */ +export const WorkflowsResponseDto$outboundSchema: z.ZodType< + WorkflowsResponseDto$Outbound, + z.ZodTypeDef, + WorkflowsResponseDto +> = z.object({ + data: z.array(z.string()), + page: z.number(), + pageSize: z.number(), + totalCount: z.number(), +}); - export const outboundSchema: z.ZodType = z.object( - { - data: z.array(WorkflowResponse$.outboundSchema), - page: z.number(), - pageSize: z.number(), - totalCount: z.number(), - } - ); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace WorkflowsResponseDto$ { + /** @deprecated use `WorkflowsResponseDto$inboundSchema` instead. */ + export const inboundSchema = WorkflowsResponseDto$inboundSchema; + /** @deprecated use `WorkflowsResponseDto$outboundSchema` instead. */ + export const outboundSchema = WorkflowsResponseDto$outboundSchema; + /** @deprecated use `WorkflowsResponseDto$Outbound` instead. */ + export type Outbound = WorkflowsResponseDto$Outbound; } diff --git a/src/models/errors/httpclienterrors.ts b/src/models/errors/httpclienterrors.ts new file mode 100644 index 00000000..cdb2995f --- /dev/null +++ b/src/models/errors/httpclienterrors.ts @@ -0,0 +1,62 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +/** + * Base class for all HTTP errors. + */ +export class HTTPClientError extends Error { + /** The underlying cause of the error. */ + override readonly cause: unknown; + override name = "HTTPClientError"; + constructor(message: string, opts?: { cause?: unknown }) { + let msg = message; + if (opts?.cause) { + msg += `: ${opts.cause}`; + } + + super(msg, opts); + // In older runtimes, the cause field would not have been assigned through + // the super() call. + if (typeof this.cause === "undefined") { + this.cause = opts?.cause; + } + } +} + +/** + * An error to capture unrecognised or unexpected errors when making HTTP calls. + */ +export class UnexpectedClientError extends HTTPClientError { + override name = "UnexpectedClientError"; +} + +/** + * An error that is raised when any inputs used to create a request are invalid. + */ +export class InvalidRequestError extends HTTPClientError { + override name = "InvalidRequestError"; +} + +/** + * An error that is raised when a HTTP request was aborted by the client error. + */ +export class RequestAbortedError extends HTTPClientError { + override readonly name = "RequestAbortedError"; +} + +/** + * An error that is raised when a HTTP request timed out due to an AbortSignal + * signal timeout. + */ +export class RequestTimeoutError extends HTTPClientError { + override readonly name = "RequestTimeoutError"; +} + +/** + * An error that is raised when a HTTP client is unable to make a request to + * a server. + */ +export class ConnectionError extends HTTPClientError { + override readonly name = "ConnectionError"; +} diff --git a/src/models/errors/index.ts b/src/models/errors/index.ts index 629f225c..900ee9d5 100644 --- a/src/models/errors/index.ts +++ b/src/models/errors/index.ts @@ -1,6 +1,7 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ +export * from "./httpclienterrors.js"; export * from "./sdkerror.js"; export * from "./sdkvalidationerror.js"; diff --git a/src/models/errors/sdkerror.ts b/src/models/errors/sdkerror.ts index 5a94e842..80e3aa42 100644 --- a/src/models/errors/sdkerror.ts +++ b/src/models/errors/sdkerror.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ export class SDKError extends Error { diff --git a/src/models/errors/sdkvalidationerror.ts b/src/models/errors/sdkvalidationerror.ts index 5eb92182..16929b9e 100644 --- a/src/models/errors/sdkvalidationerror.ts +++ b/src/models/errors/sdkvalidationerror.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -10,15 +10,17 @@ export class SDKValidationError extends Error { */ public readonly rawValue: unknown; + /** + * The raw message that failed validation. + */ + public readonly rawMessage: unknown; + constructor(message: string, cause: unknown, rawValue: unknown) { - super(message); + super(`${message}: ${cause}`); this.name = "SDKValidationError"; this.cause = cause; this.rawValue = rawValue; - } - - public override toString(): string { - return `${this.message}: ${this.cause}`; + this.rawMessage = message; } /** @@ -28,7 +30,7 @@ export class SDKValidationError extends Error { */ public pretty(): string { if (this.cause instanceof z.ZodError) { - return `${this.message}\n${formatZodError(this.cause)}`; + return `${this.rawMessage}\n${formatZodError(this.cause)}`; } else { return this.toString(); } diff --git a/src/models/operations/changescontrollerapplydiff.ts b/src/models/operations/changescontrollerapplydiff.ts index ca3b9f29..e0cddbfc 100644 --- a/src/models/operations/changescontrollerapplydiff.ts +++ b/src/models/operations/changescontrollerapplydiff.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -9,24 +9,37 @@ export type ChangesControllerApplyDiffRequest = { }; /** @internal */ -export namespace ChangesControllerApplyDiffRequest$ { - export const inboundSchema: z.ZodType< - ChangesControllerApplyDiffRequest, - z.ZodTypeDef, - unknown - > = z.object({ - changeId: z.string(), - }); +export const ChangesControllerApplyDiffRequest$inboundSchema: z.ZodType< + ChangesControllerApplyDiffRequest, + z.ZodTypeDef, + unknown +> = z.object({ + changeId: z.string(), +}); + +/** @internal */ +export type ChangesControllerApplyDiffRequest$Outbound = { + changeId: string; +}; - export type Outbound = { - changeId: string; - }; +/** @internal */ +export const ChangesControllerApplyDiffRequest$outboundSchema: z.ZodType< + ChangesControllerApplyDiffRequest$Outbound, + z.ZodTypeDef, + ChangesControllerApplyDiffRequest +> = z.object({ + changeId: z.string(), +}); - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - ChangesControllerApplyDiffRequest - > = z.object({ - changeId: z.string(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ChangesControllerApplyDiffRequest$ { + /** @deprecated use `ChangesControllerApplyDiffRequest$inboundSchema` instead. */ + export const inboundSchema = ChangesControllerApplyDiffRequest$inboundSchema; + /** @deprecated use `ChangesControllerApplyDiffRequest$outboundSchema` instead. */ + export const outboundSchema = ChangesControllerApplyDiffRequest$outboundSchema; + /** @deprecated use `ChangesControllerApplyDiffRequest$Outbound` instead. */ + export type Outbound = ChangesControllerApplyDiffRequest$Outbound; } diff --git a/src/models/operations/changescontrollergetchanges.ts b/src/models/operations/changescontrollergetchanges.ts index ebb33af1..48c7431a 100644 --- a/src/models/operations/changescontrollergetchanges.ts +++ b/src/models/operations/changescontrollergetchanges.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -11,30 +11,43 @@ export type ChangesControllerGetChangesRequest = { }; /** @internal */ -export namespace ChangesControllerGetChangesRequest$ { - export const inboundSchema: z.ZodType< - ChangesControllerGetChangesRequest, - z.ZodTypeDef, - unknown - > = z.object({ - page: z.number().optional(), - limit: z.number().default(10), - promoted: z.string().default("false"), - }); +export const ChangesControllerGetChangesRequest$inboundSchema: z.ZodType< + ChangesControllerGetChangesRequest, + z.ZodTypeDef, + unknown +> = z.object({ + page: z.number().optional(), + limit: z.number().default(10), + promoted: z.string().default("false"), +}); + +/** @internal */ +export type ChangesControllerGetChangesRequest$Outbound = { + page?: number | undefined; + limit: number; + promoted: string; +}; - export type Outbound = { - page?: number | undefined; - limit: number; - promoted: string; - }; +/** @internal */ +export const ChangesControllerGetChangesRequest$outboundSchema: z.ZodType< + ChangesControllerGetChangesRequest$Outbound, + z.ZodTypeDef, + ChangesControllerGetChangesRequest +> = z.object({ + page: z.number().optional(), + limit: z.number().default(10), + promoted: z.string().default("false"), +}); - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - ChangesControllerGetChangesRequest - > = z.object({ - page: z.number().optional(), - limit: z.number().default(10), - promoted: z.string().default("false"), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ChangesControllerGetChangesRequest$ { + /** @deprecated use `ChangesControllerGetChangesRequest$inboundSchema` instead. */ + export const inboundSchema = ChangesControllerGetChangesRequest$inboundSchema; + /** @deprecated use `ChangesControllerGetChangesRequest$outboundSchema` instead. */ + export const outboundSchema = ChangesControllerGetChangesRequest$outboundSchema; + /** @deprecated use `ChangesControllerGetChangesRequest$Outbound` instead. */ + export type Outbound = ChangesControllerGetChangesRequest$Outbound; } diff --git a/src/models/operations/eventscontrollercancel.ts b/src/models/operations/eventscontrollercancel.ts index 4135694f..8fd8537e 100644 --- a/src/models/operations/eventscontrollercancel.ts +++ b/src/models/operations/eventscontrollercancel.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -9,18 +9,37 @@ export type EventsControllerCancelRequest = { }; /** @internal */ -export namespace EventsControllerCancelRequest$ { - export const inboundSchema: z.ZodType = - z.object({ - transactionId: z.string(), - }); +export const EventsControllerCancelRequest$inboundSchema: z.ZodType< + EventsControllerCancelRequest, + z.ZodTypeDef, + unknown +> = z.object({ + transactionId: z.string(), +}); + +/** @internal */ +export type EventsControllerCancelRequest$Outbound = { + transactionId: string; +}; - export type Outbound = { - transactionId: string; - }; +/** @internal */ +export const EventsControllerCancelRequest$outboundSchema: z.ZodType< + EventsControllerCancelRequest$Outbound, + z.ZodTypeDef, + EventsControllerCancelRequest +> = z.object({ + transactionId: z.string(), +}); - export const outboundSchema: z.ZodType = - z.object({ - transactionId: z.string(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace EventsControllerCancelRequest$ { + /** @deprecated use `EventsControllerCancelRequest$inboundSchema` instead. */ + export const inboundSchema = EventsControllerCancelRequest$inboundSchema; + /** @deprecated use `EventsControllerCancelRequest$outboundSchema` instead. */ + export const outboundSchema = EventsControllerCancelRequest$outboundSchema; + /** @deprecated use `EventsControllerCancelRequest$Outbound` instead. */ + export type Outbound = EventsControllerCancelRequest$Outbound; } diff --git a/src/models/operations/executiondetailscontrollergetexecutiondetailsfornotification.ts b/src/models/operations/executiondetailscontrollergetexecutiondetailsfornotification.ts index b11aa33a..3d073865 100644 --- a/src/models/operations/executiondetailscontrollergetexecutiondetailsfornotification.ts +++ b/src/models/operations/executiondetailscontrollergetexecutiondetailsfornotification.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -10,27 +10,43 @@ export type ExecutionDetailsControllerGetExecutionDetailsForNotificationRequest }; /** @internal */ -export namespace ExecutionDetailsControllerGetExecutionDetailsForNotificationRequest$ { - export const inboundSchema: z.ZodType< - ExecutionDetailsControllerGetExecutionDetailsForNotificationRequest, - z.ZodTypeDef, - unknown - > = z.object({ - notificationId: z.string(), - subscriberId: z.string(), - }); +export const ExecutionDetailsControllerGetExecutionDetailsForNotificationRequest$inboundSchema: z.ZodType< + ExecutionDetailsControllerGetExecutionDetailsForNotificationRequest, + z.ZodTypeDef, + unknown +> = z.object({ + notificationId: z.string(), + subscriberId: z.string(), +}); - export type Outbound = { - notificationId: string; - subscriberId: string; - }; +/** @internal */ +export type ExecutionDetailsControllerGetExecutionDetailsForNotificationRequest$Outbound = { + notificationId: string; + subscriberId: string; +}; - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - ExecutionDetailsControllerGetExecutionDetailsForNotificationRequest - > = z.object({ - notificationId: z.string(), - subscriberId: z.string(), - }); +/** @internal */ +export const ExecutionDetailsControllerGetExecutionDetailsForNotificationRequest$outboundSchema: z.ZodType< + ExecutionDetailsControllerGetExecutionDetailsForNotificationRequest$Outbound, + z.ZodTypeDef, + ExecutionDetailsControllerGetExecutionDetailsForNotificationRequest +> = z.object({ + notificationId: z.string(), + subscriberId: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ExecutionDetailsControllerGetExecutionDetailsForNotificationRequest$ { + /** @deprecated use `ExecutionDetailsControllerGetExecutionDetailsForNotificationRequest$inboundSchema` instead. */ + export const inboundSchema = + ExecutionDetailsControllerGetExecutionDetailsForNotificationRequest$inboundSchema; + /** @deprecated use `ExecutionDetailsControllerGetExecutionDetailsForNotificationRequest$outboundSchema` instead. */ + export const outboundSchema = + ExecutionDetailsControllerGetExecutionDetailsForNotificationRequest$outboundSchema; + /** @deprecated use `ExecutionDetailsControllerGetExecutionDetailsForNotificationRequest$Outbound` instead. */ + export type Outbound = + ExecutionDetailsControllerGetExecutionDetailsForNotificationRequest$Outbound; } diff --git a/src/models/operations/feedscontrollerdeletefeedbyid.ts b/src/models/operations/feedscontrollerdeletefeedbyid.ts index 8c3c0a1c..5564cd08 100644 --- a/src/models/operations/feedscontrollerdeletefeedbyid.ts +++ b/src/models/operations/feedscontrollerdeletefeedbyid.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -9,24 +9,37 @@ export type FeedsControllerDeleteFeedByIdRequest = { }; /** @internal */ -export namespace FeedsControllerDeleteFeedByIdRequest$ { - export const inboundSchema: z.ZodType< - FeedsControllerDeleteFeedByIdRequest, - z.ZodTypeDef, - unknown - > = z.object({ - feedId: z.string(), - }); +export const FeedsControllerDeleteFeedByIdRequest$inboundSchema: z.ZodType< + FeedsControllerDeleteFeedByIdRequest, + z.ZodTypeDef, + unknown +> = z.object({ + feedId: z.string(), +}); + +/** @internal */ +export type FeedsControllerDeleteFeedByIdRequest$Outbound = { + feedId: string; +}; - export type Outbound = { - feedId: string; - }; +/** @internal */ +export const FeedsControllerDeleteFeedByIdRequest$outboundSchema: z.ZodType< + FeedsControllerDeleteFeedByIdRequest$Outbound, + z.ZodTypeDef, + FeedsControllerDeleteFeedByIdRequest +> = z.object({ + feedId: z.string(), +}); - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - FeedsControllerDeleteFeedByIdRequest - > = z.object({ - feedId: z.string(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace FeedsControllerDeleteFeedByIdRequest$ { + /** @deprecated use `FeedsControllerDeleteFeedByIdRequest$inboundSchema` instead. */ + export const inboundSchema = FeedsControllerDeleteFeedByIdRequest$inboundSchema; + /** @deprecated use `FeedsControllerDeleteFeedByIdRequest$outboundSchema` instead. */ + export const outboundSchema = FeedsControllerDeleteFeedByIdRequest$outboundSchema; + /** @deprecated use `FeedsControllerDeleteFeedByIdRequest$Outbound` instead. */ + export type Outbound = FeedsControllerDeleteFeedByIdRequest$Outbound; } diff --git a/src/models/operations/index.ts b/src/models/operations/index.ts index 8adf0591..daf49eb4 100644 --- a/src/models/operations/index.ts +++ b/src/models/operations/index.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ export * from "./changescontrollerapplydiff.js"; @@ -25,7 +25,6 @@ export * from "./notificationgroupscontrollerupdatenotificationgroup.js"; export * from "./notificationscontrollergetactivitygraphstats.js"; export * from "./notificationscontrollergetnotification.js"; export * from "./notificationscontrollerlistnotifications.js"; -export * from "./organizationcontrollerremove.js"; export * from "./subscriberscontrollerchataccessoauth.js"; export * from "./subscriberscontrollerchatoauthcallback.js"; export * from "./subscriberscontrollerdeletesubscribercredentials.js"; diff --git a/src/models/operations/integrationscontrollergetwebhooksupportstatus.ts b/src/models/operations/integrationscontrollergetwebhooksupportstatus.ts index 5449ebc2..517416cd 100644 --- a/src/models/operations/integrationscontrollergetwebhooksupportstatus.ts +++ b/src/models/operations/integrationscontrollergetwebhooksupportstatus.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -9,24 +9,38 @@ export type IntegrationsControllerGetWebhookSupportStatusRequest = { }; /** @internal */ -export namespace IntegrationsControllerGetWebhookSupportStatusRequest$ { - export const inboundSchema: z.ZodType< - IntegrationsControllerGetWebhookSupportStatusRequest, - z.ZodTypeDef, - unknown - > = z.object({ - providerOrIntegrationId: z.string(), - }); +export const IntegrationsControllerGetWebhookSupportStatusRequest$inboundSchema: z.ZodType< + IntegrationsControllerGetWebhookSupportStatusRequest, + z.ZodTypeDef, + unknown +> = z.object({ + providerOrIntegrationId: z.string(), +}); + +/** @internal */ +export type IntegrationsControllerGetWebhookSupportStatusRequest$Outbound = { + providerOrIntegrationId: string; +}; - export type Outbound = { - providerOrIntegrationId: string; - }; +/** @internal */ +export const IntegrationsControllerGetWebhookSupportStatusRequest$outboundSchema: z.ZodType< + IntegrationsControllerGetWebhookSupportStatusRequest$Outbound, + z.ZodTypeDef, + IntegrationsControllerGetWebhookSupportStatusRequest +> = z.object({ + providerOrIntegrationId: z.string(), +}); - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - IntegrationsControllerGetWebhookSupportStatusRequest - > = z.object({ - providerOrIntegrationId: z.string(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace IntegrationsControllerGetWebhookSupportStatusRequest$ { + /** @deprecated use `IntegrationsControllerGetWebhookSupportStatusRequest$inboundSchema` instead. */ + export const inboundSchema = IntegrationsControllerGetWebhookSupportStatusRequest$inboundSchema; + /** @deprecated use `IntegrationsControllerGetWebhookSupportStatusRequest$outboundSchema` instead. */ + export const outboundSchema = + IntegrationsControllerGetWebhookSupportStatusRequest$outboundSchema; + /** @deprecated use `IntegrationsControllerGetWebhookSupportStatusRequest$Outbound` instead. */ + export type Outbound = IntegrationsControllerGetWebhookSupportStatusRequest$Outbound; } diff --git a/src/models/operations/integrationscontrollerremoveintegration.ts b/src/models/operations/integrationscontrollerremoveintegration.ts index 09e025c6..6b6ef392 100644 --- a/src/models/operations/integrationscontrollerremoveintegration.ts +++ b/src/models/operations/integrationscontrollerremoveintegration.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -9,24 +9,37 @@ export type IntegrationsControllerRemoveIntegrationRequest = { }; /** @internal */ -export namespace IntegrationsControllerRemoveIntegrationRequest$ { - export const inboundSchema: z.ZodType< - IntegrationsControllerRemoveIntegrationRequest, - z.ZodTypeDef, - unknown - > = z.object({ - integrationId: z.string(), - }); +export const IntegrationsControllerRemoveIntegrationRequest$inboundSchema: z.ZodType< + IntegrationsControllerRemoveIntegrationRequest, + z.ZodTypeDef, + unknown +> = z.object({ + integrationId: z.string(), +}); + +/** @internal */ +export type IntegrationsControllerRemoveIntegrationRequest$Outbound = { + integrationId: string; +}; - export type Outbound = { - integrationId: string; - }; +/** @internal */ +export const IntegrationsControllerRemoveIntegrationRequest$outboundSchema: z.ZodType< + IntegrationsControllerRemoveIntegrationRequest$Outbound, + z.ZodTypeDef, + IntegrationsControllerRemoveIntegrationRequest +> = z.object({ + integrationId: z.string(), +}); - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - IntegrationsControllerRemoveIntegrationRequest - > = z.object({ - integrationId: z.string(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace IntegrationsControllerRemoveIntegrationRequest$ { + /** @deprecated use `IntegrationsControllerRemoveIntegrationRequest$inboundSchema` instead. */ + export const inboundSchema = IntegrationsControllerRemoveIntegrationRequest$inboundSchema; + /** @deprecated use `IntegrationsControllerRemoveIntegrationRequest$outboundSchema` instead. */ + export const outboundSchema = IntegrationsControllerRemoveIntegrationRequest$outboundSchema; + /** @deprecated use `IntegrationsControllerRemoveIntegrationRequest$Outbound` instead. */ + export type Outbound = IntegrationsControllerRemoveIntegrationRequest$Outbound; } diff --git a/src/models/operations/integrationscontrollersetintegrationasprimary.ts b/src/models/operations/integrationscontrollersetintegrationasprimary.ts index 74026924..7a79d691 100644 --- a/src/models/operations/integrationscontrollersetintegrationasprimary.ts +++ b/src/models/operations/integrationscontrollersetintegrationasprimary.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -9,24 +9,38 @@ export type IntegrationsControllerSetIntegrationAsPrimaryRequest = { }; /** @internal */ -export namespace IntegrationsControllerSetIntegrationAsPrimaryRequest$ { - export const inboundSchema: z.ZodType< - IntegrationsControllerSetIntegrationAsPrimaryRequest, - z.ZodTypeDef, - unknown - > = z.object({ - integrationId: z.string(), - }); +export const IntegrationsControllerSetIntegrationAsPrimaryRequest$inboundSchema: z.ZodType< + IntegrationsControllerSetIntegrationAsPrimaryRequest, + z.ZodTypeDef, + unknown +> = z.object({ + integrationId: z.string(), +}); + +/** @internal */ +export type IntegrationsControllerSetIntegrationAsPrimaryRequest$Outbound = { + integrationId: string; +}; - export type Outbound = { - integrationId: string; - }; +/** @internal */ +export const IntegrationsControllerSetIntegrationAsPrimaryRequest$outboundSchema: z.ZodType< + IntegrationsControllerSetIntegrationAsPrimaryRequest$Outbound, + z.ZodTypeDef, + IntegrationsControllerSetIntegrationAsPrimaryRequest +> = z.object({ + integrationId: z.string(), +}); - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - IntegrationsControllerSetIntegrationAsPrimaryRequest - > = z.object({ - integrationId: z.string(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace IntegrationsControllerSetIntegrationAsPrimaryRequest$ { + /** @deprecated use `IntegrationsControllerSetIntegrationAsPrimaryRequest$inboundSchema` instead. */ + export const inboundSchema = IntegrationsControllerSetIntegrationAsPrimaryRequest$inboundSchema; + /** @deprecated use `IntegrationsControllerSetIntegrationAsPrimaryRequest$outboundSchema` instead. */ + export const outboundSchema = + IntegrationsControllerSetIntegrationAsPrimaryRequest$outboundSchema; + /** @deprecated use `IntegrationsControllerSetIntegrationAsPrimaryRequest$Outbound` instead. */ + export type Outbound = IntegrationsControllerSetIntegrationAsPrimaryRequest$Outbound; } diff --git a/src/models/operations/integrationscontrollerupdateintegrationbyid.ts b/src/models/operations/integrationscontrollerupdateintegrationbyid.ts index cf154415..b143eea2 100644 --- a/src/models/operations/integrationscontrollerupdateintegrationbyid.ts +++ b/src/models/operations/integrationscontrollerupdateintegrationbyid.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; @@ -12,39 +12,52 @@ export type IntegrationsControllerUpdateIntegrationByIdRequest = { }; /** @internal */ -export namespace IntegrationsControllerUpdateIntegrationByIdRequest$ { - export const inboundSchema: z.ZodType< - IntegrationsControllerUpdateIntegrationByIdRequest, - z.ZodTypeDef, - unknown - > = z - .object({ - integrationId: z.string(), - UpdateIntegrationRequestDto: components.UpdateIntegrationRequestDto$.inboundSchema, - }) - .transform((v) => { - return remap$(v, { - UpdateIntegrationRequestDto: "updateIntegrationRequestDto", - }); +export const IntegrationsControllerUpdateIntegrationByIdRequest$inboundSchema: z.ZodType< + IntegrationsControllerUpdateIntegrationByIdRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + integrationId: z.string(), + UpdateIntegrationRequestDto: components.UpdateIntegrationRequestDto$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + UpdateIntegrationRequestDto: "updateIntegrationRequestDto", }); + }); - export type Outbound = { - integrationId: string; - UpdateIntegrationRequestDto: components.UpdateIntegrationRequestDto$.Outbound; - }; +/** @internal */ +export type IntegrationsControllerUpdateIntegrationByIdRequest$Outbound = { + integrationId: string; + UpdateIntegrationRequestDto: components.UpdateIntegrationRequestDto$Outbound; +}; - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - IntegrationsControllerUpdateIntegrationByIdRequest - > = z - .object({ - integrationId: z.string(), - updateIntegrationRequestDto: components.UpdateIntegrationRequestDto$.outboundSchema, - }) - .transform((v) => { - return remap$(v, { - updateIntegrationRequestDto: "UpdateIntegrationRequestDto", - }); +/** @internal */ +export const IntegrationsControllerUpdateIntegrationByIdRequest$outboundSchema: z.ZodType< + IntegrationsControllerUpdateIntegrationByIdRequest$Outbound, + z.ZodTypeDef, + IntegrationsControllerUpdateIntegrationByIdRequest +> = z + .object({ + integrationId: z.string(), + updateIntegrationRequestDto: components.UpdateIntegrationRequestDto$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + updateIntegrationRequestDto: "UpdateIntegrationRequestDto", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace IntegrationsControllerUpdateIntegrationByIdRequest$ { + /** @deprecated use `IntegrationsControllerUpdateIntegrationByIdRequest$inboundSchema` instead. */ + export const inboundSchema = IntegrationsControllerUpdateIntegrationByIdRequest$inboundSchema; + /** @deprecated use `IntegrationsControllerUpdateIntegrationByIdRequest$outboundSchema` instead. */ + export const outboundSchema = IntegrationsControllerUpdateIntegrationByIdRequest$outboundSchema; + /** @deprecated use `IntegrationsControllerUpdateIntegrationByIdRequest$Outbound` instead. */ + export type Outbound = IntegrationsControllerUpdateIntegrationByIdRequest$Outbound; } diff --git a/src/models/operations/layoutscontrollerdeletelayout.ts b/src/models/operations/layoutscontrollerdeletelayout.ts index 2f07b508..88cf6c3a 100644 --- a/src/models/operations/layoutscontrollerdeletelayout.ts +++ b/src/models/operations/layoutscontrollerdeletelayout.ts @@ -1,32 +1,48 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; export type LayoutsControllerDeleteLayoutRequest = { + /** + * The layout id + */ layoutId: string; }; /** @internal */ -export namespace LayoutsControllerDeleteLayoutRequest$ { - export const inboundSchema: z.ZodType< - LayoutsControllerDeleteLayoutRequest, - z.ZodTypeDef, - unknown - > = z.object({ - layoutId: z.string(), - }); +export const LayoutsControllerDeleteLayoutRequest$inboundSchema: z.ZodType< + LayoutsControllerDeleteLayoutRequest, + z.ZodTypeDef, + unknown +> = z.object({ + layoutId: z.string(), +}); + +/** @internal */ +export type LayoutsControllerDeleteLayoutRequest$Outbound = { + layoutId: string; +}; - export type Outbound = { - layoutId: string; - }; +/** @internal */ +export const LayoutsControllerDeleteLayoutRequest$outboundSchema: z.ZodType< + LayoutsControllerDeleteLayoutRequest$Outbound, + z.ZodTypeDef, + LayoutsControllerDeleteLayoutRequest +> = z.object({ + layoutId: z.string(), +}); - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - LayoutsControllerDeleteLayoutRequest - > = z.object({ - layoutId: z.string(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace LayoutsControllerDeleteLayoutRequest$ { + /** @deprecated use `LayoutsControllerDeleteLayoutRequest$inboundSchema` instead. */ + export const inboundSchema = LayoutsControllerDeleteLayoutRequest$inboundSchema; + /** @deprecated use `LayoutsControllerDeleteLayoutRequest$outboundSchema` instead. */ + export const outboundSchema = LayoutsControllerDeleteLayoutRequest$outboundSchema; + /** @deprecated use `LayoutsControllerDeleteLayoutRequest$Outbound` instead. */ + export type Outbound = LayoutsControllerDeleteLayoutRequest$Outbound; } diff --git a/src/models/operations/layoutscontrollergetlayout.ts b/src/models/operations/layoutscontrollergetlayout.ts index 1566336d..e26f7427 100644 --- a/src/models/operations/layoutscontrollergetlayout.ts +++ b/src/models/operations/layoutscontrollergetlayout.ts @@ -1,32 +1,48 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; export type LayoutsControllerGetLayoutRequest = { + /** + * The layout id + */ layoutId: string; }; /** @internal */ -export namespace LayoutsControllerGetLayoutRequest$ { - export const inboundSchema: z.ZodType< - LayoutsControllerGetLayoutRequest, - z.ZodTypeDef, - unknown - > = z.object({ - layoutId: z.string(), - }); +export const LayoutsControllerGetLayoutRequest$inboundSchema: z.ZodType< + LayoutsControllerGetLayoutRequest, + z.ZodTypeDef, + unknown +> = z.object({ + layoutId: z.string(), +}); + +/** @internal */ +export type LayoutsControllerGetLayoutRequest$Outbound = { + layoutId: string; +}; - export type Outbound = { - layoutId: string; - }; +/** @internal */ +export const LayoutsControllerGetLayoutRequest$outboundSchema: z.ZodType< + LayoutsControllerGetLayoutRequest$Outbound, + z.ZodTypeDef, + LayoutsControllerGetLayoutRequest +> = z.object({ + layoutId: z.string(), +}); - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - LayoutsControllerGetLayoutRequest - > = z.object({ - layoutId: z.string(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace LayoutsControllerGetLayoutRequest$ { + /** @deprecated use `LayoutsControllerGetLayoutRequest$inboundSchema` instead. */ + export const inboundSchema = LayoutsControllerGetLayoutRequest$inboundSchema; + /** @deprecated use `LayoutsControllerGetLayoutRequest$outboundSchema` instead. */ + export const outboundSchema = LayoutsControllerGetLayoutRequest$outboundSchema; + /** @deprecated use `LayoutsControllerGetLayoutRequest$Outbound` instead. */ + export type Outbound = LayoutsControllerGetLayoutRequest$Outbound; } diff --git a/src/models/operations/layoutscontrollerlistlayouts.ts b/src/models/operations/layoutscontrollerlistlayouts.ts index 484da442..a948cc19 100644 --- a/src/models/operations/layoutscontrollerlistlayouts.ts +++ b/src/models/operations/layoutscontrollerlistlayouts.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { ClosedEnum } from "../../types/enums.js"; @@ -37,39 +37,63 @@ export type LayoutsControllerListLayoutsRequest = { }; /** @internal */ +export const OrderBy$inboundSchema: z.ZodNativeEnum = z.nativeEnum(OrderBy); + +/** @internal */ +export const OrderBy$outboundSchema: z.ZodNativeEnum = OrderBy$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace OrderBy$ { - export const inboundSchema: z.ZodNativeEnum = z.nativeEnum(OrderBy); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; + /** @deprecated use `OrderBy$inboundSchema` instead. */ + export const inboundSchema = OrderBy$inboundSchema; + /** @deprecated use `OrderBy$outboundSchema` instead. */ + export const outboundSchema = OrderBy$outboundSchema; } /** @internal */ -export namespace LayoutsControllerListLayoutsRequest$ { - export const inboundSchema: z.ZodType< - LayoutsControllerListLayoutsRequest, - z.ZodTypeDef, - unknown - > = z.object({ - page: z.number().optional(), - pageSize: z.number().optional(), - sortBy: z.string().optional(), - orderBy: OrderBy$.inboundSchema.optional(), - }); +export const LayoutsControllerListLayoutsRequest$inboundSchema: z.ZodType< + LayoutsControllerListLayoutsRequest, + z.ZodTypeDef, + unknown +> = z.object({ + page: z.number().optional(), + pageSize: z.number().optional(), + sortBy: z.string().optional(), + orderBy: OrderBy$inboundSchema.optional(), +}); + +/** @internal */ +export type LayoutsControllerListLayoutsRequest$Outbound = { + page?: number | undefined; + pageSize?: number | undefined; + sortBy?: string | undefined; + orderBy?: string | undefined; +}; - export type Outbound = { - page?: number | undefined; - pageSize?: number | undefined; - sortBy?: string | undefined; - orderBy?: string | undefined; - }; +/** @internal */ +export const LayoutsControllerListLayoutsRequest$outboundSchema: z.ZodType< + LayoutsControllerListLayoutsRequest$Outbound, + z.ZodTypeDef, + LayoutsControllerListLayoutsRequest +> = z.object({ + page: z.number().optional(), + pageSize: z.number().optional(), + sortBy: z.string().optional(), + orderBy: OrderBy$outboundSchema.optional(), +}); - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - LayoutsControllerListLayoutsRequest - > = z.object({ - page: z.number().optional(), - pageSize: z.number().optional(), - sortBy: z.string().optional(), - orderBy: OrderBy$.outboundSchema.optional(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace LayoutsControllerListLayoutsRequest$ { + /** @deprecated use `LayoutsControllerListLayoutsRequest$inboundSchema` instead. */ + export const inboundSchema = LayoutsControllerListLayoutsRequest$inboundSchema; + /** @deprecated use `LayoutsControllerListLayoutsRequest$outboundSchema` instead. */ + export const outboundSchema = LayoutsControllerListLayoutsRequest$outboundSchema; + /** @deprecated use `LayoutsControllerListLayoutsRequest$Outbound` instead. */ + export type Outbound = LayoutsControllerListLayoutsRequest$Outbound; } diff --git a/src/models/operations/layoutscontrollersetdefaultlayout.ts b/src/models/operations/layoutscontrollersetdefaultlayout.ts index 3eaf2742..622b5730 100644 --- a/src/models/operations/layoutscontrollersetdefaultlayout.ts +++ b/src/models/operations/layoutscontrollersetdefaultlayout.ts @@ -1,32 +1,48 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; export type LayoutsControllerSetDefaultLayoutRequest = { + /** + * The layout id + */ layoutId: string; }; /** @internal */ -export namespace LayoutsControllerSetDefaultLayoutRequest$ { - export const inboundSchema: z.ZodType< - LayoutsControllerSetDefaultLayoutRequest, - z.ZodTypeDef, - unknown - > = z.object({ - layoutId: z.string(), - }); +export const LayoutsControllerSetDefaultLayoutRequest$inboundSchema: z.ZodType< + LayoutsControllerSetDefaultLayoutRequest, + z.ZodTypeDef, + unknown +> = z.object({ + layoutId: z.string(), +}); + +/** @internal */ +export type LayoutsControllerSetDefaultLayoutRequest$Outbound = { + layoutId: string; +}; - export type Outbound = { - layoutId: string; - }; +/** @internal */ +export const LayoutsControllerSetDefaultLayoutRequest$outboundSchema: z.ZodType< + LayoutsControllerSetDefaultLayoutRequest$Outbound, + z.ZodTypeDef, + LayoutsControllerSetDefaultLayoutRequest +> = z.object({ + layoutId: z.string(), +}); - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - LayoutsControllerSetDefaultLayoutRequest - > = z.object({ - layoutId: z.string(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace LayoutsControllerSetDefaultLayoutRequest$ { + /** @deprecated use `LayoutsControllerSetDefaultLayoutRequest$inboundSchema` instead. */ + export const inboundSchema = LayoutsControllerSetDefaultLayoutRequest$inboundSchema; + /** @deprecated use `LayoutsControllerSetDefaultLayoutRequest$outboundSchema` instead. */ + export const outboundSchema = LayoutsControllerSetDefaultLayoutRequest$outboundSchema; + /** @deprecated use `LayoutsControllerSetDefaultLayoutRequest$Outbound` instead. */ + export type Outbound = LayoutsControllerSetDefaultLayoutRequest$Outbound; } diff --git a/src/models/operations/layoutscontrollerupdatelayout.ts b/src/models/operations/layoutscontrollerupdatelayout.ts index 2810d35d..683f1fa9 100644 --- a/src/models/operations/layoutscontrollerupdatelayout.ts +++ b/src/models/operations/layoutscontrollerupdatelayout.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; @@ -7,44 +7,60 @@ import * as components from "../components/index.js"; import * as z from "zod"; export type LayoutsControllerUpdateLayoutRequest = { + /** + * The layout id + */ layoutId: string; updateLayoutRequestDto: components.UpdateLayoutRequestDto; }; /** @internal */ -export namespace LayoutsControllerUpdateLayoutRequest$ { - export const inboundSchema: z.ZodType< - LayoutsControllerUpdateLayoutRequest, - z.ZodTypeDef, - unknown - > = z - .object({ - layoutId: z.string(), - UpdateLayoutRequestDto: components.UpdateLayoutRequestDto$.inboundSchema, - }) - .transform((v) => { - return remap$(v, { - UpdateLayoutRequestDto: "updateLayoutRequestDto", - }); +export const LayoutsControllerUpdateLayoutRequest$inboundSchema: z.ZodType< + LayoutsControllerUpdateLayoutRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + layoutId: z.string(), + UpdateLayoutRequestDto: components.UpdateLayoutRequestDto$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + UpdateLayoutRequestDto: "updateLayoutRequestDto", }); + }); - export type Outbound = { - layoutId: string; - UpdateLayoutRequestDto: components.UpdateLayoutRequestDto$.Outbound; - }; +/** @internal */ +export type LayoutsControllerUpdateLayoutRequest$Outbound = { + layoutId: string; + UpdateLayoutRequestDto: components.UpdateLayoutRequestDto$Outbound; +}; - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - LayoutsControllerUpdateLayoutRequest - > = z - .object({ - layoutId: z.string(), - updateLayoutRequestDto: components.UpdateLayoutRequestDto$.outboundSchema, - }) - .transform((v) => { - return remap$(v, { - updateLayoutRequestDto: "UpdateLayoutRequestDto", - }); +/** @internal */ +export const LayoutsControllerUpdateLayoutRequest$outboundSchema: z.ZodType< + LayoutsControllerUpdateLayoutRequest$Outbound, + z.ZodTypeDef, + LayoutsControllerUpdateLayoutRequest +> = z + .object({ + layoutId: z.string(), + updateLayoutRequestDto: components.UpdateLayoutRequestDto$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + updateLayoutRequestDto: "UpdateLayoutRequestDto", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace LayoutsControllerUpdateLayoutRequest$ { + /** @deprecated use `LayoutsControllerUpdateLayoutRequest$inboundSchema` instead. */ + export const inboundSchema = LayoutsControllerUpdateLayoutRequest$inboundSchema; + /** @deprecated use `LayoutsControllerUpdateLayoutRequest$outboundSchema` instead. */ + export const outboundSchema = LayoutsControllerUpdateLayoutRequest$outboundSchema; + /** @deprecated use `LayoutsControllerUpdateLayoutRequest$Outbound` instead. */ + export type Outbound = LayoutsControllerUpdateLayoutRequest$Outbound; } diff --git a/src/models/operations/messagescontrollerdeletemessage.ts b/src/models/operations/messagescontrollerdeletemessage.ts index 0c49bbc5..71da9ee9 100644 --- a/src/models/operations/messagescontrollerdeletemessage.ts +++ b/src/models/operations/messagescontrollerdeletemessage.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -9,24 +9,37 @@ export type MessagesControllerDeleteMessageRequest = { }; /** @internal */ -export namespace MessagesControllerDeleteMessageRequest$ { - export const inboundSchema: z.ZodType< - MessagesControllerDeleteMessageRequest, - z.ZodTypeDef, - unknown - > = z.object({ - messageId: z.string(), - }); +export const MessagesControllerDeleteMessageRequest$inboundSchema: z.ZodType< + MessagesControllerDeleteMessageRequest, + z.ZodTypeDef, + unknown +> = z.object({ + messageId: z.string(), +}); + +/** @internal */ +export type MessagesControllerDeleteMessageRequest$Outbound = { + messageId: string; +}; - export type Outbound = { - messageId: string; - }; +/** @internal */ +export const MessagesControllerDeleteMessageRequest$outboundSchema: z.ZodType< + MessagesControllerDeleteMessageRequest$Outbound, + z.ZodTypeDef, + MessagesControllerDeleteMessageRequest +> = z.object({ + messageId: z.string(), +}); - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - MessagesControllerDeleteMessageRequest - > = z.object({ - messageId: z.string(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace MessagesControllerDeleteMessageRequest$ { + /** @deprecated use `MessagesControllerDeleteMessageRequest$inboundSchema` instead. */ + export const inboundSchema = MessagesControllerDeleteMessageRequest$inboundSchema; + /** @deprecated use `MessagesControllerDeleteMessageRequest$outboundSchema` instead. */ + export const outboundSchema = MessagesControllerDeleteMessageRequest$outboundSchema; + /** @deprecated use `MessagesControllerDeleteMessageRequest$Outbound` instead. */ + export type Outbound = MessagesControllerDeleteMessageRequest$Outbound; } diff --git a/src/models/operations/messagescontrollerdeletemessagesbytransactionid.ts b/src/models/operations/messagescontrollerdeletemessagesbytransactionid.ts index 2a4c351b..e6b22315 100644 --- a/src/models/operations/messagescontrollerdeletemessagesbytransactionid.ts +++ b/src/models/operations/messagescontrollerdeletemessagesbytransactionid.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { ClosedEnum } from "../../types/enums.js"; @@ -29,33 +29,59 @@ export type MessagesControllerDeleteMessagesByTransactionIdRequest = { }; /** @internal */ +export const Channel$inboundSchema: z.ZodNativeEnum = z.nativeEnum(Channel); + +/** @internal */ +export const Channel$outboundSchema: z.ZodNativeEnum = Channel$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace Channel$ { - export const inboundSchema: z.ZodNativeEnum = z.nativeEnum(Channel); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; + /** @deprecated use `Channel$inboundSchema` instead. */ + export const inboundSchema = Channel$inboundSchema; + /** @deprecated use `Channel$outboundSchema` instead. */ + export const outboundSchema = Channel$outboundSchema; } /** @internal */ +export const MessagesControllerDeleteMessagesByTransactionIdRequest$inboundSchema: z.ZodType< + MessagesControllerDeleteMessagesByTransactionIdRequest, + z.ZodTypeDef, + unknown +> = z.object({ + channel: Channel$inboundSchema.optional(), + transactionId: z.string(), +}); + +/** @internal */ +export type MessagesControllerDeleteMessagesByTransactionIdRequest$Outbound = { + channel?: string | undefined; + transactionId: string; +}; + +/** @internal */ +export const MessagesControllerDeleteMessagesByTransactionIdRequest$outboundSchema: z.ZodType< + MessagesControllerDeleteMessagesByTransactionIdRequest$Outbound, + z.ZodTypeDef, + MessagesControllerDeleteMessagesByTransactionIdRequest +> = z.object({ + channel: Channel$outboundSchema.optional(), + transactionId: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace MessagesControllerDeleteMessagesByTransactionIdRequest$ { - export const inboundSchema: z.ZodType< - MessagesControllerDeleteMessagesByTransactionIdRequest, - z.ZodTypeDef, - unknown - > = z.object({ - channel: Channel$.inboundSchema.optional(), - transactionId: z.string(), - }); - - export type Outbound = { - channel?: string | undefined; - transactionId: string; - }; - - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - MessagesControllerDeleteMessagesByTransactionIdRequest - > = z.object({ - channel: Channel$.outboundSchema.optional(), - transactionId: z.string(), - }); + /** @deprecated use `MessagesControllerDeleteMessagesByTransactionIdRequest$inboundSchema` instead. */ + export const inboundSchema = + MessagesControllerDeleteMessagesByTransactionIdRequest$inboundSchema; + /** @deprecated use `MessagesControllerDeleteMessagesByTransactionIdRequest$outboundSchema` instead. */ + export const outboundSchema = + MessagesControllerDeleteMessagesByTransactionIdRequest$outboundSchema; + /** @deprecated use `MessagesControllerDeleteMessagesByTransactionIdRequest$Outbound` instead. */ + export type Outbound = MessagesControllerDeleteMessagesByTransactionIdRequest$Outbound; } diff --git a/src/models/operations/messagescontrollergetmessages.ts b/src/models/operations/messagescontrollergetmessages.ts index 7f0fbae7..705d4622 100644 --- a/src/models/operations/messagescontrollergetmessages.ts +++ b/src/models/operations/messagescontrollergetmessages.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { ClosedEnum } from "../../types/enums.js"; @@ -23,43 +23,68 @@ export type MessagesControllerGetMessagesRequest = { }; /** @internal */ +export const QueryParamChannel$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(QueryParamChannel); + +/** @internal */ +export const QueryParamChannel$outboundSchema: z.ZodNativeEnum = + QueryParamChannel$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace QueryParamChannel$ { - export const inboundSchema: z.ZodNativeEnum = - z.nativeEnum(QueryParamChannel); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; + /** @deprecated use `QueryParamChannel$inboundSchema` instead. */ + export const inboundSchema = QueryParamChannel$inboundSchema; + /** @deprecated use `QueryParamChannel$outboundSchema` instead. */ + export const outboundSchema = QueryParamChannel$outboundSchema; } /** @internal */ -export namespace MessagesControllerGetMessagesRequest$ { - export const inboundSchema: z.ZodType< - MessagesControllerGetMessagesRequest, - z.ZodTypeDef, - unknown - > = z.object({ - channel: QueryParamChannel$.inboundSchema.optional(), - subscriberId: z.string().optional(), - transactionId: z.array(z.string()).optional(), - page: z.number().default(0), - limit: z.number().default(10), - }); +export const MessagesControllerGetMessagesRequest$inboundSchema: z.ZodType< + MessagesControllerGetMessagesRequest, + z.ZodTypeDef, + unknown +> = z.object({ + channel: QueryParamChannel$inboundSchema.optional(), + subscriberId: z.string().optional(), + transactionId: z.array(z.string()).optional(), + page: z.number().default(0), + limit: z.number().default(10), +}); - export type Outbound = { - channel?: string | undefined; - subscriberId?: string | undefined; - transactionId?: Array | undefined; - page: number; - limit: number; - }; +/** @internal */ +export type MessagesControllerGetMessagesRequest$Outbound = { + channel?: string | undefined; + subscriberId?: string | undefined; + transactionId?: Array | undefined; + page: number; + limit: number; +}; + +/** @internal */ +export const MessagesControllerGetMessagesRequest$outboundSchema: z.ZodType< + MessagesControllerGetMessagesRequest$Outbound, + z.ZodTypeDef, + MessagesControllerGetMessagesRequest +> = z.object({ + channel: QueryParamChannel$outboundSchema.optional(), + subscriberId: z.string().optional(), + transactionId: z.array(z.string()).optional(), + page: z.number().default(0), + limit: z.number().default(10), +}); - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - MessagesControllerGetMessagesRequest - > = z.object({ - channel: QueryParamChannel$.outboundSchema.optional(), - subscriberId: z.string().optional(), - transactionId: z.array(z.string()).optional(), - page: z.number().default(0), - limit: z.number().default(10), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace MessagesControllerGetMessagesRequest$ { + /** @deprecated use `MessagesControllerGetMessagesRequest$inboundSchema` instead. */ + export const inboundSchema = MessagesControllerGetMessagesRequest$inboundSchema; + /** @deprecated use `MessagesControllerGetMessagesRequest$outboundSchema` instead. */ + export const outboundSchema = MessagesControllerGetMessagesRequest$outboundSchema; + /** @deprecated use `MessagesControllerGetMessagesRequest$Outbound` instead. */ + export type Outbound = MessagesControllerGetMessagesRequest$Outbound; } diff --git a/src/models/operations/notificationgroupscontrollerdeletenotificationgroup.ts b/src/models/operations/notificationgroupscontrollerdeletenotificationgroup.ts index ebc95d8b..3f04f8dd 100644 --- a/src/models/operations/notificationgroupscontrollerdeletenotificationgroup.ts +++ b/src/models/operations/notificationgroupscontrollerdeletenotificationgroup.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -9,24 +9,39 @@ export type NotificationGroupsControllerDeleteNotificationGroupRequest = { }; /** @internal */ -export namespace NotificationGroupsControllerDeleteNotificationGroupRequest$ { - export const inboundSchema: z.ZodType< - NotificationGroupsControllerDeleteNotificationGroupRequest, - z.ZodTypeDef, - unknown - > = z.object({ - id: z.string(), - }); +export const NotificationGroupsControllerDeleteNotificationGroupRequest$inboundSchema: z.ZodType< + NotificationGroupsControllerDeleteNotificationGroupRequest, + z.ZodTypeDef, + unknown +> = z.object({ + id: z.string(), +}); + +/** @internal */ +export type NotificationGroupsControllerDeleteNotificationGroupRequest$Outbound = { + id: string; +}; - export type Outbound = { - id: string; - }; +/** @internal */ +export const NotificationGroupsControllerDeleteNotificationGroupRequest$outboundSchema: z.ZodType< + NotificationGroupsControllerDeleteNotificationGroupRequest$Outbound, + z.ZodTypeDef, + NotificationGroupsControllerDeleteNotificationGroupRequest +> = z.object({ + id: z.string(), +}); - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - NotificationGroupsControllerDeleteNotificationGroupRequest - > = z.object({ - id: z.string(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace NotificationGroupsControllerDeleteNotificationGroupRequest$ { + /** @deprecated use `NotificationGroupsControllerDeleteNotificationGroupRequest$inboundSchema` instead. */ + export const inboundSchema = + NotificationGroupsControllerDeleteNotificationGroupRequest$inboundSchema; + /** @deprecated use `NotificationGroupsControllerDeleteNotificationGroupRequest$outboundSchema` instead. */ + export const outboundSchema = + NotificationGroupsControllerDeleteNotificationGroupRequest$outboundSchema; + /** @deprecated use `NotificationGroupsControllerDeleteNotificationGroupRequest$Outbound` instead. */ + export type Outbound = NotificationGroupsControllerDeleteNotificationGroupRequest$Outbound; } diff --git a/src/models/operations/notificationgroupscontrollergetnotificationgroup.ts b/src/models/operations/notificationgroupscontrollergetnotificationgroup.ts index f8b6b6cd..8a4f3e2a 100644 --- a/src/models/operations/notificationgroupscontrollergetnotificationgroup.ts +++ b/src/models/operations/notificationgroupscontrollergetnotificationgroup.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -9,24 +9,39 @@ export type NotificationGroupsControllerGetNotificationGroupRequest = { }; /** @internal */ -export namespace NotificationGroupsControllerGetNotificationGroupRequest$ { - export const inboundSchema: z.ZodType< - NotificationGroupsControllerGetNotificationGroupRequest, - z.ZodTypeDef, - unknown - > = z.object({ - id: z.string(), - }); +export const NotificationGroupsControllerGetNotificationGroupRequest$inboundSchema: z.ZodType< + NotificationGroupsControllerGetNotificationGroupRequest, + z.ZodTypeDef, + unknown +> = z.object({ + id: z.string(), +}); + +/** @internal */ +export type NotificationGroupsControllerGetNotificationGroupRequest$Outbound = { + id: string; +}; - export type Outbound = { - id: string; - }; +/** @internal */ +export const NotificationGroupsControllerGetNotificationGroupRequest$outboundSchema: z.ZodType< + NotificationGroupsControllerGetNotificationGroupRequest$Outbound, + z.ZodTypeDef, + NotificationGroupsControllerGetNotificationGroupRequest +> = z.object({ + id: z.string(), +}); - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - NotificationGroupsControllerGetNotificationGroupRequest - > = z.object({ - id: z.string(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace NotificationGroupsControllerGetNotificationGroupRequest$ { + /** @deprecated use `NotificationGroupsControllerGetNotificationGroupRequest$inboundSchema` instead. */ + export const inboundSchema = + NotificationGroupsControllerGetNotificationGroupRequest$inboundSchema; + /** @deprecated use `NotificationGroupsControllerGetNotificationGroupRequest$outboundSchema` instead. */ + export const outboundSchema = + NotificationGroupsControllerGetNotificationGroupRequest$outboundSchema; + /** @deprecated use `NotificationGroupsControllerGetNotificationGroupRequest$Outbound` instead. */ + export type Outbound = NotificationGroupsControllerGetNotificationGroupRequest$Outbound; } diff --git a/src/models/operations/notificationgroupscontrollerupdatenotificationgroup.ts b/src/models/operations/notificationgroupscontrollerupdatenotificationgroup.ts index 3b8f3f61..72fea630 100644 --- a/src/models/operations/notificationgroupscontrollerupdatenotificationgroup.ts +++ b/src/models/operations/notificationgroupscontrollerupdatenotificationgroup.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; @@ -12,41 +12,56 @@ export type NotificationGroupsControllerUpdateNotificationGroupRequest = { }; /** @internal */ -export namespace NotificationGroupsControllerUpdateNotificationGroupRequest$ { - export const inboundSchema: z.ZodType< - NotificationGroupsControllerUpdateNotificationGroupRequest, - z.ZodTypeDef, - unknown - > = z - .object({ - id: z.string(), - CreateNotificationGroupRequestDto: - components.CreateNotificationGroupRequestDto$.inboundSchema, - }) - .transform((v) => { - return remap$(v, { - CreateNotificationGroupRequestDto: "createNotificationGroupRequestDto", - }); +export const NotificationGroupsControllerUpdateNotificationGroupRequest$inboundSchema: z.ZodType< + NotificationGroupsControllerUpdateNotificationGroupRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + id: z.string(), + CreateNotificationGroupRequestDto: + components.CreateNotificationGroupRequestDto$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + CreateNotificationGroupRequestDto: "createNotificationGroupRequestDto", }); + }); - export type Outbound = { - id: string; - CreateNotificationGroupRequestDto: components.CreateNotificationGroupRequestDto$.Outbound; - }; +/** @internal */ +export type NotificationGroupsControllerUpdateNotificationGroupRequest$Outbound = { + id: string; + CreateNotificationGroupRequestDto: components.CreateNotificationGroupRequestDto$Outbound; +}; - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - NotificationGroupsControllerUpdateNotificationGroupRequest - > = z - .object({ - id: z.string(), - createNotificationGroupRequestDto: - components.CreateNotificationGroupRequestDto$.outboundSchema, - }) - .transform((v) => { - return remap$(v, { - createNotificationGroupRequestDto: "CreateNotificationGroupRequestDto", - }); +/** @internal */ +export const NotificationGroupsControllerUpdateNotificationGroupRequest$outboundSchema: z.ZodType< + NotificationGroupsControllerUpdateNotificationGroupRequest$Outbound, + z.ZodTypeDef, + NotificationGroupsControllerUpdateNotificationGroupRequest +> = z + .object({ + id: z.string(), + createNotificationGroupRequestDto: + components.CreateNotificationGroupRequestDto$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + createNotificationGroupRequestDto: "CreateNotificationGroupRequestDto", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace NotificationGroupsControllerUpdateNotificationGroupRequest$ { + /** @deprecated use `NotificationGroupsControllerUpdateNotificationGroupRequest$inboundSchema` instead. */ + export const inboundSchema = + NotificationGroupsControllerUpdateNotificationGroupRequest$inboundSchema; + /** @deprecated use `NotificationGroupsControllerUpdateNotificationGroupRequest$outboundSchema` instead. */ + export const outboundSchema = + NotificationGroupsControllerUpdateNotificationGroupRequest$outboundSchema; + /** @deprecated use `NotificationGroupsControllerUpdateNotificationGroupRequest$Outbound` instead. */ + export type Outbound = NotificationGroupsControllerUpdateNotificationGroupRequest$Outbound; } diff --git a/src/models/operations/notificationscontrollergetactivitygraphstats.ts b/src/models/operations/notificationscontrollergetactivitygraphstats.ts index 055d3cc2..4c177b9d 100644 --- a/src/models/operations/notificationscontrollergetactivitygraphstats.ts +++ b/src/models/operations/notificationscontrollergetactivitygraphstats.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -9,24 +9,38 @@ export type NotificationsControllerGetActivityGraphStatsRequest = { }; /** @internal */ -export namespace NotificationsControllerGetActivityGraphStatsRequest$ { - export const inboundSchema: z.ZodType< - NotificationsControllerGetActivityGraphStatsRequest, - z.ZodTypeDef, - unknown - > = z.object({ - days: z.number().optional(), - }); +export const NotificationsControllerGetActivityGraphStatsRequest$inboundSchema: z.ZodType< + NotificationsControllerGetActivityGraphStatsRequest, + z.ZodTypeDef, + unknown +> = z.object({ + days: z.number().optional(), +}); + +/** @internal */ +export type NotificationsControllerGetActivityGraphStatsRequest$Outbound = { + days?: number | undefined; +}; - export type Outbound = { - days?: number | undefined; - }; +/** @internal */ +export const NotificationsControllerGetActivityGraphStatsRequest$outboundSchema: z.ZodType< + NotificationsControllerGetActivityGraphStatsRequest$Outbound, + z.ZodTypeDef, + NotificationsControllerGetActivityGraphStatsRequest +> = z.object({ + days: z.number().optional(), +}); - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - NotificationsControllerGetActivityGraphStatsRequest - > = z.object({ - days: z.number().optional(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace NotificationsControllerGetActivityGraphStatsRequest$ { + /** @deprecated use `NotificationsControllerGetActivityGraphStatsRequest$inboundSchema` instead. */ + export const inboundSchema = NotificationsControllerGetActivityGraphStatsRequest$inboundSchema; + /** @deprecated use `NotificationsControllerGetActivityGraphStatsRequest$outboundSchema` instead. */ + export const outboundSchema = + NotificationsControllerGetActivityGraphStatsRequest$outboundSchema; + /** @deprecated use `NotificationsControllerGetActivityGraphStatsRequest$Outbound` instead. */ + export type Outbound = NotificationsControllerGetActivityGraphStatsRequest$Outbound; } diff --git a/src/models/operations/notificationscontrollergetnotification.ts b/src/models/operations/notificationscontrollergetnotification.ts index c72d924e..23780b15 100644 --- a/src/models/operations/notificationscontrollergetnotification.ts +++ b/src/models/operations/notificationscontrollergetnotification.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -9,24 +9,37 @@ export type NotificationsControllerGetNotificationRequest = { }; /** @internal */ -export namespace NotificationsControllerGetNotificationRequest$ { - export const inboundSchema: z.ZodType< - NotificationsControllerGetNotificationRequest, - z.ZodTypeDef, - unknown - > = z.object({ - notificationId: z.string(), - }); +export const NotificationsControllerGetNotificationRequest$inboundSchema: z.ZodType< + NotificationsControllerGetNotificationRequest, + z.ZodTypeDef, + unknown +> = z.object({ + notificationId: z.string(), +}); + +/** @internal */ +export type NotificationsControllerGetNotificationRequest$Outbound = { + notificationId: string; +}; - export type Outbound = { - notificationId: string; - }; +/** @internal */ +export const NotificationsControllerGetNotificationRequest$outboundSchema: z.ZodType< + NotificationsControllerGetNotificationRequest$Outbound, + z.ZodTypeDef, + NotificationsControllerGetNotificationRequest +> = z.object({ + notificationId: z.string(), +}); - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - NotificationsControllerGetNotificationRequest - > = z.object({ - notificationId: z.string(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace NotificationsControllerGetNotificationRequest$ { + /** @deprecated use `NotificationsControllerGetNotificationRequest$inboundSchema` instead. */ + export const inboundSchema = NotificationsControllerGetNotificationRequest$inboundSchema; + /** @deprecated use `NotificationsControllerGetNotificationRequest$outboundSchema` instead. */ + export const outboundSchema = NotificationsControllerGetNotificationRequest$outboundSchema; + /** @deprecated use `NotificationsControllerGetNotificationRequest$Outbound` instead. */ + export type Outbound = NotificationsControllerGetNotificationRequest$Outbound; } diff --git a/src/models/operations/notificationscontrollerlistnotifications.ts b/src/models/operations/notificationscontrollerlistnotifications.ts index b85bfc25..0465f07f 100644 --- a/src/models/operations/notificationscontrollerlistnotifications.ts +++ b/src/models/operations/notificationscontrollerlistnotifications.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { ClosedEnum } from "../../types/enums.js"; @@ -28,48 +28,72 @@ export type NotificationsControllerListNotificationsRequest = { }; /** @internal */ +export const Channels$inboundSchema: z.ZodNativeEnum = z.nativeEnum(Channels); + +/** @internal */ +export const Channels$outboundSchema: z.ZodNativeEnum = Channels$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace Channels$ { - export const inboundSchema: z.ZodNativeEnum = z.nativeEnum(Channels); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; + /** @deprecated use `Channels$inboundSchema` instead. */ + export const inboundSchema = Channels$inboundSchema; + /** @deprecated use `Channels$outboundSchema` instead. */ + export const outboundSchema = Channels$outboundSchema; } /** @internal */ -export namespace NotificationsControllerListNotificationsRequest$ { - export const inboundSchema: z.ZodType< - NotificationsControllerListNotificationsRequest, - z.ZodTypeDef, - unknown - > = z.object({ - channels: z.array(Channels$.inboundSchema), - templates: z.array(z.string()), - emails: z.array(z.string()), - search: z.string(), - subscriberIds: z.array(z.string()), - page: z.number().default(0), - transactionId: z.string().optional(), - }); +export const NotificationsControllerListNotificationsRequest$inboundSchema: z.ZodType< + NotificationsControllerListNotificationsRequest, + z.ZodTypeDef, + unknown +> = z.object({ + channels: z.array(Channels$inboundSchema), + templates: z.array(z.string()), + emails: z.array(z.string()), + search: z.string(), + subscriberIds: z.array(z.string()), + page: z.number().default(0), + transactionId: z.string().optional(), +}); + +/** @internal */ +export type NotificationsControllerListNotificationsRequest$Outbound = { + channels: Array; + templates: Array; + emails: Array; + search: string; + subscriberIds: Array; + page: number; + transactionId?: string | undefined; +}; - export type Outbound = { - channels: Array; - templates: Array; - emails: Array; - search: string; - subscriberIds: Array; - page: number; - transactionId?: string | undefined; - }; +/** @internal */ +export const NotificationsControllerListNotificationsRequest$outboundSchema: z.ZodType< + NotificationsControllerListNotificationsRequest$Outbound, + z.ZodTypeDef, + NotificationsControllerListNotificationsRequest +> = z.object({ + channels: z.array(Channels$outboundSchema), + templates: z.array(z.string()), + emails: z.array(z.string()), + search: z.string(), + subscriberIds: z.array(z.string()), + page: z.number().default(0), + transactionId: z.string().optional(), +}); - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - NotificationsControllerListNotificationsRequest - > = z.object({ - channels: z.array(Channels$.outboundSchema), - templates: z.array(z.string()), - emails: z.array(z.string()), - search: z.string(), - subscriberIds: z.array(z.string()), - page: z.number().default(0), - transactionId: z.string().optional(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace NotificationsControllerListNotificationsRequest$ { + /** @deprecated use `NotificationsControllerListNotificationsRequest$inboundSchema` instead. */ + export const inboundSchema = NotificationsControllerListNotificationsRequest$inboundSchema; + /** @deprecated use `NotificationsControllerListNotificationsRequest$outboundSchema` instead. */ + export const outboundSchema = NotificationsControllerListNotificationsRequest$outboundSchema; + /** @deprecated use `NotificationsControllerListNotificationsRequest$Outbound` instead. */ + export type Outbound = NotificationsControllerListNotificationsRequest$Outbound; } diff --git a/src/models/operations/organizationcontrollerremove.ts b/src/models/operations/organizationcontrollerremove.ts deleted file mode 100644 index 84331f39..00000000 --- a/src/models/operations/organizationcontrollerremove.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - */ - -import * as z from "zod"; - -export type OrganizationControllerRemoveRequest = { - memberId: string; -}; - -/** @internal */ -export namespace OrganizationControllerRemoveRequest$ { - export const inboundSchema: z.ZodType< - OrganizationControllerRemoveRequest, - z.ZodTypeDef, - unknown - > = z.object({ - memberId: z.string(), - }); - - export type Outbound = { - memberId: string; - }; - - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - OrganizationControllerRemoveRequest - > = z.object({ - memberId: z.string(), - }); -} diff --git a/src/models/operations/subscriberscontrollerchataccessoauth.ts b/src/models/operations/subscriberscontrollerchataccessoauth.ts index b74a2d1d..295f1849 100644 --- a/src/models/operations/subscriberscontrollerchataccessoauth.ts +++ b/src/models/operations/subscriberscontrollerchataccessoauth.ts @@ -1,48 +1,61 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; export type SubscribersControllerChatAccessOauthRequest = { subscriberId: string; - providerId: string; + providerId?: any | undefined; hmacHash: string; environmentId: string; integrationIdentifier?: string | undefined; }; /** @internal */ -export namespace SubscribersControllerChatAccessOauthRequest$ { - export const inboundSchema: z.ZodType< - SubscribersControllerChatAccessOauthRequest, - z.ZodTypeDef, - unknown - > = z.object({ - subscriberId: z.string(), - providerId: z.string(), - hmacHash: z.string(), - environmentId: z.string(), - integrationIdentifier: z.string().optional(), - }); +export const SubscribersControllerChatAccessOauthRequest$inboundSchema: z.ZodType< + SubscribersControllerChatAccessOauthRequest, + z.ZodTypeDef, + unknown +> = z.object({ + subscriberId: z.string(), + providerId: z.any().optional(), + hmacHash: z.string(), + environmentId: z.string(), + integrationIdentifier: z.string().optional(), +}); - export type Outbound = { - subscriberId: string; - providerId: string; - hmacHash: string; - environmentId: string; - integrationIdentifier?: string | undefined; - }; +/** @internal */ +export type SubscribersControllerChatAccessOauthRequest$Outbound = { + subscriberId: string; + providerId?: any | undefined; + hmacHash: string; + environmentId: string; + integrationIdentifier?: string | undefined; +}; + +/** @internal */ +export const SubscribersControllerChatAccessOauthRequest$outboundSchema: z.ZodType< + SubscribersControllerChatAccessOauthRequest$Outbound, + z.ZodTypeDef, + SubscribersControllerChatAccessOauthRequest +> = z.object({ + subscriberId: z.string(), + providerId: z.any().optional(), + hmacHash: z.string(), + environmentId: z.string(), + integrationIdentifier: z.string().optional(), +}); - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - SubscribersControllerChatAccessOauthRequest - > = z.object({ - subscriberId: z.string(), - providerId: z.string(), - hmacHash: z.string(), - environmentId: z.string(), - integrationIdentifier: z.string().optional(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SubscribersControllerChatAccessOauthRequest$ { + /** @deprecated use `SubscribersControllerChatAccessOauthRequest$inboundSchema` instead. */ + export const inboundSchema = SubscribersControllerChatAccessOauthRequest$inboundSchema; + /** @deprecated use `SubscribersControllerChatAccessOauthRequest$outboundSchema` instead. */ + export const outboundSchema = SubscribersControllerChatAccessOauthRequest$outboundSchema; + /** @deprecated use `SubscribersControllerChatAccessOauthRequest$Outbound` instead. */ + export type Outbound = SubscribersControllerChatAccessOauthRequest$Outbound; } diff --git a/src/models/operations/subscriberscontrollerchatoauthcallback.ts b/src/models/operations/subscriberscontrollerchatoauthcallback.ts index 63d6c25f..ef2f12f2 100644 --- a/src/models/operations/subscriberscontrollerchatoauthcallback.ts +++ b/src/models/operations/subscriberscontrollerchatoauthcallback.ts @@ -1,12 +1,12 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; export type SubscribersControllerChatOauthCallbackRequest = { subscriberId: string; - providerId: string; + providerId?: any | undefined; code: string; hmacHash: string; environmentId: string; @@ -16,56 +16,82 @@ export type SubscribersControllerChatOauthCallbackRequest = { export type SubscribersControllerChatOauthCallbackResponseBody = {}; /** @internal */ -export namespace SubscribersControllerChatOauthCallbackRequest$ { - export const inboundSchema: z.ZodType< - SubscribersControllerChatOauthCallbackRequest, - z.ZodTypeDef, - unknown - > = z.object({ - subscriberId: z.string(), - providerId: z.string(), - code: z.string(), - hmacHash: z.string(), - environmentId: z.string(), - integrationIdentifier: z.string().optional(), - }); +export const SubscribersControllerChatOauthCallbackRequest$inboundSchema: z.ZodType< + SubscribersControllerChatOauthCallbackRequest, + z.ZodTypeDef, + unknown +> = z.object({ + subscriberId: z.string(), + providerId: z.any().optional(), + code: z.string(), + hmacHash: z.string(), + environmentId: z.string(), + integrationIdentifier: z.string().optional(), +}); + +/** @internal */ +export type SubscribersControllerChatOauthCallbackRequest$Outbound = { + subscriberId: string; + providerId?: any | undefined; + code: string; + hmacHash: string; + environmentId: string; + integrationIdentifier?: string | undefined; +}; - export type Outbound = { - subscriberId: string; - providerId: string; - code: string; - hmacHash: string; - environmentId: string; - integrationIdentifier?: string | undefined; - }; +/** @internal */ +export const SubscribersControllerChatOauthCallbackRequest$outboundSchema: z.ZodType< + SubscribersControllerChatOauthCallbackRequest$Outbound, + z.ZodTypeDef, + SubscribersControllerChatOauthCallbackRequest +> = z.object({ + subscriberId: z.string(), + providerId: z.any().optional(), + code: z.string(), + hmacHash: z.string(), + environmentId: z.string(), + integrationIdentifier: z.string().optional(), +}); - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - SubscribersControllerChatOauthCallbackRequest - > = z.object({ - subscriberId: z.string(), - providerId: z.string(), - code: z.string(), - hmacHash: z.string(), - environmentId: z.string(), - integrationIdentifier: z.string().optional(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SubscribersControllerChatOauthCallbackRequest$ { + /** @deprecated use `SubscribersControllerChatOauthCallbackRequest$inboundSchema` instead. */ + export const inboundSchema = SubscribersControllerChatOauthCallbackRequest$inboundSchema; + /** @deprecated use `SubscribersControllerChatOauthCallbackRequest$outboundSchema` instead. */ + export const outboundSchema = SubscribersControllerChatOauthCallbackRequest$outboundSchema; + /** @deprecated use `SubscribersControllerChatOauthCallbackRequest$Outbound` instead. */ + export type Outbound = SubscribersControllerChatOauthCallbackRequest$Outbound; } /** @internal */ -export namespace SubscribersControllerChatOauthCallbackResponseBody$ { - export const inboundSchema: z.ZodType< - SubscribersControllerChatOauthCallbackResponseBody, - z.ZodTypeDef, - unknown - > = z.object({}); +export const SubscribersControllerChatOauthCallbackResponseBody$inboundSchema: z.ZodType< + SubscribersControllerChatOauthCallbackResponseBody, + z.ZodTypeDef, + unknown +> = z.object({}); - export type Outbound = {}; +/** @internal */ +export type SubscribersControllerChatOauthCallbackResponseBody$Outbound = {}; - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - SubscribersControllerChatOauthCallbackResponseBody - > = z.object({}); +/** @internal */ +export const SubscribersControllerChatOauthCallbackResponseBody$outboundSchema: z.ZodType< + SubscribersControllerChatOauthCallbackResponseBody$Outbound, + z.ZodTypeDef, + SubscribersControllerChatOauthCallbackResponseBody +> = z.object({}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SubscribersControllerChatOauthCallbackResponseBody$ { + /** @deprecated use `SubscribersControllerChatOauthCallbackResponseBody$inboundSchema` instead. */ + export const inboundSchema = SubscribersControllerChatOauthCallbackResponseBody$inboundSchema; + /** @deprecated use `SubscribersControllerChatOauthCallbackResponseBody$outboundSchema` instead. */ + export const outboundSchema = SubscribersControllerChatOauthCallbackResponseBody$outboundSchema; + /** @deprecated use `SubscribersControllerChatOauthCallbackResponseBody$Outbound` instead. */ + export type Outbound = SubscribersControllerChatOauthCallbackResponseBody$Outbound; } diff --git a/src/models/operations/subscriberscontrollerdeletesubscribercredentials.ts b/src/models/operations/subscriberscontrollerdeletesubscribercredentials.ts index 0a8dc71b..7ebd675f 100644 --- a/src/models/operations/subscriberscontrollerdeletesubscribercredentials.ts +++ b/src/models/operations/subscriberscontrollerdeletesubscribercredentials.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -10,27 +10,42 @@ export type SubscribersControllerDeleteSubscriberCredentialsRequest = { }; /** @internal */ -export namespace SubscribersControllerDeleteSubscriberCredentialsRequest$ { - export const inboundSchema: z.ZodType< - SubscribersControllerDeleteSubscriberCredentialsRequest, - z.ZodTypeDef, - unknown - > = z.object({ - subscriberId: z.string(), - providerId: z.string(), - }); +export const SubscribersControllerDeleteSubscriberCredentialsRequest$inboundSchema: z.ZodType< + SubscribersControllerDeleteSubscriberCredentialsRequest, + z.ZodTypeDef, + unknown +> = z.object({ + subscriberId: z.string(), + providerId: z.string(), +}); - export type Outbound = { - subscriberId: string; - providerId: string; - }; +/** @internal */ +export type SubscribersControllerDeleteSubscriberCredentialsRequest$Outbound = { + subscriberId: string; + providerId: string; +}; - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - SubscribersControllerDeleteSubscriberCredentialsRequest - > = z.object({ - subscriberId: z.string(), - providerId: z.string(), - }); +/** @internal */ +export const SubscribersControllerDeleteSubscriberCredentialsRequest$outboundSchema: z.ZodType< + SubscribersControllerDeleteSubscriberCredentialsRequest$Outbound, + z.ZodTypeDef, + SubscribersControllerDeleteSubscriberCredentialsRequest +> = z.object({ + subscriberId: z.string(), + providerId: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SubscribersControllerDeleteSubscriberCredentialsRequest$ { + /** @deprecated use `SubscribersControllerDeleteSubscriberCredentialsRequest$inboundSchema` instead. */ + export const inboundSchema = + SubscribersControllerDeleteSubscriberCredentialsRequest$inboundSchema; + /** @deprecated use `SubscribersControllerDeleteSubscriberCredentialsRequest$outboundSchema` instead. */ + export const outboundSchema = + SubscribersControllerDeleteSubscriberCredentialsRequest$outboundSchema; + /** @deprecated use `SubscribersControllerDeleteSubscriberCredentialsRequest$Outbound` instead. */ + export type Outbound = SubscribersControllerDeleteSubscriberCredentialsRequest$Outbound; } diff --git a/src/models/operations/subscriberscontrollergetnotificationsfeed.ts b/src/models/operations/subscriberscontrollergetnotificationsfeed.ts index b4831613..b3a17c71 100644 --- a/src/models/operations/subscriberscontrollergetnotificationsfeed.ts +++ b/src/models/operations/subscriberscontrollergetnotificationsfeed.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as components from "../components/index.js"; @@ -34,71 +34,99 @@ export type SubscribersControllerGetNotificationsFeedResponseBody = { }; /** @internal */ -export namespace SubscribersControllerGetNotificationsFeedRequest$ { - export const inboundSchema: z.ZodType< - SubscribersControllerGetNotificationsFeedRequest, - z.ZodTypeDef, - unknown - > = z.object({ - subscriberId: z.string(), - page: z.number().optional(), - limit: z.number().default(10), - read: z.boolean().optional(), - seen: z.boolean().optional(), - payload: z.string().optional(), - }); +export const SubscribersControllerGetNotificationsFeedRequest$inboundSchema: z.ZodType< + SubscribersControllerGetNotificationsFeedRequest, + z.ZodTypeDef, + unknown +> = z.object({ + subscriberId: z.string(), + page: z.number().optional(), + limit: z.number().default(10), + read: z.boolean().optional(), + seen: z.boolean().optional(), + payload: z.string().optional(), +}); - export type Outbound = { - subscriberId: string; - page?: number | undefined; - limit: number; - read?: boolean | undefined; - seen?: boolean | undefined; - payload?: string | undefined; - }; +/** @internal */ +export type SubscribersControllerGetNotificationsFeedRequest$Outbound = { + subscriberId: string; + page?: number | undefined; + limit: number; + read?: boolean | undefined; + seen?: boolean | undefined; + payload?: string | undefined; +}; - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - SubscribersControllerGetNotificationsFeedRequest - > = z.object({ - subscriberId: z.string(), - page: z.number().optional(), - limit: z.number().default(10), - read: z.boolean().optional(), - seen: z.boolean().optional(), - payload: z.string().optional(), - }); +/** @internal */ +export const SubscribersControllerGetNotificationsFeedRequest$outboundSchema: z.ZodType< + SubscribersControllerGetNotificationsFeedRequest$Outbound, + z.ZodTypeDef, + SubscribersControllerGetNotificationsFeedRequest +> = z.object({ + subscriberId: z.string(), + page: z.number().optional(), + limit: z.number().default(10), + read: z.boolean().optional(), + seen: z.boolean().optional(), + payload: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SubscribersControllerGetNotificationsFeedRequest$ { + /** @deprecated use `SubscribersControllerGetNotificationsFeedRequest$inboundSchema` instead. */ + export const inboundSchema = SubscribersControllerGetNotificationsFeedRequest$inboundSchema; + /** @deprecated use `SubscribersControllerGetNotificationsFeedRequest$outboundSchema` instead. */ + export const outboundSchema = SubscribersControllerGetNotificationsFeedRequest$outboundSchema; + /** @deprecated use `SubscribersControllerGetNotificationsFeedRequest$Outbound` instead. */ + export type Outbound = SubscribersControllerGetNotificationsFeedRequest$Outbound; } /** @internal */ -export namespace SubscribersControllerGetNotificationsFeedResponseBody$ { - export const inboundSchema: z.ZodType< - SubscribersControllerGetNotificationsFeedResponseBody, - z.ZodTypeDef, - unknown - > = z.object({ - data: z.array(components.FeedResponseDto$.inboundSchema), - hasMore: z.boolean(), - page: z.number(), - pageSize: z.number(), - }); +export const SubscribersControllerGetNotificationsFeedResponseBody$inboundSchema: z.ZodType< + SubscribersControllerGetNotificationsFeedResponseBody, + z.ZodTypeDef, + unknown +> = z.object({ + data: z.array(components.FeedResponseDto$inboundSchema), + hasMore: z.boolean(), + page: z.number(), + pageSize: z.number(), +}); - export type Outbound = { - data: Array; - hasMore: boolean; - page: number; - pageSize: number; - }; +/** @internal */ +export type SubscribersControllerGetNotificationsFeedResponseBody$Outbound = { + data: Array; + hasMore: boolean; + page: number; + pageSize: number; +}; + +/** @internal */ +export const SubscribersControllerGetNotificationsFeedResponseBody$outboundSchema: z.ZodType< + SubscribersControllerGetNotificationsFeedResponseBody$Outbound, + z.ZodTypeDef, + SubscribersControllerGetNotificationsFeedResponseBody +> = z.object({ + data: z.array(components.FeedResponseDto$outboundSchema), + hasMore: z.boolean(), + page: z.number(), + pageSize: z.number(), +}); - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - SubscribersControllerGetNotificationsFeedResponseBody - > = z.object({ - data: z.array(components.FeedResponseDto$.outboundSchema), - hasMore: z.boolean(), - page: z.number(), - pageSize: z.number(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SubscribersControllerGetNotificationsFeedResponseBody$ { + /** @deprecated use `SubscribersControllerGetNotificationsFeedResponseBody$inboundSchema` instead. */ + export const inboundSchema = + SubscribersControllerGetNotificationsFeedResponseBody$inboundSchema; + /** @deprecated use `SubscribersControllerGetNotificationsFeedResponseBody$outboundSchema` instead. */ + export const outboundSchema = + SubscribersControllerGetNotificationsFeedResponseBody$outboundSchema; + /** @deprecated use `SubscribersControllerGetNotificationsFeedResponseBody$Outbound` instead. */ + export type Outbound = SubscribersControllerGetNotificationsFeedResponseBody$Outbound; } diff --git a/src/models/operations/subscriberscontrollergetsubscriber.ts b/src/models/operations/subscriberscontrollergetsubscriber.ts index b4aa0d1f..0a94c96d 100644 --- a/src/models/operations/subscriberscontrollergetsubscriber.ts +++ b/src/models/operations/subscriberscontrollergetsubscriber.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -9,24 +9,37 @@ export type SubscribersControllerGetSubscriberRequest = { }; /** @internal */ -export namespace SubscribersControllerGetSubscriberRequest$ { - export const inboundSchema: z.ZodType< - SubscribersControllerGetSubscriberRequest, - z.ZodTypeDef, - unknown - > = z.object({ - subscriberId: z.string(), - }); +export const SubscribersControllerGetSubscriberRequest$inboundSchema: z.ZodType< + SubscribersControllerGetSubscriberRequest, + z.ZodTypeDef, + unknown +> = z.object({ + subscriberId: z.string(), +}); + +/** @internal */ +export type SubscribersControllerGetSubscriberRequest$Outbound = { + subscriberId: string; +}; - export type Outbound = { - subscriberId: string; - }; +/** @internal */ +export const SubscribersControllerGetSubscriberRequest$outboundSchema: z.ZodType< + SubscribersControllerGetSubscriberRequest$Outbound, + z.ZodTypeDef, + SubscribersControllerGetSubscriberRequest +> = z.object({ + subscriberId: z.string(), +}); - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - SubscribersControllerGetSubscriberRequest - > = z.object({ - subscriberId: z.string(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SubscribersControllerGetSubscriberRequest$ { + /** @deprecated use `SubscribersControllerGetSubscriberRequest$inboundSchema` instead. */ + export const inboundSchema = SubscribersControllerGetSubscriberRequest$inboundSchema; + /** @deprecated use `SubscribersControllerGetSubscriberRequest$outboundSchema` instead. */ + export const outboundSchema = SubscribersControllerGetSubscriberRequest$outboundSchema; + /** @deprecated use `SubscribersControllerGetSubscriberRequest$Outbound` instead. */ + export type Outbound = SubscribersControllerGetSubscriberRequest$Outbound; } diff --git a/src/models/operations/subscriberscontrollergetsubscriberpreferencebylevel.ts b/src/models/operations/subscriberscontrollergetsubscriberpreferencebylevel.ts index d5201dd8..fc2bcb41 100644 --- a/src/models/operations/subscriberscontrollergetsubscriberpreferencebylevel.ts +++ b/src/models/operations/subscriberscontrollergetsubscriberpreferencebylevel.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { ClosedEnum } from "../../types/enums.js"; @@ -26,33 +26,59 @@ export type SubscribersControllerGetSubscriberPreferenceByLevelRequest = { }; /** @internal */ +export const Parameter$inboundSchema: z.ZodNativeEnum = z.nativeEnum(Parameter); + +/** @internal */ +export const Parameter$outboundSchema: z.ZodNativeEnum = Parameter$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace Parameter$ { - export const inboundSchema: z.ZodNativeEnum = z.nativeEnum(Parameter); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; + /** @deprecated use `Parameter$inboundSchema` instead. */ + export const inboundSchema = Parameter$inboundSchema; + /** @deprecated use `Parameter$outboundSchema` instead. */ + export const outboundSchema = Parameter$outboundSchema; } /** @internal */ +export const SubscribersControllerGetSubscriberPreferenceByLevelRequest$inboundSchema: z.ZodType< + SubscribersControllerGetSubscriberPreferenceByLevelRequest, + z.ZodTypeDef, + unknown +> = z.object({ + parameter: Parameter$inboundSchema, + subscriberId: z.string(), +}); + +/** @internal */ +export type SubscribersControllerGetSubscriberPreferenceByLevelRequest$Outbound = { + parameter: string; + subscriberId: string; +}; + +/** @internal */ +export const SubscribersControllerGetSubscriberPreferenceByLevelRequest$outboundSchema: z.ZodType< + SubscribersControllerGetSubscriberPreferenceByLevelRequest$Outbound, + z.ZodTypeDef, + SubscribersControllerGetSubscriberPreferenceByLevelRequest +> = z.object({ + parameter: Parameter$outboundSchema, + subscriberId: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace SubscribersControllerGetSubscriberPreferenceByLevelRequest$ { - export const inboundSchema: z.ZodType< - SubscribersControllerGetSubscriberPreferenceByLevelRequest, - z.ZodTypeDef, - unknown - > = z.object({ - parameter: Parameter$.inboundSchema, - subscriberId: z.string(), - }); - - export type Outbound = { - parameter: string; - subscriberId: string; - }; - - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - SubscribersControllerGetSubscriberPreferenceByLevelRequest - > = z.object({ - parameter: Parameter$.outboundSchema, - subscriberId: z.string(), - }); + /** @deprecated use `SubscribersControllerGetSubscriberPreferenceByLevelRequest$inboundSchema` instead. */ + export const inboundSchema = + SubscribersControllerGetSubscriberPreferenceByLevelRequest$inboundSchema; + /** @deprecated use `SubscribersControllerGetSubscriberPreferenceByLevelRequest$outboundSchema` instead. */ + export const outboundSchema = + SubscribersControllerGetSubscriberPreferenceByLevelRequest$outboundSchema; + /** @deprecated use `SubscribersControllerGetSubscriberPreferenceByLevelRequest$Outbound` instead. */ + export type Outbound = SubscribersControllerGetSubscriberPreferenceByLevelRequest$Outbound; } diff --git a/src/models/operations/subscriberscontrollergetunseencount.ts b/src/models/operations/subscriberscontrollergetunseencount.ts index 36d5d909..420f0683 100644 --- a/src/models/operations/subscriberscontrollergetunseencount.ts +++ b/src/models/operations/subscriberscontrollergetunseencount.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -11,30 +11,43 @@ export type SubscribersControllerGetUnseenCountRequest = { }; /** @internal */ -export namespace SubscribersControllerGetUnseenCountRequest$ { - export const inboundSchema: z.ZodType< - SubscribersControllerGetUnseenCountRequest, - z.ZodTypeDef, - unknown - > = z.object({ - seen: z.boolean(), - subscriberId: z.string(), - limit: z.number(), - }); +export const SubscribersControllerGetUnseenCountRequest$inboundSchema: z.ZodType< + SubscribersControllerGetUnseenCountRequest, + z.ZodTypeDef, + unknown +> = z.object({ + seen: z.boolean(), + subscriberId: z.string(), + limit: z.number(), +}); + +/** @internal */ +export type SubscribersControllerGetUnseenCountRequest$Outbound = { + seen: boolean; + subscriberId: string; + limit: number; +}; - export type Outbound = { - seen: boolean; - subscriberId: string; - limit: number; - }; +/** @internal */ +export const SubscribersControllerGetUnseenCountRequest$outboundSchema: z.ZodType< + SubscribersControllerGetUnseenCountRequest$Outbound, + z.ZodTypeDef, + SubscribersControllerGetUnseenCountRequest +> = z.object({ + seen: z.boolean(), + subscriberId: z.string(), + limit: z.number(), +}); - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - SubscribersControllerGetUnseenCountRequest - > = z.object({ - seen: z.boolean(), - subscriberId: z.string(), - limit: z.number(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SubscribersControllerGetUnseenCountRequest$ { + /** @deprecated use `SubscribersControllerGetUnseenCountRequest$inboundSchema` instead. */ + export const inboundSchema = SubscribersControllerGetUnseenCountRequest$inboundSchema; + /** @deprecated use `SubscribersControllerGetUnseenCountRequest$outboundSchema` instead. */ + export const outboundSchema = SubscribersControllerGetUnseenCountRequest$outboundSchema; + /** @deprecated use `SubscribersControllerGetUnseenCountRequest$Outbound` instead. */ + export type Outbound = SubscribersControllerGetUnseenCountRequest$Outbound; } diff --git a/src/models/operations/subscriberscontrollerlistsubscriberpreferences.ts b/src/models/operations/subscriberscontrollerlistsubscriberpreferences.ts index 1b375bd3..04f4a73a 100644 --- a/src/models/operations/subscriberscontrollerlistsubscriberpreferences.ts +++ b/src/models/operations/subscriberscontrollerlistsubscriberpreferences.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -9,24 +9,39 @@ export type SubscribersControllerListSubscriberPreferencesRequest = { }; /** @internal */ -export namespace SubscribersControllerListSubscriberPreferencesRequest$ { - export const inboundSchema: z.ZodType< - SubscribersControllerListSubscriberPreferencesRequest, - z.ZodTypeDef, - unknown - > = z.object({ - subscriberId: z.string(), - }); +export const SubscribersControllerListSubscriberPreferencesRequest$inboundSchema: z.ZodType< + SubscribersControllerListSubscriberPreferencesRequest, + z.ZodTypeDef, + unknown +> = z.object({ + subscriberId: z.string(), +}); + +/** @internal */ +export type SubscribersControllerListSubscriberPreferencesRequest$Outbound = { + subscriberId: string; +}; - export type Outbound = { - subscriberId: string; - }; +/** @internal */ +export const SubscribersControllerListSubscriberPreferencesRequest$outboundSchema: z.ZodType< + SubscribersControllerListSubscriberPreferencesRequest$Outbound, + z.ZodTypeDef, + SubscribersControllerListSubscriberPreferencesRequest +> = z.object({ + subscriberId: z.string(), +}); - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - SubscribersControllerListSubscriberPreferencesRequest - > = z.object({ - subscriberId: z.string(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SubscribersControllerListSubscriberPreferencesRequest$ { + /** @deprecated use `SubscribersControllerListSubscriberPreferencesRequest$inboundSchema` instead. */ + export const inboundSchema = + SubscribersControllerListSubscriberPreferencesRequest$inboundSchema; + /** @deprecated use `SubscribersControllerListSubscriberPreferencesRequest$outboundSchema` instead. */ + export const outboundSchema = + SubscribersControllerListSubscriberPreferencesRequest$outboundSchema; + /** @deprecated use `SubscribersControllerListSubscriberPreferencesRequest$Outbound` instead. */ + export type Outbound = SubscribersControllerListSubscriberPreferencesRequest$Outbound; } diff --git a/src/models/operations/subscriberscontrollerlistsubscribers.ts b/src/models/operations/subscriberscontrollerlistsubscribers.ts index 50c16ac2..8f6ffa6a 100644 --- a/src/models/operations/subscriberscontrollerlistsubscribers.ts +++ b/src/models/operations/subscriberscontrollerlistsubscribers.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; @@ -32,94 +32,133 @@ export type SubscribersControllerListSubscribersResponse = { }; /** @internal */ -export namespace SubscribersControllerListSubscribersRequest$ { - export const inboundSchema: z.ZodType< - SubscribersControllerListSubscribersRequest, - z.ZodTypeDef, - unknown - > = z.object({ - page: z.number().optional(), - limit: z.number().default(10), - }); +export const SubscribersControllerListSubscribersRequest$inboundSchema: z.ZodType< + SubscribersControllerListSubscribersRequest, + z.ZodTypeDef, + unknown +> = z.object({ + page: z.number().optional(), + limit: z.number().default(10), +}); - export type Outbound = { - page?: number | undefined; - limit: number; - }; - - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - SubscribersControllerListSubscribersRequest - > = z.object({ - page: z.number().optional(), - limit: z.number().default(10), - }); +/** @internal */ +export type SubscribersControllerListSubscribersRequest$Outbound = { + page?: number | undefined; + limit: number; +}; + +/** @internal */ +export const SubscribersControllerListSubscribersRequest$outboundSchema: z.ZodType< + SubscribersControllerListSubscribersRequest$Outbound, + z.ZodTypeDef, + SubscribersControllerListSubscribersRequest +> = z.object({ + page: z.number().optional(), + limit: z.number().default(10), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SubscribersControllerListSubscribersRequest$ { + /** @deprecated use `SubscribersControllerListSubscribersRequest$inboundSchema` instead. */ + export const inboundSchema = SubscribersControllerListSubscribersRequest$inboundSchema; + /** @deprecated use `SubscribersControllerListSubscribersRequest$outboundSchema` instead. */ + export const outboundSchema = SubscribersControllerListSubscribersRequest$outboundSchema; + /** @deprecated use `SubscribersControllerListSubscribersRequest$Outbound` instead. */ + export type Outbound = SubscribersControllerListSubscribersRequest$Outbound; } /** @internal */ -export namespace SubscribersControllerListSubscribersResponseBody$ { - export const inboundSchema: z.ZodType< - SubscribersControllerListSubscribersResponseBody, - z.ZodTypeDef, - unknown - > = z.object({ - data: z.array(components.SubscriberResponseDto$.inboundSchema), - hasMore: z.boolean(), - page: z.number(), - pageSize: z.number(), - }); +export const SubscribersControllerListSubscribersResponseBody$inboundSchema: z.ZodType< + SubscribersControllerListSubscribersResponseBody, + z.ZodTypeDef, + unknown +> = z.object({ + data: z.array(components.SubscriberResponseDto$inboundSchema), + hasMore: z.boolean(), + page: z.number(), + pageSize: z.number(), +}); - export type Outbound = { - data: Array; - hasMore: boolean; - page: number; - pageSize: number; - }; - - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - SubscribersControllerListSubscribersResponseBody - > = z.object({ - data: z.array(components.SubscriberResponseDto$.outboundSchema), - hasMore: z.boolean(), - page: z.number(), - pageSize: z.number(), - }); +/** @internal */ +export type SubscribersControllerListSubscribersResponseBody$Outbound = { + data: Array; + hasMore: boolean; + page: number; + pageSize: number; +}; + +/** @internal */ +export const SubscribersControllerListSubscribersResponseBody$outboundSchema: z.ZodType< + SubscribersControllerListSubscribersResponseBody$Outbound, + z.ZodTypeDef, + SubscribersControllerListSubscribersResponseBody +> = z.object({ + data: z.array(components.SubscriberResponseDto$outboundSchema), + hasMore: z.boolean(), + page: z.number(), + pageSize: z.number(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SubscribersControllerListSubscribersResponseBody$ { + /** @deprecated use `SubscribersControllerListSubscribersResponseBody$inboundSchema` instead. */ + export const inboundSchema = SubscribersControllerListSubscribersResponseBody$inboundSchema; + /** @deprecated use `SubscribersControllerListSubscribersResponseBody$outboundSchema` instead. */ + export const outboundSchema = SubscribersControllerListSubscribersResponseBody$outboundSchema; + /** @deprecated use `SubscribersControllerListSubscribersResponseBody$Outbound` instead. */ + export type Outbound = SubscribersControllerListSubscribersResponseBody$Outbound; } /** @internal */ -export namespace SubscribersControllerListSubscribersResponse$ { - export const inboundSchema: z.ZodType< - SubscribersControllerListSubscribersResponse, - z.ZodTypeDef, - unknown - > = z - .object({ - Result: z.lazy(() => SubscribersControllerListSubscribersResponseBody$.inboundSchema), - }) - .transform((v) => { - return remap$(v, { - Result: "result", - }); +export const SubscribersControllerListSubscribersResponse$inboundSchema: z.ZodType< + SubscribersControllerListSubscribersResponse, + z.ZodTypeDef, + unknown +> = z + .object({ + Result: z.lazy(() => SubscribersControllerListSubscribersResponseBody$inboundSchema), + }) + .transform((v) => { + return remap$(v, { + Result: "result", }); + }); - export type Outbound = { - Result: SubscribersControllerListSubscribersResponseBody$.Outbound; - }; - - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - SubscribersControllerListSubscribersResponse - > = z - .object({ - result: z.lazy(() => SubscribersControllerListSubscribersResponseBody$.outboundSchema), - }) - .transform((v) => { - return remap$(v, { - result: "Result", - }); +/** @internal */ +export type SubscribersControllerListSubscribersResponse$Outbound = { + Result: SubscribersControllerListSubscribersResponseBody$Outbound; +}; + +/** @internal */ +export const SubscribersControllerListSubscribersResponse$outboundSchema: z.ZodType< + SubscribersControllerListSubscribersResponse$Outbound, + z.ZodTypeDef, + SubscribersControllerListSubscribersResponse +> = z + .object({ + result: z.lazy(() => SubscribersControllerListSubscribersResponseBody$outboundSchema), + }) + .transform((v) => { + return remap$(v, { + result: "Result", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SubscribersControllerListSubscribersResponse$ { + /** @deprecated use `SubscribersControllerListSubscribersResponse$inboundSchema` instead. */ + export const inboundSchema = SubscribersControllerListSubscribersResponse$inboundSchema; + /** @deprecated use `SubscribersControllerListSubscribersResponse$outboundSchema` instead. */ + export const outboundSchema = SubscribersControllerListSubscribersResponse$outboundSchema; + /** @deprecated use `SubscribersControllerListSubscribersResponse$Outbound` instead. */ + export type Outbound = SubscribersControllerListSubscribersResponse$Outbound; } diff --git a/src/models/operations/subscriberscontrollermarkactionasseen.ts b/src/models/operations/subscriberscontrollermarkactionasseen.ts index 43b80b62..ae6419ca 100644 --- a/src/models/operations/subscriberscontrollermarkactionasseen.ts +++ b/src/models/operations/subscriberscontrollermarkactionasseen.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; @@ -8,51 +8,64 @@ import * as z from "zod"; export type SubscribersControllerMarkActionAsSeenRequest = { messageId: string; - type: string; + type?: any | undefined; subscriberId: string; markMessageActionAsSeenDto: components.MarkMessageActionAsSeenDto; }; /** @internal */ -export namespace SubscribersControllerMarkActionAsSeenRequest$ { - export const inboundSchema: z.ZodType< - SubscribersControllerMarkActionAsSeenRequest, - z.ZodTypeDef, - unknown - > = z - .object({ - messageId: z.string(), - type: z.string(), - subscriberId: z.string(), - MarkMessageActionAsSeenDto: components.MarkMessageActionAsSeenDto$.inboundSchema, - }) - .transform((v) => { - return remap$(v, { - MarkMessageActionAsSeenDto: "markMessageActionAsSeenDto", - }); +export const SubscribersControllerMarkActionAsSeenRequest$inboundSchema: z.ZodType< + SubscribersControllerMarkActionAsSeenRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + messageId: z.string(), + type: z.any().optional(), + subscriberId: z.string(), + MarkMessageActionAsSeenDto: components.MarkMessageActionAsSeenDto$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + MarkMessageActionAsSeenDto: "markMessageActionAsSeenDto", }); + }); - export type Outbound = { - messageId: string; - type: string; - subscriberId: string; - MarkMessageActionAsSeenDto: components.MarkMessageActionAsSeenDto$.Outbound; - }; +/** @internal */ +export type SubscribersControllerMarkActionAsSeenRequest$Outbound = { + messageId: string; + type?: any | undefined; + subscriberId: string; + MarkMessageActionAsSeenDto: components.MarkMessageActionAsSeenDto$Outbound; +}; - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - SubscribersControllerMarkActionAsSeenRequest - > = z - .object({ - messageId: z.string(), - type: z.string(), - subscriberId: z.string(), - markMessageActionAsSeenDto: components.MarkMessageActionAsSeenDto$.outboundSchema, - }) - .transform((v) => { - return remap$(v, { - markMessageActionAsSeenDto: "MarkMessageActionAsSeenDto", - }); +/** @internal */ +export const SubscribersControllerMarkActionAsSeenRequest$outboundSchema: z.ZodType< + SubscribersControllerMarkActionAsSeenRequest$Outbound, + z.ZodTypeDef, + SubscribersControllerMarkActionAsSeenRequest +> = z + .object({ + messageId: z.string(), + type: z.any().optional(), + subscriberId: z.string(), + markMessageActionAsSeenDto: components.MarkMessageActionAsSeenDto$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + markMessageActionAsSeenDto: "MarkMessageActionAsSeenDto", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SubscribersControllerMarkActionAsSeenRequest$ { + /** @deprecated use `SubscribersControllerMarkActionAsSeenRequest$inboundSchema` instead. */ + export const inboundSchema = SubscribersControllerMarkActionAsSeenRequest$inboundSchema; + /** @deprecated use `SubscribersControllerMarkActionAsSeenRequest$outboundSchema` instead. */ + export const outboundSchema = SubscribersControllerMarkActionAsSeenRequest$outboundSchema; + /** @deprecated use `SubscribersControllerMarkActionAsSeenRequest$Outbound` instead. */ + export type Outbound = SubscribersControllerMarkActionAsSeenRequest$Outbound; } diff --git a/src/models/operations/subscriberscontrollermarkallunreadasread.ts b/src/models/operations/subscriberscontrollermarkallunreadasread.ts index cce39abc..2e038109 100644 --- a/src/models/operations/subscriberscontrollermarkallunreadasread.ts +++ b/src/models/operations/subscriberscontrollermarkallunreadasread.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; @@ -12,39 +12,52 @@ export type SubscribersControllerMarkAllUnreadAsReadRequest = { }; /** @internal */ -export namespace SubscribersControllerMarkAllUnreadAsReadRequest$ { - export const inboundSchema: z.ZodType< - SubscribersControllerMarkAllUnreadAsReadRequest, - z.ZodTypeDef, - unknown - > = z - .object({ - subscriberId: z.string(), - MarkAllMessageAsRequestDto: components.MarkAllMessageAsRequestDto$.inboundSchema, - }) - .transform((v) => { - return remap$(v, { - MarkAllMessageAsRequestDto: "markAllMessageAsRequestDto", - }); +export const SubscribersControllerMarkAllUnreadAsReadRequest$inboundSchema: z.ZodType< + SubscribersControllerMarkAllUnreadAsReadRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + subscriberId: z.string(), + MarkAllMessageAsRequestDto: components.MarkAllMessageAsRequestDto$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + MarkAllMessageAsRequestDto: "markAllMessageAsRequestDto", }); + }); - export type Outbound = { - subscriberId: string; - MarkAllMessageAsRequestDto: components.MarkAllMessageAsRequestDto$.Outbound; - }; +/** @internal */ +export type SubscribersControllerMarkAllUnreadAsReadRequest$Outbound = { + subscriberId: string; + MarkAllMessageAsRequestDto: components.MarkAllMessageAsRequestDto$Outbound; +}; - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - SubscribersControllerMarkAllUnreadAsReadRequest - > = z - .object({ - subscriberId: z.string(), - markAllMessageAsRequestDto: components.MarkAllMessageAsRequestDto$.outboundSchema, - }) - .transform((v) => { - return remap$(v, { - markAllMessageAsRequestDto: "MarkAllMessageAsRequestDto", - }); +/** @internal */ +export const SubscribersControllerMarkAllUnreadAsReadRequest$outboundSchema: z.ZodType< + SubscribersControllerMarkAllUnreadAsReadRequest$Outbound, + z.ZodTypeDef, + SubscribersControllerMarkAllUnreadAsReadRequest +> = z + .object({ + subscriberId: z.string(), + markAllMessageAsRequestDto: components.MarkAllMessageAsRequestDto$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + markAllMessageAsRequestDto: "MarkAllMessageAsRequestDto", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SubscribersControllerMarkAllUnreadAsReadRequest$ { + /** @deprecated use `SubscribersControllerMarkAllUnreadAsReadRequest$inboundSchema` instead. */ + export const inboundSchema = SubscribersControllerMarkAllUnreadAsReadRequest$inboundSchema; + /** @deprecated use `SubscribersControllerMarkAllUnreadAsReadRequest$outboundSchema` instead. */ + export const outboundSchema = SubscribersControllerMarkAllUnreadAsReadRequest$outboundSchema; + /** @deprecated use `SubscribersControllerMarkAllUnreadAsReadRequest$Outbound` instead. */ + export type Outbound = SubscribersControllerMarkAllUnreadAsReadRequest$Outbound; } diff --git a/src/models/operations/subscriberscontrollermarkmessagesas.ts b/src/models/operations/subscriberscontrollermarkmessagesas.ts index 1b37793d..efb5a98b 100644 --- a/src/models/operations/subscriberscontrollermarkmessagesas.ts +++ b/src/models/operations/subscriberscontrollermarkmessagesas.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; @@ -12,39 +12,52 @@ export type SubscribersControllerMarkMessagesAsRequest = { }; /** @internal */ -export namespace SubscribersControllerMarkMessagesAsRequest$ { - export const inboundSchema: z.ZodType< - SubscribersControllerMarkMessagesAsRequest, - z.ZodTypeDef, - unknown - > = z - .object({ - subscriberId: z.string(), - MessageMarkAsRequestDto: components.MessageMarkAsRequestDto$.inboundSchema, - }) - .transform((v) => { - return remap$(v, { - MessageMarkAsRequestDto: "messageMarkAsRequestDto", - }); +export const SubscribersControllerMarkMessagesAsRequest$inboundSchema: z.ZodType< + SubscribersControllerMarkMessagesAsRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + subscriberId: z.string(), + MessageMarkAsRequestDto: components.MessageMarkAsRequestDto$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + MessageMarkAsRequestDto: "messageMarkAsRequestDto", }); + }); - export type Outbound = { - subscriberId: string; - MessageMarkAsRequestDto: components.MessageMarkAsRequestDto$.Outbound; - }; +/** @internal */ +export type SubscribersControllerMarkMessagesAsRequest$Outbound = { + subscriberId: string; + MessageMarkAsRequestDto: components.MessageMarkAsRequestDto$Outbound; +}; - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - SubscribersControllerMarkMessagesAsRequest - > = z - .object({ - subscriberId: z.string(), - messageMarkAsRequestDto: components.MessageMarkAsRequestDto$.outboundSchema, - }) - .transform((v) => { - return remap$(v, { - messageMarkAsRequestDto: "MessageMarkAsRequestDto", - }); +/** @internal */ +export const SubscribersControllerMarkMessagesAsRequest$outboundSchema: z.ZodType< + SubscribersControllerMarkMessagesAsRequest$Outbound, + z.ZodTypeDef, + SubscribersControllerMarkMessagesAsRequest +> = z + .object({ + subscriberId: z.string(), + messageMarkAsRequestDto: components.MessageMarkAsRequestDto$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + messageMarkAsRequestDto: "MessageMarkAsRequestDto", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SubscribersControllerMarkMessagesAsRequest$ { + /** @deprecated use `SubscribersControllerMarkMessagesAsRequest$inboundSchema` instead. */ + export const inboundSchema = SubscribersControllerMarkMessagesAsRequest$inboundSchema; + /** @deprecated use `SubscribersControllerMarkMessagesAsRequest$outboundSchema` instead. */ + export const outboundSchema = SubscribersControllerMarkMessagesAsRequest$outboundSchema; + /** @deprecated use `SubscribersControllerMarkMessagesAsRequest$Outbound` instead. */ + export type Outbound = SubscribersControllerMarkMessagesAsRequest$Outbound; } diff --git a/src/models/operations/subscriberscontrollermodifysubscriberchannel.ts b/src/models/operations/subscriberscontrollermodifysubscriberchannel.ts index 877d06e1..da7bb82b 100644 --- a/src/models/operations/subscriberscontrollermodifysubscriberchannel.ts +++ b/src/models/operations/subscriberscontrollermodifysubscriberchannel.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; @@ -12,41 +12,55 @@ export type SubscribersControllerModifySubscriberChannelRequest = { }; /** @internal */ -export namespace SubscribersControllerModifySubscriberChannelRequest$ { - export const inboundSchema: z.ZodType< - SubscribersControllerModifySubscriberChannelRequest, - z.ZodTypeDef, - unknown - > = z - .object({ - subscriberId: z.string(), - UpdateSubscriberChannelRequestDto: - components.UpdateSubscriberChannelRequestDto$.inboundSchema, - }) - .transform((v) => { - return remap$(v, { - UpdateSubscriberChannelRequestDto: "updateSubscriberChannelRequestDto", - }); +export const SubscribersControllerModifySubscriberChannelRequest$inboundSchema: z.ZodType< + SubscribersControllerModifySubscriberChannelRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + subscriberId: z.string(), + UpdateSubscriberChannelRequestDto: + components.UpdateSubscriberChannelRequestDto$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + UpdateSubscriberChannelRequestDto: "updateSubscriberChannelRequestDto", }); + }); - export type Outbound = { - subscriberId: string; - UpdateSubscriberChannelRequestDto: components.UpdateSubscriberChannelRequestDto$.Outbound; - }; +/** @internal */ +export type SubscribersControllerModifySubscriberChannelRequest$Outbound = { + subscriberId: string; + UpdateSubscriberChannelRequestDto: components.UpdateSubscriberChannelRequestDto$Outbound; +}; - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - SubscribersControllerModifySubscriberChannelRequest - > = z - .object({ - subscriberId: z.string(), - updateSubscriberChannelRequestDto: - components.UpdateSubscriberChannelRequestDto$.outboundSchema, - }) - .transform((v) => { - return remap$(v, { - updateSubscriberChannelRequestDto: "UpdateSubscriberChannelRequestDto", - }); +/** @internal */ +export const SubscribersControllerModifySubscriberChannelRequest$outboundSchema: z.ZodType< + SubscribersControllerModifySubscriberChannelRequest$Outbound, + z.ZodTypeDef, + SubscribersControllerModifySubscriberChannelRequest +> = z + .object({ + subscriberId: z.string(), + updateSubscriberChannelRequestDto: + components.UpdateSubscriberChannelRequestDto$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + updateSubscriberChannelRequestDto: "UpdateSubscriberChannelRequestDto", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SubscribersControllerModifySubscriberChannelRequest$ { + /** @deprecated use `SubscribersControllerModifySubscriberChannelRequest$inboundSchema` instead. */ + export const inboundSchema = SubscribersControllerModifySubscriberChannelRequest$inboundSchema; + /** @deprecated use `SubscribersControllerModifySubscriberChannelRequest$outboundSchema` instead. */ + export const outboundSchema = + SubscribersControllerModifySubscriberChannelRequest$outboundSchema; + /** @deprecated use `SubscribersControllerModifySubscriberChannelRequest$Outbound` instead. */ + export type Outbound = SubscribersControllerModifySubscriberChannelRequest$Outbound; } diff --git a/src/models/operations/subscriberscontrollerremovesubscriber.ts b/src/models/operations/subscriberscontrollerremovesubscriber.ts index fd736520..abd4627f 100644 --- a/src/models/operations/subscriberscontrollerremovesubscriber.ts +++ b/src/models/operations/subscriberscontrollerremovesubscriber.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -9,24 +9,37 @@ export type SubscribersControllerRemoveSubscriberRequest = { }; /** @internal */ -export namespace SubscribersControllerRemoveSubscriberRequest$ { - export const inboundSchema: z.ZodType< - SubscribersControllerRemoveSubscriberRequest, - z.ZodTypeDef, - unknown - > = z.object({ - subscriberId: z.string(), - }); +export const SubscribersControllerRemoveSubscriberRequest$inboundSchema: z.ZodType< + SubscribersControllerRemoveSubscriberRequest, + z.ZodTypeDef, + unknown +> = z.object({ + subscriberId: z.string(), +}); + +/** @internal */ +export type SubscribersControllerRemoveSubscriberRequest$Outbound = { + subscriberId: string; +}; - export type Outbound = { - subscriberId: string; - }; +/** @internal */ +export const SubscribersControllerRemoveSubscriberRequest$outboundSchema: z.ZodType< + SubscribersControllerRemoveSubscriberRequest$Outbound, + z.ZodTypeDef, + SubscribersControllerRemoveSubscriberRequest +> = z.object({ + subscriberId: z.string(), +}); - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - SubscribersControllerRemoveSubscriberRequest - > = z.object({ - subscriberId: z.string(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SubscribersControllerRemoveSubscriberRequest$ { + /** @deprecated use `SubscribersControllerRemoveSubscriberRequest$inboundSchema` instead. */ + export const inboundSchema = SubscribersControllerRemoveSubscriberRequest$inboundSchema; + /** @deprecated use `SubscribersControllerRemoveSubscriberRequest$outboundSchema` instead. */ + export const outboundSchema = SubscribersControllerRemoveSubscriberRequest$outboundSchema; + /** @deprecated use `SubscribersControllerRemoveSubscriberRequest$Outbound` instead. */ + export type Outbound = SubscribersControllerRemoveSubscriberRequest$Outbound; } diff --git a/src/models/operations/subscriberscontrollerupdatesubscriber.ts b/src/models/operations/subscriberscontrollerupdatesubscriber.ts index f3963479..ad4eaa9b 100644 --- a/src/models/operations/subscriberscontrollerupdatesubscriber.ts +++ b/src/models/operations/subscriberscontrollerupdatesubscriber.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; @@ -12,39 +12,52 @@ export type SubscribersControllerUpdateSubscriberRequest = { }; /** @internal */ -export namespace SubscribersControllerUpdateSubscriberRequest$ { - export const inboundSchema: z.ZodType< - SubscribersControllerUpdateSubscriberRequest, - z.ZodTypeDef, - unknown - > = z - .object({ - subscriberId: z.string(), - UpdateSubscriberRequestDto: components.UpdateSubscriberRequestDto$.inboundSchema, - }) - .transform((v) => { - return remap$(v, { - UpdateSubscriberRequestDto: "updateSubscriberRequestDto", - }); +export const SubscribersControllerUpdateSubscriberRequest$inboundSchema: z.ZodType< + SubscribersControllerUpdateSubscriberRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + subscriberId: z.string(), + UpdateSubscriberRequestDto: components.UpdateSubscriberRequestDto$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + UpdateSubscriberRequestDto: "updateSubscriberRequestDto", }); + }); - export type Outbound = { - subscriberId: string; - UpdateSubscriberRequestDto: components.UpdateSubscriberRequestDto$.Outbound; - }; +/** @internal */ +export type SubscribersControllerUpdateSubscriberRequest$Outbound = { + subscriberId: string; + UpdateSubscriberRequestDto: components.UpdateSubscriberRequestDto$Outbound; +}; - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - SubscribersControllerUpdateSubscriberRequest - > = z - .object({ - subscriberId: z.string(), - updateSubscriberRequestDto: components.UpdateSubscriberRequestDto$.outboundSchema, - }) - .transform((v) => { - return remap$(v, { - updateSubscriberRequestDto: "UpdateSubscriberRequestDto", - }); +/** @internal */ +export const SubscribersControllerUpdateSubscriberRequest$outboundSchema: z.ZodType< + SubscribersControllerUpdateSubscriberRequest$Outbound, + z.ZodTypeDef, + SubscribersControllerUpdateSubscriberRequest +> = z + .object({ + subscriberId: z.string(), + updateSubscriberRequestDto: components.UpdateSubscriberRequestDto$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + updateSubscriberRequestDto: "UpdateSubscriberRequestDto", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SubscribersControllerUpdateSubscriberRequest$ { + /** @deprecated use `SubscribersControllerUpdateSubscriberRequest$inboundSchema` instead. */ + export const inboundSchema = SubscribersControllerUpdateSubscriberRequest$inboundSchema; + /** @deprecated use `SubscribersControllerUpdateSubscriberRequest$outboundSchema` instead. */ + export const outboundSchema = SubscribersControllerUpdateSubscriberRequest$outboundSchema; + /** @deprecated use `SubscribersControllerUpdateSubscriberRequest$Outbound` instead. */ + export type Outbound = SubscribersControllerUpdateSubscriberRequest$Outbound; } diff --git a/src/models/operations/subscriberscontrollerupdatesubscriberchannel.ts b/src/models/operations/subscriberscontrollerupdatesubscriberchannel.ts index 886f633a..0c8b4115 100644 --- a/src/models/operations/subscriberscontrollerupdatesubscriberchannel.ts +++ b/src/models/operations/subscriberscontrollerupdatesubscriberchannel.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; @@ -12,41 +12,55 @@ export type SubscribersControllerUpdateSubscriberChannelRequest = { }; /** @internal */ -export namespace SubscribersControllerUpdateSubscriberChannelRequest$ { - export const inboundSchema: z.ZodType< - SubscribersControllerUpdateSubscriberChannelRequest, - z.ZodTypeDef, - unknown - > = z - .object({ - subscriberId: z.string(), - UpdateSubscriberChannelRequestDto: - components.UpdateSubscriberChannelRequestDto$.inboundSchema, - }) - .transform((v) => { - return remap$(v, { - UpdateSubscriberChannelRequestDto: "updateSubscriberChannelRequestDto", - }); +export const SubscribersControllerUpdateSubscriberChannelRequest$inboundSchema: z.ZodType< + SubscribersControllerUpdateSubscriberChannelRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + subscriberId: z.string(), + UpdateSubscriberChannelRequestDto: + components.UpdateSubscriberChannelRequestDto$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + UpdateSubscriberChannelRequestDto: "updateSubscriberChannelRequestDto", }); + }); - export type Outbound = { - subscriberId: string; - UpdateSubscriberChannelRequestDto: components.UpdateSubscriberChannelRequestDto$.Outbound; - }; +/** @internal */ +export type SubscribersControllerUpdateSubscriberChannelRequest$Outbound = { + subscriberId: string; + UpdateSubscriberChannelRequestDto: components.UpdateSubscriberChannelRequestDto$Outbound; +}; - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - SubscribersControllerUpdateSubscriberChannelRequest - > = z - .object({ - subscriberId: z.string(), - updateSubscriberChannelRequestDto: - components.UpdateSubscriberChannelRequestDto$.outboundSchema, - }) - .transform((v) => { - return remap$(v, { - updateSubscriberChannelRequestDto: "UpdateSubscriberChannelRequestDto", - }); +/** @internal */ +export const SubscribersControllerUpdateSubscriberChannelRequest$outboundSchema: z.ZodType< + SubscribersControllerUpdateSubscriberChannelRequest$Outbound, + z.ZodTypeDef, + SubscribersControllerUpdateSubscriberChannelRequest +> = z + .object({ + subscriberId: z.string(), + updateSubscriberChannelRequestDto: + components.UpdateSubscriberChannelRequestDto$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + updateSubscriberChannelRequestDto: "UpdateSubscriberChannelRequestDto", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SubscribersControllerUpdateSubscriberChannelRequest$ { + /** @deprecated use `SubscribersControllerUpdateSubscriberChannelRequest$inboundSchema` instead. */ + export const inboundSchema = SubscribersControllerUpdateSubscriberChannelRequest$inboundSchema; + /** @deprecated use `SubscribersControllerUpdateSubscriberChannelRequest$outboundSchema` instead. */ + export const outboundSchema = + SubscribersControllerUpdateSubscriberChannelRequest$outboundSchema; + /** @deprecated use `SubscribersControllerUpdateSubscriberChannelRequest$Outbound` instead. */ + export type Outbound = SubscribersControllerUpdateSubscriberChannelRequest$Outbound; } diff --git a/src/models/operations/subscriberscontrollerupdatesubscriberglobalpreferences.ts b/src/models/operations/subscriberscontrollerupdatesubscriberglobalpreferences.ts index 26202875..76f7f7d5 100644 --- a/src/models/operations/subscriberscontrollerupdatesubscriberglobalpreferences.ts +++ b/src/models/operations/subscriberscontrollerupdatesubscriberglobalpreferences.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; @@ -12,43 +12,58 @@ export type SubscribersControllerUpdateSubscriberGlobalPreferencesRequest = { }; /** @internal */ -export namespace SubscribersControllerUpdateSubscriberGlobalPreferencesRequest$ { - export const inboundSchema: z.ZodType< - SubscribersControllerUpdateSubscriberGlobalPreferencesRequest, - z.ZodTypeDef, - unknown - > = z - .object({ - subscriberId: z.string(), +export const SubscribersControllerUpdateSubscriberGlobalPreferencesRequest$inboundSchema: z.ZodType< + SubscribersControllerUpdateSubscriberGlobalPreferencesRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + subscriberId: z.string(), + UpdateSubscriberGlobalPreferencesRequestDto: + components.UpdateSubscriberGlobalPreferencesRequestDto$inboundSchema, + }) + .transform((v) => { + return remap$(v, { UpdateSubscriberGlobalPreferencesRequestDto: - components.UpdateSubscriberGlobalPreferencesRequestDto$.inboundSchema, - }) - .transform((v) => { - return remap$(v, { - UpdateSubscriberGlobalPreferencesRequestDto: - "updateSubscriberGlobalPreferencesRequestDto", - }); + "updateSubscriberGlobalPreferencesRequestDto", }); + }); - export type Outbound = { - subscriberId: string; - UpdateSubscriberGlobalPreferencesRequestDto: components.UpdateSubscriberGlobalPreferencesRequestDto$.Outbound; - }; +/** @internal */ +export type SubscribersControllerUpdateSubscriberGlobalPreferencesRequest$Outbound = { + subscriberId: string; + UpdateSubscriberGlobalPreferencesRequestDto: components.UpdateSubscriberGlobalPreferencesRequestDto$Outbound; +}; - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - SubscribersControllerUpdateSubscriberGlobalPreferencesRequest - > = z - .object({ - subscriberId: z.string(), +/** @internal */ +export const SubscribersControllerUpdateSubscriberGlobalPreferencesRequest$outboundSchema: z.ZodType< + SubscribersControllerUpdateSubscriberGlobalPreferencesRequest$Outbound, + z.ZodTypeDef, + SubscribersControllerUpdateSubscriberGlobalPreferencesRequest +> = z + .object({ + subscriberId: z.string(), + updateSubscriberGlobalPreferencesRequestDto: + components.UpdateSubscriberGlobalPreferencesRequestDto$outboundSchema, + }) + .transform((v) => { + return remap$(v, { updateSubscriberGlobalPreferencesRequestDto: - components.UpdateSubscriberGlobalPreferencesRequestDto$.outboundSchema, - }) - .transform((v) => { - return remap$(v, { - updateSubscriberGlobalPreferencesRequestDto: - "UpdateSubscriberGlobalPreferencesRequestDto", - }); + "UpdateSubscriberGlobalPreferencesRequestDto", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SubscribersControllerUpdateSubscriberGlobalPreferencesRequest$ { + /** @deprecated use `SubscribersControllerUpdateSubscriberGlobalPreferencesRequest$inboundSchema` instead. */ + export const inboundSchema = + SubscribersControllerUpdateSubscriberGlobalPreferencesRequest$inboundSchema; + /** @deprecated use `SubscribersControllerUpdateSubscriberGlobalPreferencesRequest$outboundSchema` instead. */ + export const outboundSchema = + SubscribersControllerUpdateSubscriberGlobalPreferencesRequest$outboundSchema; + /** @deprecated use `SubscribersControllerUpdateSubscriberGlobalPreferencesRequest$Outbound` instead. */ + export type Outbound = SubscribersControllerUpdateSubscriberGlobalPreferencesRequest$Outbound; } diff --git a/src/models/operations/subscriberscontrollerupdatesubscriberonlineflag.ts b/src/models/operations/subscriberscontrollerupdatesubscriberonlineflag.ts index a5e70d1c..36d2d728 100644 --- a/src/models/operations/subscriberscontrollerupdatesubscriberonlineflag.ts +++ b/src/models/operations/subscriberscontrollerupdatesubscriberonlineflag.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; @@ -12,41 +12,56 @@ export type SubscribersControllerUpdateSubscriberOnlineFlagRequest = { }; /** @internal */ -export namespace SubscribersControllerUpdateSubscriberOnlineFlagRequest$ { - export const inboundSchema: z.ZodType< - SubscribersControllerUpdateSubscriberOnlineFlagRequest, - z.ZodTypeDef, - unknown - > = z - .object({ - subscriberId: z.string(), - UpdateSubscriberOnlineFlagRequestDto: - components.UpdateSubscriberOnlineFlagRequestDto$.inboundSchema, - }) - .transform((v) => { - return remap$(v, { - UpdateSubscriberOnlineFlagRequestDto: "updateSubscriberOnlineFlagRequestDto", - }); +export const SubscribersControllerUpdateSubscriberOnlineFlagRequest$inboundSchema: z.ZodType< + SubscribersControllerUpdateSubscriberOnlineFlagRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + subscriberId: z.string(), + UpdateSubscriberOnlineFlagRequestDto: + components.UpdateSubscriberOnlineFlagRequestDto$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + UpdateSubscriberOnlineFlagRequestDto: "updateSubscriberOnlineFlagRequestDto", }); + }); - export type Outbound = { - subscriberId: string; - UpdateSubscriberOnlineFlagRequestDto: components.UpdateSubscriberOnlineFlagRequestDto$.Outbound; - }; +/** @internal */ +export type SubscribersControllerUpdateSubscriberOnlineFlagRequest$Outbound = { + subscriberId: string; + UpdateSubscriberOnlineFlagRequestDto: components.UpdateSubscriberOnlineFlagRequestDto$Outbound; +}; - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - SubscribersControllerUpdateSubscriberOnlineFlagRequest - > = z - .object({ - subscriberId: z.string(), - updateSubscriberOnlineFlagRequestDto: - components.UpdateSubscriberOnlineFlagRequestDto$.outboundSchema, - }) - .transform((v) => { - return remap$(v, { - updateSubscriberOnlineFlagRequestDto: "UpdateSubscriberOnlineFlagRequestDto", - }); +/** @internal */ +export const SubscribersControllerUpdateSubscriberOnlineFlagRequest$outboundSchema: z.ZodType< + SubscribersControllerUpdateSubscriberOnlineFlagRequest$Outbound, + z.ZodTypeDef, + SubscribersControllerUpdateSubscriberOnlineFlagRequest +> = z + .object({ + subscriberId: z.string(), + updateSubscriberOnlineFlagRequestDto: + components.UpdateSubscriberOnlineFlagRequestDto$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + updateSubscriberOnlineFlagRequestDto: "UpdateSubscriberOnlineFlagRequestDto", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SubscribersControllerUpdateSubscriberOnlineFlagRequest$ { + /** @deprecated use `SubscribersControllerUpdateSubscriberOnlineFlagRequest$inboundSchema` instead. */ + export const inboundSchema = + SubscribersControllerUpdateSubscriberOnlineFlagRequest$inboundSchema; + /** @deprecated use `SubscribersControllerUpdateSubscriberOnlineFlagRequest$outboundSchema` instead. */ + export const outboundSchema = + SubscribersControllerUpdateSubscriberOnlineFlagRequest$outboundSchema; + /** @deprecated use `SubscribersControllerUpdateSubscriberOnlineFlagRequest$Outbound` instead. */ + export type Outbound = SubscribersControllerUpdateSubscriberOnlineFlagRequest$Outbound; } diff --git a/src/models/operations/subscriberscontrollerupdatesubscriberpreference.ts b/src/models/operations/subscriberscontrollerupdatesubscriberpreference.ts index 85f71fd7..d9ad51db 100644 --- a/src/models/operations/subscriberscontrollerupdatesubscriberpreference.ts +++ b/src/models/operations/subscriberscontrollerupdatesubscriberpreference.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; @@ -13,44 +13,59 @@ export type SubscribersControllerUpdateSubscriberPreferenceRequest = { }; /** @internal */ -export namespace SubscribersControllerUpdateSubscriberPreferenceRequest$ { - export const inboundSchema: z.ZodType< - SubscribersControllerUpdateSubscriberPreferenceRequest, - z.ZodTypeDef, - unknown - > = z - .object({ - subscriberId: z.string(), - parameter: z.string(), - UpdateSubscriberPreferenceRequestDto: - components.UpdateSubscriberPreferenceRequestDto$.inboundSchema, - }) - .transform((v) => { - return remap$(v, { - UpdateSubscriberPreferenceRequestDto: "updateSubscriberPreferenceRequestDto", - }); +export const SubscribersControllerUpdateSubscriberPreferenceRequest$inboundSchema: z.ZodType< + SubscribersControllerUpdateSubscriberPreferenceRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + subscriberId: z.string(), + parameter: z.string(), + UpdateSubscriberPreferenceRequestDto: + components.UpdateSubscriberPreferenceRequestDto$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + UpdateSubscriberPreferenceRequestDto: "updateSubscriberPreferenceRequestDto", }); + }); - export type Outbound = { - subscriberId: string; - parameter: string; - UpdateSubscriberPreferenceRequestDto: components.UpdateSubscriberPreferenceRequestDto$.Outbound; - }; +/** @internal */ +export type SubscribersControllerUpdateSubscriberPreferenceRequest$Outbound = { + subscriberId: string; + parameter: string; + UpdateSubscriberPreferenceRequestDto: components.UpdateSubscriberPreferenceRequestDto$Outbound; +}; - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - SubscribersControllerUpdateSubscriberPreferenceRequest - > = z - .object({ - subscriberId: z.string(), - parameter: z.string(), - updateSubscriberPreferenceRequestDto: - components.UpdateSubscriberPreferenceRequestDto$.outboundSchema, - }) - .transform((v) => { - return remap$(v, { - updateSubscriberPreferenceRequestDto: "UpdateSubscriberPreferenceRequestDto", - }); +/** @internal */ +export const SubscribersControllerUpdateSubscriberPreferenceRequest$outboundSchema: z.ZodType< + SubscribersControllerUpdateSubscriberPreferenceRequest$Outbound, + z.ZodTypeDef, + SubscribersControllerUpdateSubscriberPreferenceRequest +> = z + .object({ + subscriberId: z.string(), + parameter: z.string(), + updateSubscriberPreferenceRequestDto: + components.UpdateSubscriberPreferenceRequestDto$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + updateSubscriberPreferenceRequestDto: "UpdateSubscriberPreferenceRequestDto", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SubscribersControllerUpdateSubscriberPreferenceRequest$ { + /** @deprecated use `SubscribersControllerUpdateSubscriberPreferenceRequest$inboundSchema` instead. */ + export const inboundSchema = + SubscribersControllerUpdateSubscriberPreferenceRequest$inboundSchema; + /** @deprecated use `SubscribersControllerUpdateSubscriberPreferenceRequest$outboundSchema` instead. */ + export const outboundSchema = + SubscribersControllerUpdateSubscriberPreferenceRequest$outboundSchema; + /** @deprecated use `SubscribersControllerUpdateSubscriberPreferenceRequest$Outbound` instead. */ + export type Outbound = SubscribersControllerUpdateSubscriberPreferenceRequest$Outbound; } diff --git a/src/models/operations/tenantcontrollergettenantbyid.ts b/src/models/operations/tenantcontrollergettenantbyid.ts index fa21cc51..e6b3eeab 100644 --- a/src/models/operations/tenantcontrollergettenantbyid.ts +++ b/src/models/operations/tenantcontrollergettenantbyid.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -9,24 +9,37 @@ export type TenantControllerGetTenantByIdRequest = { }; /** @internal */ -export namespace TenantControllerGetTenantByIdRequest$ { - export const inboundSchema: z.ZodType< - TenantControllerGetTenantByIdRequest, - z.ZodTypeDef, - unknown - > = z.object({ - identifier: z.string(), - }); +export const TenantControllerGetTenantByIdRequest$inboundSchema: z.ZodType< + TenantControllerGetTenantByIdRequest, + z.ZodTypeDef, + unknown +> = z.object({ + identifier: z.string(), +}); + +/** @internal */ +export type TenantControllerGetTenantByIdRequest$Outbound = { + identifier: string; +}; - export type Outbound = { - identifier: string; - }; +/** @internal */ +export const TenantControllerGetTenantByIdRequest$outboundSchema: z.ZodType< + TenantControllerGetTenantByIdRequest$Outbound, + z.ZodTypeDef, + TenantControllerGetTenantByIdRequest +> = z.object({ + identifier: z.string(), +}); - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - TenantControllerGetTenantByIdRequest - > = z.object({ - identifier: z.string(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace TenantControllerGetTenantByIdRequest$ { + /** @deprecated use `TenantControllerGetTenantByIdRequest$inboundSchema` instead. */ + export const inboundSchema = TenantControllerGetTenantByIdRequest$inboundSchema; + /** @deprecated use `TenantControllerGetTenantByIdRequest$outboundSchema` instead. */ + export const outboundSchema = TenantControllerGetTenantByIdRequest$outboundSchema; + /** @deprecated use `TenantControllerGetTenantByIdRequest$Outbound` instead. */ + export type Outbound = TenantControllerGetTenantByIdRequest$Outbound; } diff --git a/src/models/operations/tenantcontrollerlisttenants.ts b/src/models/operations/tenantcontrollerlisttenants.ts index da420e6e..e2ba3485 100644 --- a/src/models/operations/tenantcontrollerlisttenants.ts +++ b/src/models/operations/tenantcontrollerlisttenants.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; @@ -32,94 +32,133 @@ export type TenantControllerListTenantsResponse = { }; /** @internal */ -export namespace TenantControllerListTenantsRequest$ { - export const inboundSchema: z.ZodType< - TenantControllerListTenantsRequest, - z.ZodTypeDef, - unknown - > = z.object({ - page: z.number().optional(), - limit: z.number().default(10), - }); +export const TenantControllerListTenantsRequest$inboundSchema: z.ZodType< + TenantControllerListTenantsRequest, + z.ZodTypeDef, + unknown +> = z.object({ + page: z.number().optional(), + limit: z.number().default(10), +}); - export type Outbound = { - page?: number | undefined; - limit: number; - }; - - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - TenantControllerListTenantsRequest - > = z.object({ - page: z.number().optional(), - limit: z.number().default(10), - }); +/** @internal */ +export type TenantControllerListTenantsRequest$Outbound = { + page?: number | undefined; + limit: number; +}; + +/** @internal */ +export const TenantControllerListTenantsRequest$outboundSchema: z.ZodType< + TenantControllerListTenantsRequest$Outbound, + z.ZodTypeDef, + TenantControllerListTenantsRequest +> = z.object({ + page: z.number().optional(), + limit: z.number().default(10), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace TenantControllerListTenantsRequest$ { + /** @deprecated use `TenantControllerListTenantsRequest$inboundSchema` instead. */ + export const inboundSchema = TenantControllerListTenantsRequest$inboundSchema; + /** @deprecated use `TenantControllerListTenantsRequest$outboundSchema` instead. */ + export const outboundSchema = TenantControllerListTenantsRequest$outboundSchema; + /** @deprecated use `TenantControllerListTenantsRequest$Outbound` instead. */ + export type Outbound = TenantControllerListTenantsRequest$Outbound; } /** @internal */ -export namespace TenantControllerListTenantsResponseBody$ { - export const inboundSchema: z.ZodType< - TenantControllerListTenantsResponseBody, - z.ZodTypeDef, - unknown - > = z.object({ - data: z.array(components.GetTenantResponseDto$.inboundSchema), - hasMore: z.boolean(), - page: z.number(), - pageSize: z.number(), - }); +export const TenantControllerListTenantsResponseBody$inboundSchema: z.ZodType< + TenantControllerListTenantsResponseBody, + z.ZodTypeDef, + unknown +> = z.object({ + data: z.array(components.GetTenantResponseDto$inboundSchema), + hasMore: z.boolean(), + page: z.number(), + pageSize: z.number(), +}); - export type Outbound = { - data: Array; - hasMore: boolean; - page: number; - pageSize: number; - }; - - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - TenantControllerListTenantsResponseBody - > = z.object({ - data: z.array(components.GetTenantResponseDto$.outboundSchema), - hasMore: z.boolean(), - page: z.number(), - pageSize: z.number(), - }); +/** @internal */ +export type TenantControllerListTenantsResponseBody$Outbound = { + data: Array; + hasMore: boolean; + page: number; + pageSize: number; +}; + +/** @internal */ +export const TenantControllerListTenantsResponseBody$outboundSchema: z.ZodType< + TenantControllerListTenantsResponseBody$Outbound, + z.ZodTypeDef, + TenantControllerListTenantsResponseBody +> = z.object({ + data: z.array(components.GetTenantResponseDto$outboundSchema), + hasMore: z.boolean(), + page: z.number(), + pageSize: z.number(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace TenantControllerListTenantsResponseBody$ { + /** @deprecated use `TenantControllerListTenantsResponseBody$inboundSchema` instead. */ + export const inboundSchema = TenantControllerListTenantsResponseBody$inboundSchema; + /** @deprecated use `TenantControllerListTenantsResponseBody$outboundSchema` instead. */ + export const outboundSchema = TenantControllerListTenantsResponseBody$outboundSchema; + /** @deprecated use `TenantControllerListTenantsResponseBody$Outbound` instead. */ + export type Outbound = TenantControllerListTenantsResponseBody$Outbound; } /** @internal */ -export namespace TenantControllerListTenantsResponse$ { - export const inboundSchema: z.ZodType< - TenantControllerListTenantsResponse, - z.ZodTypeDef, - unknown - > = z - .object({ - Result: z.lazy(() => TenantControllerListTenantsResponseBody$.inboundSchema), - }) - .transform((v) => { - return remap$(v, { - Result: "result", - }); +export const TenantControllerListTenantsResponse$inboundSchema: z.ZodType< + TenantControllerListTenantsResponse, + z.ZodTypeDef, + unknown +> = z + .object({ + Result: z.lazy(() => TenantControllerListTenantsResponseBody$inboundSchema), + }) + .transform((v) => { + return remap$(v, { + Result: "result", }); + }); - export type Outbound = { - Result: TenantControllerListTenantsResponseBody$.Outbound; - }; - - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - TenantControllerListTenantsResponse - > = z - .object({ - result: z.lazy(() => TenantControllerListTenantsResponseBody$.outboundSchema), - }) - .transform((v) => { - return remap$(v, { - result: "Result", - }); +/** @internal */ +export type TenantControllerListTenantsResponse$Outbound = { + Result: TenantControllerListTenantsResponseBody$Outbound; +}; + +/** @internal */ +export const TenantControllerListTenantsResponse$outboundSchema: z.ZodType< + TenantControllerListTenantsResponse$Outbound, + z.ZodTypeDef, + TenantControllerListTenantsResponse +> = z + .object({ + result: z.lazy(() => TenantControllerListTenantsResponseBody$outboundSchema), + }) + .transform((v) => { + return remap$(v, { + result: "Result", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace TenantControllerListTenantsResponse$ { + /** @deprecated use `TenantControllerListTenantsResponse$inboundSchema` instead. */ + export const inboundSchema = TenantControllerListTenantsResponse$inboundSchema; + /** @deprecated use `TenantControllerListTenantsResponse$outboundSchema` instead. */ + export const outboundSchema = TenantControllerListTenantsResponse$outboundSchema; + /** @deprecated use `TenantControllerListTenantsResponse$Outbound` instead. */ + export type Outbound = TenantControllerListTenantsResponse$Outbound; } diff --git a/src/models/operations/tenantcontrollerremovetenant.ts b/src/models/operations/tenantcontrollerremovetenant.ts index bd6c94d2..ac7b0c03 100644 --- a/src/models/operations/tenantcontrollerremovetenant.ts +++ b/src/models/operations/tenantcontrollerremovetenant.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -9,24 +9,37 @@ export type TenantControllerRemoveTenantRequest = { }; /** @internal */ -export namespace TenantControllerRemoveTenantRequest$ { - export const inboundSchema: z.ZodType< - TenantControllerRemoveTenantRequest, - z.ZodTypeDef, - unknown - > = z.object({ - identifier: z.string(), - }); +export const TenantControllerRemoveTenantRequest$inboundSchema: z.ZodType< + TenantControllerRemoveTenantRequest, + z.ZodTypeDef, + unknown +> = z.object({ + identifier: z.string(), +}); + +/** @internal */ +export type TenantControllerRemoveTenantRequest$Outbound = { + identifier: string; +}; - export type Outbound = { - identifier: string; - }; +/** @internal */ +export const TenantControllerRemoveTenantRequest$outboundSchema: z.ZodType< + TenantControllerRemoveTenantRequest$Outbound, + z.ZodTypeDef, + TenantControllerRemoveTenantRequest +> = z.object({ + identifier: z.string(), +}); - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - TenantControllerRemoveTenantRequest - > = z.object({ - identifier: z.string(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace TenantControllerRemoveTenantRequest$ { + /** @deprecated use `TenantControllerRemoveTenantRequest$inboundSchema` instead. */ + export const inboundSchema = TenantControllerRemoveTenantRequest$inboundSchema; + /** @deprecated use `TenantControllerRemoveTenantRequest$outboundSchema` instead. */ + export const outboundSchema = TenantControllerRemoveTenantRequest$outboundSchema; + /** @deprecated use `TenantControllerRemoveTenantRequest$Outbound` instead. */ + export type Outbound = TenantControllerRemoveTenantRequest$Outbound; } diff --git a/src/models/operations/tenantcontrollerupdatetenant.ts b/src/models/operations/tenantcontrollerupdatetenant.ts index 1218b736..f3daec24 100644 --- a/src/models/operations/tenantcontrollerupdatetenant.ts +++ b/src/models/operations/tenantcontrollerupdatetenant.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; @@ -12,39 +12,52 @@ export type TenantControllerUpdateTenantRequest = { }; /** @internal */ -export namespace TenantControllerUpdateTenantRequest$ { - export const inboundSchema: z.ZodType< - TenantControllerUpdateTenantRequest, - z.ZodTypeDef, - unknown - > = z - .object({ - identifier: z.string(), - UpdateTenantRequestDto: components.UpdateTenantRequestDto$.inboundSchema, - }) - .transform((v) => { - return remap$(v, { - UpdateTenantRequestDto: "updateTenantRequestDto", - }); +export const TenantControllerUpdateTenantRequest$inboundSchema: z.ZodType< + TenantControllerUpdateTenantRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + identifier: z.string(), + UpdateTenantRequestDto: components.UpdateTenantRequestDto$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + UpdateTenantRequestDto: "updateTenantRequestDto", }); + }); - export type Outbound = { - identifier: string; - UpdateTenantRequestDto: components.UpdateTenantRequestDto$.Outbound; - }; +/** @internal */ +export type TenantControllerUpdateTenantRequest$Outbound = { + identifier: string; + UpdateTenantRequestDto: components.UpdateTenantRequestDto$Outbound; +}; - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - TenantControllerUpdateTenantRequest - > = z - .object({ - identifier: z.string(), - updateTenantRequestDto: components.UpdateTenantRequestDto$.outboundSchema, - }) - .transform((v) => { - return remap$(v, { - updateTenantRequestDto: "UpdateTenantRequestDto", - }); +/** @internal */ +export const TenantControllerUpdateTenantRequest$outboundSchema: z.ZodType< + TenantControllerUpdateTenantRequest$Outbound, + z.ZodTypeDef, + TenantControllerUpdateTenantRequest +> = z + .object({ + identifier: z.string(), + updateTenantRequestDto: components.UpdateTenantRequestDto$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + updateTenantRequestDto: "UpdateTenantRequestDto", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace TenantControllerUpdateTenantRequest$ { + /** @deprecated use `TenantControllerUpdateTenantRequest$inboundSchema` instead. */ + export const inboundSchema = TenantControllerUpdateTenantRequest$inboundSchema; + /** @deprecated use `TenantControllerUpdateTenantRequest$outboundSchema` instead. */ + export const outboundSchema = TenantControllerUpdateTenantRequest$outboundSchema; + /** @deprecated use `TenantControllerUpdateTenantRequest$Outbound` instead. */ + export type Outbound = TenantControllerUpdateTenantRequest$Outbound; } diff --git a/src/models/operations/topicscontrolleraddsubscribers.ts b/src/models/operations/topicscontrolleraddsubscribers.ts index 6fca8f40..579b55b7 100644 --- a/src/models/operations/topicscontrolleraddsubscribers.ts +++ b/src/models/operations/topicscontrolleraddsubscribers.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; @@ -7,44 +7,60 @@ import * as components from "../components/index.js"; import * as z from "zod"; export type TopicsControllerAddSubscribersRequest = { + /** + * The topic key + */ topicKey: string; addSubscribersRequestDto: components.AddSubscribersRequestDto; }; /** @internal */ -export namespace TopicsControllerAddSubscribersRequest$ { - export const inboundSchema: z.ZodType< - TopicsControllerAddSubscribersRequest, - z.ZodTypeDef, - unknown - > = z - .object({ - topicKey: z.string(), - AddSubscribersRequestDto: components.AddSubscribersRequestDto$.inboundSchema, - }) - .transform((v) => { - return remap$(v, { - AddSubscribersRequestDto: "addSubscribersRequestDto", - }); +export const TopicsControllerAddSubscribersRequest$inboundSchema: z.ZodType< + TopicsControllerAddSubscribersRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + topicKey: z.string(), + AddSubscribersRequestDto: components.AddSubscribersRequestDto$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + AddSubscribersRequestDto: "addSubscribersRequestDto", }); + }); - export type Outbound = { - topicKey: string; - AddSubscribersRequestDto: components.AddSubscribersRequestDto$.Outbound; - }; +/** @internal */ +export type TopicsControllerAddSubscribersRequest$Outbound = { + topicKey: string; + AddSubscribersRequestDto: components.AddSubscribersRequestDto$Outbound; +}; - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - TopicsControllerAddSubscribersRequest - > = z - .object({ - topicKey: z.string(), - addSubscribersRequestDto: components.AddSubscribersRequestDto$.outboundSchema, - }) - .transform((v) => { - return remap$(v, { - addSubscribersRequestDto: "AddSubscribersRequestDto", - }); +/** @internal */ +export const TopicsControllerAddSubscribersRequest$outboundSchema: z.ZodType< + TopicsControllerAddSubscribersRequest$Outbound, + z.ZodTypeDef, + TopicsControllerAddSubscribersRequest +> = z + .object({ + topicKey: z.string(), + addSubscribersRequestDto: components.AddSubscribersRequestDto$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + addSubscribersRequestDto: "AddSubscribersRequestDto", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace TopicsControllerAddSubscribersRequest$ { + /** @deprecated use `TopicsControllerAddSubscribersRequest$inboundSchema` instead. */ + export const inboundSchema = TopicsControllerAddSubscribersRequest$inboundSchema; + /** @deprecated use `TopicsControllerAddSubscribersRequest$outboundSchema` instead. */ + export const outboundSchema = TopicsControllerAddSubscribersRequest$outboundSchema; + /** @deprecated use `TopicsControllerAddSubscribersRequest$Outbound` instead. */ + export type Outbound = TopicsControllerAddSubscribersRequest$Outbound; } diff --git a/src/models/operations/topicscontrollerdeletetopic.ts b/src/models/operations/topicscontrollerdeletetopic.ts index 495c2069..3e6ab31b 100644 --- a/src/models/operations/topicscontrollerdeletetopic.ts +++ b/src/models/operations/topicscontrollerdeletetopic.ts @@ -1,32 +1,48 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; export type TopicsControllerDeleteTopicRequest = { + /** + * The topic key + */ topicKey: string; }; /** @internal */ -export namespace TopicsControllerDeleteTopicRequest$ { - export const inboundSchema: z.ZodType< - TopicsControllerDeleteTopicRequest, - z.ZodTypeDef, - unknown - > = z.object({ - topicKey: z.string(), - }); +export const TopicsControllerDeleteTopicRequest$inboundSchema: z.ZodType< + TopicsControllerDeleteTopicRequest, + z.ZodTypeDef, + unknown +> = z.object({ + topicKey: z.string(), +}); + +/** @internal */ +export type TopicsControllerDeleteTopicRequest$Outbound = { + topicKey: string; +}; - export type Outbound = { - topicKey: string; - }; +/** @internal */ +export const TopicsControllerDeleteTopicRequest$outboundSchema: z.ZodType< + TopicsControllerDeleteTopicRequest$Outbound, + z.ZodTypeDef, + TopicsControllerDeleteTopicRequest +> = z.object({ + topicKey: z.string(), +}); - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - TopicsControllerDeleteTopicRequest - > = z.object({ - topicKey: z.string(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace TopicsControllerDeleteTopicRequest$ { + /** @deprecated use `TopicsControllerDeleteTopicRequest$inboundSchema` instead. */ + export const inboundSchema = TopicsControllerDeleteTopicRequest$inboundSchema; + /** @deprecated use `TopicsControllerDeleteTopicRequest$outboundSchema` instead. */ + export const outboundSchema = TopicsControllerDeleteTopicRequest$outboundSchema; + /** @deprecated use `TopicsControllerDeleteTopicRequest$Outbound` instead. */ + export type Outbound = TopicsControllerDeleteTopicRequest$Outbound; } diff --git a/src/models/operations/topicscontrollergettopic.ts b/src/models/operations/topicscontrollergettopic.ts index 54b0d68e..5efff29a 100644 --- a/src/models/operations/topicscontrollergettopic.ts +++ b/src/models/operations/topicscontrollergettopic.ts @@ -1,29 +1,48 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; export type TopicsControllerGetTopicRequest = { + /** + * The topic key + */ topicKey: string; }; /** @internal */ -export namespace TopicsControllerGetTopicRequest$ { - export const inboundSchema: z.ZodType = - z.object({ - topicKey: z.string(), - }); +export const TopicsControllerGetTopicRequest$inboundSchema: z.ZodType< + TopicsControllerGetTopicRequest, + z.ZodTypeDef, + unknown +> = z.object({ + topicKey: z.string(), +}); + +/** @internal */ +export type TopicsControllerGetTopicRequest$Outbound = { + topicKey: string; +}; - export type Outbound = { - topicKey: string; - }; +/** @internal */ +export const TopicsControllerGetTopicRequest$outboundSchema: z.ZodType< + TopicsControllerGetTopicRequest$Outbound, + z.ZodTypeDef, + TopicsControllerGetTopicRequest +> = z.object({ + topicKey: z.string(), +}); - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - TopicsControllerGetTopicRequest - > = z.object({ - topicKey: z.string(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace TopicsControllerGetTopicRequest$ { + /** @deprecated use `TopicsControllerGetTopicRequest$inboundSchema` instead. */ + export const inboundSchema = TopicsControllerGetTopicRequest$inboundSchema; + /** @deprecated use `TopicsControllerGetTopicRequest$outboundSchema` instead. */ + export const outboundSchema = TopicsControllerGetTopicRequest$outboundSchema; + /** @deprecated use `TopicsControllerGetTopicRequest$Outbound` instead. */ + export type Outbound = TopicsControllerGetTopicRequest$Outbound; } diff --git a/src/models/operations/topicscontrollergettopicsubscriber.ts b/src/models/operations/topicscontrollergettopicsubscriber.ts index 45fca5fa..162b8e0c 100644 --- a/src/models/operations/topicscontrollergettopicsubscriber.ts +++ b/src/models/operations/topicscontrollergettopicsubscriber.ts @@ -1,36 +1,55 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; export type TopicsControllerGetTopicSubscriberRequest = { - topicKey: string; + /** + * The external subscriber id + */ externalSubscriberId: string; + /** + * The topic key + */ + topicKey: string; }; /** @internal */ -export namespace TopicsControllerGetTopicSubscriberRequest$ { - export const inboundSchema: z.ZodType< - TopicsControllerGetTopicSubscriberRequest, - z.ZodTypeDef, - unknown - > = z.object({ - topicKey: z.string(), - externalSubscriberId: z.string(), - }); +export const TopicsControllerGetTopicSubscriberRequest$inboundSchema: z.ZodType< + TopicsControllerGetTopicSubscriberRequest, + z.ZodTypeDef, + unknown +> = z.object({ + externalSubscriberId: z.string(), + topicKey: z.string(), +}); - export type Outbound = { - topicKey: string; - externalSubscriberId: string; - }; +/** @internal */ +export type TopicsControllerGetTopicSubscriberRequest$Outbound = { + externalSubscriberId: string; + topicKey: string; +}; + +/** @internal */ +export const TopicsControllerGetTopicSubscriberRequest$outboundSchema: z.ZodType< + TopicsControllerGetTopicSubscriberRequest$Outbound, + z.ZodTypeDef, + TopicsControllerGetTopicSubscriberRequest +> = z.object({ + externalSubscriberId: z.string(), + topicKey: z.string(), +}); - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - TopicsControllerGetTopicSubscriberRequest - > = z.object({ - topicKey: z.string(), - externalSubscriberId: z.string(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace TopicsControllerGetTopicSubscriberRequest$ { + /** @deprecated use `TopicsControllerGetTopicSubscriberRequest$inboundSchema` instead. */ + export const inboundSchema = TopicsControllerGetTopicSubscriberRequest$inboundSchema; + /** @deprecated use `TopicsControllerGetTopicSubscriberRequest$outboundSchema` instead. */ + export const outboundSchema = TopicsControllerGetTopicSubscriberRequest$outboundSchema; + /** @deprecated use `TopicsControllerGetTopicSubscriberRequest$Outbound` instead. */ + export type Outbound = TopicsControllerGetTopicSubscriberRequest$Outbound; } diff --git a/src/models/operations/topicscontrollerlisttopics.ts b/src/models/operations/topicscontrollerlisttopics.ts index 0c98459b..f531d8e3 100644 --- a/src/models/operations/topicscontrollerlisttopics.ts +++ b/src/models/operations/topicscontrollerlisttopics.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -20,30 +20,43 @@ export type TopicsControllerListTopicsRequest = { }; /** @internal */ -export namespace TopicsControllerListTopicsRequest$ { - export const inboundSchema: z.ZodType< - TopicsControllerListTopicsRequest, - z.ZodTypeDef, - unknown - > = z.object({ - page: z.number().default(0), - pageSize: z.number().default(10), - key: z.string().optional(), - }); +export const TopicsControllerListTopicsRequest$inboundSchema: z.ZodType< + TopicsControllerListTopicsRequest, + z.ZodTypeDef, + unknown +> = z.object({ + page: z.number().default(0), + pageSize: z.number().default(10), + key: z.string().optional(), +}); + +/** @internal */ +export type TopicsControllerListTopicsRequest$Outbound = { + page: number; + pageSize: number; + key?: string | undefined; +}; - export type Outbound = { - page: number; - pageSize: number; - key?: string | undefined; - }; +/** @internal */ +export const TopicsControllerListTopicsRequest$outboundSchema: z.ZodType< + TopicsControllerListTopicsRequest$Outbound, + z.ZodTypeDef, + TopicsControllerListTopicsRequest +> = z.object({ + page: z.number().default(0), + pageSize: z.number().default(10), + key: z.string().optional(), +}); - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - TopicsControllerListTopicsRequest - > = z.object({ - page: z.number().default(0), - pageSize: z.number().default(10), - key: z.string().optional(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace TopicsControllerListTopicsRequest$ { + /** @deprecated use `TopicsControllerListTopicsRequest$inboundSchema` instead. */ + export const inboundSchema = TopicsControllerListTopicsRequest$inboundSchema; + /** @deprecated use `TopicsControllerListTopicsRequest$outboundSchema` instead. */ + export const outboundSchema = TopicsControllerListTopicsRequest$outboundSchema; + /** @deprecated use `TopicsControllerListTopicsRequest$Outbound` instead. */ + export type Outbound = TopicsControllerListTopicsRequest$Outbound; } diff --git a/src/models/operations/topicscontrollerremovesubscribers.ts b/src/models/operations/topicscontrollerremovesubscribers.ts index eb2f3877..58a49b67 100644 --- a/src/models/operations/topicscontrollerremovesubscribers.ts +++ b/src/models/operations/topicscontrollerremovesubscribers.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; @@ -7,44 +7,60 @@ import * as components from "../components/index.js"; import * as z from "zod"; export type TopicsControllerRemoveSubscribersRequest = { + /** + * The topic key + */ topicKey: string; removeSubscribersRequestDto: components.RemoveSubscribersRequestDto; }; /** @internal */ -export namespace TopicsControllerRemoveSubscribersRequest$ { - export const inboundSchema: z.ZodType< - TopicsControllerRemoveSubscribersRequest, - z.ZodTypeDef, - unknown - > = z - .object({ - topicKey: z.string(), - RemoveSubscribersRequestDto: components.RemoveSubscribersRequestDto$.inboundSchema, - }) - .transform((v) => { - return remap$(v, { - RemoveSubscribersRequestDto: "removeSubscribersRequestDto", - }); +export const TopicsControllerRemoveSubscribersRequest$inboundSchema: z.ZodType< + TopicsControllerRemoveSubscribersRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + topicKey: z.string(), + RemoveSubscribersRequestDto: components.RemoveSubscribersRequestDto$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + RemoveSubscribersRequestDto: "removeSubscribersRequestDto", }); + }); - export type Outbound = { - topicKey: string; - RemoveSubscribersRequestDto: components.RemoveSubscribersRequestDto$.Outbound; - }; +/** @internal */ +export type TopicsControllerRemoveSubscribersRequest$Outbound = { + topicKey: string; + RemoveSubscribersRequestDto: components.RemoveSubscribersRequestDto$Outbound; +}; - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - TopicsControllerRemoveSubscribersRequest - > = z - .object({ - topicKey: z.string(), - removeSubscribersRequestDto: components.RemoveSubscribersRequestDto$.outboundSchema, - }) - .transform((v) => { - return remap$(v, { - removeSubscribersRequestDto: "RemoveSubscribersRequestDto", - }); +/** @internal */ +export const TopicsControllerRemoveSubscribersRequest$outboundSchema: z.ZodType< + TopicsControllerRemoveSubscribersRequest$Outbound, + z.ZodTypeDef, + TopicsControllerRemoveSubscribersRequest +> = z + .object({ + topicKey: z.string(), + removeSubscribersRequestDto: components.RemoveSubscribersRequestDto$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + removeSubscribersRequestDto: "RemoveSubscribersRequestDto", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace TopicsControllerRemoveSubscribersRequest$ { + /** @deprecated use `TopicsControllerRemoveSubscribersRequest$inboundSchema` instead. */ + export const inboundSchema = TopicsControllerRemoveSubscribersRequest$inboundSchema; + /** @deprecated use `TopicsControllerRemoveSubscribersRequest$outboundSchema` instead. */ + export const outboundSchema = TopicsControllerRemoveSubscribersRequest$outboundSchema; + /** @deprecated use `TopicsControllerRemoveSubscribersRequest$Outbound` instead. */ + export type Outbound = TopicsControllerRemoveSubscribersRequest$Outbound; } diff --git a/src/models/operations/topicscontrollerrenametopic.ts b/src/models/operations/topicscontrollerrenametopic.ts index a3f6047f..a9e8679e 100644 --- a/src/models/operations/topicscontrollerrenametopic.ts +++ b/src/models/operations/topicscontrollerrenametopic.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; @@ -7,44 +7,60 @@ import * as components from "../components/index.js"; import * as z from "zod"; export type TopicsControllerRenameTopicRequest = { + /** + * The topic key + */ topicKey: string; renameTopicRequestDto: components.RenameTopicRequestDto; }; /** @internal */ -export namespace TopicsControllerRenameTopicRequest$ { - export const inboundSchema: z.ZodType< - TopicsControllerRenameTopicRequest, - z.ZodTypeDef, - unknown - > = z - .object({ - topicKey: z.string(), - RenameTopicRequestDto: components.RenameTopicRequestDto$.inboundSchema, - }) - .transform((v) => { - return remap$(v, { - RenameTopicRequestDto: "renameTopicRequestDto", - }); +export const TopicsControllerRenameTopicRequest$inboundSchema: z.ZodType< + TopicsControllerRenameTopicRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + topicKey: z.string(), + RenameTopicRequestDto: components.RenameTopicRequestDto$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + RenameTopicRequestDto: "renameTopicRequestDto", }); + }); - export type Outbound = { - topicKey: string; - RenameTopicRequestDto: components.RenameTopicRequestDto$.Outbound; - }; +/** @internal */ +export type TopicsControllerRenameTopicRequest$Outbound = { + topicKey: string; + RenameTopicRequestDto: components.RenameTopicRequestDto$Outbound; +}; - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - TopicsControllerRenameTopicRequest - > = z - .object({ - topicKey: z.string(), - renameTopicRequestDto: components.RenameTopicRequestDto$.outboundSchema, - }) - .transform((v) => { - return remap$(v, { - renameTopicRequestDto: "RenameTopicRequestDto", - }); +/** @internal */ +export const TopicsControllerRenameTopicRequest$outboundSchema: z.ZodType< + TopicsControllerRenameTopicRequest$Outbound, + z.ZodTypeDef, + TopicsControllerRenameTopicRequest +> = z + .object({ + topicKey: z.string(), + renameTopicRequestDto: components.RenameTopicRequestDto$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + renameTopicRequestDto: "RenameTopicRequestDto", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace TopicsControllerRenameTopicRequest$ { + /** @deprecated use `TopicsControllerRenameTopicRequest$inboundSchema` instead. */ + export const inboundSchema = TopicsControllerRenameTopicRequest$inboundSchema; + /** @deprecated use `TopicsControllerRenameTopicRequest$outboundSchema` instead. */ + export const outboundSchema = TopicsControllerRenameTopicRequest$outboundSchema; + /** @deprecated use `TopicsControllerRenameTopicRequest$Outbound` instead. */ + export type Outbound = TopicsControllerRenameTopicRequest$Outbound; } diff --git a/src/models/operations/workflowcontrollerdeleteworkflowbyid.ts b/src/models/operations/workflowcontrollerdeleteworkflowbyid.ts index fecfea37..eda96404 100644 --- a/src/models/operations/workflowcontrollerdeleteworkflowbyid.ts +++ b/src/models/operations/workflowcontrollerdeleteworkflowbyid.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -9,24 +9,37 @@ export type WorkflowControllerDeleteWorkflowByIdRequest = { }; /** @internal */ -export namespace WorkflowControllerDeleteWorkflowByIdRequest$ { - export const inboundSchema: z.ZodType< - WorkflowControllerDeleteWorkflowByIdRequest, - z.ZodTypeDef, - unknown - > = z.object({ - workflowId: z.string(), - }); +export const WorkflowControllerDeleteWorkflowByIdRequest$inboundSchema: z.ZodType< + WorkflowControllerDeleteWorkflowByIdRequest, + z.ZodTypeDef, + unknown +> = z.object({ + workflowId: z.string(), +}); + +/** @internal */ +export type WorkflowControllerDeleteWorkflowByIdRequest$Outbound = { + workflowId: string; +}; - export type Outbound = { - workflowId: string; - }; +/** @internal */ +export const WorkflowControllerDeleteWorkflowByIdRequest$outboundSchema: z.ZodType< + WorkflowControllerDeleteWorkflowByIdRequest$Outbound, + z.ZodTypeDef, + WorkflowControllerDeleteWorkflowByIdRequest +> = z.object({ + workflowId: z.string(), +}); - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - WorkflowControllerDeleteWorkflowByIdRequest - > = z.object({ - workflowId: z.string(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace WorkflowControllerDeleteWorkflowByIdRequest$ { + /** @deprecated use `WorkflowControllerDeleteWorkflowByIdRequest$inboundSchema` instead. */ + export const inboundSchema = WorkflowControllerDeleteWorkflowByIdRequest$inboundSchema; + /** @deprecated use `WorkflowControllerDeleteWorkflowByIdRequest$outboundSchema` instead. */ + export const outboundSchema = WorkflowControllerDeleteWorkflowByIdRequest$outboundSchema; + /** @deprecated use `WorkflowControllerDeleteWorkflowByIdRequest$Outbound` instead. */ + export type Outbound = WorkflowControllerDeleteWorkflowByIdRequest$Outbound; } diff --git a/src/models/operations/workflowcontrollergetworkflowbyid.ts b/src/models/operations/workflowcontrollergetworkflowbyid.ts index 2ad584bc..bdee564d 100644 --- a/src/models/operations/workflowcontrollergetworkflowbyid.ts +++ b/src/models/operations/workflowcontrollergetworkflowbyid.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -9,24 +9,37 @@ export type WorkflowControllerGetWorkflowByIdRequest = { }; /** @internal */ -export namespace WorkflowControllerGetWorkflowByIdRequest$ { - export const inboundSchema: z.ZodType< - WorkflowControllerGetWorkflowByIdRequest, - z.ZodTypeDef, - unknown - > = z.object({ - workflowId: z.string(), - }); +export const WorkflowControllerGetWorkflowByIdRequest$inboundSchema: z.ZodType< + WorkflowControllerGetWorkflowByIdRequest, + z.ZodTypeDef, + unknown +> = z.object({ + workflowId: z.string(), +}); + +/** @internal */ +export type WorkflowControllerGetWorkflowByIdRequest$Outbound = { + workflowId: string; +}; - export type Outbound = { - workflowId: string; - }; +/** @internal */ +export const WorkflowControllerGetWorkflowByIdRequest$outboundSchema: z.ZodType< + WorkflowControllerGetWorkflowByIdRequest$Outbound, + z.ZodTypeDef, + WorkflowControllerGetWorkflowByIdRequest +> = z.object({ + workflowId: z.string(), +}); - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - WorkflowControllerGetWorkflowByIdRequest - > = z.object({ - workflowId: z.string(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace WorkflowControllerGetWorkflowByIdRequest$ { + /** @deprecated use `WorkflowControllerGetWorkflowByIdRequest$inboundSchema` instead. */ + export const inboundSchema = WorkflowControllerGetWorkflowByIdRequest$inboundSchema; + /** @deprecated use `WorkflowControllerGetWorkflowByIdRequest$outboundSchema` instead. */ + export const outboundSchema = WorkflowControllerGetWorkflowByIdRequest$outboundSchema; + /** @deprecated use `WorkflowControllerGetWorkflowByIdRequest$Outbound` instead. */ + export type Outbound = WorkflowControllerGetWorkflowByIdRequest$Outbound; } diff --git a/src/models/operations/workflowcontrollerlistworkflows.ts b/src/models/operations/workflowcontrollerlistworkflows.ts index a7914a38..4f14d3c2 100644 --- a/src/models/operations/workflowcontrollerlistworkflows.ts +++ b/src/models/operations/workflowcontrollerlistworkflows.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; @@ -14,30 +14,43 @@ export type WorkflowControllerListWorkflowsRequest = { }; /** @internal */ -export namespace WorkflowControllerListWorkflowsRequest$ { - export const inboundSchema: z.ZodType< - WorkflowControllerListWorkflowsRequest, - z.ZodTypeDef, - unknown - > = z.object({ - page: z.number().optional(), - limit: z.number().default(10), - query: z.string().optional(), - }); +export const WorkflowControllerListWorkflowsRequest$inboundSchema: z.ZodType< + WorkflowControllerListWorkflowsRequest, + z.ZodTypeDef, + unknown +> = z.object({ + page: z.number().optional(), + limit: z.number().default(10), + query: z.string().optional(), +}); - export type Outbound = { - page?: number | undefined; - limit: number; - query?: string | undefined; - }; +/** @internal */ +export type WorkflowControllerListWorkflowsRequest$Outbound = { + page?: number | undefined; + limit: number; + query?: string | undefined; +}; - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - WorkflowControllerListWorkflowsRequest - > = z.object({ - page: z.number().optional(), - limit: z.number().default(10), - query: z.string().optional(), - }); +/** @internal */ +export const WorkflowControllerListWorkflowsRequest$outboundSchema: z.ZodType< + WorkflowControllerListWorkflowsRequest$Outbound, + z.ZodTypeDef, + WorkflowControllerListWorkflowsRequest +> = z.object({ + page: z.number().optional(), + limit: z.number().default(10), + query: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace WorkflowControllerListWorkflowsRequest$ { + /** @deprecated use `WorkflowControllerListWorkflowsRequest$inboundSchema` instead. */ + export const inboundSchema = WorkflowControllerListWorkflowsRequest$inboundSchema; + /** @deprecated use `WorkflowControllerListWorkflowsRequest$outboundSchema` instead. */ + export const outboundSchema = WorkflowControllerListWorkflowsRequest$outboundSchema; + /** @deprecated use `WorkflowControllerListWorkflowsRequest$Outbound` instead. */ + export type Outbound = WorkflowControllerListWorkflowsRequest$Outbound; } diff --git a/src/models/operations/workflowcontrollerupdateactivestatus.ts b/src/models/operations/workflowcontrollerupdateactivestatus.ts index 4bbbc429..b5dd7777 100644 --- a/src/models/operations/workflowcontrollerupdateactivestatus.ts +++ b/src/models/operations/workflowcontrollerupdateactivestatus.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; @@ -12,41 +12,52 @@ export type WorkflowControllerUpdateActiveStatusRequest = { }; /** @internal */ -export namespace WorkflowControllerUpdateActiveStatusRequest$ { - export const inboundSchema: z.ZodType< - WorkflowControllerUpdateActiveStatusRequest, - z.ZodTypeDef, - unknown - > = z - .object({ - workflowId: z.string(), - ChangeWorkflowStatusRequestDto: - components.ChangeWorkflowStatusRequestDto$.inboundSchema, - }) - .transform((v) => { - return remap$(v, { - ChangeWorkflowStatusRequestDto: "changeWorkflowStatusRequestDto", - }); +export const WorkflowControllerUpdateActiveStatusRequest$inboundSchema: z.ZodType< + WorkflowControllerUpdateActiveStatusRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + workflowId: z.string(), + ChangeWorkflowStatusRequestDto: components.ChangeWorkflowStatusRequestDto$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + ChangeWorkflowStatusRequestDto: "changeWorkflowStatusRequestDto", }); + }); - export type Outbound = { - workflowId: string; - ChangeWorkflowStatusRequestDto: components.ChangeWorkflowStatusRequestDto$.Outbound; - }; +/** @internal */ +export type WorkflowControllerUpdateActiveStatusRequest$Outbound = { + workflowId: string; + ChangeWorkflowStatusRequestDto: components.ChangeWorkflowStatusRequestDto$Outbound; +}; - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - WorkflowControllerUpdateActiveStatusRequest - > = z - .object({ - workflowId: z.string(), - changeWorkflowStatusRequestDto: - components.ChangeWorkflowStatusRequestDto$.outboundSchema, - }) - .transform((v) => { - return remap$(v, { - changeWorkflowStatusRequestDto: "ChangeWorkflowStatusRequestDto", - }); +/** @internal */ +export const WorkflowControllerUpdateActiveStatusRequest$outboundSchema: z.ZodType< + WorkflowControllerUpdateActiveStatusRequest$Outbound, + z.ZodTypeDef, + WorkflowControllerUpdateActiveStatusRequest +> = z + .object({ + workflowId: z.string(), + changeWorkflowStatusRequestDto: components.ChangeWorkflowStatusRequestDto$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + changeWorkflowStatusRequestDto: "ChangeWorkflowStatusRequestDto", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace WorkflowControllerUpdateActiveStatusRequest$ { + /** @deprecated use `WorkflowControllerUpdateActiveStatusRequest$inboundSchema` instead. */ + export const inboundSchema = WorkflowControllerUpdateActiveStatusRequest$inboundSchema; + /** @deprecated use `WorkflowControllerUpdateActiveStatusRequest$outboundSchema` instead. */ + export const outboundSchema = WorkflowControllerUpdateActiveStatusRequest$outboundSchema; + /** @deprecated use `WorkflowControllerUpdateActiveStatusRequest$Outbound` instead. */ + export type Outbound = WorkflowControllerUpdateActiveStatusRequest$Outbound; } diff --git a/src/models/operations/workflowcontrollerupdateworkflowbyid.ts b/src/models/operations/workflowcontrollerupdateworkflowbyid.ts index 92d528cb..4a773600 100644 --- a/src/models/operations/workflowcontrollerupdateworkflowbyid.ts +++ b/src/models/operations/workflowcontrollerupdateworkflowbyid.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { remap as remap$ } from "../../lib/primitives.js"; @@ -12,39 +12,52 @@ export type WorkflowControllerUpdateWorkflowByIdRequest = { }; /** @internal */ -export namespace WorkflowControllerUpdateWorkflowByIdRequest$ { - export const inboundSchema: z.ZodType< - WorkflowControllerUpdateWorkflowByIdRequest, - z.ZodTypeDef, - unknown - > = z - .object({ - workflowId: z.string(), - UpdateWorkflowRequestDto: components.UpdateWorkflowRequestDto$.inboundSchema, - }) - .transform((v) => { - return remap$(v, { - UpdateWorkflowRequestDto: "updateWorkflowRequestDto", - }); +export const WorkflowControllerUpdateWorkflowByIdRequest$inboundSchema: z.ZodType< + WorkflowControllerUpdateWorkflowByIdRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + workflowId: z.string(), + UpdateWorkflowRequestDto: components.UpdateWorkflowRequestDto$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + UpdateWorkflowRequestDto: "updateWorkflowRequestDto", }); + }); - export type Outbound = { - workflowId: string; - UpdateWorkflowRequestDto: components.UpdateWorkflowRequestDto$.Outbound; - }; +/** @internal */ +export type WorkflowControllerUpdateWorkflowByIdRequest$Outbound = { + workflowId: string; + UpdateWorkflowRequestDto: components.UpdateWorkflowRequestDto$Outbound; +}; - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - WorkflowControllerUpdateWorkflowByIdRequest - > = z - .object({ - workflowId: z.string(), - updateWorkflowRequestDto: components.UpdateWorkflowRequestDto$.outboundSchema, - }) - .transform((v) => { - return remap$(v, { - updateWorkflowRequestDto: "UpdateWorkflowRequestDto", - }); +/** @internal */ +export const WorkflowControllerUpdateWorkflowByIdRequest$outboundSchema: z.ZodType< + WorkflowControllerUpdateWorkflowByIdRequest$Outbound, + z.ZodTypeDef, + WorkflowControllerUpdateWorkflowByIdRequest +> = z + .object({ + workflowId: z.string(), + updateWorkflowRequestDto: components.UpdateWorkflowRequestDto$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + updateWorkflowRequestDto: "UpdateWorkflowRequestDto", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace WorkflowControllerUpdateWorkflowByIdRequest$ { + /** @deprecated use `WorkflowControllerUpdateWorkflowByIdRequest$inboundSchema` instead. */ + export const inboundSchema = WorkflowControllerUpdateWorkflowByIdRequest$inboundSchema; + /** @deprecated use `WorkflowControllerUpdateWorkflowByIdRequest$outboundSchema` instead. */ + export const outboundSchema = WorkflowControllerUpdateWorkflowByIdRequest$outboundSchema; + /** @deprecated use `WorkflowControllerUpdateWorkflowByIdRequest$Outbound` instead. */ + export type Outbound = WorkflowControllerUpdateWorkflowByIdRequest$Outbound; } diff --git a/src/sdk/apikeys.ts b/src/sdk/apikeys.ts index be3742b7..cb350e00 100644 --- a/src/sdk/apikeys.ts +++ b/src/sdk/apikeys.ts @@ -1,179 +1,17 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SDKHooks } from "../hooks/hooks.js"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; -import { HTTPClient } from "../lib/http.js"; -import * as retries$ from "../lib/retries.js"; +import { environmentsApiKeysList } from "../funcs/environmentsApiKeysList.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; -import * as z from "zod"; +import { unwrapAsync } from "../types/fp.js"; export class ApiKeys extends ClientSDK { - private readonly options$: SDKOptions & { hooks?: SDKHooks }; - - constructor(options: SDKOptions = {}) { - const opt = options as unknown; - let hooks: SDKHooks; - if ( - typeof opt === "object" && - opt != null && - "hooks" in opt && - opt.hooks instanceof SDKHooks - ) { - hooks = opt.hooks; - } else { - hooks = new SDKHooks(); - } - - super({ - client: options.httpClient || new HTTPClient(), - baseURL: serverURLFromOptions(options), - hooks, - }); - - this.options$ = { ...options, hooks }; - void this.options$; - } - /** * Get api keys */ - async list( - options?: RequestOptions & { retries?: retries$.RetryConfig } - ): Promise> { - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); - - const path$ = this.templateURLComponent("/v1/environments/api-keys")(); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "EnvironmentsController_listOrganizationApiKeys", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "GET", - path: path$, - headers: headers$, - query: query$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher>() - .json(200, z.array(components.ApiKey$.inboundSchema)) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; - } - - /** - * Regenerate api keys - */ - async regenerate( - options?: RequestOptions & { retries?: retries$.RetryConfig } - ): Promise> { - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); - - const path$ = this.templateURLComponent("/v1/environments/api-keys/regenerate")(); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "EnvironmentsController_regenerateOrganizationApiKeys", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "POST", - path: path$, - headers: headers$, - query: query$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher>() - .json(201, z.array(components.ApiKey$.inboundSchema)) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + async list(options?: RequestOptions): Promise> { + return unwrapAsync(environmentsApiKeysList(this, options)); } } diff --git a/src/sdk/authentication.ts b/src/sdk/authentication.ts index 7da29036..e066979d 100644 --- a/src/sdk/authentication.ts +++ b/src/sdk/authentication.ts @@ -1,144 +1,22 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SDKHooks } from "../hooks/hooks.js"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; -import { - encodeFormQuery as encodeFormQuery$, - encodeSimple as encodeSimple$, -} from "../lib/encodings.js"; -import { HTTPClient } from "../lib/http.js"; -import * as retries$ from "../lib/retries.js"; -import * as schemas$ from "../lib/schemas.js"; +import { subscribersAuthenticationChatAccessOauth } from "../funcs/subscribersAuthenticationChatAccessOauth.js"; +import { subscribersAuthenticationChatAccessOauthCallBack } from "../funcs/subscribersAuthenticationChatAccessOauthCallBack.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as operations from "../models/operations/index.js"; -import * as z from "zod"; +import { unwrapAsync } from "../types/fp.js"; export class Authentication extends ClientSDK { - private readonly options$: SDKOptions & { hooks?: SDKHooks }; - - constructor(options: SDKOptions = {}) { - const opt = options as unknown; - let hooks: SDKHooks; - if ( - typeof opt === "object" && - opt != null && - "hooks" in opt && - opt.hooks instanceof SDKHooks - ) { - hooks = opt.hooks; - } else { - hooks = new SDKHooks(); - } - - super({ - client: options.httpClient || new HTTPClient(), - baseURL: serverURLFromOptions(options), - hooks, - }); - - this.options$ = { ...options, hooks }; - void this.options$; - } - /** * Handle chat oauth */ async chatAccessOauth( request: operations.SubscribersControllerChatAccessOauthRequest, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise { - const input$ = request; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "*/*"); - - const payload$ = schemas$.parse( - input$, - (value$) => - operations.SubscribersControllerChatAccessOauthRequest$.outboundSchema.parse( - value$ - ), - "Input validation failed" - ); - const body$ = null; - - const pathParams$ = { - providerId: encodeSimple$("providerId", payload$.providerId, { - explode: false, - charEncoding: "percent", - }), - subscriberId: encodeSimple$("subscriberId", payload$.subscriberId, { - explode: false, - charEncoding: "percent", - }), - }; - const path$ = this.templateURLComponent( - "/v1/subscribers/{subscriberId}/credentials/{providerId}/oauth" - )(pathParams$); - - const query$ = encodeFormQuery$({ - environmentId: payload$.environmentId, - hmacHash: payload$.hmacHash, - integrationIdentifier: payload$.integrationIdentifier, - }); - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "SubscribersController_chatAccessOauth", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .void(200, z.void()) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + return unwrapAsync(subscribersAuthenticationChatAccessOauth(this, request, options)); } /** @@ -146,99 +24,10 @@ export class Authentication extends ClientSDK { */ async chatAccessOauthCallBack( request: operations.SubscribersControllerChatOauthCallbackRequest, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise { - const input$ = request; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => - operations.SubscribersControllerChatOauthCallbackRequest$.outboundSchema.parse( - value$ - ), - "Input validation failed" - ); - const body$ = null; - - const pathParams$ = { - providerId: encodeSimple$("providerId", payload$.providerId, { - explode: false, - charEncoding: "percent", - }), - subscriberId: encodeSimple$("subscriberId", payload$.subscriberId, { - explode: false, - charEncoding: "percent", - }), - }; - const path$ = this.templateURLComponent( - "/v1/subscribers/{subscriberId}/credentials/{providerId}/oauth/callback" - )(pathParams$); - - const query$ = encodeFormQuery$({ - code: payload$.code, - environmentId: payload$.environmentId, - hmacHash: payload$.hmacHash, - integrationIdentifier: payload$.integrationIdentifier, - }); - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "SubscribersController_chatOauthCallback", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options + return unwrapAsync( + subscribersAuthenticationChatAccessOauthCallBack(this, request, options) ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = - await this.matcher() - .json(200, operations.SubscribersControllerChatOauthCallbackResponseBody$) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; } } diff --git a/src/sdk/branding.ts b/src/sdk/branding.ts deleted file mode 100644 index 78bb49c1..00000000 --- a/src/sdk/branding.ts +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - */ - -import { SDKHooks } from "../hooks/hooks.js"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; -import { encodeJSON as encodeJSON$ } from "../lib/encodings.js"; -import { HTTPClient } from "../lib/http.js"; -import * as retries$ from "../lib/retries.js"; -import * as schemas$ from "../lib/schemas.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as components from "../models/components/index.js"; - -export class Branding extends ClientSDK { - private readonly options$: SDKOptions & { hooks?: SDKHooks }; - - constructor(options: SDKOptions = {}) { - const opt = options as unknown; - let hooks: SDKHooks; - if ( - typeof opt === "object" && - opt != null && - "hooks" in opt && - opt.hooks instanceof SDKHooks - ) { - hooks = opt.hooks; - } else { - hooks = new SDKHooks(); - } - - super({ - client: options.httpClient || new HTTPClient(), - baseURL: serverURLFromOptions(options), - hooks, - }); - - this.options$ = { ...options, hooks }; - void this.options$; - } - - /** - * Update organization branding details - */ - async update( - request: components.UpdateBrandingDetailsDto, - options?: RequestOptions & { retries?: retries$.RetryConfig } - ): Promise { - const input$ = request; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Content-Type", "application/json"); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => components.UpdateBrandingDetailsDto$.outboundSchema.parse(value$), - "Input validation failed" - ); - const body$ = encodeJSON$("body", payload$, { explode: true }); - - const path$ = this.templateURLComponent("/v1/organizations/branding")(); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "OrganizationController_updateBrandingDetails", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "PUT", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(200, components.OrganizationBrandingResponseDto$) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; - } -} diff --git a/src/sdk/changes.ts b/src/sdk/changes.ts index f9246a8f..c830057f 100644 --- a/src/sdk/changes.ts +++ b/src/sdk/changes.ts @@ -1,135 +1,25 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SDKHooks } from "../hooks/hooks.js"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; -import { - encodeFormQuery as encodeFormQuery$, - encodeJSON as encodeJSON$, - encodeSimple as encodeSimple$, -} from "../lib/encodings.js"; -import { HTTPClient } from "../lib/http.js"; -import * as retries$ from "../lib/retries.js"; -import * as schemas$ from "../lib/schemas.js"; +import { changesApply } from "../funcs/changesApply.js"; +import { changesApplyBulk } from "../funcs/changesApplyBulk.js"; +import { changesCount } from "../funcs/changesCount.js"; +import { changesRetrieve } from "../funcs/changesRetrieve.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; import * as operations from "../models/operations/index.js"; -import * as z from "zod"; +import { unwrapAsync } from "../types/fp.js"; export class Changes extends ClientSDK { - private readonly options$: SDKOptions & { hooks?: SDKHooks }; - - constructor(options: SDKOptions = {}) { - const opt = options as unknown; - let hooks: SDKHooks; - if ( - typeof opt === "object" && - opt != null && - "hooks" in opt && - opt.hooks instanceof SDKHooks - ) { - hooks = opt.hooks; - } else { - hooks = new SDKHooks(); - } - - super({ - client: options.httpClient || new HTTPClient(), - baseURL: serverURLFromOptions(options), - hooks, - }); - - this.options$ = { ...options, hooks }; - void this.options$; - } - /** * Apply change */ async apply( changeId: string, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise> { - const input$: operations.ChangesControllerApplyDiffRequest = { - changeId: changeId, - }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => operations.ChangesControllerApplyDiffRequest$.outboundSchema.parse(value$), - "Input validation failed" - ); - const body$ = null; - - const pathParams$ = { - changeId: encodeSimple$("changeId", payload$.changeId, { - explode: false, - charEncoding: "percent", - }), - }; - const path$ = this.templateURLComponent("/v1/changes/{changeId}/apply")(pathParams$); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "ChangesController_applyDiff", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "POST", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher>() - .json(201, z.array(components.ChangeResponseDto$.inboundSchema)) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + return unwrapAsync(changesApply(this, changeId, options)); } /** @@ -137,150 +27,16 @@ export class Changes extends ClientSDK { */ async applyBulk( request: components.BulkApplyChangeDto, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise> { - const input$ = request; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Content-Type", "application/json"); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => components.BulkApplyChangeDto$.outboundSchema.parse(value$), - "Input validation failed" - ); - const body$ = encodeJSON$("body", payload$, { explode: true }); - - const path$ = this.templateURLComponent("/v1/changes/bulk/apply")(); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "ChangesController_bulkApplyDiff", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "POST", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher>() - .json(201, z.array(components.ChangeResponseDto$.inboundSchema)) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + return unwrapAsync(changesApplyBulk(this, request, options)); } /** * Get changes count */ - async count( - options?: RequestOptions & { retries?: retries$.RetryConfig } - ): Promise { - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); - - const path$ = this.templateURLComponent("/v1/changes/count")(); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "ChangesController_getChangesCount", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "GET", - path: path$, - headers: headers$, - query: query$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(200, components.DataNumberDto$) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + async count(options?: RequestOptions): Promise { + return unwrapAsync(changesCount(this, options)); } /** @@ -288,82 +44,8 @@ export class Changes extends ClientSDK { */ async retrieve( request: operations.ChangesControllerGetChangesRequest, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise { - const input$ = request; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => operations.ChangesControllerGetChangesRequest$.outboundSchema.parse(value$), - "Input validation failed" - ); - const body$ = null; - - const path$ = this.templateURLComponent("/v1/changes")(); - - const query$ = encodeFormQuery$({ - limit: payload$.limit, - page: payload$.page, - promoted: payload$.promoted, - }); - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "ChangesController_getChanges", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(200, components.ChangesResponseDto$) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + return unwrapAsync(changesRetrieve(this, request, options)); } } diff --git a/src/sdk/credentials.ts b/src/sdk/credentials.ts index cfd737fe..c2925b23 100644 --- a/src/sdk/credentials.ts +++ b/src/sdk/credentials.ts @@ -1,45 +1,15 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SDKHooks } from "../hooks/hooks.js"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; -import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; -import { HTTPClient } from "../lib/http.js"; -import * as retries$ from "../lib/retries.js"; -import * as schemas$ from "../lib/schemas.js"; +import { subscribersCredentialsAppend } from "../funcs/subscribersCredentialsAppend.js"; +import { subscribersCredentialsDelete } from "../funcs/subscribersCredentialsDelete.js"; +import { subscribersCredentialsUpdate } from "../funcs/subscribersCredentialsUpdate.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; -import * as operations from "../models/operations/index.js"; -import * as z from "zod"; +import { unwrapAsync } from "../types/fp.js"; export class Credentials extends ClientSDK { - private readonly options$: SDKOptions & { hooks?: SDKHooks }; - - constructor(options: SDKOptions = {}) { - const opt = options as unknown; - let hooks: SDKHooks; - if ( - typeof opt === "object" && - opt != null && - "hooks" in opt && - opt.hooks instanceof SDKHooks - ) { - hooks = opt.hooks; - } else { - hooks = new SDKHooks(); - } - - super({ - client: options.httpClient || new HTTPClient(), - baseURL: serverURLFromOptions(options), - hooks, - }); - - this.options$ = { ...options, hooks }; - void this.options$; - } - /** * Modify subscriber credentials * @@ -50,96 +20,16 @@ export class Credentials extends ClientSDK { async append( subscriberId: string, updateSubscriberChannelRequestDto: components.UpdateSubscriberChannelRequestDto, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise { - const input$: operations.SubscribersControllerModifySubscriberChannelRequest = { - subscriberId: subscriberId, - updateSubscriberChannelRequestDto: updateSubscriberChannelRequestDto, - }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Content-Type", "application/json"); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => - operations.SubscribersControllerModifySubscriberChannelRequest$.outboundSchema.parse( - value$ - ), - "Input validation failed" + return unwrapAsync( + subscribersCredentialsAppend( + this, + subscriberId, + updateSubscriberChannelRequestDto, + options + ) ); - const body$ = encodeJSON$("body", payload$.UpdateSubscriberChannelRequestDto, { - explode: true, - }); - - const pathParams$ = { - subscriberId: encodeSimple$("subscriberId", payload$.subscriberId, { - explode: false, - charEncoding: "percent", - }), - }; - const path$ = this.templateURLComponent("/v1/subscribers/{subscriberId}/credentials")( - pathParams$ - ); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "SubscribersController_modifySubscriberChannel", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "PATCH", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(200, components.SubscriberResponseDto$) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; } /** @@ -151,97 +41,9 @@ export class Credentials extends ClientSDK { async delete( subscriberId: string, providerId: string, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise { - const input$: operations.SubscribersControllerDeleteSubscriberCredentialsRequest = { - subscriberId: subscriberId, - providerId: providerId, - }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "*/*"); - - const payload$ = schemas$.parse( - input$, - (value$) => - operations.SubscribersControllerDeleteSubscriberCredentialsRequest$.outboundSchema.parse( - value$ - ), - "Input validation failed" - ); - const body$ = null; - - const pathParams$ = { - providerId: encodeSimple$("providerId", payload$.providerId, { - explode: false, - charEncoding: "percent", - }), - subscriberId: encodeSimple$("subscriberId", payload$.subscriberId, { - explode: false, - charEncoding: "percent", - }), - }; - const path$ = this.templateURLComponent( - "/v1/subscribers/{subscriberId}/credentials/{providerId}" - )(pathParams$); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "SubscribersController_deleteSubscriberCredentials", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "DELETE", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .void(204, z.void()) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + return unwrapAsync(subscribersCredentialsDelete(this, subscriberId, providerId, options)); } /** @@ -253,95 +55,15 @@ export class Credentials extends ClientSDK { async update( subscriberId: string, updateSubscriberChannelRequestDto: components.UpdateSubscriberChannelRequestDto, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise { - const input$: operations.SubscribersControllerUpdateSubscriberChannelRequest = { - subscriberId: subscriberId, - updateSubscriberChannelRequestDto: updateSubscriberChannelRequestDto, - }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Content-Type", "application/json"); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => - operations.SubscribersControllerUpdateSubscriberChannelRequest$.outboundSchema.parse( - value$ - ), - "Input validation failed" - ); - const body$ = encodeJSON$("body", payload$.UpdateSubscriberChannelRequestDto, { - explode: true, - }); - - const pathParams$ = { - subscriberId: encodeSimple$("subscriberId", payload$.subscriberId, { - explode: false, - charEncoding: "percent", - }), - }; - const path$ = this.templateURLComponent("/v1/subscribers/{subscriberId}/credentials")( - pathParams$ - ); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "SubscribersController_updateSubscriberChannel", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "PUT", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options + return unwrapAsync( + subscribersCredentialsUpdate( + this, + subscriberId, + updateSubscriberChannelRequestDto, + options + ) ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(200, components.SubscriberResponseDto$) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; } } diff --git a/src/sdk/environments.ts b/src/sdk/environments.ts index 18d52610..1c25a7fe 100644 --- a/src/sdk/environments.ts +++ b/src/sdk/environments.ts @@ -1,43 +1,15 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SDKHooks } from "../hooks/hooks.js"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; -import { HTTPClient } from "../lib/http.js"; -import * as retries$ from "../lib/retries.js"; +import { environmentsList } from "../funcs/environmentsList.js"; +import { environmentsRetrieve } from "../funcs/environmentsRetrieve.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; +import { unwrapAsync } from "../types/fp.js"; import { ApiKeys } from "./apikeys.js"; -import * as z from "zod"; export class Environments extends ClientSDK { - private readonly options$: SDKOptions & { hooks?: SDKHooks }; - - constructor(options: SDKOptions = {}) { - const opt = options as unknown; - let hooks: SDKHooks; - if ( - typeof opt === "object" && - opt != null && - "hooks" in opt && - opt.hooks instanceof SDKHooks - ) { - hooks = opt.hooks; - } else { - hooks = new SDKHooks(); - } - - super({ - client: options.httpClient || new HTTPClient(), - baseURL: serverURLFromOptions(options), - hooks, - }); - - this.options$ = { ...options, hooks }; - void this.options$; - } - private _apiKeys?: ApiKeys; get apiKeys(): ApiKeys { return (this._apiKeys ??= new ApiKeys(this.options$)); @@ -46,140 +18,14 @@ export class Environments extends ClientSDK { /** * Get environments */ - async list( - options?: RequestOptions & { retries?: retries$.RetryConfig } - ): Promise> { - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); - - const path$ = this.templateURLComponent("/v1/environments")(); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "EnvironmentsController_listMyEnvironments", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "GET", - path: path$, - headers: headers$, - query: query$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher>() - .json(200, z.array(components.EnvironmentResponseDto$.inboundSchema)) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + async list(options?: RequestOptions): Promise> { + return unwrapAsync(environmentsList(this, options)); } /** * Get current environment */ - async retrieve( - options?: RequestOptions & { retries?: retries$.RetryConfig } - ): Promise { - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); - - const path$ = this.templateURLComponent("/v1/environments/me")(); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "EnvironmentsController_getCurrentEnvironment", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "GET", - path: path$, - headers: headers$, - query: query$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(200, components.EnvironmentResponseDto$) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + async retrieve(options?: RequestOptions): Promise { + return unwrapAsync(environmentsRetrieve(this, options)); } } diff --git a/src/sdk/events.ts b/src/sdk/events.ts deleted file mode 100644 index ce82f629..00000000 --- a/src/sdk/events.ts +++ /dev/null @@ -1,308 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - */ - -import { SDKHooks } from "../hooks/hooks.js"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; -import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; -import { HTTPClient } from "../lib/http.js"; -import * as retries$ from "../lib/retries.js"; -import * as schemas$ from "../lib/schemas.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as components from "../models/components/index.js"; -import * as operations from "../models/operations/index.js"; -import * as z from "zod"; - -export class Events extends ClientSDK { - private readonly options$: SDKOptions & { hooks?: SDKHooks }; - - constructor(options: SDKOptions = {}) { - const opt = options as unknown; - let hooks: SDKHooks; - if ( - typeof opt === "object" && - opt != null && - "hooks" in opt && - opt.hooks instanceof SDKHooks - ) { - hooks = opt.hooks; - } else { - hooks = new SDKHooks(); - } - - super({ - client: options.httpClient || new HTTPClient(), - baseURL: serverURLFromOptions(options), - hooks, - }); - - this.options$ = { ...options, hooks }; - void this.options$; - } - - /** - * Cancel triggered event - * - * @remarks - * - * Using a previously generated transactionId during the event trigger, - * will cancel any active or pending workflows. This is useful to cancel active digests, delays etc... - * - */ - async cancel( - transactionId: string, - options?: RequestOptions & { retries?: retries$.RetryConfig } - ): Promise { - const input$: operations.EventsControllerCancelRequest = { - transactionId: transactionId, - }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => operations.EventsControllerCancelRequest$.outboundSchema.parse(value$), - "Input validation failed" - ); - const body$ = null; - - const pathParams$ = { - transactionId: encodeSimple$("transactionId", payload$.transactionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path$ = this.templateURLComponent("/v1/events/trigger/{transactionId}")(pathParams$); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "EventsController_cancel", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "DELETE", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(200, components.DataBooleanDto$) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; - } - - /** - * Broadcast event to all - * - * @remarks - * Trigger a broadcast event to all existing subscribers, could be used to send announcements, etc. - * In the future could be used to trigger events to a subset of subscribers based on defined filters. - */ - async triggerBroadcast( - request: components.TriggerEventToAllRequestDto, - options?: RequestOptions & { retries?: retries$.RetryConfig } - ): Promise { - const input$ = request; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Content-Type", "application/json"); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => components.TriggerEventToAllRequestDto$.outboundSchema.parse(value$), - "Input validation failed" - ); - const body$ = encodeJSON$("body", payload$, { explode: true }); - - const path$ = this.templateURLComponent("/v1/events/trigger/broadcast")(); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "EventsController_broadcastEventToAll", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "POST", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json([200, 201], components.TriggerEventResponseDto$) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; - } - - /** - * Bulk trigger event - * - * @remarks - * - * Using this endpoint you can trigger multiple events at once, to avoid multiple calls to the API. - * The bulk API is limited to 100 events per request. - * - */ - async triggerBulk( - request: components.BulkTriggerEventDto, - options?: RequestOptions & { retries?: retries$.RetryConfig } - ): Promise> { - const input$ = request; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Content-Type", "application/json"); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => components.BulkTriggerEventDto$.outboundSchema.parse(value$), - "Input validation failed" - ); - const body$ = encodeJSON$("body", payload$, { explode: true }); - - const path$ = this.templateURLComponent("/v1/events/trigger/bulk")(); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "EventsController_triggerBulk", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "POST", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher>() - .json(201, z.array(components.TriggerEventResponseDto$.inboundSchema)) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; - } -} diff --git a/src/sdk/executiondetails.ts b/src/sdk/executiondetails.ts index 52efe8aa..ec61c459 100644 --- a/src/sdk/executiondetails.ts +++ b/src/sdk/executiondetails.ts @@ -1,133 +1,21 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SDKHooks } from "../hooks/hooks.js"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; -import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; -import { HTTPClient } from "../lib/http.js"; -import * as retries$ from "../lib/retries.js"; -import * as schemas$ from "../lib/schemas.js"; +import { executionDetailsRetrieve } from "../funcs/executionDetailsRetrieve.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; -import * as operations from "../models/operations/index.js"; -import * as z from "zod"; +import { unwrapAsync } from "../types/fp.js"; export class ExecutionDetails extends ClientSDK { - private readonly options$: SDKOptions & { hooks?: SDKHooks }; - - constructor(options: SDKOptions = {}) { - const opt = options as unknown; - let hooks: SDKHooks; - if ( - typeof opt === "object" && - opt != null && - "hooks" in opt && - opt.hooks instanceof SDKHooks - ) { - hooks = opt.hooks; - } else { - hooks = new SDKHooks(); - } - - super({ - client: options.httpClient || new HTTPClient(), - baseURL: serverURLFromOptions(options), - hooks, - }); - - this.options$ = { ...options, hooks }; - void this.options$; - } - /** * Get execution details */ async retrieve( notificationId: string, subscriberId: string, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise> { - const input$: operations.ExecutionDetailsControllerGetExecutionDetailsForNotificationRequest = - { - notificationId: notificationId, - subscriberId: subscriberId, - }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => - operations.ExecutionDetailsControllerGetExecutionDetailsForNotificationRequest$.outboundSchema.parse( - value$ - ), - "Input validation failed" - ); - const body$ = null; - - const path$ = this.templateURLComponent("/v1/execution-details")(); - - const query$ = encodeFormQuery$({ - notificationId: payload$.notificationId, - subscriberId: payload$.subscriberId, - }); - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "ExecutionDetailsController_getExecutionDetailsForNotification", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher>() - .json(200, z.array(components.ExecutionDetailsResponseDto$.inboundSchema)) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + return unwrapAsync(executionDetailsRetrieve(this, notificationId, subscriberId, options)); } } diff --git a/src/sdk/feeds.ts b/src/sdk/feeds.ts index ea08b864..92f2ba46 100644 --- a/src/sdk/feeds.ts +++ b/src/sdk/feeds.ts @@ -1,124 +1,23 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SDKHooks } from "../hooks/hooks.js"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; -import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; -import { HTTPClient } from "../lib/http.js"; -import * as retries$ from "../lib/retries.js"; -import * as schemas$ from "../lib/schemas.js"; +import { feedsCreate } from "../funcs/feedsCreate.js"; +import { feedsDelete } from "../funcs/feedsDelete.js"; +import { feedsRetrieve } from "../funcs/feedsRetrieve.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; -import * as operations from "../models/operations/index.js"; -import * as z from "zod"; +import { unwrapAsync } from "../types/fp.js"; export class Feeds extends ClientSDK { - private readonly options$: SDKOptions & { hooks?: SDKHooks }; - - constructor(options: SDKOptions = {}) { - const opt = options as unknown; - let hooks: SDKHooks; - if ( - typeof opt === "object" && - opt != null && - "hooks" in opt && - opt.hooks instanceof SDKHooks - ) { - hooks = opt.hooks; - } else { - hooks = new SDKHooks(); - } - - super({ - client: options.httpClient || new HTTPClient(), - baseURL: serverURLFromOptions(options), - hooks, - }); - - this.options$ = { ...options, hooks }; - void this.options$; - } - /** * Create feed */ async create( request: components.CreateFeedRequestDto, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise { - const input$ = request; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Content-Type", "application/json"); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => components.CreateFeedRequestDto$.outboundSchema.parse(value$), - "Input validation failed" - ); - const body$ = encodeJSON$("body", payload$, { explode: true }); - - const path$ = this.templateURLComponent("/v1/feeds")(); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "FeedsController_createFeed", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "POST", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(201, components.FeedResponseDto$) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + return unwrapAsync(feedsCreate(this, request, options)); } /** @@ -126,157 +25,15 @@ export class Feeds extends ClientSDK { */ async delete( feedId: string, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise> { - const input$: operations.FeedsControllerDeleteFeedByIdRequest = { - feedId: feedId, - }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => - operations.FeedsControllerDeleteFeedByIdRequest$.outboundSchema.parse(value$), - "Input validation failed" - ); - const body$ = null; - - const pathParams$ = { - feedId: encodeSimple$("feedId", payload$.feedId, { - explode: false, - charEncoding: "percent", - }), - }; - const path$ = this.templateURLComponent("/v1/feeds/{feedId}")(pathParams$); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "FeedsController_deleteFeedById", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "DELETE", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher>() - .json(200, z.array(components.FeedResponseDto$.inboundSchema)) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + return unwrapAsync(feedsDelete(this, feedId, options)); } /** * Get feeds */ - async retrieve( - options?: RequestOptions & { retries?: retries$.RetryConfig } - ): Promise> { - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); - - const path$ = this.templateURLComponent("/v1/feeds")(); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "FeedsController_getFeeds", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "GET", - path: path$, - headers: headers$, - query: query$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher>() - .json(200, z.array(components.FeedResponseDto$.inboundSchema)) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + async retrieve(options?: RequestOptions): Promise> { + return unwrapAsync(feedsRetrieve(this, options)); } } diff --git a/src/sdk/index.ts b/src/sdk/index.ts index 34a84fc2..ecac2264 100644 --- a/src/sdk/index.ts +++ b/src/sdk/index.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ export * from "./sdk.js"; diff --git a/src/sdk/integrations.ts b/src/sdk/integrations.ts index d26a9dae..d2e0f739 100644 --- a/src/sdk/integrations.ts +++ b/src/sdk/integrations.ts @@ -1,46 +1,19 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SDKHooks } from "../hooks/hooks.js"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; -import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; -import { HTTPClient } from "../lib/http.js"; -import * as retries$ from "../lib/retries.js"; -import * as schemas$ from "../lib/schemas.js"; +import { integrationsCreate } from "../funcs/integrationsCreate.js"; +import { integrationsDelete } from "../funcs/integrationsDelete.js"; +import { integrationsList } from "../funcs/integrationsList.js"; +import { integrationsListActive } from "../funcs/integrationsListActive.js"; +import { integrationsSetAsPrimary } from "../funcs/integrationsSetAsPrimary.js"; +import { integrationsUpdate } from "../funcs/integrationsUpdate.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; -import * as operations from "../models/operations/index.js"; +import { unwrapAsync } from "../types/fp.js"; import { Webhooks } from "./webhooks.js"; -import * as z from "zod"; export class Integrations extends ClientSDK { - private readonly options$: SDKOptions & { hooks?: SDKHooks }; - - constructor(options: SDKOptions = {}) { - const opt = options as unknown; - let hooks: SDKHooks; - if ( - typeof opt === "object" && - opt != null && - "hooks" in opt && - opt.hooks instanceof SDKHooks - ) { - hooks = opt.hooks; - } else { - hooks = new SDKHooks(); - } - - super({ - client: options.httpClient || new HTTPClient(), - baseURL: serverURLFromOptions(options), - hooks, - }); - - this.options$ = { ...options, hooks }; - void this.options$; - } - private _webhooks?: Webhooks; get webhooks(): Webhooks { return (this._webhooks ??= new Webhooks(this.options$)); @@ -54,80 +27,9 @@ export class Integrations extends ClientSDK { */ async create( request: components.CreateIntegrationRequestDto, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise { - const input$ = request; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Content-Type", "application/json"); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => components.CreateIntegrationRequestDto$.outboundSchema.parse(value$), - "Input validation failed" - ); - const body$ = encodeJSON$("body", payload$, { explode: true }); - - const path$ = this.templateURLComponent("/v1/integrations")(); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "IntegrationsController_createIntegration", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "POST", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(201, components.IntegrationResponseDto$) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + return unwrapAsync(integrationsCreate(this, request, options)); } /** @@ -135,90 +37,9 @@ export class Integrations extends ClientSDK { */ async delete( integrationId: string, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise> { - const input$: operations.IntegrationsControllerRemoveIntegrationRequest = { - integrationId: integrationId, - }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => - operations.IntegrationsControllerRemoveIntegrationRequest$.outboundSchema.parse( - value$ - ), - "Input validation failed" - ); - const body$ = null; - - const pathParams$ = { - integrationId: encodeSimple$("integrationId", payload$.integrationId, { - explode: false, - charEncoding: "percent", - }), - }; - const path$ = this.templateURLComponent("/v1/integrations/{integrationId}")(pathParams$); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "IntegrationsController_removeIntegration", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "DELETE", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher>() - .json(200, z.array(components.IntegrationResponseDto$.inboundSchema)) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + return unwrapAsync(integrationsDelete(this, integrationId, options)); } /** @@ -227,71 +48,8 @@ export class Integrations extends ClientSDK { * @remarks * Return all the integrations the user has created for that organization. Review v.0.17.0 changelog for a breaking change */ - async list( - options?: RequestOptions & { retries?: retries$.RetryConfig } - ): Promise> { - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); - - const path$ = this.templateURLComponent("/v1/integrations")(); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "IntegrationsController_listIntegrations", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "GET", - path: path$, - headers: headers$, - query: query$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher>() - .json(200, z.array(components.IntegrationResponseDto$.inboundSchema)) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + async list(options?: RequestOptions): Promise> { + return unwrapAsync(integrationsList(this, options)); } /** @@ -300,71 +58,8 @@ export class Integrations extends ClientSDK { * @remarks * Return all the active integrations the user has created for that organization. Review v.0.17.0 changelog for a breaking change */ - async listActive( - options?: RequestOptions & { retries?: retries$.RetryConfig } - ): Promise> { - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); - - const path$ = this.templateURLComponent("/v1/integrations/active")(); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "IntegrationsController_getActiveIntegrations", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "GET", - path: path$, - headers: headers$, - query: query$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher>() - .json(200, z.array(components.IntegrationResponseDto$.inboundSchema)) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + async listActive(options?: RequestOptions): Promise> { + return unwrapAsync(integrationsListActive(this, options)); } /** @@ -372,92 +67,9 @@ export class Integrations extends ClientSDK { */ async setAsPrimary( integrationId: string, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise { - const input$: operations.IntegrationsControllerSetIntegrationAsPrimaryRequest = { - integrationId: integrationId, - }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => - operations.IntegrationsControllerSetIntegrationAsPrimaryRequest$.outboundSchema.parse( - value$ - ), - "Input validation failed" - ); - const body$ = null; - - const pathParams$ = { - integrationId: encodeSimple$("integrationId", payload$.integrationId, { - explode: false, - charEncoding: "percent", - }), - }; - const path$ = this.templateURLComponent("/v1/integrations/{integrationId}/set-primary")( - pathParams$ - ); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "IntegrationsController_setIntegrationAsPrimary", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["404", "409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "POST", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json([200, 201], components.IntegrationResponseDto$) - .fail([404, 409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + return unwrapAsync(integrationsSetAsPrimary(this, integrationId, options)); } /** @@ -466,91 +78,10 @@ export class Integrations extends ClientSDK { async update( integrationId: string, updateIntegrationRequestDto: components.UpdateIntegrationRequestDto, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise { - const input$: operations.IntegrationsControllerUpdateIntegrationByIdRequest = { - integrationId: integrationId, - updateIntegrationRequestDto: updateIntegrationRequestDto, - }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Content-Type", "application/json"); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => - operations.IntegrationsControllerUpdateIntegrationByIdRequest$.outboundSchema.parse( - value$ - ), - "Input validation failed" - ); - const body$ = encodeJSON$("body", payload$.UpdateIntegrationRequestDto, { explode: true }); - - const pathParams$ = { - integrationId: encodeSimple$("integrationId", payload$.integrationId, { - explode: false, - charEncoding: "percent", - }), - }; - const path$ = this.templateURLComponent("/v1/integrations/{integrationId}")(pathParams$); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "IntegrationsController_updateIntegrationById", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["404", "409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "PUT", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options + return unwrapAsync( + integrationsUpdate(this, integrationId, updateIntegrationRequestDto, options) ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(200, components.IntegrationResponseDto$) - .fail([404, 409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; } } diff --git a/src/sdk/layouts.ts b/src/sdk/layouts.ts index a0b1d495..79fdf758 100644 --- a/src/sdk/layouts.ts +++ b/src/sdk/layouts.ts @@ -1,120 +1,27 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SDKHooks } from "../hooks/hooks.js"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; -import { - encodeFormQuery as encodeFormQuery$, - encodeJSON as encodeJSON$, - encodeSimple as encodeSimple$, -} from "../lib/encodings.js"; -import { HTTPClient } from "../lib/http.js"; -import * as retries$ from "../lib/retries.js"; -import * as schemas$ from "../lib/schemas.js"; +import { layoutsCreate } from "../funcs/layoutsCreate.js"; +import { layoutsDelete } from "../funcs/layoutsDelete.js"; +import { layoutsList } from "../funcs/layoutsList.js"; +import { layoutsRetrieve } from "../funcs/layoutsRetrieve.js"; +import { layoutsSetAsDefault } from "../funcs/layoutsSetAsDefault.js"; +import { layoutsUpdate } from "../funcs/layoutsUpdate.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; import * as operations from "../models/operations/index.js"; -import * as z from "zod"; +import { unwrapAsync } from "../types/fp.js"; export class Layouts extends ClientSDK { - private readonly options$: SDKOptions & { hooks?: SDKHooks }; - - constructor(options: SDKOptions = {}) { - const opt = options as unknown; - let hooks: SDKHooks; - if ( - typeof opt === "object" && - opt != null && - "hooks" in opt && - opt.hooks instanceof SDKHooks - ) { - hooks = opt.hooks; - } else { - hooks = new SDKHooks(); - } - - super({ - client: options.httpClient || new HTTPClient(), - baseURL: serverURLFromOptions(options), - hooks, - }); - - this.options$ = { ...options, hooks }; - void this.options$; - } - /** * Layout creation * * @remarks * Create a layout */ - async create( - options?: RequestOptions & { retries?: retries$.RetryConfig } - ): Promise { - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); - - const path$ = this.templateURLComponent("/v1/layouts")(); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "LayoutsController_PropertyDescriptor", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "POST", - path: path$, - headers: headers$, - query: query$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(201, components.CreateLayoutResponseDto$) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + async create(options?: RequestOptions): Promise { + return unwrapAsync(layoutsCreate(this, options)); } /** @@ -123,90 +30,8 @@ export class Layouts extends ClientSDK { * @remarks * Execute a soft delete of a layout given a certain ID. */ - async delete( - layoutId: string, - options?: RequestOptions & { retries?: retries$.RetryConfig } - ): Promise { - const input$: operations.LayoutsControllerDeleteLayoutRequest = { - layoutId: layoutId, - }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "*/*"); - - const payload$ = schemas$.parse( - input$, - (value$) => - operations.LayoutsControllerDeleteLayoutRequest$.outboundSchema.parse(value$), - "Input validation failed" - ); - const body$ = null; - - const pathParams$ = { - layoutId: encodeSimple$("layoutId", payload$.layoutId, { - explode: false, - charEncoding: "percent", - }), - }; - const path$ = this.templateURLComponent("/v1/layouts/{layoutId}")(pathParams$); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "LayoutsController_deleteLayout", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["404", "409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "DELETE", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .void(204, z.void()) - .fail([404, 409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + async delete(layoutId: string, options?: RequestOptions): Promise { + return unwrapAsync(layoutsDelete(this, layoutId, options)); } /** @@ -217,85 +42,9 @@ export class Layouts extends ClientSDK { */ async list( request: operations.LayoutsControllerListLayoutsRequest, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise { - const input$ = typeof request === "undefined" ? {} : request; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "*/*"); - - const payload$ = schemas$.parse( - input$, - (value$) => - operations.LayoutsControllerListLayoutsRequest$.outboundSchema.parse(value$), - "Input validation failed" - ); - const body$ = null; - - const path$ = this.templateURLComponent("/v1/layouts")(); - - const query$ = encodeFormQuery$({ - orderBy: payload$.orderBy, - page: payload$.page, - pageSize: payload$.pageSize, - sortBy: payload$.sortBy, - }); - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "LayoutsController_listLayouts", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["400", "409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .void(200, z.void()) - .fail([400, 409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + return unwrapAsync(layoutsList(this, request, options)); } /** @@ -306,87 +55,9 @@ export class Layouts extends ClientSDK { */ async retrieve( layoutId: string, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise { - const input$: operations.LayoutsControllerGetLayoutRequest = { - layoutId: layoutId, - }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => operations.LayoutsControllerGetLayoutRequest$.outboundSchema.parse(value$), - "Input validation failed" - ); - const body$ = null; - - const pathParams$ = { - layoutId: encodeSimple$("layoutId", payload$.layoutId, { - explode: false, - charEncoding: "percent", - }), - }; - const path$ = this.templateURLComponent("/v1/layouts/{layoutId}")(pathParams$); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "LayoutsController_getLayout", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["404", "409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(200, components.GetLayoutResponseDto$) - .fail([404, 409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + return unwrapAsync(layoutsRetrieve(this, layoutId, options)); } /** @@ -395,90 +66,8 @@ export class Layouts extends ClientSDK { * @remarks * Sets the default layout for the environment and updates to non default to the existing default layout (if any). */ - async setAsDefault( - layoutId: string, - options?: RequestOptions & { retries?: retries$.RetryConfig } - ): Promise { - const input$: operations.LayoutsControllerSetDefaultLayoutRequest = { - layoutId: layoutId, - }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "*/*"); - - const payload$ = schemas$.parse( - input$, - (value$) => - operations.LayoutsControllerSetDefaultLayoutRequest$.outboundSchema.parse(value$), - "Input validation failed" - ); - const body$ = null; - - const pathParams$ = { - layoutId: encodeSimple$("layoutId", payload$.layoutId, { - explode: false, - charEncoding: "percent", - }), - }; - const path$ = this.templateURLComponent("/v1/layouts/{layoutId}/default")(pathParams$); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "LayoutsController_setDefaultLayout", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["404", "409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "POST", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .void(204, z.void()) - .fail([404, 409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + async setAsDefault(layoutId: string, options?: RequestOptions): Promise { + return unwrapAsync(layoutsSetAsDefault(this, layoutId, options)); } /** @@ -490,92 +79,8 @@ export class Layouts extends ClientSDK { async update( layoutId: string, updateLayoutRequestDto: components.UpdateLayoutRequestDto, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise { - const input$: operations.LayoutsControllerUpdateLayoutRequest = { - layoutId: layoutId, - updateLayoutRequestDto: updateLayoutRequestDto, - }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Content-Type", "application/json"); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => - operations.LayoutsControllerUpdateLayoutRequest$.outboundSchema.parse(value$), - "Input validation failed" - ); - const body$ = encodeJSON$("body", payload$.UpdateLayoutRequestDto, { explode: true }); - - const pathParams$ = { - layoutId: encodeSimple$("layoutId", payload$.layoutId, { - explode: false, - charEncoding: "percent", - }), - }; - const path$ = this.templateURLComponent("/v1/layouts/{layoutId}")(pathParams$); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "LayoutsController_updateLayout", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { - context, - errorCodes: ["400", "404", "409", "429", "4XX", "503", "5XX"], - }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "PATCH", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(200, components.UpdateLayoutResponseDto$) - .fail([400, 404, 409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + return unwrapAsync(layoutsUpdate(this, layoutId, updateLayoutRequestDto, options)); } } diff --git a/src/sdk/members.ts b/src/sdk/members.ts deleted file mode 100644 index 855b9dd3..00000000 --- a/src/sdk/members.ts +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - */ - -import { SDKHooks } from "../hooks/hooks.js"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; -import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; -import { HTTPClient } from "../lib/http.js"; -import * as retries$ from "../lib/retries.js"; -import * as schemas$ from "../lib/schemas.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as components from "../models/components/index.js"; -import * as operations from "../models/operations/index.js"; -import * as z from "zod"; - -export class Members extends ClientSDK { - private readonly options$: SDKOptions & { hooks?: SDKHooks }; - - constructor(options: SDKOptions = {}) { - const opt = options as unknown; - let hooks: SDKHooks; - if ( - typeof opt === "object" && - opt != null && - "hooks" in opt && - opt.hooks instanceof SDKHooks - ) { - hooks = opt.hooks; - } else { - hooks = new SDKHooks(); - } - - super({ - client: options.httpClient || new HTTPClient(), - baseURL: serverURLFromOptions(options), - hooks, - }); - - this.options$ = { ...options, hooks }; - void this.options$; - } - - /** - * Remove a member from organization using memberId - */ - async delete( - memberId: string, - options?: RequestOptions & { retries?: retries$.RetryConfig } - ): Promise { - const input$: operations.OrganizationControllerRemoveRequest = { - memberId: memberId, - }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => - operations.OrganizationControllerRemoveRequest$.outboundSchema.parse(value$), - "Input validation failed" - ); - const body$ = null; - - const pathParams$ = { - memberId: encodeSimple$("memberId", payload$.memberId, { - explode: false, - charEncoding: "percent", - }), - }; - const path$ = this.templateURLComponent("/v1/organizations/members/{memberId}")( - pathParams$ - ); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "OrganizationController_remove", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "DELETE", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(200, components.MemberResponseDto$) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; - } - - /** - * Fetch all members of current organizations - */ - async list( - options?: RequestOptions & { retries?: retries$.RetryConfig } - ): Promise> { - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); - - const path$ = this.templateURLComponent("/v1/organizations/members")(); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "OrganizationController_listOrganizationMembers", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "GET", - path: path$, - headers: headers$, - query: query$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher>() - .json(200, z.array(components.MemberResponseDto$.inboundSchema)) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; - } -} diff --git a/src/sdk/messages.ts b/src/sdk/messages.ts index 140e3528..87e10a65 100644 --- a/src/sdk/messages.ts +++ b/src/sdk/messages.ts @@ -1,48 +1,16 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SDKHooks } from "../hooks/hooks.js"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; -import { - encodeFormQuery as encodeFormQuery$, - encodeSimple as encodeSimple$, -} from "../lib/encodings.js"; -import { HTTPClient } from "../lib/http.js"; -import * as retries$ from "../lib/retries.js"; -import * as schemas$ from "../lib/schemas.js"; +import { messagesDelete } from "../funcs/messagesDelete.js"; +import { messagesDeleteByTransactionId } from "../funcs/messagesDeleteByTransactionId.js"; +import { messagesRetrieve } from "../funcs/messagesRetrieve.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; import * as operations from "../models/operations/index.js"; -import * as z from "zod"; +import { unwrapAsync } from "../types/fp.js"; export class Messages extends ClientSDK { - private readonly options$: SDKOptions & { hooks?: SDKHooks }; - - constructor(options: SDKOptions = {}) { - const opt = options as unknown; - let hooks: SDKHooks; - if ( - typeof opt === "object" && - opt != null && - "hooks" in opt && - opt.hooks instanceof SDKHooks - ) { - hooks = opt.hooks; - } else { - hooks = new SDKHooks(); - } - - super({ - client: options.httpClient || new HTTPClient(), - baseURL: serverURLFromOptions(options), - hooks, - }); - - this.options$ = { ...options, hooks }; - void this.options$; - } - /** * Delete message * @@ -51,88 +19,9 @@ export class Messages extends ClientSDK { */ async delete( messageId: string, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise { - const input$: operations.MessagesControllerDeleteMessageRequest = { - messageId: messageId, - }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => - operations.MessagesControllerDeleteMessageRequest$.outboundSchema.parse(value$), - "Input validation failed" - ); - const body$ = null; - - const pathParams$ = { - messageId: encodeSimple$("messageId", payload$.messageId, { - explode: false, - charEncoding: "percent", - }), - }; - const path$ = this.templateURLComponent("/v1/messages/{messageId}")(pathParams$); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "MessagesController_deleteMessage", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "DELETE", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(200, components.DeleteMessageResponseDto$) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + return unwrapAsync(messagesDelete(this, messageId, options)); } /** @@ -144,95 +33,9 @@ export class Messages extends ClientSDK { async deleteByTransactionId( transactionId: string, channel?: operations.Channel | undefined, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise { - const input$: operations.MessagesControllerDeleteMessagesByTransactionIdRequest = { - channel: channel, - transactionId: transactionId, - }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "*/*"); - - const payload$ = schemas$.parse( - input$, - (value$) => - operations.MessagesControllerDeleteMessagesByTransactionIdRequest$.outboundSchema.parse( - value$ - ), - "Input validation failed" - ); - const body$ = null; - - const pathParams$ = { - transactionId: encodeSimple$("transactionId", payload$.transactionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path$ = this.templateURLComponent("/v1/messages/transaction/{transactionId}")( - pathParams$ - ); - - const query$ = encodeFormQuery$({ - channel: payload$.channel, - }); - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "MessagesController_deleteMessagesByTransactionId", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "DELETE", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .void(204, z.void()) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + return unwrapAsync(messagesDeleteByTransactionId(this, transactionId, channel, options)); } /** @@ -243,85 +46,8 @@ export class Messages extends ClientSDK { */ async retrieve( request: operations.MessagesControllerGetMessagesRequest, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise { - const input$ = typeof request === "undefined" ? {} : request; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => - operations.MessagesControllerGetMessagesRequest$.outboundSchema.parse(value$), - "Input validation failed" - ); - const body$ = null; - - const path$ = this.templateURLComponent("/v1/messages")(); - - const query$ = encodeFormQuery$({ - channel: payload$.channel, - limit: payload$.limit, - page: payload$.page, - subscriberId: payload$.subscriberId, - transactionId: payload$.transactionId, - }); - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "MessagesController_getMessages", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(200, components.ActivitiesResponseDto$) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + return unwrapAsync(messagesRetrieve(this, request, options)); } } diff --git a/src/sdk/notifications.ts b/src/sdk/notifications.ts index 27c315c1..f088e6e6 100644 --- a/src/sdk/notifications.ts +++ b/src/sdk/notifications.ts @@ -1,48 +1,16 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SDKHooks } from "../hooks/hooks.js"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; -import { - encodeFormQuery as encodeFormQuery$, - encodeSimple as encodeSimple$, -} from "../lib/encodings.js"; -import { HTTPClient } from "../lib/http.js"; -import * as retries$ from "../lib/retries.js"; -import * as schemas$ from "../lib/schemas.js"; +import { notificationsList } from "../funcs/notificationsList.js"; +import { notificationsRetrieve } from "../funcs/notificationsRetrieve.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; import * as operations from "../models/operations/index.js"; +import { unwrapAsync } from "../types/fp.js"; import { Stats } from "./stats.js"; export class Notifications extends ClientSDK { - private readonly options$: SDKOptions & { hooks?: SDKHooks }; - - constructor(options: SDKOptions = {}) { - const opt = options as unknown; - let hooks: SDKHooks; - if ( - typeof opt === "object" && - opt != null && - "hooks" in opt && - opt.hooks instanceof SDKHooks - ) { - hooks = opt.hooks; - } else { - hooks = new SDKHooks(); - } - - super({ - client: options.httpClient || new HTTPClient(), - baseURL: serverURLFromOptions(options), - hooks, - }); - - this.options$ = { ...options, hooks }; - void this.options$; - } - private _stats?: Stats; get stats(): Stats { return (this._stats ??= new Stats(this.options$)); @@ -53,90 +21,9 @@ export class Notifications extends ClientSDK { */ async list( request: operations.NotificationsControllerListNotificationsRequest, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise { - const input$ = request; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => - operations.NotificationsControllerListNotificationsRequest$.outboundSchema.parse( - value$ - ), - "Input validation failed" - ); - const body$ = null; - - const path$ = this.templateURLComponent("/v1/notifications")(); - - const query$ = encodeFormQuery$({ - channels: payload$.channels, - emails: payload$.emails, - page: payload$.page, - search: payload$.search, - subscriberIds: payload$.subscriberIds, - templates: payload$.templates, - transactionId: payload$.transactionId, - }); - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "NotificationsController_listNotifications", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(200, components.ActivitiesResponseDto$) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + return unwrapAsync(notificationsList(this, request, options)); } /** @@ -144,89 +31,8 @@ export class Notifications extends ClientSDK { */ async retrieve( notificationId: string, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise { - const input$: operations.NotificationsControllerGetNotificationRequest = { - notificationId: notificationId, - }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => - operations.NotificationsControllerGetNotificationRequest$.outboundSchema.parse( - value$ - ), - "Input validation failed" - ); - const body$ = null; - - const pathParams$ = { - notificationId: encodeSimple$("notificationId", payload$.notificationId, { - explode: false, - charEncoding: "percent", - }), - }; - const path$ = this.templateURLComponent("/v1/notifications/{notificationId}")(pathParams$); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "NotificationsController_getNotification", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(200, components.ActivityNotificationResponseDto$) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + return unwrapAsync(notificationsRetrieve(this, notificationId, options)); } } diff --git a/src/sdk/novumessages.ts b/src/sdk/novumessages.ts index e7f3aa34..25a26912 100644 --- a/src/sdk/novumessages.ts +++ b/src/sdk/novumessages.ts @@ -1,139 +1,27 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SDKHooks } from "../hooks/hooks.js"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; -import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; -import { HTTPClient } from "../lib/http.js"; -import * as retries$ from "../lib/retries.js"; -import * as schemas$ from "../lib/schemas.js"; +import { subscribersMessagesMarkAll } from "../funcs/subscribersMessagesMarkAll.js"; +import { subscribersMessagesMarkAllAs } from "../funcs/subscribersMessagesMarkAllAs.js"; +import { subscribersMessagesUpdateAsSeen } from "../funcs/subscribersMessagesUpdateAsSeen.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; import * as operations from "../models/operations/index.js"; -import * as z from "zod"; +import { unwrapAsync } from "../types/fp.js"; export class NovuMessages extends ClientSDK { - private readonly options$: SDKOptions & { hooks?: SDKHooks }; - - constructor(options: SDKOptions = {}) { - const opt = options as unknown; - let hooks: SDKHooks; - if ( - typeof opt === "object" && - opt != null && - "hooks" in opt && - opt.hooks instanceof SDKHooks - ) { - hooks = opt.hooks; - } else { - hooks = new SDKHooks(); - } - - super({ - client: options.httpClient || new HTTPClient(), - baseURL: serverURLFromOptions(options), - hooks, - }); - - this.options$ = { ...options, hooks }; - void this.options$; - } - /** * Marks all the subscriber messages as read, unread, seen or unseen. Optionally you can pass feed id (or array) to mark messages of a particular feed. */ async markAll( subscriberId: string, markAllMessageAsRequestDto: components.MarkAllMessageAsRequestDto, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise { - const input$: operations.SubscribersControllerMarkAllUnreadAsReadRequest = { - subscriberId: subscriberId, - markAllMessageAsRequestDto: markAllMessageAsRequestDto, - }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Content-Type", "application/json"); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => - operations.SubscribersControllerMarkAllUnreadAsReadRequest$.outboundSchema.parse( - value$ - ), - "Input validation failed" + return unwrapAsync( + subscribersMessagesMarkAll(this, subscriberId, markAllMessageAsRequestDto, options) ); - const body$ = encodeJSON$("body", payload$.MarkAllMessageAsRequestDto, { explode: true }); - - const pathParams$ = { - subscriberId: encodeSimple$("subscriberId", payload$.subscriberId, { - explode: false, - charEncoding: "percent", - }), - }; - const path$ = this.templateURLComponent("/v1/subscribers/{subscriberId}/messages/mark-all")( - pathParams$ - ); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "SubscribersController_markAllUnreadAsRead", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "POST", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(201, z.number()) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; } /** @@ -142,92 +30,11 @@ export class NovuMessages extends ClientSDK { async markAllAs( subscriberId: string, messageMarkAsRequestDto: components.MessageMarkAsRequestDto, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise> { - const input$: operations.SubscribersControllerMarkMessagesAsRequest = { - subscriberId: subscriberId, - messageMarkAsRequestDto: messageMarkAsRequestDto, - }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Content-Type", "application/json"); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => - operations.SubscribersControllerMarkMessagesAsRequest$.outboundSchema.parse(value$), - "Input validation failed" + return unwrapAsync( + subscribersMessagesMarkAllAs(this, subscriberId, messageMarkAsRequestDto, options) ); - const body$ = encodeJSON$("body", payload$.MessageMarkAsRequestDto, { explode: true }); - - const pathParams$ = { - subscriberId: encodeSimple$("subscriberId", payload$.subscriberId, { - explode: false, - charEncoding: "percent", - }), - }; - const path$ = this.templateURLComponent("/v1/subscribers/{subscriberId}/messages/mark-as")( - pathParams$ - ); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "SubscribersController_markMessagesAs", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "POST", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher>() - .json(201, z.array(components.MessageEntity$.inboundSchema)) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; } /** @@ -235,95 +42,8 @@ export class NovuMessages extends ClientSDK { */ async updateAsSeen( request: operations.SubscribersControllerMarkActionAsSeenRequest, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise { - const input$ = request; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Content-Type", "application/json"); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => - operations.SubscribersControllerMarkActionAsSeenRequest$.outboundSchema.parse( - value$ - ), - "Input validation failed" - ); - const body$ = encodeJSON$("body", payload$.MarkMessageActionAsSeenDto, { explode: true }); - - const pathParams$ = { - messageId: encodeSimple$("messageId", payload$.messageId, { - explode: false, - charEncoding: "percent", - }), - subscriberId: encodeSimple$("subscriberId", payload$.subscriberId, { - explode: false, - charEncoding: "percent", - }), - type: encodeSimple$("type", payload$.type, { explode: false, charEncoding: "percent" }), - }; - const path$ = this.templateURLComponent( - "/v1/subscribers/{subscriberId}/messages/{messageId}/actions/{type}" - )(pathParams$); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "SubscribersController_markActionAsSeen", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "POST", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(201, components.MessageResponseDto$) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + return unwrapAsync(subscribersMessagesUpdateAsSeen(this, request, options)); } } diff --git a/src/sdk/novunotifications.ts b/src/sdk/novunotifications.ts index 39b05d6c..71379e53 100644 --- a/src/sdk/novunotifications.ts +++ b/src/sdk/novunotifications.ts @@ -1,143 +1,23 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SDKHooks } from "../hooks/hooks.js"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; -import { - encodeFormQuery as encodeFormQuery$, - encodeSimple as encodeSimple$, -} from "../lib/encodings.js"; -import { HTTPClient } from "../lib/http.js"; -import * as retries$ from "../lib/retries.js"; -import * as schemas$ from "../lib/schemas.js"; +import { subscribersNotificationsRetrieve } from "../funcs/subscribersNotificationsRetrieve.js"; +import { subscribersNotificationsUnseenCount } from "../funcs/subscribersNotificationsUnseenCount.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; import * as operations from "../models/operations/index.js"; +import { unwrapAsync } from "../types/fp.js"; export class NovuNotifications extends ClientSDK { - private readonly options$: SDKOptions & { hooks?: SDKHooks }; - - constructor(options: SDKOptions = {}) { - const opt = options as unknown; - let hooks: SDKHooks; - if ( - typeof opt === "object" && - opt != null && - "hooks" in opt && - opt.hooks instanceof SDKHooks - ) { - hooks = opt.hooks; - } else { - hooks = new SDKHooks(); - } - - super({ - client: options.httpClient || new HTTPClient(), - baseURL: serverURLFromOptions(options), - hooks, - }); - - this.options$ = { ...options, hooks }; - void this.options$; - } - /** * Get in-app notification feed for a particular subscriber */ async retrieve( request: operations.SubscribersControllerGetNotificationsFeedRequest, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise { - const input$ = request; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => - operations.SubscribersControllerGetNotificationsFeedRequest$.outboundSchema.parse( - value$ - ), - "Input validation failed" - ); - const body$ = null; - - const pathParams$ = { - subscriberId: encodeSimple$("subscriberId", payload$.subscriberId, { - explode: false, - charEncoding: "percent", - }), - }; - const path$ = this.templateURLComponent( - "/v1/subscribers/{subscriberId}/notifications/feed" - )(pathParams$); - - const query$ = encodeFormQuery$({ - limit: payload$.limit, - page: payload$.page, - payload: payload$.payload, - read: payload$.read, - seen: payload$.seen, - }); - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "SubscribersController_getNotificationsFeed", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = - await this.matcher() - .json(200, operations.SubscribersControllerGetNotificationsFeedResponseBody$) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + return unwrapAsync(subscribersNotificationsRetrieve(this, request, options)); } /** @@ -145,90 +25,8 @@ export class NovuNotifications extends ClientSDK { */ async unseenCount( request: operations.SubscribersControllerGetUnseenCountRequest, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise { - const input$ = request; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => - operations.SubscribersControllerGetUnseenCountRequest$.outboundSchema.parse(value$), - "Input validation failed" - ); - const body$ = null; - - const pathParams$ = { - subscriberId: encodeSimple$("subscriberId", payload$.subscriberId, { - explode: false, - charEncoding: "percent", - }), - }; - const path$ = this.templateURLComponent( - "/v1/subscribers/{subscriberId}/notifications/unseen" - )(pathParams$); - - const query$ = encodeFormQuery$({ - limit: payload$.limit, - seen: payload$.seen, - }); - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "SubscribersController_getUnseenCount", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(200, components.UnseenCountResponse$) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + return unwrapAsync(subscribersNotificationsUnseenCount(this, request, options)); } } diff --git a/src/sdk/novusubscribers.ts b/src/sdk/novusubscribers.ts index 703d2b85..ee1a37da 100644 --- a/src/sdk/novusubscribers.ts +++ b/src/sdk/novusubscribers.ts @@ -1,45 +1,15 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SDKHooks } from "../hooks/hooks.js"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; -import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; -import { HTTPClient } from "../lib/http.js"; -import * as retries$ from "../lib/retries.js"; -import * as schemas$ from "../lib/schemas.js"; +import { topicsSubscribersAssign } from "../funcs/topicsSubscribersAssign.js"; +import { topicsSubscribersDelete } from "../funcs/topicsSubscribersDelete.js"; +import { topicsSubscribersRetrieve } from "../funcs/topicsSubscribersRetrieve.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; -import * as operations from "../models/operations/index.js"; -import * as z from "zod"; +import { unwrapAsync } from "../types/fp.js"; export class NovuSubscribers extends ClientSDK { - private readonly options$: SDKOptions & { hooks?: SDKHooks }; - - constructor(options: SDKOptions = {}) { - const opt = options as unknown; - let hooks: SDKHooks; - if ( - typeof opt === "object" && - opt != null && - "hooks" in opt && - opt.hooks instanceof SDKHooks - ) { - hooks = opt.hooks; - } else { - hooks = new SDKHooks(); - } - - super({ - client: options.httpClient || new HTTPClient(), - baseURL: serverURLFromOptions(options), - hooks, - }); - - this.options$ = { ...options, hooks }; - void this.options$; - } - /** * Subscribers addition * @@ -49,90 +19,11 @@ export class NovuSubscribers extends ClientSDK { async assign( topicKey: string, addSubscribersRequestDto: components.AddSubscribersRequestDto, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise { - const input$: operations.TopicsControllerAddSubscribersRequest = { - topicKey: topicKey, - addSubscribersRequestDto: addSubscribersRequestDto, - }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Content-Type", "application/json"); - headers$.set("Accept", "*/*"); - - const payload$ = schemas$.parse( - input$, - (value$) => - operations.TopicsControllerAddSubscribersRequest$.outboundSchema.parse(value$), - "Input validation failed" - ); - const body$ = encodeJSON$("body", payload$.AddSubscribersRequestDto, { explode: true }); - - const pathParams$ = { - topicKey: encodeSimple$("topicKey", payload$.topicKey, { - explode: false, - charEncoding: "percent", - }), - }; - const path$ = this.templateURLComponent("/v1/topics/{topicKey}/subscribers")(pathParams$); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "TopicsController_addSubscribers", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "POST", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options + return unwrapAsync( + topicsSubscribersAssign(this, topicKey, addSubscribersRequestDto, options) ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .void([200, 204], z.void()) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; } /** @@ -144,92 +35,11 @@ export class NovuSubscribers extends ClientSDK { async delete( topicKey: string, removeSubscribersRequestDto: components.RemoveSubscribersRequestDto, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise { - const input$: operations.TopicsControllerRemoveSubscribersRequest = { - topicKey: topicKey, - removeSubscribersRequestDto: removeSubscribersRequestDto, - }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Content-Type", "application/json"); - headers$.set("Accept", "*/*"); - - const payload$ = schemas$.parse( - input$, - (value$) => - operations.TopicsControllerRemoveSubscribersRequest$.outboundSchema.parse(value$), - "Input validation failed" - ); - const body$ = encodeJSON$("body", payload$.RemoveSubscribersRequestDto, { explode: true }); - - const pathParams$ = { - topicKey: encodeSimple$("topicKey", payload$.topicKey, { - explode: false, - charEncoding: "percent", - }), - }; - const path$ = this.templateURLComponent("/v1/topics/{topicKey}/subscribers/removal")( - pathParams$ + return unwrapAsync( + topicsSubscribersDelete(this, topicKey, removeSubscribersRequestDto, options) ); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "TopicsController_removeSubscribers", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "POST", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .void(204, z.void()) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; } /** @@ -239,97 +49,12 @@ export class NovuSubscribers extends ClientSDK { * Check if a subscriber belongs to a certain topic */ async retrieve( - topicKey: string, externalSubscriberId: string, - options?: RequestOptions & { retries?: retries$.RetryConfig } + topicKey: string, + options?: RequestOptions ): Promise { - const input$: operations.TopicsControllerGetTopicSubscriberRequest = { - topicKey: topicKey, - externalSubscriberId: externalSubscriberId, - }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => - operations.TopicsControllerGetTopicSubscriberRequest$.outboundSchema.parse(value$), - "Input validation failed" + return unwrapAsync( + topicsSubscribersRetrieve(this, externalSubscriberId, topicKey, options) ); - const body$ = null; - - const pathParams$ = { - externalSubscriberId: encodeSimple$( - "externalSubscriberId", - payload$.externalSubscriberId, - { explode: false, charEncoding: "percent" } - ), - topicKey: encodeSimple$("topicKey", payload$.topicKey, { - explode: false, - charEncoding: "percent", - }), - }; - const path$ = this.templateURLComponent( - "/v1/topics/{topicKey}/subscribers/{externalSubscriberId}" - )(pathParams$); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "TopicsController_getTopicSubscriber", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(200, components.TopicSubscriberDto$) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; } } diff --git a/src/sdk/organizations.ts b/src/sdk/organizations.ts index 5f0b637a..d78b764c 100644 --- a/src/sdk/organizations.ts +++ b/src/sdk/organizations.ts @@ -1,355 +1,41 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SDKHooks } from "../hooks/hooks.js"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; -import { encodeJSON as encodeJSON$ } from "../lib/encodings.js"; -import { HTTPClient } from "../lib/http.js"; -import * as retries$ from "../lib/retries.js"; -import * as schemas$ from "../lib/schemas.js"; +import { organizationsEEOrganizationControllerRenameOrganization } from "../funcs/organizationsEEOrganizationControllerRenameOrganization.js"; +import { organizationsRetrieve } from "../funcs/organizationsRetrieve.js"; +import { organizationsUpdate } from "../funcs/organizationsUpdate.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; -import { Branding } from "./branding.js"; -import { Members } from "./members.js"; -import * as z from "zod"; +import { unwrapAsync } from "../types/fp.js"; export class Organizations extends ClientSDK { - private readonly options$: SDKOptions & { hooks?: SDKHooks }; - - constructor(options: SDKOptions = {}) { - const opt = options as unknown; - let hooks: SDKHooks; - if ( - typeof opt === "object" && - opt != null && - "hooks" in opt && - opt.hooks instanceof SDKHooks - ) { - hooks = opt.hooks; - } else { - hooks = new SDKHooks(); - } - - super({ - client: options.httpClient || new HTTPClient(), - baseURL: serverURLFromOptions(options), - hooks, - }); - - this.options$ = { ...options, hooks }; - void this.options$; - } - - private _branding?: Branding; - get branding(): Branding { - return (this._branding ??= new Branding(this.options$)); - } - - private _members?: Members; - get members(): Members { - return (this._members ??= new Members(this.options$)); - } - - /** - * Create an organization - */ - async create( - request: components.CreateOrganizationDto, - options?: RequestOptions & { retries?: retries$.RetryConfig } - ): Promise { - const input$ = request; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Content-Type", "application/json"); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => components.CreateOrganizationDto$.outboundSchema.parse(value$), - "Input validation failed" - ); - const body$ = encodeJSON$("body", payload$, { explode: true }); - - const path$ = this.templateURLComponent("/v1/organizations")(); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "OrganizationController_createOrganization", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "POST", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(201, components.OrganizationResponseDto$) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; - } - - /** - * Fetch all organizations - */ - async list( - options?: RequestOptions & { retries?: retries$.RetryConfig } - ): Promise> { - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); - - const path$ = this.templateURLComponent("/v1/organizations")(); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "OrganizationController_listOrganizations", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "GET", - path: path$, - headers: headers$, - query: query$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher>() - .json(200, z.array(components.OrganizationResponseDto$.inboundSchema)) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; - } - /** * Rename organization name */ - async rename( + async eeOrganizationControllerRenameOrganization( request: components.RenameOrganizationDto, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise { - const input$ = request; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Content-Type", "application/json"); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => components.RenameOrganizationDto$.outboundSchema.parse(value$), - "Input validation failed" - ); - const body$ = encodeJSON$("body", payload$, { explode: true }); - - const path$ = this.templateURLComponent("/v1/organizations")(); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "OrganizationController_rename", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "PATCH", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options + return unwrapAsync( + organizationsEEOrganizationControllerRenameOrganization(this, request, options) ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(200, components.RenameOrganizationDto$) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; } /** * Fetch current organization details */ - async retrieve( - options?: RequestOptions & { retries?: retries$.RetryConfig } - ): Promise { - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); - - const path$ = this.templateURLComponent("/v1/organizations/me")(); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "OrganizationController_getSelfOrganizationData", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "GET", - path: path$, - headers: headers$, - query: query$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(200, components.OrganizationResponseDto$) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); + async retrieve(options?: RequestOptions): Promise { + return unwrapAsync(organizationsRetrieve(this, options)); + } - return result$; + /** + * Update organization branding details + */ + async update( + request: components.UpdateBrandingDetailsDto, + options?: RequestOptions + ): Promise { + return unwrapAsync(organizationsUpdate(this, request, options)); } } diff --git a/src/sdk/preferences.ts b/src/sdk/preferences.ts index 85d5bb32..44a6b0bf 100644 --- a/src/sdk/preferences.ts +++ b/src/sdk/preferences.ts @@ -1,138 +1,25 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SDKHooks } from "../hooks/hooks.js"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; -import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; -import { HTTPClient } from "../lib/http.js"; -import * as retries$ from "../lib/retries.js"; -import * as schemas$ from "../lib/schemas.js"; +import { subscribersPreferencesList } from "../funcs/subscribersPreferencesList.js"; +import { subscribersPreferencesRetrieveByLevel } from "../funcs/subscribersPreferencesRetrieveByLevel.js"; +import { subscribersPreferencesUpdate } from "../funcs/subscribersPreferencesUpdate.js"; +import { subscribersPreferencesUpdateGlobal } from "../funcs/subscribersPreferencesUpdateGlobal.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; import * as operations from "../models/operations/index.js"; -import * as z from "zod"; +import { unwrapAsync } from "../types/fp.js"; export class Preferences extends ClientSDK { - private readonly options$: SDKOptions & { hooks?: SDKHooks }; - - constructor(options: SDKOptions = {}) { - const opt = options as unknown; - let hooks: SDKHooks; - if ( - typeof opt === "object" && - opt != null && - "hooks" in opt && - opt.hooks instanceof SDKHooks - ) { - hooks = opt.hooks; - } else { - hooks = new SDKHooks(); - } - - super({ - client: options.httpClient || new HTTPClient(), - baseURL: serverURLFromOptions(options), - hooks, - }); - - this.options$ = { ...options, hooks }; - void this.options$; - } - /** * Get subscriber preferences */ async list( subscriberId: string, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise> { - const input$: operations.SubscribersControllerListSubscriberPreferencesRequest = { - subscriberId: subscriberId, - }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => - operations.SubscribersControllerListSubscriberPreferencesRequest$.outboundSchema.parse( - value$ - ), - "Input validation failed" - ); - const body$ = null; - - const pathParams$ = { - subscriberId: encodeSimple$("subscriberId", payload$.subscriberId, { - explode: false, - charEncoding: "percent", - }), - }; - const path$ = this.templateURLComponent("/v1/subscribers/{subscriberId}/preferences")( - pathParams$ - ); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "SubscribersController_listSubscriberPreferences", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher< - Array - >() - .json(200, z.array(components.UpdateSubscriberPreferenceResponseDto$.inboundSchema)) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + return unwrapAsync(subscribersPreferencesList(this, subscriberId, options)); } /** @@ -141,99 +28,11 @@ export class Preferences extends ClientSDK { async retrieveByLevel( parameter: operations.Parameter, subscriberId: string, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise> { - const input$: operations.SubscribersControllerGetSubscriberPreferenceByLevelRequest = { - parameter: parameter, - subscriberId: subscriberId, - }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => - operations.SubscribersControllerGetSubscriberPreferenceByLevelRequest$.outboundSchema.parse( - value$ - ), - "Input validation failed" - ); - const body$ = null; - - const pathParams$ = { - parameter: encodeSimple$("parameter", payload$.parameter, { - explode: false, - charEncoding: "percent", - }), - subscriberId: encodeSimple$("subscriberId", payload$.subscriberId, { - explode: false, - charEncoding: "percent", - }), - }; - const path$ = this.templateURLComponent( - "/v1/subscribers/{subscriberId}/preferences/{parameter}" - )(pathParams$); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "SubscribersController_getSubscriberPreferenceByLevel", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } + return unwrapAsync( + subscribersPreferencesRetrieveByLevel(this, parameter, subscriberId, options) ); - - const [result$] = await this.matcher< - Array - >() - .json(200, z.array(components.GetSubscriberPreferencesResponseDto$.inboundSchema)) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; } /** @@ -241,97 +40,9 @@ export class Preferences extends ClientSDK { */ async update( request: operations.SubscribersControllerUpdateSubscriberPreferenceRequest, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise { - const input$ = request; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Content-Type", "application/json"); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => - operations.SubscribersControllerUpdateSubscriberPreferenceRequest$.outboundSchema.parse( - value$ - ), - "Input validation failed" - ); - const body$ = encodeJSON$("body", payload$.UpdateSubscriberPreferenceRequestDto, { - explode: true, - }); - - const pathParams$ = { - parameter: encodeSimple$("parameter", payload$.parameter, { - explode: false, - charEncoding: "percent", - }), - subscriberId: encodeSimple$("subscriberId", payload$.subscriberId, { - explode: false, - charEncoding: "percent", - }), - }; - const path$ = this.templateURLComponent( - "/v1/subscribers/{subscriberId}/preferences/{parameter}" - )(pathParams$); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "SubscribersController_updateSubscriberPreference", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "PATCH", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(200, components.UpdateSubscriberPreferenceResponseDto$) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + return unwrapAsync(subscribersPreferencesUpdate(this, request, options)); } /** @@ -340,96 +51,15 @@ export class Preferences extends ClientSDK { async updateGlobal( subscriberId: string, updateSubscriberGlobalPreferencesRequestDto: components.UpdateSubscriberGlobalPreferencesRequestDto, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise { - const input$: operations.SubscribersControllerUpdateSubscriberGlobalPreferencesRequest = { - subscriberId: subscriberId, - updateSubscriberGlobalPreferencesRequestDto: + return unwrapAsync( + subscribersPreferencesUpdateGlobal( + this, + subscriberId, updateSubscriberGlobalPreferencesRequestDto, - }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Content-Type", "application/json"); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => - operations.SubscribersControllerUpdateSubscriberGlobalPreferencesRequest$.outboundSchema.parse( - value$ - ), - "Input validation failed" - ); - const body$ = encodeJSON$("body", payload$.UpdateSubscriberGlobalPreferencesRequestDto, { - explode: true, - }); - - const pathParams$ = { - subscriberId: encodeSimple$("subscriberId", payload$.subscriberId, { - explode: false, - charEncoding: "percent", - }), - }; - const path$ = this.templateURLComponent("/v1/subscribers/{subscriberId}/preferences")( - pathParams$ + options + ) ); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "SubscribersController_updateSubscriberGlobalPreferences", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "PATCH", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(200, components.UpdateSubscriberPreferenceResponseDto$) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; } } diff --git a/src/sdk/properties.ts b/src/sdk/properties.ts index 589c543a..a8b2c7a7 100644 --- a/src/sdk/properties.ts +++ b/src/sdk/properties.ts @@ -1,44 +1,13 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SDKHooks } from "../hooks/hooks.js"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; -import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; -import { HTTPClient } from "../lib/http.js"; -import * as retries$ from "../lib/retries.js"; -import * as schemas$ from "../lib/schemas.js"; +import { subscribersPropertiesUpdateOnlineFlag } from "../funcs/subscribersPropertiesUpdateOnlineFlag.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; -import * as operations from "../models/operations/index.js"; +import { unwrapAsync } from "../types/fp.js"; export class Properties extends ClientSDK { - private readonly options$: SDKOptions & { hooks?: SDKHooks }; - - constructor(options: SDKOptions = {}) { - const opt = options as unknown; - let hooks: SDKHooks; - if ( - typeof opt === "object" && - opt != null && - "hooks" in opt && - opt.hooks instanceof SDKHooks - ) { - hooks = opt.hooks; - } else { - hooks = new SDKHooks(); - } - - super({ - client: options.httpClient || new HTTPClient(), - baseURL: serverURLFromOptions(options), - hooks, - }); - - this.options$ = { ...options, hooks }; - void this.options$; - } - /** * Update subscriber online status * @@ -48,95 +17,15 @@ export class Properties extends ClientSDK { async updateOnlineFlag( subscriberId: string, updateSubscriberOnlineFlagRequestDto: components.UpdateSubscriberOnlineFlagRequestDto, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise { - const input$: operations.SubscribersControllerUpdateSubscriberOnlineFlagRequest = { - subscriberId: subscriberId, - updateSubscriberOnlineFlagRequestDto: updateSubscriberOnlineFlagRequestDto, - }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Content-Type", "application/json"); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => - operations.SubscribersControllerUpdateSubscriberOnlineFlagRequest$.outboundSchema.parse( - value$ - ), - "Input validation failed" - ); - const body$ = encodeJSON$("body", payload$.UpdateSubscriberOnlineFlagRequestDto, { - explode: true, - }); - - const pathParams$ = { - subscriberId: encodeSimple$("subscriberId", payload$.subscriberId, { - explode: false, - charEncoding: "percent", - }), - }; - const path$ = this.templateURLComponent("/v1/subscribers/{subscriberId}/online-status")( - pathParams$ + return unwrapAsync( + subscribersPropertiesUpdateOnlineFlag( + this, + subscriberId, + updateSubscriberOnlineFlagRequestDto, + options + ) ); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "SubscribersController_updateSubscriberOnlineFlag", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "PATCH", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(200, components.SubscriberResponseDto$) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; } } diff --git a/src/sdk/sdk.ts b/src/sdk/sdk.ts index 83caa599..7b69ed80 100644 --- a/src/sdk/sdk.ts +++ b/src/sdk/sdk.ts @@ -1,18 +1,16 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SDKHooks } from "../hooks/hooks.js"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; -import { encodeJSON as encodeJSON$ } from "../lib/encodings.js"; -import { HTTPClient } from "../lib/http.js"; -import * as retries$ from "../lib/retries.js"; -import * as schemas$ from "../lib/schemas.js"; +import { cancel } from "../funcs/cancel.js"; +import { trigger } from "../funcs/trigger.js"; +import { triggerBroadcast } from "../funcs/triggerBroadcast.js"; +import { triggerBulk } from "../funcs/triggerBulk.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; +import { unwrapAsync } from "../types/fp.js"; import { Changes } from "./changes.js"; import { Environments } from "./environments.js"; -import { Events } from "./events.js"; import { ExecutionDetails } from "./executiondetails.js"; import { Feeds } from "./feeds.js"; import { Integrations } from "./integrations.js"; @@ -27,32 +25,6 @@ import { WorkflowGroups } from "./workflowgroups.js"; import { Workflows } from "./workflows.js"; export class Novu extends ClientSDK { - private readonly options$: SDKOptions & { hooks?: SDKHooks }; - - constructor(options: SDKOptions = {}) { - const opt = options as unknown; - let hooks: SDKHooks; - if ( - typeof opt === "object" && - opt != null && - "hooks" in opt && - opt.hooks instanceof SDKHooks - ) { - hooks = opt.hooks; - } else { - hooks = new SDKHooks(); - } - - super({ - client: options.httpClient || new HTTPClient(), - baseURL: serverURLFromOptions(options), - hooks, - }); - - this.options$ = { ...options, hooks }; - void this.options$; - } - private _changes?: Changes; get changes(): Changes { return (this._changes ??= new Changes(this.options$)); @@ -63,11 +35,6 @@ export class Novu extends ClientSDK { return (this._environments ??= new Environments(this.options$)); } - private _events?: Events; - get events(): Events { - return (this._events ??= new Events(this.options$)); - } - private _executionDetails?: ExecutionDetails; get executionDetails(): ExecutionDetails { return (this._executionDetails ??= new ExecutionDetails(this.options$)); @@ -128,6 +95,22 @@ export class Novu extends ClientSDK { return (this._workflows ??= new Workflows(this.options$)); } + /** + * Cancel triggered event + * + * @remarks + * + * Using a previously generated transactionId during the event trigger, + * will cancel any active or pending workflows. This is useful to cancel active digests, delays etc... + * + */ + async cancel( + transactionId: string, + options?: RequestOptions + ): Promise { + return unwrapAsync(cancel(this, transactionId, options)); + } + /** * Trigger event * @@ -140,79 +123,38 @@ export class Novu extends ClientSDK { */ async trigger( request: components.TriggerEventRequestDto, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise { - const input$ = request; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Content-Type", "application/json"); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => components.TriggerEventRequestDto$.outboundSchema.parse(value$), - "Input validation failed" - ); - const body$ = encodeJSON$("body", payload$, { explode: true }); - - const path$ = this.templateURLComponent("/v1/events/trigger")(); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "EventsController_trigger", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "POST", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(201, components.TriggerEventResponseDto$) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + return unwrapAsync(trigger(this, request, options)); + } + + /** + * Broadcast event to all + * + * @remarks + * Trigger a broadcast event to all existing subscribers, could be used to send announcements, etc. + * In the future could be used to trigger events to a subset of subscribers based on defined filters. + */ + async triggerBroadcast( + request: components.TriggerEventToAllRequestDto, + options?: RequestOptions + ): Promise { + return unwrapAsync(triggerBroadcast(this, request, options)); + } + + /** + * Bulk trigger event + * + * @remarks + * + * Using this endpoint you can trigger multiple events at once, to avoid multiple calls to the API. + * The bulk API is limited to 100 events per request. + * + */ + async triggerBulk( + request: components.BulkTriggerEventDto, + options?: RequestOptions + ): Promise> { + return unwrapAsync(triggerBulk(this, request, options)); } } diff --git a/src/sdk/stats.ts b/src/sdk/stats.ts index 6c50bf5c..24e44a96 100644 --- a/src/sdk/stats.ts +++ b/src/sdk/stats.ts @@ -1,199 +1,28 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SDKHooks } from "../hooks/hooks.js"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; -import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; -import { HTTPClient } from "../lib/http.js"; -import * as retries$ from "../lib/retries.js"; -import * as schemas$ from "../lib/schemas.js"; +import { notificationsStatsGraph } from "../funcs/notificationsStatsGraph.js"; +import { notificationsStatsRetrieve } from "../funcs/notificationsStatsRetrieve.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; -import * as operations from "../models/operations/index.js"; -import * as z from "zod"; +import { unwrapAsync } from "../types/fp.js"; export class Stats extends ClientSDK { - private readonly options$: SDKOptions & { hooks?: SDKHooks }; - - constructor(options: SDKOptions = {}) { - const opt = options as unknown; - let hooks: SDKHooks; - if ( - typeof opt === "object" && - opt != null && - "hooks" in opt && - opt.hooks instanceof SDKHooks - ) { - hooks = opt.hooks; - } else { - hooks = new SDKHooks(); - } - - super({ - client: options.httpClient || new HTTPClient(), - baseURL: serverURLFromOptions(options), - hooks, - }); - - this.options$ = { ...options, hooks }; - void this.options$; - } - /** * Get notification graph statistics */ async graph( days?: number | undefined, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise> { - const input$: operations.NotificationsControllerGetActivityGraphStatsRequest = { - days: days, - }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => - operations.NotificationsControllerGetActivityGraphStatsRequest$.outboundSchema.parse( - value$ - ), - "Input validation failed" - ); - const body$ = null; - - const path$ = this.templateURLComponent("/v1/notifications/graph/stats")(); - - const query$ = encodeFormQuery$({ - days: payload$.days, - }); - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "NotificationsController_getActivityGraphStats", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher>() - .json(200, z.array(components.ActivityGraphStatesResponse$.inboundSchema)) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + return unwrapAsync(notificationsStatsGraph(this, days, options)); } /** * Get notification statistics */ - async retrieve( - options?: RequestOptions & { retries?: retries$.RetryConfig } - ): Promise { - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); - - const path$ = this.templateURLComponent("/v1/notifications/stats")(); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "NotificationsController_getActivityStats", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "GET", - path: path$, - headers: headers$, - query: query$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(200, components.ActivityStatsResponseDto$) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + async retrieve(options?: RequestOptions): Promise { + return unwrapAsync(notificationsStatsRetrieve(this, options)); } } diff --git a/src/sdk/status.ts b/src/sdk/status.ts index 6185cfb4..7587a4ac 100644 --- a/src/sdk/status.ts +++ b/src/sdk/status.ts @@ -1,44 +1,13 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SDKHooks } from "../hooks/hooks.js"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; -import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; -import { HTTPClient } from "../lib/http.js"; -import * as retries$ from "../lib/retries.js"; -import * as schemas$ from "../lib/schemas.js"; +import { workflowsStatusUpdate } from "../funcs/workflowsStatusUpdate.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; -import * as operations from "../models/operations/index.js"; +import { unwrapAsync } from "../types/fp.js"; export class Status extends ClientSDK { - private readonly options$: SDKOptions & { hooks?: SDKHooks }; - - constructor(options: SDKOptions = {}) { - const opt = options as unknown; - let hooks: SDKHooks; - if ( - typeof opt === "object" && - opt != null && - "hooks" in opt && - opt.hooks instanceof SDKHooks - ) { - hooks = opt.hooks; - } else { - hooks = new SDKHooks(); - } - - super({ - client: options.httpClient || new HTTPClient(), - baseURL: serverURLFromOptions(options), - hooks, - }); - - this.options$ = { ...options, hooks }; - void this.options$; - } - /** * Update workflow status * @@ -48,93 +17,10 @@ export class Status extends ClientSDK { async update( workflowId: string, changeWorkflowStatusRequestDto: components.ChangeWorkflowStatusRequestDto, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise { - const input$: operations.WorkflowControllerUpdateActiveStatusRequest = { - workflowId: workflowId, - changeWorkflowStatusRequestDto: changeWorkflowStatusRequestDto, - }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Content-Type", "application/json"); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => - operations.WorkflowControllerUpdateActiveStatusRequest$.outboundSchema.parse( - value$ - ), - "Input validation failed" - ); - const body$ = encodeJSON$("body", payload$.ChangeWorkflowStatusRequestDto, { - explode: true, - }); - - const pathParams$ = { - workflowId: encodeSimple$("workflowId", payload$.workflowId, { - explode: false, - charEncoding: "percent", - }), - }; - const path$ = this.templateURLComponent("/v1/workflows/{workflowId}/status")(pathParams$); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "WorkflowController_updateActiveStatus", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "PUT", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } + return unwrapAsync( + workflowsStatusUpdate(this, workflowId, changeWorkflowStatusRequestDto, options) ); - - const [result$] = await this.matcher() - .json(200, components.WorkflowResponse$) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; } } diff --git a/src/sdk/subscribers.ts b/src/sdk/subscribers.ts index 1b7280f4..4b47f740 100644 --- a/src/sdk/subscribers.ts +++ b/src/sdk/subscribers.ts @@ -1,57 +1,26 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SDKHooks } from "../hooks/hooks.js"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; -import { - encodeFormQuery as encodeFormQuery$, - encodeJSON as encodeJSON$, - encodeSimple as encodeSimple$, -} from "../lib/encodings.js"; -import { HTTPClient } from "../lib/http.js"; -import * as retries$ from "../lib/retries.js"; -import * as schemas$ from "../lib/schemas.js"; +import { subscribersCreate } from "../funcs/subscribersCreate.js"; +import { subscribersCreateBulk } from "../funcs/subscribersCreateBulk.js"; +import { subscribersDelete } from "../funcs/subscribersDelete.js"; +import { subscribersList } from "../funcs/subscribersList.js"; +import { subscribersRetrieve } from "../funcs/subscribersRetrieve.js"; +import { subscribersUpdate } from "../funcs/subscribersUpdate.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; import * as operations from "../models/operations/index.js"; -import { createPageIterator, PageIterator, Paginator } from "../types/operations.js"; +import { unwrapAsync } from "../types/fp.js"; +import { PageIterator, unwrapResultIterator } from "../types/operations.js"; import { Authentication } from "./authentication.js"; import { Credentials } from "./credentials.js"; import { NovuMessages } from "./novumessages.js"; import { NovuNotifications } from "./novunotifications.js"; import { Preferences } from "./preferences.js"; import { Properties } from "./properties.js"; -import jp from "jsonpath"; -import * as z from "zod"; export class Subscribers extends ClientSDK { - private readonly options$: SDKOptions & { hooks?: SDKHooks }; - - constructor(options: SDKOptions = {}) { - const opt = options as unknown; - let hooks: SDKHooks; - if ( - typeof opt === "object" && - opt != null && - "hooks" in opt && - opt.hooks instanceof SDKHooks - ) { - hooks = opt.hooks; - } else { - hooks = new SDKHooks(); - } - - super({ - client: options.httpClient || new HTTPClient(), - baseURL: serverURLFromOptions(options), - hooks, - }); - - this.options$ = { ...options, hooks }; - void this.options$; - } - private _credentials?: Credentials; get credentials(): Credentials { return (this._credentials ??= new Credentials(this.options$)); @@ -90,80 +59,9 @@ export class Subscribers extends ClientSDK { */ async create( request: components.CreateSubscriberRequestDto, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise { - const input$ = request; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Content-Type", "application/json"); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => components.CreateSubscriberRequestDto$.outboundSchema.parse(value$), - "Input validation failed" - ); - const body$ = encodeJSON$("body", payload$, { explode: true }); - - const path$ = this.templateURLComponent("/v1/subscribers")(); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "SubscribersController_createSubscriber", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "POST", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(201, components.SubscriberResponseDto$) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + return unwrapAsync(subscribersCreate(this, request, options)); } /** @@ -177,80 +75,9 @@ export class Subscribers extends ClientSDK { */ async createBulk( request: components.BulkSubscriberCreateDto, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise { - const input$ = request; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Content-Type", "application/json"); - headers$.set("Accept", "*/*"); - - const payload$ = schemas$.parse( - input$, - (value$) => components.BulkSubscriberCreateDto$.outboundSchema.parse(value$), - "Input validation failed" - ); - const body$ = encodeJSON$("body", payload$, { explode: true }); - - const path$ = this.templateURLComponent("/v1/subscribers/bulk")(); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "SubscribersController_bulkCreateSubscribers", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "POST", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .void(201, z.void()) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + return unwrapAsync(subscribersCreateBulk(this, request, options)); } /** @@ -261,90 +88,9 @@ export class Subscribers extends ClientSDK { */ async delete( subscriberId: string, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise { - const input$: operations.SubscribersControllerRemoveSubscriberRequest = { - subscriberId: subscriberId, - }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => - operations.SubscribersControllerRemoveSubscriberRequest$.outboundSchema.parse( - value$ - ), - "Input validation failed" - ); - const body$ = null; - - const pathParams$ = { - subscriberId: encodeSimple$("subscriberId", payload$.subscriberId, { - explode: false, - charEncoding: "percent", - }), - }; - const path$ = this.templateURLComponent("/v1/subscribers/{subscriberId}")(pathParams$); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "SubscribersController_removeSubscriber", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "DELETE", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(200, components.DeleteSubscriberResponseDto$) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + return unwrapAsync(subscribersDelete(this, subscriberId, options)); } /** @@ -356,117 +102,9 @@ export class Subscribers extends ClientSDK { async list( page?: number | undefined, limit?: number | undefined, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise> { - const input$: operations.SubscribersControllerListSubscribersRequest = { - page: page, - limit: limit, - }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => - operations.SubscribersControllerListSubscribersRequest$.outboundSchema.parse( - value$ - ), - "Input validation failed" - ); - const body$ = null; - - const path$ = this.templateURLComponent("/v1/subscribers")(); - - const query$ = encodeFormQuery$({ - limit: payload$.limit, - page: payload$.page, - }); - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "SubscribersController_listSubscribers", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const responseFields$ = { - HttpMeta: { Response: response, Request: request$ }, - }; - - const [result$, raw$] = - await this.matcher() - .json(200, operations.SubscribersControllerListSubscribersResponse$, { - key: "Result", - }) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response, { extraFields: responseFields$ }); - - const nextFunc = ( - responseData: unknown - ): Paginator => { - const page = input$.page || 0; - const nextPage = page + 1; - - if (!responseData) { - return () => null; - } - const results = jp.value(responseData, "$.data.resultArray"); - if (!results.length) { - return () => null; - } - const limit = input$.limit || 0; - if (results.length < limit) { - return () => null; - } - - return () => this.list(nextPage, limit, options); - }; - - const page$ = { ...result$, next: nextFunc(raw$) }; - return { ...page$, ...createPageIterator(page$) }; + return unwrapResultIterator(subscribersList(this, page, limit, options)); } /** @@ -477,88 +115,9 @@ export class Subscribers extends ClientSDK { */ async retrieve( subscriberId: string, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise { - const input$: operations.SubscribersControllerGetSubscriberRequest = { - subscriberId: subscriberId, - }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => - operations.SubscribersControllerGetSubscriberRequest$.outboundSchema.parse(value$), - "Input validation failed" - ); - const body$ = null; - - const pathParams$ = { - subscriberId: encodeSimple$("subscriberId", payload$.subscriberId, { - explode: false, - charEncoding: "percent", - }), - }; - const path$ = this.templateURLComponent("/v1/subscribers/{subscriberId}")(pathParams$); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "SubscribersController_getSubscriber", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(200, components.SubscriberResponseDto$) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + return unwrapAsync(subscribersRetrieve(this, subscriberId, options)); } /** @@ -570,91 +129,10 @@ export class Subscribers extends ClientSDK { async update( subscriberId: string, updateSubscriberRequestDto: components.UpdateSubscriberRequestDto, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise { - const input$: operations.SubscribersControllerUpdateSubscriberRequest = { - subscriberId: subscriberId, - updateSubscriberRequestDto: updateSubscriberRequestDto, - }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Content-Type", "application/json"); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => - operations.SubscribersControllerUpdateSubscriberRequest$.outboundSchema.parse( - value$ - ), - "Input validation failed" + return unwrapAsync( + subscribersUpdate(this, subscriberId, updateSubscriberRequestDto, options) ); - const body$ = encodeJSON$("body", payload$.UpdateSubscriberRequestDto, { explode: true }); - - const pathParams$ = { - subscriberId: encodeSimple$("subscriberId", payload$.subscriberId, { - explode: false, - charEncoding: "percent", - }), - }; - const path$ = this.templateURLComponent("/v1/subscribers/{subscriberId}")(pathParams$); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "SubscribersController_updateSubscriber", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "PUT", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(200, components.SubscriberResponseDto$) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; } } diff --git a/src/sdk/tenants.ts b/src/sdk/tenants.ts index a226a164..e169d1c2 100644 --- a/src/sdk/tenants.ts +++ b/src/sdk/tenants.ts @@ -1,527 +1,80 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SDKHooks } from "../hooks/hooks.js"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; -import { - encodeFormQuery as encodeFormQuery$, - encodeJSON as encodeJSON$, - encodeSimple as encodeSimple$, -} from "../lib/encodings.js"; -import { HTTPClient } from "../lib/http.js"; -import * as retries$ from "../lib/retries.js"; -import * as schemas$ from "../lib/schemas.js"; +import { tenantsCreate } from "../funcs/tenantsCreate.js"; +import { tenantsDelete } from "../funcs/tenantsDelete.js"; +import { tenantsList } from "../funcs/tenantsList.js"; +import { tenantsRetrieve } from "../funcs/tenantsRetrieve.js"; +import { tenantsUpdate } from "../funcs/tenantsUpdate.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; import * as operations from "../models/operations/index.js"; -import { createPageIterator, PageIterator, Paginator } from "../types/operations.js"; -import jp from "jsonpath"; -import * as z from "zod"; +import { unwrapAsync } from "../types/fp.js"; +import { PageIterator, unwrapResultIterator } from "../types/operations.js"; export class Tenants extends ClientSDK { - private readonly options$: SDKOptions & { hooks?: SDKHooks }; - - constructor(options: SDKOptions = {}) { - const opt = options as unknown; - let hooks: SDKHooks; - if ( - typeof opt === "object" && - opt != null && - "hooks" in opt && - opt.hooks instanceof SDKHooks - ) { - hooks = opt.hooks; - } else { - hooks = new SDKHooks(); - } - - super({ - client: options.httpClient || new HTTPClient(), - baseURL: serverURLFromOptions(options), - hooks, - }); - - this.options$ = { ...options, hooks }; - void this.options$; - } - /** * Create tenant * * @remarks - * Create tenant under the current environment + * Create tenant under the current environment Tenants is not supported in code first version of the API. */ async create( request: components.CreateTenantRequestDto, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise { - const input$ = request; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Content-Type", "application/json"); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => components.CreateTenantRequestDto$.outboundSchema.parse(value$), - "Input validation failed" - ); - const body$ = encodeJSON$("body", payload$, { explode: true }); - - const path$ = this.templateURLComponent("/v1/tenants")(); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "TenantController_createTenant", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "POST", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json([200, 201], components.CreateTenantResponseDto$) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + return unwrapAsync(tenantsCreate(this, request, options)); } /** * Delete tenant * * @remarks - * Deletes a tenant entity from the Novu platform + * Deletes a tenant entity from the Novu platform. Tenants is not supported in code first version of the API. */ - async delete( - identifier: string, - options?: RequestOptions & { retries?: retries$.RetryConfig } - ): Promise { - const input$: operations.TenantControllerRemoveTenantRequest = { - identifier: identifier, - }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "*/*"); - - const payload$ = schemas$.parse( - input$, - (value$) => - operations.TenantControllerRemoveTenantRequest$.outboundSchema.parse(value$), - "Input validation failed" - ); - const body$ = null; - - const pathParams$ = { - identifier: encodeSimple$("identifier", payload$.identifier, { - explode: false, - charEncoding: "percent", - }), - }; - const path$ = this.templateURLComponent("/v1/tenants/{identifier}")(pathParams$); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "TenantController_removeTenant", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["404", "409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "DELETE", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .void(204, z.void()) - .fail([404, 409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + async delete(identifier: string, options?: RequestOptions): Promise { + return unwrapAsync(tenantsDelete(this, identifier, options)); } /** * Get tenants * * @remarks - * Returns a list of tenants, could paginated using the `page` and `limit` query parameter + * Returns a list of tenants, could paginated using the `page` and `limit` query parameter. Tenants is not supported in code first version of the API. */ async list( page?: number | undefined, limit?: number | undefined, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise> { - const input$: operations.TenantControllerListTenantsRequest = { - page: page, - limit: limit, - }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => operations.TenantControllerListTenantsRequest$.outboundSchema.parse(value$), - "Input validation failed" - ); - const body$ = null; - - const path$ = this.templateURLComponent("/v1/tenants")(); - - const query$ = encodeFormQuery$({ - limit: payload$.limit, - page: payload$.page, - }); - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "TenantController_listTenants", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const responseFields$ = { - HttpMeta: { Response: response, Request: request$ }, - }; - - const [result$, raw$] = await this.matcher() - .json(200, operations.TenantControllerListTenantsResponse$, { key: "Result" }) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response, { extraFields: responseFields$ }); - - const nextFunc = ( - responseData: unknown - ): Paginator => { - const page = input$.page || 0; - const nextPage = page + 1; - - if (!responseData) { - return () => null; - } - const results = jp.value(responseData, "$.data.resultArray"); - if (!results.length) { - return () => null; - } - const limit = input$.limit || 0; - if (results.length < limit) { - return () => null; - } - - return () => this.list(nextPage, limit, options); - }; - - const page$ = { ...result$, next: nextFunc(raw$) }; - return { ...page$, ...createPageIterator(page$) }; + return unwrapResultIterator(tenantsList(this, page, limit, options)); } /** * Get tenant * * @remarks - * Get tenant by your internal id used to identify the tenant + * Get tenant by your internal id used to identify the tenant Tenants is not supported in code first version of the API. */ async retrieve( identifier: string, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise { - const input$: operations.TenantControllerGetTenantByIdRequest = { - identifier: identifier, - }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => - operations.TenantControllerGetTenantByIdRequest$.outboundSchema.parse(value$), - "Input validation failed" - ); - const body$ = null; - - const pathParams$ = { - identifier: encodeSimple$("identifier", payload$.identifier, { - explode: false, - charEncoding: "percent", - }), - }; - const path$ = this.templateURLComponent("/v1/tenants/{identifier}")(pathParams$); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "TenantController_getTenantById", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["404", "409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(200, components.GetTenantResponseDto$) - .fail([404, 409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + return unwrapAsync(tenantsRetrieve(this, identifier, options)); } /** * Update tenant * * @remarks - * Update tenant by your internal id used to identify the tenant + * Update tenant by your internal id used to identify the tenant Tenants is not supported in code first version of the API. */ async update( identifier: string, updateTenantRequestDto: components.UpdateTenantRequestDto, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise { - const input$: operations.TenantControllerUpdateTenantRequest = { - identifier: identifier, - updateTenantRequestDto: updateTenantRequestDto, - }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Content-Type", "application/json"); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => - operations.TenantControllerUpdateTenantRequest$.outboundSchema.parse(value$), - "Input validation failed" - ); - const body$ = encodeJSON$("body", payload$.UpdateTenantRequestDto, { explode: true }); - - const pathParams$ = { - identifier: encodeSimple$("identifier", payload$.identifier, { - explode: false, - charEncoding: "percent", - }), - }; - const path$ = this.templateURLComponent("/v1/tenants/{identifier}")(pathParams$); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "TenantController_updateTenant", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["404", "409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "PATCH", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(200, components.UpdateTenantResponseDto$) - .fail([404, 409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + return unwrapAsync(tenantsUpdate(this, identifier, updateTenantRequestDto, options)); } } diff --git a/src/sdk/topics.ts b/src/sdk/topics.ts index f6ba737f..4c53188c 100644 --- a/src/sdk/topics.ts +++ b/src/sdk/topics.ts @@ -1,50 +1,19 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SDKHooks } from "../hooks/hooks.js"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; -import { - encodeFormQuery as encodeFormQuery$, - encodeJSON as encodeJSON$, - encodeSimple as encodeSimple$, -} from "../lib/encodings.js"; -import { HTTPClient } from "../lib/http.js"; -import * as retries$ from "../lib/retries.js"; -import * as schemas$ from "../lib/schemas.js"; +import { topicsCreate } from "../funcs/topicsCreate.js"; +import { topicsDelete } from "../funcs/topicsDelete.js"; +import { topicsList } from "../funcs/topicsList.js"; +import { topicsRename } from "../funcs/topicsRename.js"; +import { topicsRetrieve } from "../funcs/topicsRetrieve.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; import * as operations from "../models/operations/index.js"; +import { unwrapAsync } from "../types/fp.js"; import { NovuSubscribers } from "./novusubscribers.js"; -import * as z from "zod"; export class Topics extends ClientSDK { - private readonly options$: SDKOptions & { hooks?: SDKHooks }; - - constructor(options: SDKOptions = {}) { - const opt = options as unknown; - let hooks: SDKHooks; - if ( - typeof opt === "object" && - opt != null && - "hooks" in opt && - opt.hooks instanceof SDKHooks - ) { - hooks = opt.hooks; - } else { - hooks = new SDKHooks(); - } - - super({ - client: options.httpClient || new HTTPClient(), - baseURL: serverURLFromOptions(options), - hooks, - }); - - this.options$ = { ...options, hooks }; - void this.options$; - } - private _subscribers?: NovuSubscribers; get subscribers(): NovuSubscribers { return (this._subscribers ??= new NovuSubscribers(this.options$)); @@ -58,80 +27,9 @@ export class Topics extends ClientSDK { */ async create( request: components.CreateTopicRequestDto, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise { - const input$ = request; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Content-Type", "application/json"); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => components.CreateTopicRequestDto$.outboundSchema.parse(value$), - "Input validation failed" - ); - const body$ = encodeJSON$("body", payload$, { explode: true }); - - const path$ = this.templateURLComponent("/v1/topics")(); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "TopicsController_createTopic", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "POST", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(201, components.CreateTopicResponseDto$) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + return unwrapAsync(topicsCreate(this, request, options)); } /** @@ -140,89 +38,8 @@ export class Topics extends ClientSDK { * @remarks * Delete a topic by its topic key if it has no subscribers */ - async delete( - topicKey: string, - options?: RequestOptions & { retries?: retries$.RetryConfig } - ): Promise { - const input$: operations.TopicsControllerDeleteTopicRequest = { - topicKey: topicKey, - }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "*/*"); - - const payload$ = schemas$.parse( - input$, - (value$) => operations.TopicsControllerDeleteTopicRequest$.outboundSchema.parse(value$), - "Input validation failed" - ); - const body$ = null; - - const pathParams$ = { - topicKey: encodeSimple$("topicKey", payload$.topicKey, { - explode: false, - charEncoding: "percent", - }), - }; - const path$ = this.templateURLComponent("/v1/topics/{topicKey}")(pathParams$); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "TopicsController_deleteTopic", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["404", "409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "DELETE", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .void(204, z.void()) - .fail([404, 409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + async delete(topicKey: string, options?: RequestOptions): Promise { + return unwrapAsync(topicsDelete(this, topicKey, options)); } /** @@ -233,83 +50,9 @@ export class Topics extends ClientSDK { */ async list( request: operations.TopicsControllerListTopicsRequest, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise { - const input$ = typeof request === "undefined" ? {} : request; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => operations.TopicsControllerListTopicsRequest$.outboundSchema.parse(value$), - "Input validation failed" - ); - const body$ = null; - - const path$ = this.templateURLComponent("/v1/topics")(); - - const query$ = encodeFormQuery$({ - key: payload$.key, - page: payload$.page, - pageSize: payload$.pageSize, - }); - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "TopicsController_listTopics", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(200, components.FilterTopicsResponseDto$) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + return unwrapAsync(topicsList(this, request, options)); } /** @@ -321,89 +64,9 @@ export class Topics extends ClientSDK { async rename( topicKey: string, renameTopicRequestDto: components.RenameTopicRequestDto, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise { - const input$: operations.TopicsControllerRenameTopicRequest = { - topicKey: topicKey, - renameTopicRequestDto: renameTopicRequestDto, - }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Content-Type", "application/json"); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => operations.TopicsControllerRenameTopicRequest$.outboundSchema.parse(value$), - "Input validation failed" - ); - const body$ = encodeJSON$("body", payload$.RenameTopicRequestDto, { explode: true }); - - const pathParams$ = { - topicKey: encodeSimple$("topicKey", payload$.topicKey, { - explode: false, - charEncoding: "percent", - }), - }; - const path$ = this.templateURLComponent("/v1/topics/{topicKey}")(pathParams$); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "TopicsController_renameTopic", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "PATCH", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(200, components.RenameTopicResponseDto$) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + return unwrapAsync(topicsRename(this, topicKey, renameTopicRequestDto, options)); } /** @@ -414,86 +77,8 @@ export class Topics extends ClientSDK { */ async retrieve( topicKey: string, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise { - const input$: operations.TopicsControllerGetTopicRequest = { - topicKey: topicKey, - }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => operations.TopicsControllerGetTopicRequest$.outboundSchema.parse(value$), - "Input validation failed" - ); - const body$ = null; - - const pathParams$ = { - topicKey: encodeSimple$("topicKey", payload$.topicKey, { - explode: false, - charEncoding: "percent", - }), - }; - const path$ = this.templateURLComponent("/v1/topics/{topicKey}")(pathParams$); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "TopicsController_getTopic", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(200, components.GetTopicResponseDto$) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + return unwrapAsync(topicsRetrieve(this, topicKey, options)); } } diff --git a/src/sdk/variables.ts b/src/sdk/variables.ts index fddfa712..a2ec6eaa 100644 --- a/src/sdk/variables.ts +++ b/src/sdk/variables.ts @@ -1,111 +1,20 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SDKHooks } from "../hooks/hooks.js"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; -import { HTTPClient } from "../lib/http.js"; -import * as retries$ from "../lib/retries.js"; +import { workflowsVariablesRetrieve } from "../funcs/workflowsVariablesRetrieve.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; +import { unwrapAsync } from "../types/fp.js"; export class Variables extends ClientSDK { - private readonly options$: SDKOptions & { hooks?: SDKHooks }; - - constructor(options: SDKOptions = {}) { - const opt = options as unknown; - let hooks: SDKHooks; - if ( - typeof opt === "object" && - opt != null && - "hooks" in opt && - opt.hooks instanceof SDKHooks - ) { - hooks = opt.hooks; - } else { - hooks = new SDKHooks(); - } - - super({ - client: options.httpClient || new HTTPClient(), - baseURL: serverURLFromOptions(options), - hooks, - }); - - this.options$ = { ...options, hooks }; - void this.options$; - } - /** * Get available variables * * @remarks * Get the variables that can be used in the workflow */ - async retrieve( - options?: RequestOptions & { retries?: retries$.RetryConfig } - ): Promise { - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); - - const path$ = this.templateURLComponent("/v1/workflows/variables")(); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "WorkflowController_getWorkflowVariables", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "GET", - path: path$, - headers: headers$, - query: query$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(200, components.VariablesResponseDto$) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + async retrieve(options?: RequestOptions): Promise { + return unwrapAsync(workflowsVariablesRetrieve(this, options)); } } diff --git a/src/sdk/webhooks.ts b/src/sdk/webhooks.ts index 8a859611..63201101 100644 --- a/src/sdk/webhooks.ts +++ b/src/sdk/webhooks.ts @@ -1,138 +1,19 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SDKHooks } from "../hooks/hooks.js"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; -import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; -import { HTTPClient } from "../lib/http.js"; -import * as retries$ from "../lib/retries.js"; -import * as schemas$ from "../lib/schemas.js"; +import { integrationsWebhooksRetrieve } from "../funcs/integrationsWebhooksRetrieve.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "../models/operations/index.js"; -import * as z from "zod"; +import { unwrapAsync } from "../types/fp.js"; export class Webhooks extends ClientSDK { - private readonly options$: SDKOptions & { hooks?: SDKHooks }; - - constructor(options: SDKOptions = {}) { - const opt = options as unknown; - let hooks: SDKHooks; - if ( - typeof opt === "object" && - opt != null && - "hooks" in opt && - opt.hooks instanceof SDKHooks - ) { - hooks = opt.hooks; - } else { - hooks = new SDKHooks(); - } - - super({ - client: options.httpClient || new HTTPClient(), - baseURL: serverURLFromOptions(options), - hooks, - }); - - this.options$ = { ...options, hooks }; - void this.options$; - } - /** * Get webhook support status for provider * * @remarks * Return the status of the webhook for this provider, if it is supported or if it is not based on a boolean value */ - async retrieve( - providerOrIntegrationId: string, - options?: RequestOptions & { retries?: retries$.RetryConfig } - ): Promise { - const input$: operations.IntegrationsControllerGetWebhookSupportStatusRequest = { - providerOrIntegrationId: providerOrIntegrationId, - }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => - operations.IntegrationsControllerGetWebhookSupportStatusRequest$.outboundSchema.parse( - value$ - ), - "Input validation failed" - ); - const body$ = null; - - const pathParams$ = { - providerOrIntegrationId: encodeSimple$( - "providerOrIntegrationId", - payload$.providerOrIntegrationId, - { explode: false, charEncoding: "percent" } - ), - }; - const path$ = this.templateURLComponent( - "/v1/integrations/webhook/provider/{providerOrIntegrationId}/status" - )(pathParams$); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "IntegrationsController_getWebhookSupportStatus", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(200, z.boolean()) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + async retrieve(providerOrIntegrationId: string, options?: RequestOptions): Promise { + return unwrapAsync(integrationsWebhooksRetrieve(this, providerOrIntegrationId, options)); } } diff --git a/src/sdk/workflowgroups.ts b/src/sdk/workflowgroups.ts index 00a6b5a4..8b0086b0 100644 --- a/src/sdk/workflowgroups.ts +++ b/src/sdk/workflowgroups.ts @@ -1,45 +1,17 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SDKHooks } from "../hooks/hooks.js"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; -import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; -import { HTTPClient } from "../lib/http.js"; -import * as retries$ from "../lib/retries.js"; -import * as schemas$ from "../lib/schemas.js"; +import { workflowGroupsCreate } from "../funcs/workflowGroupsCreate.js"; +import { workflowGroupsDelete } from "../funcs/workflowGroupsDelete.js"; +import { workflowGroupsList } from "../funcs/workflowGroupsList.js"; +import { workflowGroupsRetrieve } from "../funcs/workflowGroupsRetrieve.js"; +import { workflowGroupsUpdate } from "../funcs/workflowGroupsUpdate.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; -import * as operations from "../models/operations/index.js"; -import * as z from "zod"; +import { unwrapAsync } from "../types/fp.js"; export class WorkflowGroups extends ClientSDK { - private readonly options$: SDKOptions & { hooks?: SDKHooks }; - - constructor(options: SDKOptions = {}) { - const opt = options as unknown; - let hooks: SDKHooks; - if ( - typeof opt === "object" && - opt != null && - "hooks" in opt && - opt.hooks instanceof SDKHooks - ) { - hooks = opt.hooks; - } else { - hooks = new SDKHooks(); - } - - super({ - client: options.httpClient || new HTTPClient(), - baseURL: serverURLFromOptions(options), - hooks, - }); - - this.options$ = { ...options, hooks }; - void this.options$; - } - /** * Create workflow group * @@ -48,80 +20,9 @@ export class WorkflowGroups extends ClientSDK { */ async create( request: components.CreateNotificationGroupRequestDto, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise { - const input$ = request; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Content-Type", "application/json"); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => components.CreateNotificationGroupRequestDto$.outboundSchema.parse(value$), - "Input validation failed" - ); - const body$ = encodeJSON$("body", payload$, { explode: true }); - - const path$ = this.templateURLComponent("/v1/notification-groups")(); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "NotificationGroupsController_createNotificationGroup", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "POST", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(201, components.NotificationGroupResponseDto$) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + return unwrapAsync(workflowGroupsCreate(this, request, options)); } /** @@ -132,87 +33,9 @@ export class WorkflowGroups extends ClientSDK { */ async delete( id: string, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise { - const input$: operations.NotificationGroupsControllerDeleteNotificationGroupRequest = { - id: id, - }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => - operations.NotificationGroupsControllerDeleteNotificationGroupRequest$.outboundSchema.parse( - value$ - ), - "Input validation failed" - ); - const body$ = null; - - const pathParams$ = { - id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), - }; - const path$ = this.templateURLComponent("/v1/notification-groups/{id}")(pathParams$); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "NotificationGroupsController_deleteNotificationGroup", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "DELETE", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(200, components.DeleteNotificationGroupResponseDto$) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + return unwrapAsync(workflowGroupsDelete(this, id, options)); } /** @@ -221,71 +44,8 @@ export class WorkflowGroups extends ClientSDK { * @remarks * workflow group was previously named notification group */ - async list( - options?: RequestOptions & { retries?: retries$.RetryConfig } - ): Promise> { - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); - - const path$ = this.templateURLComponent("/v1/notification-groups")(); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "NotificationGroupsController_listNotificationGroups", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "GET", - path: path$, - headers: headers$, - query: query$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher>() - .json(200, z.array(components.NotificationGroupResponseDto$.inboundSchema)) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + async list(options?: RequestOptions): Promise> { + return unwrapAsync(workflowGroupsList(this, options)); } /** @@ -296,87 +56,9 @@ export class WorkflowGroups extends ClientSDK { */ async retrieve( id: string, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise { - const input$: operations.NotificationGroupsControllerGetNotificationGroupRequest = { - id: id, - }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => - operations.NotificationGroupsControllerGetNotificationGroupRequest$.outboundSchema.parse( - value$ - ), - "Input validation failed" - ); - const body$ = null; - - const pathParams$ = { - id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), - }; - const path$ = this.templateURLComponent("/v1/notification-groups/{id}")(pathParams$); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "NotificationGroupsController_getNotificationGroup", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(200, components.NotificationGroupResponseDto$) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + return unwrapAsync(workflowGroupsRetrieve(this, id, options)); } /** @@ -388,90 +70,10 @@ export class WorkflowGroups extends ClientSDK { async update( id: string, createNotificationGroupRequestDto: components.CreateNotificationGroupRequestDto, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise { - const input$: operations.NotificationGroupsControllerUpdateNotificationGroupRequest = { - id: id, - createNotificationGroupRequestDto: createNotificationGroupRequestDto, - }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Content-Type", "application/json"); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => - operations.NotificationGroupsControllerUpdateNotificationGroupRequest$.outboundSchema.parse( - value$ - ), - "Input validation failed" + return unwrapAsync( + workflowGroupsUpdate(this, id, createNotificationGroupRequestDto, options) ); - const body$ = encodeJSON$("body", payload$.CreateNotificationGroupRequestDto, { - explode: true, - }); - - const pathParams$ = { - id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), - }; - const path$ = this.templateURLComponent("/v1/notification-groups/{id}")(pathParams$); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "NotificationGroupsController_updateNotificationGroup", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "PATCH", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(200, components.NotificationGroupResponseDto$) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; } } diff --git a/src/sdk/workflows.ts b/src/sdk/workflows.ts index 2f2c9ffa..62e18638 100644 --- a/src/sdk/workflows.ts +++ b/src/sdk/workflows.ts @@ -1,50 +1,20 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SDKHooks } from "../hooks/hooks.js"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; -import { - encodeFormQuery as encodeFormQuery$, - encodeJSON as encodeJSON$, - encodeSimple as encodeSimple$, -} from "../lib/encodings.js"; -import { HTTPClient } from "../lib/http.js"; -import * as retries$ from "../lib/retries.js"; -import * as schemas$ from "../lib/schemas.js"; +import { workflowsCreate } from "../funcs/workflowsCreate.js"; +import { workflowsDelete } from "../funcs/workflowsDelete.js"; +import { workflowsList } from "../funcs/workflowsList.js"; +import { workflowsRetrieve } from "../funcs/workflowsRetrieve.js"; +import { workflowsUpdate } from "../funcs/workflowsUpdate.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; import * as operations from "../models/operations/index.js"; +import { unwrapAsync } from "../types/fp.js"; import { Status } from "./status.js"; import { Variables } from "./variables.js"; export class Workflows extends ClientSDK { - private readonly options$: SDKOptions & { hooks?: SDKHooks }; - - constructor(options: SDKOptions = {}) { - const opt = options as unknown; - let hooks: SDKHooks; - if ( - typeof opt === "object" && - opt != null && - "hooks" in opt && - opt.hooks instanceof SDKHooks - ) { - hooks = opt.hooks; - } else { - hooks = new SDKHooks(); - } - - super({ - client: options.httpClient || new HTTPClient(), - baseURL: serverURLFromOptions(options), - hooks, - }); - - this.options$ = { ...options, hooks }; - void this.options$; - } - private _variables?: Variables; get variables(): Variables { return (this._variables ??= new Variables(this.options$)); @@ -63,80 +33,9 @@ export class Workflows extends ClientSDK { */ async create( request: components.CreateWorkflowRequestDto, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise { - const input$ = request; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Content-Type", "application/json"); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => components.CreateWorkflowRequestDto$.outboundSchema.parse(value$), - "Input validation failed" - ); - const body$ = encodeJSON$("body", payload$, { explode: true }); - - const path$ = this.templateURLComponent("/v1/workflows")(); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "WorkflowController_create", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "POST", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(201, components.WorkflowResponse$) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + return unwrapAsync(workflowsCreate(this, request, options)); } /** @@ -145,92 +44,8 @@ export class Workflows extends ClientSDK { * @remarks * Workflow was previously named notification template */ - async delete( - workflowId: string, - options?: RequestOptions & { retries?: retries$.RetryConfig } - ): Promise { - const input$: operations.WorkflowControllerDeleteWorkflowByIdRequest = { - workflowId: workflowId, - }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => - operations.WorkflowControllerDeleteWorkflowByIdRequest$.outboundSchema.parse( - value$ - ), - "Input validation failed" - ); - const body$ = null; - - const pathParams$ = { - workflowId: encodeSimple$("workflowId", payload$.workflowId, { - explode: false, - charEncoding: "percent", - }), - }; - const path$ = this.templateURLComponent("/v1/workflows/{workflowId}")(pathParams$); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "WorkflowController_deleteWorkflowById", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "DELETE", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(200, components.DataBooleanDto$) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + async delete(workflowId: string, options?: RequestOptions): Promise { + return unwrapAsync(workflowsDelete(this, workflowId, options)); } /** @@ -241,84 +56,9 @@ export class Workflows extends ClientSDK { */ async list( request: operations.WorkflowControllerListWorkflowsRequest, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise { - const input$ = typeof request === "undefined" ? {} : request; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => - operations.WorkflowControllerListWorkflowsRequest$.outboundSchema.parse(value$), - "Input validation failed" - ); - const body$ = null; - - const path$ = this.templateURLComponent("/v1/workflows")(); - - const query$ = encodeFormQuery$({ - limit: payload$.limit, - page: payload$.page, - query: payload$.query, - }); - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "WorkflowController_listWorkflows", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(200, components.WorkflowsResponseDto$) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + return unwrapAsync(workflowsList(this, request, options)); } /** @@ -329,88 +69,9 @@ export class Workflows extends ClientSDK { */ async retrieve( workflowId: string, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise { - const input$: operations.WorkflowControllerGetWorkflowByIdRequest = { - workflowId: workflowId, - }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => - operations.WorkflowControllerGetWorkflowByIdRequest$.outboundSchema.parse(value$), - "Input validation failed" - ); - const body$ = null; - - const pathParams$ = { - workflowId: encodeSimple$("workflowId", payload$.workflowId, { - explode: false, - charEncoding: "percent", - }), - }; - const path$ = this.templateURLComponent("/v1/workflows/{workflowId}")(pathParams$); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "WorkflowController_getWorkflowById", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "GET", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(200, components.WorkflowResponse$) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + return unwrapAsync(workflowsRetrieve(this, workflowId, options)); } /** @@ -422,91 +83,8 @@ export class Workflows extends ClientSDK { async update( workflowId: string, updateWorkflowRequestDto: components.UpdateWorkflowRequestDto, - options?: RequestOptions & { retries?: retries$.RetryConfig } + options?: RequestOptions ): Promise { - const input$: operations.WorkflowControllerUpdateWorkflowByIdRequest = { - workflowId: workflowId, - updateWorkflowRequestDto: updateWorkflowRequestDto, - }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Content-Type", "application/json"); - headers$.set("Accept", "application/json"); - - const payload$ = schemas$.parse( - input$, - (value$) => - operations.WorkflowControllerUpdateWorkflowByIdRequest$.outboundSchema.parse( - value$ - ), - "Input validation failed" - ); - const body$ = encodeJSON$("body", payload$.UpdateWorkflowRequestDto, { explode: true }); - - const pathParams$ = { - workflowId: encodeSimple$("workflowId", payload$.workflowId, { - explode: false, - charEncoding: "percent", - }), - }; - const path$ = this.templateURLComponent("/v1/workflows/{workflowId}")(pathParams$); - - const query$ = ""; - - let security$; - if (typeof this.options$.apiKey === "function") { - security$ = { apiKey: await this.options$.apiKey() }; - } else if (this.options$.apiKey) { - security$ = { apiKey: this.options$.apiKey }; - } else { - security$ = {}; - } - const context = { - operationID: "WorkflowController_updateWorkflowById", - oAuth2Scopes: [], - securitySource: this.options$.apiKey, - }; - const securitySettings$ = this.resolveGlobalSecurity(security$); - - const doOptions = { context, errorCodes: ["409", "429", "4XX", "503", "5XX"] }; - const request$ = this.createRequest$( - context, - { - security: securitySettings$, - method: "PUT", - path: path$, - headers: headers$, - query: query$, - body: body$, - }, - options - ); - - const retryConfig = options?.retries || - this.options$.retryConfig || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 30000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - }; - - const response = await retries$.retry( - () => { - const cloned = request$.clone(); - return this.do$(cloned, doOptions); - }, - { config: retryConfig, statusCodes: ["408", "409", "429", "5XX"] } - ); - - const [result$] = await this.matcher() - .json(200, components.WorkflowResponse$) - .fail([409, 429, "4XX", 503, "5XX"]) - .match(response); - - return result$; + return unwrapAsync(workflowsUpdate(this, workflowId, updateWorkflowRequestDto, options)); } } diff --git a/src/types/blobs.ts b/src/types/blobs.ts index cbb8a57f..4ce84602 100644 --- a/src/types/blobs.ts +++ b/src/types/blobs.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; diff --git a/src/types/constdatetime.ts b/src/types/constdatetime.ts new file mode 100644 index 00000000..c0a4409c --- /dev/null +++ b/src/types/constdatetime.ts @@ -0,0 +1,15 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +export function constDateTime( + val: string, +): z.ZodType { + return z.custom((v) => { + return ( + typeof v === "string" && new Date(v).getTime() === new Date(val).getTime() + ); + }, `Value must be equivelant to ${val}`); +} diff --git a/src/types/enums.ts b/src/types/enums.ts index 4de0142b..6fb6d910 100644 --- a/src/types/enums.ts +++ b/src/types/enums.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ declare const __brand: unique symbol; diff --git a/src/types/fp.ts b/src/types/fp.ts new file mode 100644 index 00000000..ccbe51ea --- /dev/null +++ b/src/types/fp.ts @@ -0,0 +1,50 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +/** + * A monad that captures the result of a function call or an error if it was not + * successful. Railway programming, enabled by this type, can be a nicer + * alternative to traditional exception throwing because it allows functions to + * declare all _known_ errors with static types and then check for them + * exhaustively in application code. Thrown exception have a type of `unknown` + * and break out of regular control flow of programs making them harder to + * inspect and more verbose work with due to try-catch blocks. + */ +export type Result = + | { ok: true; value: T; error?: never } + | { ok: false; value?: never; error: E }; + +export function OK(value: V): Result { + return { ok: true, value }; +} + +export function ERR(error: E): Result { + return { ok: false, error }; +} + +/** + * unwrap is a convenience function for extracting a value from a result or + * throwing if there was an error. + */ +export function unwrap(r: Result): T { + if (!r.ok) { + throw r.error; + } + return r.value; +} + +/** + * unwrapAsync is a convenience function for resolving a value from a Promise + * of a result or rejecting if an error occurred. + */ +export async function unwrapAsync( + pr: Promise>, +): Promise { + const r = await pr; + if (!r.ok) { + throw r.error; + } + + return r.value; +} diff --git a/src/types/index.ts b/src/types/index.ts index 374373e9..dbaa5e6e 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ export { RFCDate } from "./rfcdate.js"; @@ -8,3 +8,4 @@ export type { Paginator, PageIterator } from "./operations.js"; export { createPageIterator } from "./operations.js"; export { catchUnrecognizedEnum } from "./enums.js"; export type { OpenEnum, ClosedEnum, Unrecognized } from "./enums.js"; +export type { Result } from "./fp.js"; diff --git a/src/types/operations.ts b/src/types/operations.ts index 7f833514..0952f6f4 100644 --- a/src/types/operations.ts +++ b/src/types/operations.ts @@ -1,25 +1,99 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -export type Paginator = () => Promise> | null; +import { Result } from "./fp.js"; -export type PageIterator = Result & { - next: Paginator; - [Symbol.asyncIterator]: () => AsyncIterableIterator; +export type Paginator = () => Promise }> | null; + +export type PageIterator = V & { + next: Paginator; + [Symbol.asyncIterator]: () => AsyncIterableIterator; }; -export function createPageIterator( - page: Result & { next: Paginator }, -): { [Symbol.asyncIterator]: () => AsyncIterableIterator } { +export function createPageIterator( + page: V & { next: Paginator }, + halt: (v: V) => boolean, +): { + [Symbol.asyncIterator]: () => AsyncIterableIterator; +} { return { [Symbol.asyncIterator]: async function* paginator() { yield page; + if (halt(page)) { + return; + } let p: typeof page | null = page; for (p = await p.next(); p != null; p = await p.next()) { yield p; + if (halt(p)) { + return; + } } }, }; } + +/** + * This utility create a special iterator that yields a single value and + * terminates. It is useful in paginated SDK functions that have early return + * paths when things go wrong. + */ +export function haltIterator(v: V): PageIterator { + return { + ...v, + next: () => null, + [Symbol.asyncIterator]: async function* paginator() { + yield v; + }, + }; +} + +/** + * Converts an async iterator of `Result` into an async iterator of `V`. + * When error results occur, the underlying error value is thrown. + */ +export async function unwrapResultIterator( + iteratorPromise: Promise>>, +): Promise> { + const resultIter = await iteratorPromise; + + if (!resultIter.ok) { + throw resultIter.error; + } + + return { + ...resultIter.value, + next: unwrapPaginator(resultIter.next), + [Symbol.asyncIterator]: async function* paginator() { + for await (const page of resultIter) { + if (!page.ok) { + throw page.error; + } + yield page.value; + } + }, + }; +} + +function unwrapPaginator( + paginator: Paginator>, +): Paginator { + return () => { + const nextResult = paginator(); + if (nextResult == null) { + return null; + } + return nextResult.then((res) => { + if (!res.ok) { + throw res.error; + } + const out = { + ...res.value, + next: unwrapPaginator(res.next), + }; + return out; + }); + }; +} diff --git a/src/types/rfcdate.ts b/src/types/rfcdate.ts index e80b6932..c79b3f53 100644 --- a/src/types/rfcdate.ts +++ b/src/types/rfcdate.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ const dateRE = /^\d{4}-\d{2}-\d{2}$/;