diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 9042e09..efd137f 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 4286f3ad-fa54-4c63-a599-e5773b27ae7b management: - docChecksum: faabdbbe9fc84fc6c528900ae6aa6e63 + docChecksum: dd697a0f871fc0a5d0c53ced79c32f06 docVersion: 2.3.0 - speakeasyVersion: 1.573.0 - generationVersion: 2.644.1 - releaseVersion: 1.3.0 - configChecksum: 1d81c2903aa748836b687293b4ec3afc + speakeasyVersion: 1.606.10 + generationVersion: 2.687.13 + releaseVersion: 1.3.1 + configChecksum: 3150e082ab04e2bb6b9554e06daf0fc8 repoURL: https://github.com/novuhq/php-novu.git installationURL: https://github.com/novuhq/php-novu published: true @@ -14,9 +14,9 @@ features: php: additionalProperties: 0.1.0 constsAndDefaults: 0.2.0 - core: 3.8.6 + core: 3.8.9 deprecations: 2.81.1 - examples: 2.81.5 + examples: 2.81.6 flattening: 2.81.1 globalSecurity: 2.81.8 globalSecurityFlattening: 0.1.2 @@ -58,6 +58,8 @@ generatedFiles: - docs/Models/Components/BulkCreateSubscriberResponseDto.md - docs/Models/Components/BulkSubscriberCreateDto.md - docs/Models/Components/BulkTriggerEventDto.md + - docs/Models/Components/BulkUpdateSubscriberPreferenceItemDto.md + - docs/Models/Components/BulkUpdateSubscriberPreferencesDto.md - docs/Models/Components/ButtonTypeEnum.md - docs/Models/Components/Channel.md - docs/Models/Components/ChannelCTATypeEnum.md @@ -66,6 +68,7 @@ generatedFiles: - docs/Models/Components/ChannelPreferenceDto.md - docs/Models/Components/ChannelSettingsDto.md - docs/Models/Components/ChannelTypeEnum.md + - docs/Models/Components/Channels.md - docs/Models/Components/ChatControlDto.md - docs/Models/Components/ChatControlsMetadataResponseDto.md - docs/Models/Components/ChatOrPushProviderEnum.md @@ -76,6 +79,7 @@ generatedFiles: - docs/Models/Components/ChatStepUpsertDtoControlValues.md - docs/Models/Components/ConstraintValidation.md - docs/Models/Components/Content.md + - docs/Models/Components/ContentIssueEnum.md - docs/Models/Components/ControlValues.md - docs/Models/Components/ControlVariables.md - docs/Models/Components/Controls.md @@ -145,6 +149,7 @@ generatedFiles: - docs/Models/Components/EmailBlock.md - docs/Models/Components/EmailBlockStyles.md - docs/Models/Components/EmailBlockTypeEnum.md + - docs/Models/Components/EmailChannelOverrides.md - docs/Models/Components/EmailControlDto.md - docs/Models/Components/EmailControlsMetadataResponseDto.md - docs/Models/Components/EmailStepResponseDto.md @@ -154,6 +159,7 @@ generatedFiles: - docs/Models/Components/EmailStepUpsertDto.md - docs/Models/Components/EmailStepUpsertDtoControlValues.md - docs/Models/Components/EnvironmentResponseDto.md + - docs/Models/Components/EnvironmentResponseDtoType.md - docs/Models/Components/ExecutionDetailsSourceEnum.md - docs/Models/Components/ExecutionDetailsStatusEnum.md - docs/Models/Components/FailedOperationDto.md @@ -162,6 +168,9 @@ generatedFiles: - docs/Models/Components/FieldFilterPartDto.md - docs/Models/Components/Five.md - docs/Models/Components/Four.md + - docs/Models/Components/GetEnvironmentTagsDto.md + - docs/Models/Components/GetPreferencesResponseDto.md + - docs/Models/Components/GetPreferencesResponseDtoData.md - docs/Models/Components/GetSubscriberPreferencesDto.md - docs/Models/Components/InAppControlDto.md - docs/Models/Components/InAppControlsMetadataResponseDto.md @@ -170,9 +179,12 @@ generatedFiles: - docs/Models/Components/InAppStepResponseDtoSlug.md - docs/Models/Components/InAppStepUpsertDto.md - docs/Models/Components/InBoundParseDomainDto.md + - docs/Models/Components/IntegrationIssueEnum.md - docs/Models/Components/IntegrationResponseDto.md - docs/Models/Components/IssueType.md - docs/Models/Components/Issues.md + - docs/Models/Components/LastName.md + - docs/Models/Components/LastPublishedBy.md - docs/Models/Components/ListSubscribersResponseDto.md - docs/Models/Components/ListTopicSubscriptionsResponseDto.md - docs/Models/Components/ListTopicsResponseDto.md @@ -232,9 +244,11 @@ generatedFiles: - docs/Models/Components/PayloadValidationErrorDtoValue.md - docs/Models/Components/Placeholder.md - docs/Models/Components/Placeholder5.md + - docs/Models/Components/PreferenceLevelEnum.md - docs/Models/Components/PreferenceOverrideSourceEnum.md - docs/Models/Components/PreferencesRequestDto.md - docs/Models/Components/PreferencesRequestDtoAll.md + - docs/Models/Components/PreferencesRequestDtoWorkflow.md - docs/Models/Components/ProviderId.md - docs/Models/Components/ProvidersIdEnum.md - docs/Models/Components/PushControlDto.md @@ -250,6 +264,7 @@ generatedFiles: - docs/Models/Components/ResourceOriginEnum.md - docs/Models/Components/RuntimeIssueDto.md - docs/Models/Components/Security.md + - docs/Models/Components/SeverityLevelEnum.md - docs/Models/Components/Slug.md - docs/Models/Components/SmsControlDto.md - docs/Models/Components/SmsControlsMetadataResponseDto.md @@ -260,11 +275,9 @@ generatedFiles: - docs/Models/Components/SmsStepUpsertDtoControlValues.md - docs/Models/Components/Status.md - docs/Models/Components/StepContentIssueDto.md - - docs/Models/Components/StepContentIssueEnum.md - docs/Models/Components/StepFilterDto.md - docs/Models/Components/StepFilterDtoValue.md - docs/Models/Components/StepIntegrationIssue.md - - docs/Models/Components/StepIntegrationIssueEnum.md - docs/Models/Components/StepIssuesDto.md - docs/Models/Components/StepResponseDto.md - docs/Models/Components/StepResponseDtoSlug.md @@ -303,6 +316,7 @@ generatedFiles: - docs/Models/Components/TriggerEventResponseDto.md - docs/Models/Components/TriggerEventToAllRequestDto.md - docs/Models/Components/TriggerEventToAllRequestDtoActor.md + - docs/Models/Components/TriggerEventToAllRequestDtoChannels.md - docs/Models/Components/TriggerEventToAllRequestDtoOverrides.md - docs/Models/Components/TriggerEventToAllRequestDtoTenant.md - docs/Models/Components/TriggerRecipientsTypeEnum.md @@ -320,6 +334,7 @@ generatedFiles: - docs/Models/Components/UpdateTopicRequestDto.md - docs/Models/Components/UpdateWorkflowDto.md - docs/Models/Components/UpdateWorkflowDtoSteps.md + - docs/Models/Components/UpdatedBy.md - docs/Models/Components/UpdatedSubscriberDto.md - docs/Models/Components/User.md - docs/Models/Components/UserAll.md @@ -332,6 +347,10 @@ generatedFiles: - docs/Models/Components/WorkflowCreationSourceEnum.md - docs/Models/Components/WorkflowIntegrationStatus.md - docs/Models/Components/WorkflowListResponseDto.md + - docs/Models/Components/WorkflowListResponseDtoLastName.md + - docs/Models/Components/WorkflowListResponseDtoLastPublishedBy.md + - docs/Models/Components/WorkflowListResponseDtoLastPublishedByLastName.md + - docs/Models/Components/WorkflowListResponseDtoUpdatedBy.md - docs/Models/Components/WorkflowPreferenceDto.md - docs/Models/Components/WorkflowPreferencesDto.md - docs/Models/Components/WorkflowPreferencesResponseDto.md @@ -340,6 +359,7 @@ generatedFiles: - docs/Models/Components/WorkflowResponse.md - docs/Models/Components/WorkflowResponseData.md - docs/Models/Components/WorkflowResponseDto.md + - docs/Models/Components/WorkflowResponseDtoLastName.md - docs/Models/Components/WorkflowResponseDtoSortField.md - docs/Models/Components/WorkflowResponseDtoSteps.md - docs/Models/Components/WorkflowStatusEnum.md @@ -354,9 +374,14 @@ generatedFiles: - docs/Models/Errors/PayloadValidationExceptionDto.md - docs/Models/Errors/PayloadValidationExceptionDtoMessage.md - docs/Models/Errors/Schema.md + - docs/Models/Errors/SubscriberResponseDto.md + - docs/Models/Errors/TopicResponseDto.md - docs/Models/Errors/ValidationErrorDto.md - docs/Models/Errors/ValidationErrorDtoMessage.md - docs/Models/Operations/Channel.md + - docs/Models/Operations/Criticality.md + - docs/Models/Operations/EnvironmentsControllerGetEnvironmentTagsRequest.md + - docs/Models/Operations/EnvironmentsControllerGetEnvironmentTagsResponse.md - docs/Models/Operations/EnvironmentsControllerV1CreateEnvironmentRequest.md - docs/Models/Operations/EnvironmentsControllerV1CreateEnvironmentResponse.md - docs/Models/Operations/EnvironmentsControllerV1DeleteEnvironmentRequest.md @@ -373,6 +398,8 @@ generatedFiles: - docs/Models/Operations/EventsControllerTriggerBulkResponse.md - docs/Models/Operations/EventsControllerTriggerRequest.md - docs/Models/Operations/EventsControllerTriggerResponse.md + - docs/Models/Operations/InboundWebhooksControllerHandleWebhookRequest.md + - docs/Models/Operations/InboundWebhooksControllerHandleWebhookResponse.md - docs/Models/Operations/IntegrationsControllerCreateIntegrationRequest.md - docs/Models/Operations/IntegrationsControllerCreateIntegrationResponse.md - docs/Models/Operations/IntegrationsControllerGetActiveIntegrationsRequest.md @@ -397,6 +424,8 @@ generatedFiles: - docs/Models/Operations/NotificationsControllerListNotificationsResponse.md - docs/Models/Operations/OrderDirection.md - docs/Models/Operations/QueryParamOrderDirection.md + - docs/Models/Operations/SubscribersControllerBulkUpdateSubscriberPreferencesRequest.md + - docs/Models/Operations/SubscribersControllerBulkUpdateSubscriberPreferencesResponse.md - docs/Models/Operations/SubscribersControllerCreateSubscriberRequest.md - docs/Models/Operations/SubscribersControllerCreateSubscriberResponse.md - docs/Models/Operations/SubscribersControllerGetSubscriberPreferencesRequest.md @@ -477,6 +506,7 @@ generatedFiles: - docs/sdks/novumessages/README.md - docs/sdks/novunotifications/README.md - docs/sdks/novutopics/README.md + - docs/sdks/preferences/README.md - docs/sdks/steps/README.md - docs/sdks/subscribers/README.md - docs/sdks/subscriberscredentials/README.md @@ -534,6 +564,8 @@ generatedFiles: - src/Models/Components/BulkCreateSubscriberResponseDto.php - src/Models/Components/BulkSubscriberCreateDto.php - src/Models/Components/BulkTriggerEventDto.php + - src/Models/Components/BulkUpdateSubscriberPreferenceItemDto.php + - src/Models/Components/BulkUpdateSubscriberPreferencesDto.php - src/Models/Components/ButtonTypeEnum.php - src/Models/Components/Channel.php - src/Models/Components/ChannelCTATypeEnum.php @@ -542,6 +574,7 @@ generatedFiles: - src/Models/Components/ChannelPreferenceDto.php - src/Models/Components/ChannelSettingsDto.php - src/Models/Components/ChannelTypeEnum.php + - src/Models/Components/Channels.php - src/Models/Components/ChatControlDto.php - src/Models/Components/ChatControlsMetadataResponseDto.php - src/Models/Components/ChatOrPushProviderEnum.php @@ -550,6 +583,7 @@ generatedFiles: - src/Models/Components/ChatStepResponseDtoSlug.php - src/Models/Components/ChatStepUpsertDto.php - src/Models/Components/ConstraintValidation.php + - src/Models/Components/ContentIssueEnum.php - src/Models/Components/ControlVariables.php - src/Models/Components/Controls.php - src/Models/Components/ControlsMetadataDto.php @@ -614,6 +648,7 @@ generatedFiles: - src/Models/Components/EmailBlock.php - src/Models/Components/EmailBlockStyles.php - src/Models/Components/EmailBlockTypeEnum.php + - src/Models/Components/EmailChannelOverrides.php - src/Models/Components/EmailControlDto.php - src/Models/Components/EmailControlsMetadataResponseDto.php - src/Models/Components/EmailStepResponseDto.php @@ -622,12 +657,16 @@ generatedFiles: - src/Models/Components/EmailStepResponseDtoSlug.php - src/Models/Components/EmailStepUpsertDto.php - src/Models/Components/EnvironmentResponseDto.php + - src/Models/Components/EnvironmentResponseDtoType.php - src/Models/Components/ExecutionDetailsSourceEnum.php - src/Models/Components/ExecutionDetailsStatusEnum.php - src/Models/Components/FailedOperationDto.php - src/Models/Components/FeedResponseDto.php - src/Models/Components/FieldFilterPartDto.php - src/Models/Components/Four.php + - src/Models/Components/GetEnvironmentTagsDto.php + - src/Models/Components/GetPreferencesResponseDto.php + - src/Models/Components/GetPreferencesResponseDtoData.php - src/Models/Components/GetSubscriberPreferencesDto.php - src/Models/Components/InAppControlDto.php - src/Models/Components/InAppControlsMetadataResponseDto.php @@ -636,9 +675,12 @@ generatedFiles: - src/Models/Components/InAppStepResponseDtoSlug.php - src/Models/Components/InAppStepUpsertDto.php - src/Models/Components/InBoundParseDomainDto.php + - src/Models/Components/IntegrationIssueEnum.php - src/Models/Components/IntegrationResponseDto.php - src/Models/Components/IssueType.php - src/Models/Components/Issues.php + - src/Models/Components/LastName.php + - src/Models/Components/LastPublishedBy.php - src/Models/Components/ListSubscribersResponseDto.php - src/Models/Components/ListTopicSubscriptionsResponseDto.php - src/Models/Components/ListTopicsResponseDto.php @@ -691,8 +733,10 @@ generatedFiles: - src/Models/Components/PatchWorkflowDto.php - src/Models/Components/Payload.php - src/Models/Components/PayloadValidationErrorDto.php + - src/Models/Components/PreferenceLevelEnum.php - src/Models/Components/PreferenceOverrideSourceEnum.php - src/Models/Components/PreferencesRequestDto.php + - src/Models/Components/PreferencesRequestDtoWorkflow.php - src/Models/Components/ProviderId.php - src/Models/Components/ProvidersIdEnum.php - src/Models/Components/PushControlDto.php @@ -707,6 +751,7 @@ generatedFiles: - src/Models/Components/ResourceOriginEnum.php - src/Models/Components/RuntimeIssueDto.php - src/Models/Components/Security.php + - src/Models/Components/SeverityLevelEnum.php - src/Models/Components/Slug.php - src/Models/Components/SmsControlDto.php - src/Models/Components/SmsControlsMetadataResponseDto.php @@ -716,11 +761,9 @@ generatedFiles: - src/Models/Components/SmsStepUpsertDto.php - src/Models/Components/Status.php - src/Models/Components/StepContentIssueDto.php - - src/Models/Components/StepContentIssueEnum.php - src/Models/Components/StepFilterDto.php - src/Models/Components/StepFilterDtoValue.php - src/Models/Components/StepIntegrationIssue.php - - src/Models/Components/StepIntegrationIssueEnum.php - src/Models/Components/StepIssuesDto.php - src/Models/Components/StepResponseDto.php - src/Models/Components/StepResponseDtoSlug.php @@ -755,6 +798,7 @@ generatedFiles: - src/Models/Components/TriggerEventRequestDto.php - src/Models/Components/TriggerEventResponseDto.php - src/Models/Components/TriggerEventToAllRequestDto.php + - src/Models/Components/TriggerEventToAllRequestDtoChannels.php - src/Models/Components/TriggerEventToAllRequestDtoOverrides.php - src/Models/Components/TriggerRecipientsTypeEnum.php - src/Models/Components/Type.php @@ -770,6 +814,7 @@ generatedFiles: - src/Models/Components/UpdateSubscriberOnlineFlagRequestDto.php - src/Models/Components/UpdateTopicRequestDto.php - src/Models/Components/UpdateWorkflowDto.php + - src/Models/Components/UpdatedBy.php - src/Models/Components/UpdatedSubscriberDto.php - src/Models/Components/UserWorkflowPreferencesDto.php - src/Models/Components/Value4.php @@ -778,6 +823,10 @@ generatedFiles: - src/Models/Components/WorkflowCreationSourceEnum.php - src/Models/Components/WorkflowIntegrationStatus.php - src/Models/Components/WorkflowListResponseDto.php + - src/Models/Components/WorkflowListResponseDtoLastName.php + - src/Models/Components/WorkflowListResponseDtoLastPublishedBy.php + - src/Models/Components/WorkflowListResponseDtoLastPublishedByLastName.php + - src/Models/Components/WorkflowListResponseDtoUpdatedBy.php - src/Models/Components/WorkflowPreferenceDto.php - src/Models/Components/WorkflowPreferencesDto.php - src/Models/Components/WorkflowPreferencesResponseDto.php @@ -785,6 +834,7 @@ generatedFiles: - src/Models/Components/WorkflowResponse.php - src/Models/Components/WorkflowResponseData.php - src/Models/Components/WorkflowResponseDto.php + - src/Models/Components/WorkflowResponseDtoLastName.php - src/Models/Components/WorkflowResponseDtoSortField.php - src/Models/Components/WorkflowStatusEnum.php - src/Models/Errors/APIException.php @@ -796,9 +846,16 @@ generatedFiles: - src/Models/Errors/PayloadValidationExceptionDto.php - src/Models/Errors/PayloadValidationExceptionDtoThrowable.php - src/Models/Errors/Schema.php + - src/Models/Errors/SubscriberResponseDto.php + - src/Models/Errors/SubscriberResponseDtoThrowable.php + - src/Models/Errors/TopicResponseDto.php + - src/Models/Errors/TopicResponseDtoThrowable.php - src/Models/Errors/ValidationErrorDto.php - src/Models/Errors/ValidationErrorDtoThrowable.php - src/Models/Operations/Channel.php + - src/Models/Operations/Criticality.php + - src/Models/Operations/EnvironmentsControllerGetEnvironmentTagsRequest.php + - src/Models/Operations/EnvironmentsControllerGetEnvironmentTagsResponse.php - src/Models/Operations/EnvironmentsControllerV1CreateEnvironmentRequest.php - src/Models/Operations/EnvironmentsControllerV1CreateEnvironmentResponse.php - src/Models/Operations/EnvironmentsControllerV1DeleteEnvironmentRequest.php @@ -815,6 +872,8 @@ generatedFiles: - src/Models/Operations/EventsControllerTriggerBulkResponse.php - src/Models/Operations/EventsControllerTriggerRequest.php - src/Models/Operations/EventsControllerTriggerResponse.php + - src/Models/Operations/InboundWebhooksControllerHandleWebhookRequest.php + - src/Models/Operations/InboundWebhooksControllerHandleWebhookResponse.php - src/Models/Operations/IntegrationsControllerCreateIntegrationRequest.php - src/Models/Operations/IntegrationsControllerCreateIntegrationResponse.php - src/Models/Operations/IntegrationsControllerGetActiveIntegrationsRequest.php @@ -839,6 +898,8 @@ generatedFiles: - src/Models/Operations/NotificationsControllerListNotificationsResponse.php - src/Models/Operations/OrderDirection.php - src/Models/Operations/QueryParamOrderDirection.php + - src/Models/Operations/SubscribersControllerBulkUpdateSubscriberPreferencesRequest.php + - src/Models/Operations/SubscribersControllerBulkUpdateSubscriberPreferencesResponse.php - src/Models/Operations/SubscribersControllerCreateSubscriberRequest.php - src/Models/Operations/SubscribersControllerCreateSubscriberResponse.php - src/Models/Operations/SubscribersControllerGetSubscriberPreferencesRequest.php @@ -917,6 +978,7 @@ generatedFiles: - src/NovuMessages.php - src/NovuNotifications.php - src/NovuTopics.php + - src/Preferences.php - src/SDKConfiguration.php - src/Steps.php - src/Subscribers.php @@ -1059,6 +1121,8 @@ examples: application/json: {"statusCode": 404, "timestamp": "2024-12-12T13:00:00Z", "path": "/api/v1/resource", "message": "xx xx xx ", "ctx": {"workflowId": "some_wf_id", "stepId": "some_wf_id"}, "errorId": "abc123", "errors": {"fieldName1": {"messages": ["Field is required", "Must be a valid email address"], "value": "invalidEmail"}, "fieldName2": {"messages": ["Must be at least 18 years old"], "value": 17}, "fieldName3": {"messages": ["Must be a boolean value"], "value": true}, "fieldName4": {"messages": ["Must be a valid object"], "value": true}, "fieldName5": {"messages": ["Field is missing"], "value": null}, "fieldName6": {"messages": ["Undefined value"]}}} "500": application/json: {"statusCode": 404, "timestamp": "2024-12-12T13:00:00Z", "path": "/api/v1/resource", "message": "xx xx xx ", "ctx": {"workflowId": "some_wf_id", "stepId": "some_wf_id"}, "errorId": "abc123"} + "409": + application/json: {"channels": [{"providerId": "chat-webhook", "credentials": {"webhookUrl": "https://example.com/webhook", "channel": "general", "deviceTokens": ["token1", "token2", "token3"], "alertUid": "12345-abcde", "title": "Critical Alert", "imageUrl": "https://example.com/image.png", "state": "resolved", "externalUrl": "https://example.com/details"}, "_integrationId": ""}], "subscriberId": "", "_organizationId": "", "_environmentId": "", "deleted": true, "createdAt": "1714911393177", "updatedAt": "1735631466004"} SubscribersController_getSubscriber: speakeasy-default-subscribers-controller-get-subscriber: parameters: @@ -1205,7 +1269,7 @@ examples: application/json: {"status": "pending"} responses: "201": - application/json: {"_templateId": "", "_environmentId": "", "_messageTemplateId": "", "_organizationId": "", "_notificationId": "", "_subscriberId": "", "subscriber": {"channels": [{"providerId": "getstream", "credentials": {"webhookUrl": "https://example.com/webhook", "channel": "general", "deviceTokens": ["token1", "token2", "token3"], "alertUid": "12345-abcde", "title": "Critical Alert", "imageUrl": "https://example.com/image.png", "state": "resolved", "externalUrl": "https://example.com/details"}, "_integrationId": ""}, {"providerId": "getstream", "credentials": {"webhookUrl": "https://example.com/webhook", "channel": "general", "deviceTokens": ["token1", "token2", "token3"], "alertUid": "12345-abcde", "title": "Critical Alert", "imageUrl": "https://example.com/image.png", "state": "resolved", "externalUrl": "https://example.com/details"}, "_integrationId": ""}], "subscriberId": "", "_organizationId": "", "_environmentId": "", "deleted": false, "createdAt": "1718333764322", "updatedAt": "1735651735471"}, "template": {"name": "", "description": "loaf than of familiarize puppet transom worth", "active": true, "draft": true, "preferenceSettings": {"email": true, "sms": false, "in_app": true, "chat": false, "push": true}, "critical": true, "tags": [], "steps": [{}, {}, {}], "_organizationId": "", "_creatorId": "", "_environmentId": "", "triggers": [{"type": "event", "identifier": "", "variables": [{"name": ""}, {"name": ""}]}, {"type": "event", "identifier": "", "variables": [{"name": ""}, {"name": ""}]}, {"type": "event", "identifier": "", "variables": [{"name": ""}, {"name": ""}]}], "_notificationGroupId": "", "deleted": true, "deletedAt": "", "deletedBy": ""}, "createdAt": "1712367103281", "content": "", "transactionId": "", "channel": "in_app", "read": false, "seen": false, "cta": {}, "status": "sent"} + application/json: {"_environmentId": "", "_organizationId": "", "_notificationId": "", "_subscriberId": "", "subscriber": {"channels": [{"providerId": "getstream", "credentials": {"webhookUrl": "https://example.com/webhook", "channel": "general", "deviceTokens": ["token1", "token2", "token3"], "alertUid": "12345-abcde", "title": "Critical Alert", "imageUrl": "https://example.com/image.png", "state": "resolved", "externalUrl": "https://example.com/details"}, "_integrationId": ""}, {"providerId": "getstream", "credentials": {"webhookUrl": "https://example.com/webhook", "channel": "general", "deviceTokens": ["token1", "token2", "token3"], "alertUid": "12345-abcde", "title": "Critical Alert", "imageUrl": "https://example.com/image.png", "state": "resolved", "externalUrl": "https://example.com/details"}, "_integrationId": ""}], "subscriberId": "", "_organizationId": "", "_environmentId": "", "deleted": false, "createdAt": "1718333764322", "updatedAt": "1735651735471"}, "template": {"name": "", "description": "loaf than of familiarize puppet transom worth", "active": true, "draft": true, "preferenceSettings": {"email": true, "sms": false, "in_app": true, "chat": false, "push": true}, "critical": true, "tags": [], "steps": [{}, {}, {}], "_organizationId": "", "_creatorId": "", "_environmentId": "", "triggers": [{"type": "event", "identifier": "", "variables": [{"name": ""}, {"name": ""}]}, {"type": "event", "identifier": "", "variables": [{"name": ""}, {"name": ""}]}, {"type": "event", "identifier": "", "variables": [{"name": ""}, {"name": ""}]}], "_notificationGroupId": "", "deleted": true, "deletedAt": "", "deletedBy": ""}, "createdAt": "1712367103281", "transactionId": "", "channel": "in_app", "read": false, "seen": false, "cta": {}, "status": "sent"} "414": application/json: {"statusCode": 404, "timestamp": "2024-12-12T13:00:00Z", "path": "/api/v1/resource", "message": "xx xx xx ", "ctx": {"workflowId": "some_wf_id", "stepId": "some_wf_id"}, "errorId": "abc123"} "400": @@ -1274,6 +1338,8 @@ examples: parameters: path: subscriberId: "" + query: + criticality: "all" responses: "200": application/json: {"global": {"enabled": false, "channels": {"email": true, "sms": false, "in_app": true, "chat": false, "push": true}}, "workflows": [{"enabled": false, "channels": {"email": true, "sms": false, "in_app": true, "chat": false, "push": true}, "overrides": [{"channel": "sms", "source": "subscriber"}, {"channel": "sms", "source": "subscriber"}, {"channel": "sms", "source": "subscriber"}], "workflow": {"slug": "", "identifier": "", "name": ""}}, {"enabled": false, "channels": {"email": true, "sms": false, "in_app": true, "chat": false, "push": true}, "overrides": [{"channel": "sms", "source": "subscriber"}, {"channel": "sms", "source": "subscriber"}, {"channel": "sms", "source": "subscriber"}], "workflow": {"slug": "", "identifier": "", "name": ""}}]} @@ -1313,6 +1379,8 @@ examples: application/json: {"statusCode": 404, "timestamp": "2024-12-12T13:00:00Z", "path": "/api/v1/resource", "message": "xx xx xx ", "ctx": {"workflowId": "some_wf_id", "stepId": "some_wf_id"}, "errorId": "abc123", "errors": {"fieldName1": {"messages": ["Field is required", "Must be a valid email address"], "value": "invalidEmail"}, "fieldName2": {"messages": ["Must be at least 18 years old"], "value": 17}, "fieldName3": {"messages": ["Must be a boolean value"], "value": true}, "fieldName4": {"messages": ["Must be a valid object"], "value": null}, "fieldName5": {"messages": ["Field is missing"], "value": null}, "fieldName6": {"messages": ["Undefined value"]}}} "500": application/json: {"statusCode": 404, "timestamp": "2024-12-12T13:00:00Z", "path": "/api/v1/resource", "message": "xx xx xx ", "ctx": {"workflowId": "some_wf_id", "stepId": "some_wf_id"}, "errorId": "abc123"} + "409": + application/json: {"_id": "64da692e9a94fb2e6449ad06", "key": "product-updates", "name": "Product Updates", "createdAt": "2023-08-15T00:00:00.000Z", "updatedAt": "2023-08-15T00:00:00.000Z"} TopicsController_getTopic: speakeasy-default-topics-controller-get-topic: parameters: @@ -1704,10 +1772,10 @@ examples: WorkflowController_create: speakeasy-default-workflow-controller-create: requestBody: - application/json: {"name": "", "active": false, "workflowId": "", "steps": [], "__source": "editor", "preferences": {"user": {"all": {"enabled": true, "readOnly": false}, "channels": {"email": {"enabled": true}, "sms": {"enabled": false}}}, "workflow": {"all": {"enabled": true, "readOnly": false}, "channels": {"email": {"enabled": true}, "sms": {"enabled": false}}}}} + application/json: {"name": "", "active": false, "isTranslationEnabled": false, "workflowId": "", "steps": [], "__source": "editor", "preferences": {"user": {"all": {"enabled": true, "readOnly": false}, "channels": {"email": {"enabled": true}, "sms": {"enabled": false}}}, "workflow": {"all": {"enabled": true, "readOnly": false}, "channels": {"email": {"enabled": true}, "sms": {"enabled": false}}}}} responses: "201": - application/json: {"name": "", "active": false, "_id": "", "workflowId": "", "slug": {}, "updatedAt": "1735646488156", "createdAt": "1725670964910", "steps": [], "origin": "external", "preferences": {"user": {"all": {"enabled": true, "readOnly": false}, "channels": {"email": {"enabled": true}, "sms": {"enabled": false}}}, "default": {"all": {"enabled": true, "readOnly": false}, "channels": {"email": {"enabled": true}, "sms": {"enabled": false}}}}, "status": "ERROR"} + application/json: {"name": "", "active": false, "isTranslationEnabled": false, "_id": "", "workflowId": "", "slug": {}, "updatedAt": "1735646488156", "createdAt": "1725670964910", "steps": [], "origin": "external", "preferences": {"user": {"all": {"enabled": true, "readOnly": false}, "channels": {"email": {"enabled": true}, "sms": {"enabled": false}}}, "default": {"all": {"enabled": true, "readOnly": false}, "channels": {"email": {"enabled": true}, "sms": {"enabled": false}}}}, "status": "ERROR"} "414": application/json: {"statusCode": 404, "timestamp": "2024-12-12T13:00:00Z", "path": "/api/v1/resource", "message": "xx xx xx ", "ctx": {"workflowId": "some_wf_id", "stepId": "some_wf_id"}, "errorId": "abc123"} "400": @@ -1735,10 +1803,10 @@ examples: path: workflowId: "" requestBody: - application/json: {"name": "", "active": false, "steps": [], "preferences": {"user": {"all": {"enabled": true, "readOnly": false}, "channels": {"email": {"enabled": true}, "sms": {"enabled": false}}}, "workflow": {"all": {"enabled": true, "readOnly": false}, "channels": {"email": {"enabled": true}, "sms": {"enabled": false}}}}, "origin": "external"} + application/json: {"name": "", "active": false, "isTranslationEnabled": false, "steps": [], "preferences": {"user": {"all": {"enabled": true, "readOnly": false}, "channels": {"email": {"enabled": true}, "sms": {"enabled": false}}}, "workflow": {"all": {"enabled": true, "readOnly": false}, "channels": {"email": {"enabled": true}, "sms": {"enabled": false}}}}, "origin": "external"} responses: "200": - application/json: {"name": "", "active": false, "_id": "", "workflowId": "", "slug": {}, "updatedAt": "1735625998632", "createdAt": "1709428435642", "steps": [{"controls": {"values": {"skip": {"and": [{"==": [{"var": "payload.tier"}, "pro"]}, {"==": [{"var": "subscriber.data.role"}, "admin"]}, {">": [{"var": "payload.amount"}, "4"]}]}, "subject": "", "body": "", "editorType": "block", "disableOutputSanitization": false}}, "variables": {}, "stepId": "", "_id": "", "name": "", "slug": {}, "type": "email", "origin": "novu-cloud", "workflowId": "", "workflowDatabaseId": ""}], "origin": "novu-cloud-v1", "preferences": {"user": {"all": {"enabled": true, "readOnly": false}, "channels": {"email": {"enabled": true}, "sms": {"enabled": false}}}, "default": {"all": {"enabled": true, "readOnly": false}, "channels": {"email": {"enabled": true}, "sms": {"enabled": false}}}}, "status": "ACTIVE"} + application/json: {"name": "", "active": false, "isTranslationEnabled": false, "_id": "", "workflowId": "", "slug": {}, "updatedAt": "1735625998632", "createdAt": "1709428435642", "steps": [{"controls": {"values": {"skip": {"and": [{"==": [{"var": "payload.tier"}, "pro"]}, {"==": [{"var": "subscriber.data.role"}, "admin"]}, {">": [{"var": "payload.amount"}, "4"]}]}, "subject": "", "body": "", "editorType": "block", "disableOutputSanitization": false}}, "variables": {}, "stepId": "", "_id": "", "name": "", "slug": {}, "type": "email", "origin": "novu-cloud", "workflowId": "", "workflowDatabaseId": ""}], "origin": "novu-cloud-v1", "preferences": {"user": {"all": {"enabled": true, "readOnly": false}, "channels": {"email": {"enabled": true}, "sms": {"enabled": false}}}, "default": {"all": {"enabled": true, "readOnly": false}, "channels": {"email": {"enabled": true}, "sms": {"enabled": false}}}}, "status": "ACTIVE"} "414": application/json: {"statusCode": 404, "timestamp": "2024-12-12T13:00:00Z", "path": "/api/v1/resource", "message": "xx xx xx ", "ctx": {"workflowId": "some_wf_id", "stepId": "some_wf_id"}, "errorId": "abc123"} "400": @@ -1754,7 +1822,7 @@ examples: workflowId: "" responses: "200": - application/json: {"name": "", "active": false, "_id": "", "workflowId": "", "slug": {}, "updatedAt": "1735639255382", "createdAt": "1721141645591", "steps": [{"controls": {"values": {"skip": {"and": [{"==": [{"var": "payload.tier"}, "pro"]}, {"==": [{"var": "subscriber.data.role"}, "admin"]}, {">": [{"var": "payload.amount"}, "4"]}]}, "subject": "", "body": "", "editorType": "block", "disableOutputSanitization": false}}, "variables": {"key": "", "key1": ""}, "stepId": "", "_id": "", "name": "", "slug": {}, "type": "email", "origin": "novu-cloud", "workflowId": "", "workflowDatabaseId": ""}], "origin": "external", "preferences": {"user": null, "default": {"all": {"enabled": true, "readOnly": false}, "channels": {"email": {"enabled": true}, "sms": {"enabled": false}}}}, "status": "ACTIVE"} + application/json: {"name": "", "active": false, "isTranslationEnabled": false, "_id": "", "workflowId": "", "slug": {}, "updatedAt": "1735639255382", "createdAt": "1721141645591", "steps": [{"controls": {"values": {"skip": {"and": [{"==": [{"var": "payload.tier"}, "pro"]}, {"==": [{"var": "subscriber.data.role"}, "admin"]}, {">": [{"var": "payload.amount"}, "4"]}]}, "subject": "", "body": "", "editorType": "block", "disableOutputSanitization": false}}, "variables": {"key": "", "key1": ""}, "stepId": "", "_id": "", "name": "", "slug": {}, "type": "email", "origin": "novu-cloud", "workflowId": "", "workflowDatabaseId": ""}], "origin": "external", "preferences": {"user": null, "default": {"all": {"enabled": true, "readOnly": false}, "channels": {"email": {"enabled": true}, "sms": {"enabled": false}}}}, "status": "ACTIVE"} "414": application/json: {"statusCode": 404, "timestamp": "2024-12-12T13:00:00Z", "path": "/api/v1/resource", "message": "xx xx xx ", "ctx": {"workflowId": "some_wf_id", "stepId": "some_wf_id"}, "errorId": "abc123"} "400": @@ -1786,7 +1854,7 @@ examples: application/json: {} responses: "200": - application/json: {"name": "", "active": false, "_id": "", "workflowId": "", "slug": {}, "updatedAt": "1735677167739", "createdAt": "1712483758485", "steps": [{"controls": {"values": {"skip": {"and": [{"==": [{"var": "payload.tier"}, "pro"]}, {"==": [{"var": "subscriber.data.role"}, "admin"]}, {">": [{"var": "payload.amount"}, "4"]}]}}}, "variables": {"key": ""}, "stepId": "", "_id": "", "name": "", "slug": {}, "type": "digest", "origin": "novu-cloud-v1", "workflowId": "", "workflowDatabaseId": ""}], "origin": "novu-cloud", "preferences": {"user": {"all": {"enabled": true, "readOnly": false}, "channels": {"email": {"enabled": true}, "sms": {"enabled": false}}}, "default": {"all": {"enabled": true, "readOnly": false}, "channels": {"email": {"enabled": true}, "sms": {"enabled": false}}}}, "status": "ACTIVE"} + application/json: {"name": "", "active": false, "isTranslationEnabled": false, "_id": "", "workflowId": "", "slug": {}, "updatedAt": "1735677167739", "createdAt": "1712483758485", "steps": [{"controls": {"values": {"skip": {"and": [{"==": [{"var": "payload.tier"}, "pro"]}, {"==": [{"var": "subscriber.data.role"}, "admin"]}, {">": [{"var": "payload.amount"}, "4"]}]}}}, "variables": {"key": ""}, "stepId": "", "_id": "", "name": "", "slug": {}, "type": "digest", "origin": "novu-cloud-v1", "workflowId": "", "workflowDatabaseId": ""}], "origin": "novu-cloud", "preferences": {"user": {"all": {"enabled": true, "readOnly": false}, "channels": {"email": {"enabled": true}, "sms": {"enabled": false}}}, "default": {"all": {"enabled": true, "readOnly": false}, "channels": {"email": {"enabled": true}, "sms": {"enabled": false}}}}, "status": "ACTIVE"} "414": application/json: {"statusCode": 404, "timestamp": "2024-12-12T13:00:00Z", "path": "/api/v1/resource", "message": "xx xx xx ", "ctx": {"workflowId": "some_wf_id", "stepId": "some_wf_id"}, "errorId": "abc123"} "400": @@ -1804,7 +1872,7 @@ examples: application/json: {"targetEnvironmentId": ""} responses: "200": - application/json: {"name": "", "active": false, "_id": "", "workflowId": "", "slug": {}, "updatedAt": "1735661360231", "createdAt": "1731115425881", "steps": [{"controls": {"values": {}}, "variables": {"key": "", "key1": "", "key2": ""}, "stepId": "", "_id": "", "name": "", "slug": {}, "type": "custom", "origin": "external", "workflowId": "", "workflowDatabaseId": ""}], "origin": "external", "preferences": {"user": {"all": {"enabled": true, "readOnly": false}, "channels": {"email": {"enabled": true}, "sms": {"enabled": false}}}, "default": {"all": {"enabled": true, "readOnly": false}, "channels": {"email": {"enabled": true}, "sms": {"enabled": false}}}}, "status": "ACTIVE"} + application/json: {"name": "", "active": false, "isTranslationEnabled": false, "_id": "", "workflowId": "", "slug": {}, "updatedAt": "1735661360231", "createdAt": "1731115425881", "steps": [{"controls": {"values": {}}, "variables": {"key": "", "key1": "", "key2": ""}, "stepId": "", "_id": "", "name": "", "slug": {}, "type": "custom", "origin": "external", "workflowId": "", "workflowDatabaseId": ""}], "origin": "external", "preferences": {"user": {"all": {"enabled": true, "readOnly": false}, "channels": {"email": {"enabled": true}, "sms": {"enabled": false}}}, "default": {"all": {"enabled": true, "readOnly": false}, "channels": {"email": {"enabled": true}, "sms": {"enabled": false}}}}, "status": "ACTIVE"} "414": application/json: {"statusCode": 404, "timestamp": "2024-12-12T13:00:00Z", "path": "/api/v1/resource", "message": "xx xx xx ", "ctx": {"workflowId": "some_wf_id", "stepId": "some_wf_id"}, "errorId": "abc123"} "400": @@ -1836,7 +1904,7 @@ examples: application/json: {"name": "Production Environment", "parentId": "60d5ecb8b3b3a30015f3e1a1", "color": "#3498db"} responses: "201": - application/json: {"_id": "60d5ecb8b3b3a30015f3e1a1", "name": "Production Environment", "_organizationId": "60d5ecb8b3b3a30015f3e1a2", "identifier": "prod-env-01", "apiKeys": [{"key": "sk_test_1234567890abcdef", "_userId": "60d5ecb8b3b3a30015f3e1a4", "hash": "hash_value_here"}], "_parentId": "60d5ecb8b3b3a30015f3e1a3", "slug": "production"} + application/json: {"_id": "60d5ecb8b3b3a30015f3e1a1", "name": "Production Environment", "_organizationId": "60d5ecb8b3b3a30015f3e1a2", "identifier": "prod-env-01", "type": "prod", "apiKeys": [{"key": "sk_test_1234567890abcdef", "_userId": "60d5ecb8b3b3a30015f3e1a4", "hash": "hash_value_here"}], "_parentId": "60d5ecb8b3b3a30015f3e1a3", "slug": "production"} "402": application/json: {"statusCode": 404, "timestamp": "2024-12-12T13:00:00Z", "path": "/api/v1/resource", "message": "xx xx xx ", "ctx": {"workflowId": "some_wf_id", "stepId": "some_wf_id"}, "errorId": "abc123"} "400": @@ -1867,7 +1935,7 @@ examples: application/json: {} responses: "200": - application/json: {"_id": "60d5ecb8b3b3a30015f3e1a1", "name": "Production Environment", "_organizationId": "60d5ecb8b3b3a30015f3e1a2", "identifier": "prod-env-01", "apiKeys": [{"key": "sk_test_1234567890abcdef", "_userId": "60d5ecb8b3b3a30015f3e1a4", "hash": "hash_value_here"}], "_parentId": "60d5ecb8b3b3a30015f3e1a3", "slug": "production"} + application/json: {"_id": "60d5ecb8b3b3a30015f3e1a1", "name": "Production Environment", "_organizationId": "60d5ecb8b3b3a30015f3e1a2", "identifier": "prod-env-01", "type": "prod", "apiKeys": [{"key": "sk_test_1234567890abcdef", "_userId": "60d5ecb8b3b3a30015f3e1a4", "hash": "hash_value_here"}], "_parentId": "60d5ecb8b3b3a30015f3e1a3", "slug": "production"} "414": application/json: {"statusCode": 404, "timestamp": "2024-12-12T13:00:00Z", "path": "/api/v1/resource", "message": "xx xx xx ", "ctx": {"workflowId": "some_wf_id", "stepId": "some_wf_id"}, "errorId": "abc123"} "400": @@ -1890,5 +1958,46 @@ examples: application/json: {"statusCode": 404, "timestamp": "2024-12-12T13:00:00Z", "path": "/api/v1/resource", "message": "xx xx xx ", "ctx": {"workflowId": "some_wf_id", "stepId": "some_wf_id"}, "errorId": "abc123", "errors": {"fieldName1": {"messages": ["Field is required", "Must be a valid email address"], "value": "invalidEmail"}, "fieldName2": {"messages": ["Must be at least 18 years old"], "value": 17}, "fieldName3": {"messages": ["Must be a boolean value"], "value": true}, "fieldName4": {"messages": ["Must be a valid object"], "value": {}}, "fieldName5": {"messages": ["Field is missing"], "value": null}, "fieldName6": {"messages": ["Undefined value"]}}} "500": application/json: {"statusCode": 404, "timestamp": "2024-12-12T13:00:00Z", "path": "/api/v1/resource", "message": "xx xx xx ", "ctx": {"workflowId": "some_wf_id", "stepId": "some_wf_id"}, "errorId": "abc123"} + InboundWebhooksController_handleWebhook: + speakeasy-default-inbound-webhooks-controller-handle-webhook: + parameters: + path: + environmentId: "" + integrationId: "" + EnvironmentsController_getEnvironmentTags: + speakeasy-default-environments-controller-get-environment-tags: + parameters: + path: + environmentId: "6615943e7ace93b0540ae377" + responses: + "200": + application/json: [{"name": ""}] + "414": + application/json: {"statusCode": 404, "timestamp": "2024-12-12T13:00:00Z", "path": "/api/v1/resource", "message": "xx xx xx ", "ctx": {"workflowId": "some_wf_id", "stepId": "some_wf_id"}, "errorId": "abc123"} + "400": + application/json: {"statusCode": 404, "timestamp": "2024-12-12T13:00:00Z", "path": "/api/v1/resource", "message": "xx xx xx ", "ctx": {"workflowId": "some_wf_id", "stepId": "some_wf_id"}, "errorId": "abc123"} + "422": + application/json: {"statusCode": 404, "timestamp": "2024-12-12T13:00:00Z", "path": "/api/v1/resource", "message": "xx xx xx ", "ctx": {"workflowId": "some_wf_id", "stepId": "some_wf_id"}, "errorId": "abc123", "errors": {"fieldName1": {"messages": ["Field is required", "Must be a valid email address"], "value": "invalidEmail"}, "fieldName2": {"messages": ["Must be at least 18 years old"], "value": 17}, "fieldName3": {"messages": ["Must be a boolean value"], "value": true}, "fieldName4": {"messages": ["Must be a valid object"], "value": null}, "fieldName5": {"messages": ["Field is missing"], "value": null}, "fieldName6": {"messages": ["Undefined value"]}}} + "500": + application/json: {"statusCode": 404, "timestamp": "2024-12-12T13:00:00Z", "path": "/api/v1/resource", "message": "xx xx xx ", "ctx": {"workflowId": "some_wf_id", "stepId": "some_wf_id"}, "errorId": "abc123"} + SubscribersController_bulkUpdateSubscriberPreferences: + speakeasy-default-subscribers-controller-bulk-update-subscriber-preferences: + parameters: + path: + subscriberId: "" + requestBody: + application/json: {"preferences": []} + responses: + "200": + application/json: [{"level": "global", "workflow": {"id": "64a1b2c3d4e5f6g7h8i9j0k1", "identifier": "welcome-email", "name": "Welcome Email Workflow", "critical": false, "tags": ["user-onboarding", "email"], "data": {}, "severity": "none"}, "enabled": true, "channels": {"email": true, "sms": false, "in_app": true, "chat": false, "push": true}}] + "414": + application/json: {"statusCode": 404, "timestamp": "2024-12-12T13:00:00Z", "path": "/api/v1/resource", "message": "xx xx xx ", "ctx": {"workflowId": "some_wf_id", "stepId": "some_wf_id"}, "errorId": "abc123"} + "400": + application/json: {"statusCode": 404, "timestamp": "2024-12-12T13:00:00Z", "path": "/api/v1/resource", "message": "xx xx xx ", "ctx": {"workflowId": "some_wf_id", "stepId": "some_wf_id"}, "errorId": "abc123"} + "422": + application/json: {"statusCode": 404, "timestamp": "2024-12-12T13:00:00Z", "path": "/api/v1/resource", "message": "xx xx xx ", "ctx": {"workflowId": "some_wf_id", "stepId": "some_wf_id"}, "errorId": "abc123", "errors": {"fieldName1": {"messages": ["Field is required", "Must be a valid email address"], "value": "invalidEmail"}, "fieldName2": {"messages": ["Must be at least 18 years old"], "value": 17}, "fieldName3": {"messages": ["Must be a boolean value"], "value": true}, "fieldName4": {"messages": ["Must be a valid object"], "value": {}}, "fieldName5": {"messages": ["Field is missing"], "value": null}, "fieldName6": {"messages": ["Undefined value"]}}} + "500": + application/json: {"statusCode": 404, "timestamp": "2024-12-12T13:00:00Z", "path": "/api/v1/resource", "message": "xx xx xx ", "ctx": {"workflowId": "some_wf_id", "stepId": "some_wf_id"}, "errorId": "abc123"} examplesVersion: 1.0.2 generatedTests: {} +releaseNotes: "## SDK Changes Detected:\n* `novu->subscribers->create()`: \n * `request.failIfExists` **Added**\n * `error` **Changed** **Breaking** :warning:\n* `novu->messages->get()`: `response.data->[]` **Changed** **Breaking** :warning:\n* `novu->topics->create()`: \n * `request.failIfExists` **Added**\n * `error` **Changed** **Breaking** :warning:\n* `novu->subscriberspreferences->list()`: `request.criticality` **Added** **Breaking** :warning:\n* `novu->subscribers->messages->markAllAs()`: `response.[]` **Changed** **Breaking** :warning:\n* `novu->subscribers->messages->updateAsSeen()`: `response` **Changed** **Breaking** :warning:\n* `novu->workflows->get()`: `response` **Changed**\n* `novu->environments->create()`: `response.type` **Added**\n* `novu->triggerbroadcast()`: \n * `request.triggerEventToAllRequestDto->overrides` **Changed**\n* `novu->trigger()`: \n * `request.triggerEventRequestDto->overrides` **Changed**\n* `novu->subscribers->preferences->bulkUpdate()`: **Added**\n* `novu->workflows->create()`: \n * `request.createWorkflowDto` **Changed**\n * `response` **Changed**\n* `novu->workflows->list()`: `response.workflows->[]` **Changed**\n* `novu->workflows->update()`: \n * `request.updateWorkflowDto` **Changed**\n * `response` **Changed**\n* `novu->inboundwebhookscontroller_handlewebhook()`: **Added**\n* `novu->workflows->patch()`: \n * `request.patchWorkflowDto` **Changed**\n * `response` **Changed**\n* `novu->workflows->sync()`: `response` **Changed**\n* `novu->triggerbulk()`: \n * `request.bulkTriggerEventDto->events->[]->overrides` **Changed**\n* `novu->environments->list()`: `response.[]->type` **Added**\n* `novu->environments->update()`: `response.type` **Added**\n* `novu->integrations->list()`: `response.[]->credentials` **Changed**\n* `novu->integrations->create()`: \n * `request.createIntegrationRequestDto->credentials` **Changed**\n * `response.credentials` **Changed**\n* `novu->integrations->update()`: \n * `request.updateIntegrationRequestDto->credentials` **Changed**\n * `response.credentials` **Changed**\n* `novu->integrations->delete()`: `response.[]->credentials` **Changed**\n* `novu->integrations->setAsPrimary()`: `response.credentials` **Changed**\n* `novu->integrations->listActive()`: `response.[]->credentials` **Changed**\n* `novu->environments->getTags()`: **Added**\n* `novu->notifications->list()`: `response.data->[]->jobs->[]->executionDetails->[]->providerId` **Changed**\n* `novu->notifications->get()`: `response.jobs->[]->executionDetails->[]->providerId` **Changed**\n" diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 57b4617..8d2b050 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -21,7 +21,7 @@ generation: generateNewTests: false skipResponseBodyAssertions: false php: - version: 1.3.0 + version: 1.3.1 additionalDependencies: autoload: {} autoload-dev: {} diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 2103f8d..086fd07 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,21 +1,21 @@ -speakeasyVersion: 1.573.0 +speakeasyVersion: 1.606.10 sources: novu-OAS: sourceNamespace: novu-oas - sourceRevisionDigest: sha256:ef701aef8f7008b1f509426fc3893c69cfea438b4412f196f33b4fd8f5264c18 - sourceBlobDigest: sha256:34c0cc64c72a6940a143193ccbcf32069abc698d4754834a2defd06b0bbfba40 + sourceRevisionDigest: sha256:dcaae3754121c8c577e4da4618aca213747c97d320ebc6adce2c85591506af31 + sourceBlobDigest: sha256:ea4427bfcd1a7e88bddf26ff678b9887c156177fb76a94351389854e9a34e180 tags: - latest - - speakeasy-sdk-regen-1750205712 + - speakeasy-sdk-regen-1755476199 - 2.3.0 targets: novu: source: novu-OAS sourceNamespace: novu-oas - sourceRevisionDigest: sha256:ef701aef8f7008b1f509426fc3893c69cfea438b4412f196f33b4fd8f5264c18 - sourceBlobDigest: sha256:34c0cc64c72a6940a143193ccbcf32069abc698d4754834a2defd06b0bbfba40 + sourceRevisionDigest: sha256:dcaae3754121c8c577e4da4618aca213747c97d320ebc6adce2c85591506af31 + sourceBlobDigest: sha256:ea4427bfcd1a7e88bddf26ff678b9887c156177fb76a94351389854e9a34e180 codeSamplesNamespace: novu-oas-php-code-samples - codeSamplesRevisionDigest: sha256:fc3cf600c462c1c370bcd2b8bfa879428f65eef70540aabaf9077841ab30a52e + codeSamplesRevisionDigest: sha256:33a21d2ad40bfe89252933941adf5a9e3849465db45f84c5fa323774df5fff7b workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index 61e7ddd..0c1433d 100644 --- a/README.md +++ b/README.md @@ -280,7 +280,6 @@ declare(strict_types=1); require 'vendor/autoload.php'; use novu; -use novu\Models\Components; $sdk = novu\Novu::builder() ->setSecurity( @@ -288,23 +287,15 @@ $sdk = novu\Novu::builder() ) ->build(); -$triggerEventRequestDto = new Components\TriggerEventRequestDto( - workflowId: 'workflow_identifier', - payload: [ - 'comment_id' => 'string', - 'post' => [ - 'text' => 'string', - ], - ], - overrides: new Components\Overrides(), - to: 'SUBSCRIBER_ID', -); -$response = $sdk->trigger( - triggerEventRequestDto: $triggerEventRequestDto + +$response = $sdk->inboundWebhooksControllerHandleWebhook( + environmentId: '', + integrationId: '' + ); -if ($response->triggerEventResponseDto !== null) { +if ($response->statusCode === 200) { // handle response } ``` @@ -318,6 +309,7 @@ if ($response->triggerEventResponseDto !== null) { ### [environments](docs/sdks/environments/README.md) +* [getTags](docs/sdks/environments/README.md#gettags) - Get environment tags * [create](docs/sdks/environments/README.md#create) - Create an environment * [list](docs/sdks/environments/README.md#list) - List all environments * [update](docs/sdks/environments/README.md#update) - Update an environment @@ -345,6 +337,7 @@ if ($response->triggerEventResponseDto !== null) { ### [Novu SDK](docs/sdks/novu/README.md) +* [inboundWebhooksControllerHandleWebhook](docs/sdks/novu/README.md#inboundwebhookscontrollerhandlewebhook) * [trigger](docs/sdks/novu/README.md#trigger) - Trigger event * [cancel](docs/sdks/novu/README.md#cancel) - Cancel triggered event * [triggerBroadcast](docs/sdks/novu/README.md#triggerbroadcast) - Broadcast event to all @@ -359,7 +352,7 @@ if ($response->triggerEventResponseDto !== null) { * [delete](docs/sdks/subscribers/README.md#delete) - Delete a subscriber * [createBulk](docs/sdks/subscribers/README.md#createbulk) - Bulk create subscribers * [updatePreferences](docs/sdks/subscribers/README.md#updatepreferences) - Update subscriber preferences -* [updateCredentials](docs/sdks/subscribers/README.md#updatecredentials) - Update provider credentials +* [updateCredentials](docs/sdks/subscribers/README.md#updatecredentials) - Upsert provider credentials * [updateOnlineStatus](docs/sdks/subscribers/README.md#updateonlinestatus) - Update subscriber online status #### [subscribers->messages](docs/sdks/novumessages/README.md) @@ -371,13 +364,17 @@ if ($response->triggerEventResponseDto !== null) { * [getFeed](docs/sdks/novunotifications/README.md#getfeed) - Retrieve subscriber notifications +#### [subscribers->preferences](docs/sdks/preferences/README.md) + +* [bulkUpdate](docs/sdks/preferences/README.md#bulkupdate) - Bulk update subscriber preferences + #### [subscribers->topics](docs/sdks/novutopics/README.md) * [list](docs/sdks/novutopics/README.md#list) - Retrieve subscriber subscriptions ### [subscribersCredentials](docs/sdks/subscriberscredentials/README.md) -* [append](docs/sdks/subscriberscredentials/README.md#append) - Upsert provider credentials +* [append](docs/sdks/subscriberscredentials/README.md#append) - Update provider credentials * [deleteProvider](docs/sdks/subscriberscredentials/README.md#deleteprovider) - Delete provider credentials ### [subscribersMessages](docs/sdks/subscribersmessages/README.md) @@ -439,7 +436,6 @@ declare(strict_types=1); require 'vendor/autoload.php'; use novu; -use novu\Models\Components; use novu\Utils\Retry; $sdk = novu\Novu::builder() @@ -448,20 +444,11 @@ $sdk = novu\Novu::builder() ) ->build(); -$triggerEventRequestDto = new Components\TriggerEventRequestDto( - workflowId: 'workflow_identifier', - payload: [ - 'comment_id' => 'string', - 'post' => [ - 'text' => 'string', - ], - ], - overrides: new Components\Overrides(), - to: 'SUBSCRIBER_ID', -); -$response = $sdk->trigger( - triggerEventRequestDto: $triggerEventRequestDto, + +$response = $sdk->inboundWebhooksControllerHandleWebhook( + environmentId: '', + integrationId: '', options: Utils\Options->builder()->setRetryConfig( new Retry\RetryConfigBackoff( initialInterval: 1, @@ -473,7 +460,7 @@ $response = $sdk->trigger( ); -if ($response->triggerEventResponseDto !== null) { +if ($response->statusCode === 200) { // handle response } ``` @@ -485,7 +472,6 @@ declare(strict_types=1); require 'vendor/autoload.php'; use novu; -use novu\Models\Components; use novu\Utils\Retry; $sdk = novu\Novu::builder() @@ -503,23 +489,15 @@ $sdk = novu\Novu::builder() ) ->build(); -$triggerEventRequestDto = new Components\TriggerEventRequestDto( - workflowId: 'workflow_identifier', - payload: [ - 'comment_id' => 'string', - 'post' => [ - 'text' => 'string', - ], - ], - overrides: new Components\Overrides(), - to: 'SUBSCRIBER_ID', -); -$response = $sdk->trigger( - triggerEventRequestDto: $triggerEventRequestDto + +$response = $sdk->inboundWebhooksControllerHandleWebhook( + environmentId: '', + integrationId: '' + ); -if ($response->triggerEventResponseDto !== null) { +if ($response->statusCode === 200) { // handle response } ``` @@ -629,7 +607,6 @@ declare(strict_types=1); require 'vendor/autoload.php'; use novu; -use novu\Models\Components; $sdk = novu\Novu::builder() ->setServerIndex(1) @@ -638,23 +615,15 @@ $sdk = novu\Novu::builder() ) ->build(); -$triggerEventRequestDto = new Components\TriggerEventRequestDto( - workflowId: 'workflow_identifier', - payload: [ - 'comment_id' => 'string', - 'post' => [ - 'text' => 'string', - ], - ], - overrides: new Components\Overrides(), - to: 'SUBSCRIBER_ID', -); -$response = $sdk->trigger( - triggerEventRequestDto: $triggerEventRequestDto + +$response = $sdk->inboundWebhooksControllerHandleWebhook( + environmentId: '', + integrationId: '' + ); -if ($response->triggerEventResponseDto !== null) { +if ($response->statusCode === 200) { // handle response } ``` @@ -668,7 +637,6 @@ declare(strict_types=1); require 'vendor/autoload.php'; use novu; -use novu\Models\Components; $sdk = novu\Novu::builder() ->setServerURL('https://eu.api.novu.co') @@ -677,23 +645,15 @@ $sdk = novu\Novu::builder() ) ->build(); -$triggerEventRequestDto = new Components\TriggerEventRequestDto( - workflowId: 'workflow_identifier', - payload: [ - 'comment_id' => 'string', - 'post' => [ - 'text' => 'string', - ], - ], - overrides: new Components\Overrides(), - to: 'SUBSCRIBER_ID', -); -$response = $sdk->trigger( - triggerEventRequestDto: $triggerEventRequestDto + +$response = $sdk->inboundWebhooksControllerHandleWebhook( + environmentId: '', + integrationId: '' + ); -if ($response->triggerEventResponseDto !== null) { +if ($response->statusCode === 200) { // handle response } ``` diff --git a/RELEASES.md b/RELEASES.md index 623a4c8..5badb2e 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -78,4 +78,14 @@ Based on: ### Generated - [php v1.3.0] . ### Releases -- [Composer v1.3.0] https://packagist.org/packages/novuhq/novu#v1.3.0 - . \ No newline at end of file +- [Composer v1.3.0] https://packagist.org/packages/novuhq/novu#v1.3.0 - . + +## 2025-09-02 00:14:19 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.606.10 (2.687.13) https://github.com/speakeasy-api/speakeasy +### Generated +- [php v1.3.1] . +### Releases +- [Composer v1.3.1] https://packagist.org/packages/novuhq/novu#v1.3.1 - . \ No newline at end of file diff --git a/composer.json b/composer.json index eaa48be..42280a4 100644 --- a/composer.json +++ b/composer.json @@ -8,18 +8,18 @@ }, "license": "MIT", "require": { - "php": "^8.2", - "galbar/jsonpath": "^3.0", + "php": ">=8.2", + "galbar/jsonpath": ">=3.0", "guzzlehttp/guzzle": "^7.0", "speakeasy/serializer": "^4.0.3", - "brick/date-time": "^0.7.0", - "phpdocumentor/type-resolver": "^1.8", - "brick/math": "^0.12.1" + "brick/date-time": ">=0.7.0", + "phpdocumentor/type-resolver": ">=1.8", + "brick/math": ">=0.12.1" }, "require-dev": { - "laravel/pint": "^1.21.2", - "phpstan/phpstan": "^2.1.0", - "phpunit/phpunit": "^10", + "laravel/pint": ">=1.21.2", + "phpstan/phpstan": ">=2.1.0", + "phpunit/phpunit": ">=10", "roave/security-advisories": "dev-latest" }, "minimum-stability": "stable", diff --git a/docs/Models/Components/ActivityNotificationExecutionDetailResponseDto.md b/docs/Models/Components/ActivityNotificationExecutionDetailResponseDto.md index bc547ba..fc35969 100644 --- a/docs/Models/Components/ActivityNotificationExecutionDetailResponseDto.md +++ b/docs/Models/Components/ActivityNotificationExecutionDetailResponseDto.md @@ -11,6 +11,6 @@ | `detail` | *string* | :heavy_check_mark: | Detailed information about the execution | | `isRetry` | *bool* | :heavy_check_mark: | Whether the execution is a retry or not | | `isTest` | *bool* | :heavy_check_mark: | Whether the execution is a test or not | -| `providerId` | [Components\ProvidersIdEnum](../../Models/Components/ProvidersIdEnum.md) | :heavy_check_mark: | Provider ID of the job | +| `providerId` | [?Components\ProvidersIdEnum](../../Models/Components/ProvidersIdEnum.md) | :heavy_minus_sign: | Provider ID of the job | | `raw` | *?string* | :heavy_minus_sign: | Raw data of the execution | | `source` | [Components\ExecutionDetailsSourceEnum](../../Models/Components/ExecutionDetailsSourceEnum.md) | :heavy_check_mark: | Source of the execution detail | \ No newline at end of file diff --git a/docs/Models/Components/BulkUpdateSubscriberPreferenceItemDto.md b/docs/Models/Components/BulkUpdateSubscriberPreferenceItemDto.md new file mode 100644 index 0000000..84fa996 --- /dev/null +++ b/docs/Models/Components/BulkUpdateSubscriberPreferenceItemDto.md @@ -0,0 +1,9 @@ +# BulkUpdateSubscriberPreferenceItemDto + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `channels` | [Components\PatchPreferenceChannelsDto](../../Models/Components/PatchPreferenceChannelsDto.md) | :heavy_check_mark: | Channel-specific preference settings | +| `workflowId` | *string* | :heavy_check_mark: | Workflow internal _id, identifier or slug | \ No newline at end of file diff --git a/docs/Models/Components/BulkUpdateSubscriberPreferencesDto.md b/docs/Models/Components/BulkUpdateSubscriberPreferencesDto.md new file mode 100644 index 0000000..d492de1 --- /dev/null +++ b/docs/Models/Components/BulkUpdateSubscriberPreferencesDto.md @@ -0,0 +1,8 @@ +# BulkUpdateSubscriberPreferencesDto + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | +| `preferences` | array<[Components\BulkUpdateSubscriberPreferenceItemDto](../../Models/Components/BulkUpdateSubscriberPreferenceItemDto.md)> | :heavy_check_mark: | Array of workflow preferences to update (maximum 100 items) | \ No newline at end of file diff --git a/docs/Models/Components/Channels.md b/docs/Models/Components/Channels.md new file mode 100644 index 0000000..2f14fa7 --- /dev/null +++ b/docs/Models/Components/Channels.md @@ -0,0 +1,10 @@ +# Channels + +Channel-specific overrides that apply to all steps of a particular channel type. Step-level overrides take precedence over channel-level overrides. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `email` | [?Components\EmailChannelOverrides](../../Models/Components/EmailChannelOverrides.md) | :heavy_minus_sign: | Email channel specific overrides | \ No newline at end of file diff --git a/docs/Models/Components/ChatOrPushProviderEnum.md b/docs/Models/Components/ChatOrPushProviderEnum.md index b17ec9e..332640a 100644 --- a/docs/Models/Components/ChatOrPushProviderEnum.md +++ b/docs/Models/Components/ChatOrPushProviderEnum.md @@ -18,6 +18,7 @@ The provider identifier for the credentials | `RocketChat` | rocket-chat | | `WhatsappBusiness` | whatsapp-business | | `ChatWebhook` | chat-webhook | +| `NovuSlack` | novu-slack | | `Fcm` | fcm | | `Apns` | apns | | `Expo` | expo | diff --git a/docs/Models/Components/StepContentIssueEnum.md b/docs/Models/Components/ContentIssueEnum.md similarity index 95% rename from docs/Models/Components/StepContentIssueEnum.md rename to docs/Models/Components/ContentIssueEnum.md index 3740fbe..54ecbcf 100644 --- a/docs/Models/Components/StepContentIssueEnum.md +++ b/docs/Models/Components/ContentIssueEnum.md @@ -1,4 +1,4 @@ -# StepContentIssueEnum +# ContentIssueEnum Type of step content issue diff --git a/docs/Models/Components/CreateWorkflowDto.md b/docs/Models/Components/CreateWorkflowDto.md index 92fc738..a0790b2 100644 --- a/docs/Models/Components/CreateWorkflowDto.md +++ b/docs/Models/Components/CreateWorkflowDto.md @@ -9,9 +9,10 @@ | `description` | *?string* | :heavy_minus_sign: | Description of the workflow | | `tags` | array<*string*> | :heavy_minus_sign: | Tags associated with the workflow | | `active` | *?bool* | :heavy_minus_sign: | Whether the workflow is active | +| `validatePayload` | *?bool* | :heavy_minus_sign: | Enable or disable payload schema validation | +| `payloadSchema` | array | :heavy_minus_sign: | The payload JSON Schema for the workflow | +| `isTranslationEnabled` | *?bool* | :heavy_minus_sign: | Enable or disable translations for this workflow | | `workflowId` | *string* | :heavy_check_mark: | Unique identifier for the workflow | | `steps` | array<[Components\InAppStepUpsertDto\|Components\EmailStepUpsertDto\|Components\SmsStepUpsertDto\|Components\PushStepUpsertDto\|Components\ChatStepUpsertDto\|Components\DelayStepUpsertDto\|Components\DigestStepUpsertDto\|Components\CustomStepUpsertDto](../../Models/Components/Steps.md)> | :heavy_check_mark: | Steps of the workflow | | `source` | [?Components\WorkflowCreationSourceEnum](../../Models/Components/WorkflowCreationSourceEnum.md) | :heavy_minus_sign: | Source of workflow creation | -| `preferences` | [?Components\PreferencesRequestDto](../../Models/Components/PreferencesRequestDto.md) | :heavy_minus_sign: | Workflow preferences | -| `payloadSchema` | array | :heavy_minus_sign: | The payload JSON Schema for the workflow | -| `validatePayload` | *?bool* | :heavy_minus_sign: | Enable or disable payload schema validation | \ No newline at end of file +| `preferences` | [?Components\PreferencesRequestDto](../../Models/Components/PreferencesRequestDto.md) | :heavy_minus_sign: | Workflow preferences | \ No newline at end of file diff --git a/docs/Models/Components/CredentialsDto.md b/docs/Models/Components/CredentialsDto.md index cf9f6b7..565cd96 100644 --- a/docs/Models/Components/CredentialsDto.md +++ b/docs/Models/Components/CredentialsDto.md @@ -46,4 +46,6 @@ | `externalLink` | *?string* | :heavy_minus_sign: | N/A | | `channelId` | *?string* | :heavy_minus_sign: | N/A | | `phoneNumberIdentification` | *?string* | :heavy_minus_sign: | N/A | -| `accessKey` | *?string* | :heavy_minus_sign: | N/A | \ No newline at end of file +| `accessKey` | *?string* | :heavy_minus_sign: | N/A | +| `appSid` | *?string* | :heavy_minus_sign: | N/A | +| `senderId` | *?string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/EmailChannelOverrides.md b/docs/Models/Components/EmailChannelOverrides.md new file mode 100644 index 0000000..a9494fc --- /dev/null +++ b/docs/Models/Components/EmailChannelOverrides.md @@ -0,0 +1,8 @@ +# EmailChannelOverrides + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | +| `layoutId` | *?string* | :heavy_minus_sign: | Override or remove the layout for all email steps in the workflow | promotional-layout-2024 | \ No newline at end of file diff --git a/docs/Models/Components/EmailControlDto.md b/docs/Models/Components/EmailControlDto.md index 529f0bb..db498b1 100644 --- a/docs/Models/Components/EmailControlDto.md +++ b/docs/Models/Components/EmailControlDto.md @@ -9,4 +9,5 @@ | `subject` | *string* | :heavy_check_mark: | Subject of the email. | | | `body` | *?string* | :heavy_minus_sign: | Body content of the email, either a valid Maily JSON object, or html string. | | | `editorType` | [?Components\EditorType](../../Models/Components/EditorType.md) | :heavy_minus_sign: | Type of editor to use for the body. | | -| `disableOutputSanitization` | *?bool* | :heavy_minus_sign: | Disable sanitization of the output. | | \ No newline at end of file +| `disableOutputSanitization` | *?bool* | :heavy_minus_sign: | Disable sanitization of the output. | | +| `layoutId` | *?string* | :heavy_minus_sign: | Layout ID to use for the email. Null means no layout, undefined means default layout. | | \ No newline at end of file diff --git a/docs/Models/Components/EmailStepResponseDtoControlValues.md b/docs/Models/Components/EmailStepResponseDtoControlValues.md index 4fee387..f70f318 100644 --- a/docs/Models/Components/EmailStepResponseDtoControlValues.md +++ b/docs/Models/Components/EmailStepResponseDtoControlValues.md @@ -12,4 +12,5 @@ Control values for the email step | `body` | *?string* | :heavy_minus_sign: | Body content of the email, either a valid Maily JSON object, or html string. | | | `editorType` | [?Components\EmailStepResponseDtoEditorType](../../Models/Components/EmailStepResponseDtoEditorType.md) | :heavy_minus_sign: | Type of editor to use for the body. | | | `disableOutputSanitization` | *?bool* | :heavy_minus_sign: | Disable sanitization of the output. | | +| `layoutId` | *?string* | :heavy_minus_sign: | Layout ID to use for the email. Null means no layout, undefined means default layout. | | | `additionalProperties` | array | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/Models/Components/EnvironmentResponseDto.md b/docs/Models/Components/EnvironmentResponseDto.md index 6effb92..eabf0e2 100644 --- a/docs/Models/Components/EnvironmentResponseDto.md +++ b/docs/Models/Components/EnvironmentResponseDto.md @@ -3,12 +3,13 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | Unique identifier of the environment | 60d5ecb8b3b3a30015f3e1a1 | -| `name` | *string* | :heavy_check_mark: | Name of the environment | Production Environment | -| `organizationId` | *string* | :heavy_check_mark: | Organization ID associated with the environment | 60d5ecb8b3b3a30015f3e1a2 | -| `identifier` | *string* | :heavy_check_mark: | Unique identifier for the environment | prod-env-01 | -| `apiKeys` | array<[Components\ApiKeyDto](../../Models/Components/ApiKeyDto.md)> | :heavy_minus_sign: | List of API keys associated with the environment | | -| `parentId` | *?string* | :heavy_minus_sign: | Parent environment ID | 60d5ecb8b3b3a30015f3e1a3 | -| `slug` | *?string* | :heavy_minus_sign: | URL-friendly slug for the environment | production | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | Unique identifier of the environment | 60d5ecb8b3b3a30015f3e1a1 | +| `name` | *string* | :heavy_check_mark: | Name of the environment | Production Environment | +| `organizationId` | *string* | :heavy_check_mark: | Organization ID associated with the environment | 60d5ecb8b3b3a30015f3e1a2 | +| `identifier` | *string* | :heavy_check_mark: | Unique identifier for the environment | prod-env-01 | +| `type` | [?Components\EnvironmentResponseDtoType](../../Models/Components/EnvironmentResponseDtoType.md) | :heavy_minus_sign: | Type of the environment | prod | +| `apiKeys` | array<[Components\ApiKeyDto](../../Models/Components/ApiKeyDto.md)> | :heavy_minus_sign: | List of API keys associated with the environment | | +| `parentId` | *?string* | :heavy_minus_sign: | Parent environment ID | 60d5ecb8b3b3a30015f3e1a3 | +| `slug` | *?string* | :heavy_minus_sign: | URL-friendly slug for the environment | production | \ No newline at end of file diff --git a/docs/Models/Components/EnvironmentResponseDtoType.md b/docs/Models/Components/EnvironmentResponseDtoType.md new file mode 100644 index 0000000..3bc89bf --- /dev/null +++ b/docs/Models/Components/EnvironmentResponseDtoType.md @@ -0,0 +1,11 @@ +# EnvironmentResponseDtoType + +Type of the environment + + +## Values + +| Name | Value | +| ------ | ------ | +| `Dev` | dev | +| `Prod` | prod | \ No newline at end of file diff --git a/docs/Models/Components/GetEnvironmentTagsDto.md b/docs/Models/Components/GetEnvironmentTagsDto.md new file mode 100644 index 0000000..60900ec --- /dev/null +++ b/docs/Models/Components/GetEnvironmentTagsDto.md @@ -0,0 +1,8 @@ +# GetEnvironmentTagsDto + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `name` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Components/GetPreferencesResponseDto.md b/docs/Models/Components/GetPreferencesResponseDto.md new file mode 100644 index 0000000..27e6c18 --- /dev/null +++ b/docs/Models/Components/GetPreferencesResponseDto.md @@ -0,0 +1,11 @@ +# GetPreferencesResponseDto + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `level` | [Components\PreferenceLevelEnum](../../Models/Components/PreferenceLevelEnum.md) | :heavy_check_mark: | The level of the preference (global or template) | | +| `workflow` | [?Components\Workflow](../../Models/Components/Workflow.md) | :heavy_minus_sign: | Workflow information if this is a template-level preference | | +| `enabled` | *bool* | :heavy_check_mark: | Whether the preference is enabled | true | +| `channels` | [Components\SubscriberPreferenceChannels](../../Models/Components/SubscriberPreferenceChannels.md) | :heavy_check_mark: | Channel-specific preference settings | | \ No newline at end of file diff --git a/docs/Models/Components/GetPreferencesResponseDtoData.md b/docs/Models/Components/GetPreferencesResponseDtoData.md new file mode 100644 index 0000000..52319b4 --- /dev/null +++ b/docs/Models/Components/GetPreferencesResponseDtoData.md @@ -0,0 +1,9 @@ +# GetPreferencesResponseDtoData + +Custom data associated with the workflow + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/Models/Components/StepIntegrationIssueEnum.md b/docs/Models/Components/IntegrationIssueEnum.md similarity index 87% rename from docs/Models/Components/StepIntegrationIssueEnum.md rename to docs/Models/Components/IntegrationIssueEnum.md index 1bb0e92..eb2aaaf 100644 --- a/docs/Models/Components/StepIntegrationIssueEnum.md +++ b/docs/Models/Components/IntegrationIssueEnum.md @@ -1,4 +1,4 @@ -# StepIntegrationIssueEnum +# IntegrationIssueEnum Type of integration issue diff --git a/docs/Models/Components/LastName.md b/docs/Models/Components/LastName.md new file mode 100644 index 0000000..0580bce --- /dev/null +++ b/docs/Models/Components/LastName.md @@ -0,0 +1,9 @@ +# LastName + +User last name + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/Models/Components/LastPublishedBy.md b/docs/Models/Components/LastPublishedBy.md new file mode 100644 index 0000000..0eaa7a6 --- /dev/null +++ b/docs/Models/Components/LastPublishedBy.md @@ -0,0 +1,13 @@ +# LastPublishedBy + +User who last published the workflow + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | User ID | +| `firstName` | *?string* | :heavy_minus_sign: | User first name | +| `lastName` | [?Components\WorkflowResponseDtoLastName](../../Models/Components/WorkflowResponseDtoLastName.md) | :heavy_minus_sign: | User last name | +| `externalId` | *?string* | :heavy_minus_sign: | User external ID | \ No newline at end of file diff --git a/docs/Models/Components/MessageResponseDto.md b/docs/Models/Components/MessageResponseDto.md index 715ef86..2f85f87 100644 --- a/docs/Models/Components/MessageResponseDto.md +++ b/docs/Models/Components/MessageResponseDto.md @@ -6,9 +6,9 @@ | Field | Type | Required | Description | | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | | `id` | *?string* | :heavy_minus_sign: | Unique identifier for the message | -| `templateId` | *string* | :heavy_check_mark: | Template ID associated with the message | +| `templateId` | *?string* | :heavy_minus_sign: | Template ID associated with the message | | `environmentId` | *string* | :heavy_check_mark: | Environment ID where the message is sent | -| `messageTemplateId` | *string* | :heavy_check_mark: | Message template ID | +| `messageTemplateId` | *?string* | :heavy_minus_sign: | Message template ID | | `organizationId` | *string* | :heavy_check_mark: | Organization ID associated with the message | | `notificationId` | *string* | :heavy_check_mark: | Notification ID associated with the message | | `subscriberId` | *string* | :heavy_check_mark: | Subscriber ID associated with the message | @@ -19,7 +19,7 @@ | `deliveredAt` | array<*string*> | :heavy_minus_sign: | Array of delivery dates for the message, if the message has multiple delivery dates, for example after being snoozed | | `lastSeenDate` | *?string* | :heavy_minus_sign: | Last seen date of the message, if available | | `lastReadDate` | *?string* | :heavy_minus_sign: | Last read date of the message, if available | -| `content` | [array\|string](../../Models/Components/Content.md) | :heavy_check_mark: | Content of the message, can be an email block or a string | +| `content` | [array\|string\|null](../../Models/Components/Content.md) | :heavy_minus_sign: | Content of the message, can be an email block or a string | | `transactionId` | *string* | :heavy_check_mark: | Transaction ID associated with the message | | `subject` | *?string* | :heavy_minus_sign: | Subject of the message, if applicable | | `channel` | [Components\ChannelTypeEnum](../../Models/Components/ChannelTypeEnum.md) | :heavy_check_mark: | Channel type through which the message is sent | diff --git a/docs/Models/Components/Overrides.md b/docs/Models/Components/Overrides.md index c5e0bbf..d1a7f73 100644 --- a/docs/Models/Components/Overrides.md +++ b/docs/Models/Components/Overrides.md @@ -7,7 +7,8 @@ This could be used to override provider specific configurations | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `steps` | array | :heavy_minus_sign: | This could be used to override provider specific configurations | {
"email-step": {
"providers": {
"sendgrid": {
"templateId": "1234567890"
}
}
}
} | +| `steps` | array | :heavy_minus_sign: | This could be used to override provider specific configurations or layout at the step level | {
"email-step": {
"providers": {
"sendgrid": {
"templateId": "1234567890"
}
},
"layoutId": "step-specific-layout"
}
} | +| `channels` | [?Components\Channels](../../Models/Components/Channels.md) | :heavy_minus_sign: | Channel-specific overrides that apply to all steps of a particular channel type. Step-level overrides take precedence over channel-level overrides. | {
"email": {
"layoutId": "promotional-layout-2024"
}
} | | `providers` | array> | :heavy_minus_sign: | Overrides the provider configuration for the entire workflow and all steps | {
"sendgrid": {
"templateId": "1234567890"
}
} | | ~~`email`~~ | array | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Override the email provider specific configurations for the entire workflow | | | ~~`push`~~ | array | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Override the push provider specific configurations for the entire workflow | | diff --git a/docs/Models/Components/PatchWorkflowDto.md b/docs/Models/Components/PatchWorkflowDto.md index 170ecf8..a25f74c 100644 --- a/docs/Models/Components/PatchWorkflowDto.md +++ b/docs/Models/Components/PatchWorkflowDto.md @@ -3,11 +3,12 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | -| `active` | *?bool* | :heavy_minus_sign: | Activate or deactivate the workflow | -| `name` | *?string* | :heavy_minus_sign: | New name for the workflow | -| `description` | *?string* | :heavy_minus_sign: | Updated description of the workflow | -| `tags` | array<*string*> | :heavy_minus_sign: | Tags associated with the workflow | -| `payloadSchema` | array | :heavy_minus_sign: | The payload JSON Schema for the workflow | -| `validatePayload` | *?bool* | :heavy_minus_sign: | Enable or disable payload schema validation | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | +| `active` | *?bool* | :heavy_minus_sign: | Activate or deactivate the workflow | +| `name` | *?string* | :heavy_minus_sign: | New name for the workflow | +| `description` | *?string* | :heavy_minus_sign: | Updated description of the workflow | +| `tags` | array<*string*> | :heavy_minus_sign: | Tags associated with the workflow | +| `payloadSchema` | array | :heavy_minus_sign: | The payload JSON Schema for the workflow | +| `validatePayload` | *?bool* | :heavy_minus_sign: | Enable or disable payload schema validation | +| `isTranslationEnabled` | *?bool* | :heavy_minus_sign: | Enable or disable translations for this workflow | \ No newline at end of file diff --git a/docs/Models/Components/PreferenceLevelEnum.md b/docs/Models/Components/PreferenceLevelEnum.md new file mode 100644 index 0000000..eece3af --- /dev/null +++ b/docs/Models/Components/PreferenceLevelEnum.md @@ -0,0 +1,11 @@ +# PreferenceLevelEnum + +The level of the preference (global or template) + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `Global` | global | +| `Template` | template | \ No newline at end of file diff --git a/docs/Models/Components/PreferencesRequestDto.md b/docs/Models/Components/PreferencesRequestDto.md index 8ddd5ce..3bfd81a 100644 --- a/docs/Models/Components/PreferencesRequestDto.md +++ b/docs/Models/Components/PreferencesRequestDto.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| `user` | [?Components\UserWorkflowPreferencesDto](../../Models/Components/User.md) | :heavy_minus_sign: | User workflow preferences | -| `workflow` | [?Components\Workflow](../../Models/Components/Workflow.md) | :heavy_minus_sign: | Workflow-specific preferences | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | +| `user` | [?Components\UserWorkflowPreferencesDto](../../Models/Components/User.md) | :heavy_minus_sign: | User workflow preferences | +| `workflow` | [?Components\PreferencesRequestDtoWorkflow](../../Models/Components/PreferencesRequestDtoWorkflow.md) | :heavy_minus_sign: | Workflow-specific preferences | \ No newline at end of file diff --git a/docs/Models/Components/PreferencesRequestDtoWorkflow.md b/docs/Models/Components/PreferencesRequestDtoWorkflow.md new file mode 100644 index 0000000..e8e9099 --- /dev/null +++ b/docs/Models/Components/PreferencesRequestDtoWorkflow.md @@ -0,0 +1,11 @@ +# PreferencesRequestDtoWorkflow + +Workflow-specific preferences + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | +| `all` | [Components\WorkflowPreferenceDto](../../Models/Components/PreferencesRequestDtoAll.md) | :heavy_check_mark: | A preference for the workflow. The values specified here will be used if no preference is specified for a channel. | | +| `channels` | array | :heavy_check_mark: | Preferences for different communication channels | {
"email": {
"enabled": true
},
"sms": {
"enabled": false
}
} | \ No newline at end of file diff --git a/docs/Models/Components/ProviderId.md b/docs/Models/Components/ProviderId.md index f4358c1..bff5140 100644 --- a/docs/Models/Components/ProviderId.md +++ b/docs/Models/Components/ProviderId.md @@ -18,6 +18,7 @@ The ID of the chat or push provider. | `RocketChat` | rocket-chat | | `WhatsappBusiness` | whatsapp-business | | `ChatWebhook` | chat-webhook | +| `NovuSlack` | novu-slack | | `Fcm` | fcm | | `Apns` | apns | | `Expo` | expo | diff --git a/docs/Models/Components/ProvidersIdEnum.md b/docs/Models/Components/ProvidersIdEnum.md index bcc9832..54a5146 100644 --- a/docs/Models/Components/ProvidersIdEnum.md +++ b/docs/Models/Components/ProvidersIdEnum.md @@ -59,6 +59,9 @@ Provider ID of the job | `EazySms` | eazy-sms | | `Mobishastra` | mobishastra | | `AfroMessage` | afro-message | +| `Unifonic` | unifonic | +| `Smsmode` | smsmode | +| `Imedia` | imedia | | `Fcm` | fcm | | `Apns` | apns | | `Expo` | expo | @@ -77,4 +80,5 @@ Provider ID of the job | `Getstream` | getstream | | `RocketChat` | rocket-chat | | `WhatsappBusiness` | whatsapp-business | -| `ChatWebhook` | chat-webhook | \ No newline at end of file +| `ChatWebhook` | chat-webhook | +| `NovuSlack` | novu-slack | \ No newline at end of file diff --git a/docs/Models/Components/SeverityLevelEnum.md b/docs/Models/Components/SeverityLevelEnum.md new file mode 100644 index 0000000..e25cabe --- /dev/null +++ b/docs/Models/Components/SeverityLevelEnum.md @@ -0,0 +1,13 @@ +# SeverityLevelEnum + +Severity level of the workflow + + +## Values + +| Name | Value | +| -------- | -------- | +| `High` | high | +| `Medium` | medium | +| `Low` | low | +| `None` | none | \ No newline at end of file diff --git a/docs/Models/Components/StepContentIssueDto.md b/docs/Models/Components/StepContentIssueDto.md index 688c84e..a6d1d95 100644 --- a/docs/Models/Components/StepContentIssueDto.md +++ b/docs/Models/Components/StepContentIssueDto.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| `issueType` | [Components\StepContentIssueEnum](../../Models/Components/StepContentIssueEnum.md) | :heavy_check_mark: | Type of step content issue | -| `variableName` | *?string* | :heavy_minus_sign: | Name of the variable related to the issue | -| `message` | *string* | :heavy_check_mark: | Detailed message describing the issue | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `issueType` | [Components\ContentIssueEnum](../../Models/Components/ContentIssueEnum.md) | :heavy_check_mark: | Type of step content issue | +| `variableName` | *?string* | :heavy_minus_sign: | Name of the variable related to the issue | +| `message` | *string* | :heavy_check_mark: | Detailed message describing the issue | \ No newline at end of file diff --git a/docs/Models/Components/StepIntegrationIssue.md b/docs/Models/Components/StepIntegrationIssue.md index 3296f11..5759970 100644 --- a/docs/Models/Components/StepIntegrationIssue.md +++ b/docs/Models/Components/StepIntegrationIssue.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `issueType` | [Components\StepIntegrationIssueEnum](../../Models/Components/StepIntegrationIssueEnum.md) | :heavy_check_mark: | Type of integration issue | -| `variableName` | *?string* | :heavy_minus_sign: | Name of the variable related to the issue | -| `message` | *string* | :heavy_check_mark: | Detailed message describing the issue | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `issueType` | [Components\IntegrationIssueEnum](../../Models/Components/IntegrationIssueEnum.md) | :heavy_check_mark: | Type of integration issue | +| `variableName` | *?string* | :heavy_minus_sign: | Name of the variable related to the issue | +| `message` | *string* | :heavy_check_mark: | Detailed message describing the issue | \ No newline at end of file diff --git a/docs/Models/Components/StepsOverrides.md b/docs/Models/Components/StepsOverrides.md index dc191bf..c802f47 100644 --- a/docs/Models/Components/StepsOverrides.md +++ b/docs/Models/Components/StepsOverrides.md @@ -5,4 +5,5 @@ | Field | Type | Required | Description | Example | | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | -| `providers` | array> | :heavy_check_mark: | Passing the provider id and the provider specific configurations | {
"sendgrid": {
"templateId": "1234567890"
}
} | \ No newline at end of file +| `providers` | array> | :heavy_minus_sign: | Passing the provider id and the provider specific configurations | {
"sendgrid": {
"templateId": "1234567890"
}
} | +| `layoutId` | *?string* | :heavy_minus_sign: | Override the or remove the layout for this specific step | welcome-email-layout | \ No newline at end of file diff --git a/docs/Models/Components/TriggerEventRequestDto.md b/docs/Models/Components/TriggerEventRequestDto.md index cc6dab4..6767dce 100644 --- a/docs/Models/Components/TriggerEventRequestDto.md +++ b/docs/Models/Components/TriggerEventRequestDto.md @@ -9,6 +9,6 @@ | `payload` | array | :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"
}
} | | `overrides` | [?Components\Overrides](../../Models/Components/Overrides.md) | :heavy_minus_sign: | This could be used to override provider specific configurations | {
"fcm": {
"data": {
"key": "value"
}
}
} | | `to` | [array\|string\|Components\SubscriberPayloadDto\|Components\TopicPayloadDto](../../Models/Components/To.md) | :heavy_check_mark: | The recipients list of people who will receive the notification. | | -| `transactionId` | *?string* | :heavy_minus_sign: | A unique identifier for this transaction, we will generate a UUID if not provided. | | +| `transactionId` | *?string* | :heavy_minus_sign: | A unique identifier for deduplication. If the same **transactionId** is sent again,
the trigger is ignored. Useful to prevent duplicate notifications. The retention period depends on your billing tier. | | | `actor` | [string\|Components\SubscriberPayloadDto\|null](../../Models/Components/Actor.md) | :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 | | | `tenant` | [string\|Components\TenantPayloadDto\|null](../../Models/Components/Tenant.md) | :heavy_minus_sign: | It is used to specify a tenant context during trigger event.
Existing tenants will be updated with the provided details. | | \ No newline at end of file diff --git a/docs/Models/Components/TriggerEventToAllRequestDtoChannels.md b/docs/Models/Components/TriggerEventToAllRequestDtoChannels.md new file mode 100644 index 0000000..efd3bc8 --- /dev/null +++ b/docs/Models/Components/TriggerEventToAllRequestDtoChannels.md @@ -0,0 +1,10 @@ +# TriggerEventToAllRequestDtoChannels + +Channel-specific overrides that apply to all steps of a particular channel type. Step-level overrides take precedence over channel-level overrides. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `email` | [?Components\EmailChannelOverrides](../../Models/Components/EmailChannelOverrides.md) | :heavy_minus_sign: | Email channel specific overrides | \ No newline at end of file diff --git a/docs/Models/Components/TriggerEventToAllRequestDtoOverrides.md b/docs/Models/Components/TriggerEventToAllRequestDtoOverrides.md index 19bb732..5441c57 100644 --- a/docs/Models/Components/TriggerEventToAllRequestDtoOverrides.md +++ b/docs/Models/Components/TriggerEventToAllRequestDtoOverrides.md @@ -7,7 +7,8 @@ This could be used to override provider specific configurations | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `steps` | array | :heavy_minus_sign: | This could be used to override provider specific configurations | {
"email-step": {
"providers": {
"sendgrid": {
"templateId": "1234567890"
}
}
}
} | +| `steps` | array | :heavy_minus_sign: | This could be used to override provider specific configurations or layout at the step level | {
"email-step": {
"providers": {
"sendgrid": {
"templateId": "1234567890"
}
},
"layoutId": "step-specific-layout"
}
} | +| `channels` | [?Components\TriggerEventToAllRequestDtoChannels](../../Models/Components/TriggerEventToAllRequestDtoChannels.md) | :heavy_minus_sign: | Channel-specific overrides that apply to all steps of a particular channel type. Step-level overrides take precedence over channel-level overrides. | {
"email": {
"layoutId": "promotional-layout-2024"
}
} | | `providers` | array> | :heavy_minus_sign: | Overrides the provider configuration for the entire workflow and all steps | {
"sendgrid": {
"templateId": "1234567890"
}
} | | ~~`email`~~ | array | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Override the email provider specific configurations for the entire workflow | | | ~~`push`~~ | array | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Override the push provider specific configurations for the entire workflow | | diff --git a/docs/Models/Components/UpdateWorkflowDto.md b/docs/Models/Components/UpdateWorkflowDto.md index 09d9b0a..6b833b8 100644 --- a/docs/Models/Components/UpdateWorkflowDto.md +++ b/docs/Models/Components/UpdateWorkflowDto.md @@ -9,9 +9,10 @@ | `description` | *?string* | :heavy_minus_sign: | Description of the workflow | | `tags` | array<*string*> | :heavy_minus_sign: | Tags associated with the workflow | | `active` | *?bool* | :heavy_minus_sign: | Whether the workflow is active | +| `validatePayload` | *?bool* | :heavy_minus_sign: | Enable or disable payload schema validation | +| `payloadSchema` | array | :heavy_minus_sign: | The payload JSON Schema for the workflow | +| `isTranslationEnabled` | *?bool* | :heavy_minus_sign: | Enable or disable translations for this workflow | | `workflowId` | *?string* | :heavy_minus_sign: | Workflow ID (allowed only for code-first workflows) | | `steps` | array<[Components\InAppStepUpsertDto\|Components\EmailStepUpsertDto\|Components\SmsStepUpsertDto\|Components\PushStepUpsertDto\|Components\ChatStepUpsertDto\|Components\DelayStepUpsertDto\|Components\DigestStepUpsertDto\|Components\CustomStepUpsertDto](../../Models/Components/UpdateWorkflowDtoSteps.md)> | :heavy_check_mark: | Steps of the workflow | | `preferences` | [Components\PreferencesRequestDto](../../Models/Components/PreferencesRequestDto.md) | :heavy_check_mark: | Workflow preferences | -| `origin` | [Components\ResourceOriginEnum](../../Models/Components/ResourceOriginEnum.md) | :heavy_check_mark: | Origin of the workflow | -| `payloadSchema` | array | :heavy_minus_sign: | The payload JSON Schema for the workflow | -| `validatePayload` | *?bool* | :heavy_minus_sign: | Enable or disable payload schema validation | \ No newline at end of file +| `origin` | [Components\ResourceOriginEnum](../../Models/Components/ResourceOriginEnum.md) | :heavy_check_mark: | Origin of the workflow | \ No newline at end of file diff --git a/docs/Models/Components/UpdatedBy.md b/docs/Models/Components/UpdatedBy.md new file mode 100644 index 0000000..8c8c434 --- /dev/null +++ b/docs/Models/Components/UpdatedBy.md @@ -0,0 +1,13 @@ +# UpdatedBy + +User who last updated the workflow + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | User ID | +| `firstName` | *?string* | :heavy_minus_sign: | User first name | +| `lastName` | [?Components\LastName](../../Models/Components/LastName.md) | :heavy_minus_sign: | User last name | +| `externalId` | *?string* | :heavy_minus_sign: | User external ID | \ No newline at end of file diff --git a/docs/Models/Components/Workflow.md b/docs/Models/Components/Workflow.md index 3f57db0..a312986 100644 --- a/docs/Models/Components/Workflow.md +++ b/docs/Models/Components/Workflow.md @@ -1,11 +1,16 @@ # Workflow -Workflow-specific preferences +Workflow information if this is a template-level preference ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | -| `all` | [Components\WorkflowPreferenceDto](../../Models/Components/PreferencesRequestDtoAll.md) | :heavy_check_mark: | A preference for the workflow. The values specified here will be used if no preference is specified for a channel. | | -| `channels` | array | :heavy_check_mark: | Preferences for different communication channels | {
"email": {
"enabled": true
},
"sms": {
"enabled": false
}
} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | Unique identifier of the workflow | 64a1b2c3d4e5f6g7h8i9j0k1 | +| `identifier` | *string* | :heavy_check_mark: | Workflow identifier used for triggering | welcome-email | +| `name` | *string* | :heavy_check_mark: | Human-readable name of the workflow | Welcome Email Workflow | +| `critical` | *bool* | :heavy_check_mark: | Whether this workflow is marked as critical | false | +| `tags` | array<*string*> | :heavy_minus_sign: | Tags associated with the workflow | [
"user-onboarding",
"email"
] | +| `data` | [?Components\GetPreferencesResponseDtoData](../../Models/Components/GetPreferencesResponseDtoData.md) | :heavy_minus_sign: | Custom data associated with the workflow | {
"category": "onboarding",
"priority": "high"
} | +| `severity` | [Components\SeverityLevelEnum](../../Models/Components/SeverityLevelEnum.md) | :heavy_check_mark: | Severity level of the workflow | | \ No newline at end of file diff --git a/docs/Models/Components/WorkflowListResponseDto.md b/docs/Models/Components/WorkflowListResponseDto.md index cf7acfb..cd18608 100644 --- a/docs/Models/Components/WorkflowListResponseDto.md +++ b/docs/Models/Components/WorkflowListResponseDto.md @@ -3,16 +3,20 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | -| `name` | *string* | :heavy_check_mark: | Name of the workflow | -| `tags` | array<*string*> | :heavy_minus_sign: | Tags associated with the workflow | -| `updatedAt` | *string* | :heavy_check_mark: | Last updated timestamp | -| `createdAt` | *string* | :heavy_check_mark: | Creation timestamp | -| `id` | *string* | :heavy_check_mark: | Unique database identifier | -| `workflowId` | *string* | :heavy_check_mark: | Workflow identifier | -| `slug` | *string* | :heavy_check_mark: | Workflow slug | -| `status` | [Components\WorkflowStatusEnum](../../Models/Components/WorkflowStatusEnum.md) | :heavy_check_mark: | Status of the workflow | -| `origin` | [Components\ResourceOriginEnum](../../Models/Components/ResourceOriginEnum.md) | :heavy_check_mark: | Origin of the workflow | -| `lastTriggeredAt` | *?string* | :heavy_minus_sign: | Timestamp of the last workflow trigger | -| `stepTypeOverviews` | array<[Components\StepTypeEnum](../../Models/Components/StepTypeEnum.md)> | :heavy_check_mark: | Overview of step types in the workflow | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | +| `name` | *string* | :heavy_check_mark: | Name of the workflow | +| `tags` | array<*string*> | :heavy_minus_sign: | Tags associated with the workflow | +| `updatedAt` | *string* | :heavy_check_mark: | Last updated timestamp | +| `createdAt` | *string* | :heavy_check_mark: | Creation timestamp | +| `updatedBy` | [?Components\WorkflowListResponseDtoUpdatedBy](../../Models/Components/WorkflowListResponseDtoUpdatedBy.md) | :heavy_minus_sign: | User who last updated the workflow | +| `lastPublishedAt` | *?string* | :heavy_minus_sign: | Timestamp of the last workflow publication | +| `lastPublishedBy` | [?Components\WorkflowListResponseDtoLastPublishedBy](../../Models/Components/WorkflowListResponseDtoLastPublishedBy.md) | :heavy_minus_sign: | User who last published the workflow | +| `id` | *string* | :heavy_check_mark: | Unique database identifier | +| `workflowId` | *string* | :heavy_check_mark: | Workflow identifier | +| `slug` | *string* | :heavy_check_mark: | Workflow slug | +| `status` | [Components\WorkflowStatusEnum](../../Models/Components/WorkflowStatusEnum.md) | :heavy_check_mark: | Status of the workflow | +| `origin` | [Components\ResourceOriginEnum](../../Models/Components/ResourceOriginEnum.md) | :heavy_check_mark: | Origin of the workflow | +| `lastTriggeredAt` | *?string* | :heavy_minus_sign: | Timestamp of the last workflow trigger | +| `stepTypeOverviews` | array<[Components\StepTypeEnum](../../Models/Components/StepTypeEnum.md)> | :heavy_check_mark: | Overview of step types in the workflow | +| `isTranslationEnabled` | *?bool* | :heavy_minus_sign: | Is translation enabled for the workflow | \ No newline at end of file diff --git a/docs/Models/Components/WorkflowListResponseDtoLastName.md b/docs/Models/Components/WorkflowListResponseDtoLastName.md new file mode 100644 index 0000000..ea4ebbb --- /dev/null +++ b/docs/Models/Components/WorkflowListResponseDtoLastName.md @@ -0,0 +1,9 @@ +# WorkflowListResponseDtoLastName + +User last name + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/Models/Components/WorkflowListResponseDtoLastPublishedBy.md b/docs/Models/Components/WorkflowListResponseDtoLastPublishedBy.md new file mode 100644 index 0000000..2137ada --- /dev/null +++ b/docs/Models/Components/WorkflowListResponseDtoLastPublishedBy.md @@ -0,0 +1,13 @@ +# WorkflowListResponseDtoLastPublishedBy + +User who last published the workflow + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | User ID | +| `firstName` | *?string* | :heavy_minus_sign: | User first name | +| `lastName` | [?Components\WorkflowListResponseDtoLastPublishedByLastName](../../Models/Components/WorkflowListResponseDtoLastPublishedByLastName.md) | :heavy_minus_sign: | User last name | +| `externalId` | *?string* | :heavy_minus_sign: | User external ID | \ No newline at end of file diff --git a/docs/Models/Components/WorkflowListResponseDtoLastPublishedByLastName.md b/docs/Models/Components/WorkflowListResponseDtoLastPublishedByLastName.md new file mode 100644 index 0000000..9899018 --- /dev/null +++ b/docs/Models/Components/WorkflowListResponseDtoLastPublishedByLastName.md @@ -0,0 +1,9 @@ +# WorkflowListResponseDtoLastPublishedByLastName + +User last name + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/Models/Components/WorkflowListResponseDtoUpdatedBy.md b/docs/Models/Components/WorkflowListResponseDtoUpdatedBy.md new file mode 100644 index 0000000..d6d2797 --- /dev/null +++ b/docs/Models/Components/WorkflowListResponseDtoUpdatedBy.md @@ -0,0 +1,13 @@ +# WorkflowListResponseDtoUpdatedBy + +User who last updated the workflow + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | User ID | +| `firstName` | *?string* | :heavy_minus_sign: | User first name | +| `lastName` | [?Components\WorkflowListResponseDtoLastName](../../Models/Components/WorkflowListResponseDtoLastName.md) | :heavy_minus_sign: | User last name | +| `externalId` | *?string* | :heavy_minus_sign: | User external ID | \ No newline at end of file diff --git a/docs/Models/Components/WorkflowResponseDto.md b/docs/Models/Components/WorkflowResponseDto.md index 3b25ade..b218ed8 100644 --- a/docs/Models/Components/WorkflowResponseDto.md +++ b/docs/Models/Components/WorkflowResponseDto.md @@ -9,17 +9,21 @@ | `description` | *?string* | :heavy_minus_sign: | Description of the workflow | | `tags` | array<*string*> | :heavy_minus_sign: | Tags associated with the workflow | | `active` | *?bool* | :heavy_minus_sign: | Whether the workflow is active | +| `validatePayload` | *?bool* | :heavy_minus_sign: | Enable or disable payload schema validation | +| `payloadSchema` | array | :heavy_minus_sign: | The payload JSON Schema for the workflow | +| `isTranslationEnabled` | *?bool* | :heavy_minus_sign: | Enable or disable translations for this workflow | | `id` | *string* | :heavy_check_mark: | Unique identifier of the workflow | | `workflowId` | *string* | :heavy_check_mark: | Workflow identifier | | `slug` | [Components\Slug](../../Models/Components/Slug.md) | :heavy_check_mark: | Slug of the workflow | | `updatedAt` | *string* | :heavy_check_mark: | Last updated timestamp | | `createdAt` | *string* | :heavy_check_mark: | Creation timestamp | +| `updatedBy` | [?Components\UpdatedBy](../../Models/Components/UpdatedBy.md) | :heavy_minus_sign: | User who last updated the workflow | +| `lastPublishedAt` | *?string* | :heavy_minus_sign: | Timestamp of the last workflow publication | +| `lastPublishedBy` | [?Components\LastPublishedBy](../../Models/Components/LastPublishedBy.md) | :heavy_minus_sign: | User who last published the workflow | | `steps` | array<[Components\InAppStepResponseDto\|Components\EmailStepResponseDto\|Components\SmsStepResponseDto\|Components\PushStepResponseDto\|Components\ChatStepResponseDto\|Components\DelayStepResponseDto\|Components\DigestStepResponseDto\|Components\CustomStepResponseDto](../../Models/Components/WorkflowResponseDtoSteps.md)> | :heavy_check_mark: | Steps of the workflow | | `origin` | [Components\ResourceOriginEnum](../../Models/Components/ResourceOriginEnum.md) | :heavy_check_mark: | Origin of the workflow | | `preferences` | [Components\WorkflowPreferencesResponseDto](../../Models/Components/WorkflowPreferencesResponseDto.md) | :heavy_check_mark: | Preferences for the workflow | | `status` | [Components\WorkflowStatusEnum](../../Models/Components/WorkflowStatusEnum.md) | :heavy_check_mark: | Status of the workflow | | `issues` | array | :heavy_minus_sign: | Runtime issues for workflow creation and update | | `lastTriggeredAt` | *?string* | :heavy_minus_sign: | Timestamp of the last workflow trigger | -| `payloadSchema` | array | :heavy_minus_sign: | The payload JSON Schema for the workflow | -| `payloadExample` | array | :heavy_minus_sign: | Generated payload example based on the payload schema | -| `validatePayload` | *?bool* | :heavy_minus_sign: | Whether payload schema validation is enabled | \ No newline at end of file +| `payloadExample` | array | :heavy_minus_sign: | Generated payload example based on the payload schema | \ No newline at end of file diff --git a/docs/Models/Components/WorkflowResponseDtoLastName.md b/docs/Models/Components/WorkflowResponseDtoLastName.md new file mode 100644 index 0000000..d668b08 --- /dev/null +++ b/docs/Models/Components/WorkflowResponseDtoLastName.md @@ -0,0 +1,9 @@ +# WorkflowResponseDtoLastName + +User last name + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/Models/Errors/SubscriberResponseDto.md b/docs/Models/Errors/SubscriberResponseDto.md new file mode 100644 index 0000000..9143230 --- /dev/null +++ b/docs/Models/Errors/SubscriberResponseDto.md @@ -0,0 +1,27 @@ +# SubscriberResponseDto + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *?string* | :heavy_minus_sign: | The internal ID generated by Novu for your subscriber. This ID does not match the `subscriberId` used in your queries. Refer to `subscriberId` for that identifier. | +| `firstName` | *?string* | :heavy_minus_sign: | The first name of the subscriber. | +| `lastName` | *?string* | :heavy_minus_sign: | The last name of the subscriber. | +| `email` | *?string* | :heavy_minus_sign: | The email address of the subscriber. | +| `phone` | *?string* | :heavy_minus_sign: | The phone number of the subscriber. | +| `avatar` | *?string* | :heavy_minus_sign: | The URL of the subscriber's avatar image. | +| `locale` | *?string* | :heavy_minus_sign: | The locale setting of the subscriber, indicating their preferred language or region. | +| `channels` | array<[Components\ChannelSettingsDto](../../Models/Components/ChannelSettingsDto.md)> | :heavy_minus_sign: | An array of channel settings associated with the subscriber. | +| ~~`topics`~~ | array<*string*> | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

An array of topics that the subscriber is subscribed to. | +| `isOnline` | *?bool* | :heavy_minus_sign: | Indicates whether the subscriber is currently online. | +| `lastOnlineAt` | *?string* | :heavy_minus_sign: | The timestamp indicating when the subscriber was last online, in ISO 8601 format. | +| `v` | *?float* | :heavy_minus_sign: | The version of the subscriber document. | +| `data` | array | :heavy_minus_sign: | Additional custom data for the subscriber | +| `timezone` | *?string* | :heavy_minus_sign: | Timezone of the subscriber | +| `subscriberId` | *string* | :heavy_check_mark: | The identifier used to create this subscriber, which typically corresponds to the user ID in your system. | +| `organizationId` | *string* | :heavy_check_mark: | The unique identifier of the organization to which the subscriber belongs. | +| `environmentId` | *string* | :heavy_check_mark: | The unique identifier of the environment associated with this subscriber. | +| `deleted` | *bool* | :heavy_check_mark: | Indicates whether the subscriber has been deleted. | +| `createdAt` | *string* | :heavy_check_mark: | The timestamp indicating when the subscriber was created, in ISO 8601 format. | +| `updatedAt` | *string* | :heavy_check_mark: | The timestamp indicating when the subscriber was last updated, in ISO 8601 format. | \ No newline at end of file diff --git a/docs/Models/Errors/TopicResponseDto.md b/docs/Models/Errors/TopicResponseDto.md new file mode 100644 index 0000000..10e4947 --- /dev/null +++ b/docs/Models/Errors/TopicResponseDto.md @@ -0,0 +1,12 @@ +# TopicResponseDto + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | +| `id` | *string* | :heavy_check_mark: | The identifier of the topic | 64da692e9a94fb2e6449ad06 | +| `key` | *string* | :heavy_check_mark: | The unique key of the topic | product-updates | +| `name` | *?string* | :heavy_minus_sign: | The name of the topic | Product Updates | +| `createdAt` | *?string* | :heavy_minus_sign: | The date the topic was created | 2023-08-15T00:00:00.000Z | +| `updatedAt` | *?string* | :heavy_minus_sign: | The date the topic was last updated | 2023-08-15T00:00:00.000Z | \ No newline at end of file diff --git a/docs/Models/Operations/Criticality.md b/docs/Models/Operations/Criticality.md new file mode 100644 index 0000000..b6be648 --- /dev/null +++ b/docs/Models/Operations/Criticality.md @@ -0,0 +1,10 @@ +# Criticality + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `Critical` | critical | +| `NonCritical` | nonCritical | +| `All` | all | \ No newline at end of file diff --git a/docs/Models/Operations/EnvironmentsControllerGetEnvironmentTagsRequest.md b/docs/Models/Operations/EnvironmentsControllerGetEnvironmentTagsRequest.md new file mode 100644 index 0000000..ec9958d --- /dev/null +++ b/docs/Models/Operations/EnvironmentsControllerGetEnvironmentTagsRequest.md @@ -0,0 +1,9 @@ +# EnvironmentsControllerGetEnvironmentTagsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `environmentId` | *string* | :heavy_check_mark: | Environment internal ID (MongoDB ObjectId) or identifier | 6615943e7ace93b0540ae377 | +| `idempotencyKey` | *?string* | :heavy_minus_sign: | A header for idempotency purposes | | \ No newline at end of file diff --git a/docs/Models/Operations/EnvironmentsControllerGetEnvironmentTagsResponse.md b/docs/Models/Operations/EnvironmentsControllerGetEnvironmentTagsResponse.md new file mode 100644 index 0000000..df0eabe --- /dev/null +++ b/docs/Models/Operations/EnvironmentsControllerGetEnvironmentTagsResponse.md @@ -0,0 +1,12 @@ +# EnvironmentsControllerGetEnvironmentTagsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `getEnvironmentTagsDtos` | array<[Components\GetEnvironmentTagsDto](../../Models/Components/GetEnvironmentTagsDto.md)> | :heavy_minus_sign: | OK | +| `headers` | array> | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/InboundWebhooksControllerHandleWebhookRequest.md b/docs/Models/Operations/InboundWebhooksControllerHandleWebhookRequest.md new file mode 100644 index 0000000..b2ccdfb --- /dev/null +++ b/docs/Models/Operations/InboundWebhooksControllerHandleWebhookRequest.md @@ -0,0 +1,10 @@ +# InboundWebhooksControllerHandleWebhookRequest + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | +| `environmentId` | *string* | :heavy_check_mark: | N/A | +| `integrationId` | *string* | :heavy_check_mark: | N/A | +| `idempotencyKey` | *?string* | :heavy_minus_sign: | A header for idempotency purposes | \ No newline at end of file diff --git a/docs/Models/Operations/InboundWebhooksControllerHandleWebhookResponse.md b/docs/Models/Operations/InboundWebhooksControllerHandleWebhookResponse.md new file mode 100644 index 0000000..ba6d32e --- /dev/null +++ b/docs/Models/Operations/InboundWebhooksControllerHandleWebhookResponse.md @@ -0,0 +1,10 @@ +# InboundWebhooksControllerHandleWebhookResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/Models/Operations/NotificationsControllerListNotificationsRequest.md b/docs/Models/Operations/NotificationsControllerListNotificationsRequest.md index cb849e6..40581a1 100644 --- a/docs/Models/Operations/NotificationsControllerListNotificationsRequest.md +++ b/docs/Models/Operations/NotificationsControllerListNotificationsRequest.md @@ -12,7 +12,7 @@ | `subscriberIds` | array<*string*> | :heavy_minus_sign: | Array of subscriber IDs or a single subscriber ID | | `page` | *?float* | :heavy_minus_sign: | Page number for pagination | | `limit` | *?float* | :heavy_minus_sign: | Limit for pagination | -| `transactionId` | *?string* | :heavy_minus_sign: | Transaction ID for filtering | +| `transactionId` | *?string* | :heavy_minus_sign: | The transaction ID to filter by | | `topicKey` | *?string* | :heavy_minus_sign: | Topic Key for filtering notifications by topic | | `after` | *?string* | :heavy_minus_sign: | Date filter for records after this timestamp. Defaults to earliest date allowed by subscription plan | | `before` | *?string* | :heavy_minus_sign: | Date filter for records before this timestamp. Defaults to current time of request (now) | diff --git a/docs/Models/Operations/SubscribersControllerBulkUpdateSubscriberPreferencesRequest.md b/docs/Models/Operations/SubscribersControllerBulkUpdateSubscriberPreferencesRequest.md new file mode 100644 index 0000000..ed3da1f --- /dev/null +++ b/docs/Models/Operations/SubscribersControllerBulkUpdateSubscriberPreferencesRequest.md @@ -0,0 +1,10 @@ +# SubscribersControllerBulkUpdateSubscriberPreferencesRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| `subscriberId` | *string* | :heavy_check_mark: | N/A | +| `idempotencyKey` | *?string* | :heavy_minus_sign: | A header for idempotency purposes | +| `bulkUpdateSubscriberPreferencesDto` | [Components\BulkUpdateSubscriberPreferencesDto](../../Models/Components/BulkUpdateSubscriberPreferencesDto.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/SubscribersControllerBulkUpdateSubscriberPreferencesResponse.md b/docs/Models/Operations/SubscribersControllerBulkUpdateSubscriberPreferencesResponse.md new file mode 100644 index 0000000..e1114a7 --- /dev/null +++ b/docs/Models/Operations/SubscribersControllerBulkUpdateSubscriberPreferencesResponse.md @@ -0,0 +1,12 @@ +# SubscribersControllerBulkUpdateSubscriberPreferencesResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `getPreferencesResponseDtos` | array<[Components\GetPreferencesResponseDto](../../Models/Components/GetPreferencesResponseDto.md)> | :heavy_minus_sign: | OK | +| `headers` | array> | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/SubscribersControllerCreateSubscriberRequest.md b/docs/Models/Operations/SubscribersControllerCreateSubscriberRequest.md index b067fbc..e7dc67d 100644 --- a/docs/Models/Operations/SubscribersControllerCreateSubscriberRequest.md +++ b/docs/Models/Operations/SubscribersControllerCreateSubscriberRequest.md @@ -5,5 +5,6 @@ | Field | Type | Required | Description | | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `failIfExists` | *?bool* | :heavy_minus_sign: | If true, the request will fail if a subscriber with the same subscriberId already exists | | `idempotencyKey` | *?string* | :heavy_minus_sign: | A header for idempotency purposes | | `createSubscriberRequestDto` | [Components\CreateSubscriberRequestDto](../../Models/Components/CreateSubscriberRequestDto.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/SubscribersControllerGetSubscriberPreferencesRequest.md b/docs/Models/Operations/SubscribersControllerGetSubscriberPreferencesRequest.md index 0eacf1e..4468808 100644 --- a/docs/Models/Operations/SubscribersControllerGetSubscriberPreferencesRequest.md +++ b/docs/Models/Operations/SubscribersControllerGetSubscriberPreferencesRequest.md @@ -3,7 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | -| `subscriberId` | *string* | :heavy_check_mark: | N/A | -| `idempotencyKey` | *?string* | :heavy_minus_sign: | A header for idempotency purposes | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `subscriberId` | *string* | :heavy_check_mark: | N/A | +| `criticality` | [Operations\Criticality](../../Models/Operations/Criticality.md) | :heavy_check_mark: | N/A | +| `idempotencyKey` | *?string* | :heavy_minus_sign: | A header for idempotency purposes | \ No newline at end of file diff --git a/docs/Models/Operations/TopicsControllerUpsertTopicRequest.md b/docs/Models/Operations/TopicsControllerUpsertTopicRequest.md index 91458ce..e706ddb 100644 --- a/docs/Models/Operations/TopicsControllerUpsertTopicRequest.md +++ b/docs/Models/Operations/TopicsControllerUpsertTopicRequest.md @@ -5,5 +5,6 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `failIfExists` | *?bool* | :heavy_minus_sign: | If true, the request will fail if a topic with the same key already exists | | `idempotencyKey` | *?string* | :heavy_minus_sign: | A header for idempotency purposes | | `createUpdateTopicRequestDto` | [Components\CreateUpdateTopicRequestDto](../../Models/Components/CreateUpdateTopicRequestDto.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdks/environments/README.md b/docs/sdks/environments/README.md index e6af2a3..07220a5 100644 --- a/docs/sdks/environments/README.md +++ b/docs/sdks/environments/README.md @@ -8,11 +8,64 @@ Environments allow you to manage different stages of your application developmen ### Available Operations +* [getTags](#gettags) - Get environment tags * [create](#create) - Create an environment * [list](#list) - List all environments * [update](#update) - Update an environment * [delete](#delete) - Delete an environment +## getTags + +Retrieve all unique tags used in workflows within the specified environment. These tags can be used for filtering workflows. + +### Example Usage + + +```php +declare(strict_types=1); + +require 'vendor/autoload.php'; + +use novu; + +$sdk = novu\Novu::builder() + ->setSecurity( + 'YOUR_SECRET_KEY_HERE' + ) + ->build(); + + + +$response = $sdk->environments->getTags( + environmentId: '6615943e7ace93b0540ae377' +); + +if ($response->getEnvironmentTagsDtos !== null) { + // handle response +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `environmentId` | *string* | :heavy_check_mark: | Environment internal ID (MongoDB ObjectId) or identifier | 6615943e7ace93b0540ae377 | +| `idempotencyKey` | *?string* | :heavy_minus_sign: | A header for idempotency purposes | | + +### Response + +**[?Operations\EnvironmentsControllerGetEnvironmentTagsResponse](../../Models/Operations/EnvironmentsControllerGetEnvironmentTagsResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| Errors\ErrorDto | 414 | application/json | +| Errors\ErrorDto | 400, 401, 403, 404, 405, 409, 413, 415 | application/json | +| Errors\ValidationErrorDto | 422 | application/json | +| Errors\ErrorDto | 500 | application/json | +| Errors\APIException | 4XX, 5XX | \*/\* | + ## create Creates a new environment within the current organization. @@ -21,6 +74,7 @@ Creates a new environment within the current organization. ### Example Usage + ```php declare(strict_types=1); @@ -78,6 +132,7 @@ This API returns a list of environments for the current organization. ### Example Usage + ```php declare(strict_types=1); @@ -129,6 +184,7 @@ Update an environment by its unique identifier **environmentId**. ### Example Usage + ```php declare(strict_types=1); @@ -185,6 +241,7 @@ Delete an environment by its unique identifier **environmentId**. ### Example Usage + ```php declare(strict_types=1); diff --git a/docs/sdks/integrations/README.md b/docs/sdks/integrations/README.md index 6b6b617..c72e42d 100644 --- a/docs/sdks/integrations/README.md +++ b/docs/sdks/integrations/README.md @@ -21,6 +21,7 @@ List all the channels integrations created in the organization ### Example Usage + ```php declare(strict_types=1); @@ -72,6 +73,7 @@ Create an integration for the current environment the user is based on the API k ### Example Usage + ```php declare(strict_types=1); @@ -128,6 +130,7 @@ Update an integration by its unique key identifier **integrationId**. ### Example Usage + ```php declare(strict_types=1); @@ -184,6 +187,7 @@ Delete an integration by its unique key identifier **integrationId**. ### Example Usage + ```php declare(strict_types=1); @@ -237,6 +241,7 @@ Update an integration as **primary** by its unique key identifier **integrationI ### Example Usage + ```php declare(strict_types=1); @@ -288,6 +293,7 @@ List all the active integrations created in the organization ### Example Usage + ```php declare(strict_types=1); diff --git a/docs/sdks/messages/README.md b/docs/sdks/messages/README.md index 8f35262..111961a 100644 --- a/docs/sdks/messages/README.md +++ b/docs/sdks/messages/README.md @@ -20,6 +20,7 @@ List all messages for the current environment. ### Example Usage + ```php declare(strict_types=1); @@ -72,6 +73,7 @@ Delete a message entity from the Novu platform by **messageId**. ### Example Usage + ```php declare(strict_types=1); @@ -124,6 +126,7 @@ Delete multiple messages from the Novu platform using **transactionId** of trigg ### Example Usage + ```php declare(strict_types=1); diff --git a/docs/sdks/notifications/README.md b/docs/sdks/notifications/README.md index 97cafd5..899675e 100644 --- a/docs/sdks/notifications/README.md +++ b/docs/sdks/notifications/README.md @@ -17,6 +17,7 @@ List all notification events (triggered events) for the current environment. ### Example Usage + ```php declare(strict_types=1); @@ -70,6 +71,7 @@ Retrieve an event by its unique key identifier **notificationId**. ### Example Usage + ```php declare(strict_types=1); diff --git a/docs/sdks/novu/README.md b/docs/sdks/novu/README.md index 1d44a9f..f5a739e 100644 --- a/docs/sdks/novu/README.md +++ b/docs/sdks/novu/README.md @@ -9,21 +9,69 @@ Novu Documentation ### Available Operations +* [inboundWebhooksControllerHandleWebhook](#inboundwebhookscontrollerhandlewebhook) * [trigger](#trigger) - Trigger event * [cancel](#cancel) - Cancel triggered event * [triggerBroadcast](#triggerbroadcast) - Broadcast event to all * [triggerBulk](#triggerbulk) - Bulk trigger event -## trigger +## inboundWebhooksControllerHandleWebhook +### Example Usage - 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. - + +```php +declare(strict_types=1); + +require 'vendor/autoload.php'; + +use novu; + +$sdk = novu\Novu::builder() + ->setSecurity( + 'YOUR_SECRET_KEY_HERE' + ) + ->build(); + + + +$response = $sdk->inboundWebhooksControllerHandleWebhook( + environmentId: '', + integrationId: '' + +); + +if ($response->statusCode === 200) { + // handle response +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | +| `environmentId` | *string* | :heavy_check_mark: | N/A | +| `integrationId` | *string* | :heavy_check_mark: | N/A | +| `idempotencyKey` | *?string* | :heavy_minus_sign: | A header for idempotency purposes | + +### Response + +**[?Operations\InboundWebhooksControllerHandleWebhookResponse](../../Models/Operations/InboundWebhooksControllerHandleWebhookResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------- | ------------------- | ------------------- | +| Errors\APIException | 4XX, 5XX | \*/\* | + +## trigger + + 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. + To prevent duplicate triggers, you can optionally pass a **transactionId** in the request body. If the same **transactionId** is used again, the trigger will be ignored. The retention period depends on your billing tier. ### Example Usage + ```php declare(strict_types=1); @@ -90,6 +138,7 @@ if ($response->triggerEventResponseDto !== null) { ### Example Usage + ```php declare(strict_types=1); @@ -143,6 +192,7 @@ Trigger a broadcast event to all existing subscribers, could be used to send ann ### Example Usage + ```php declare(strict_types=1); @@ -216,6 +266,7 @@ if ($response->triggerEventResponseDto !== null) { ### Example Usage + ```php declare(strict_types=1); diff --git a/docs/sdks/novumessages/README.md b/docs/sdks/novumessages/README.md index 2e9648c..68a897f 100644 --- a/docs/sdks/novumessages/README.md +++ b/docs/sdks/novumessages/README.md @@ -15,6 +15,7 @@ Update in-app (inbox) notification's action status by its unique key identifier ### Example Usage + ```php declare(strict_types=1); @@ -75,6 +76,7 @@ Update subscriber's multiple in-app (inbox) notifications state such as seen, re ### Example Usage + ```php declare(strict_types=1); diff --git a/docs/sdks/novunotifications/README.md b/docs/sdks/novunotifications/README.md index 50b0457..b49536d 100644 --- a/docs/sdks/novunotifications/README.md +++ b/docs/sdks/novunotifications/README.md @@ -13,6 +13,7 @@ Retrieve subscriber in-app (inbox) notifications by its unique key identifier ** ### Example Usage + ```php declare(strict_types=1); diff --git a/docs/sdks/novutopics/README.md b/docs/sdks/novutopics/README.md index 74b59b3..6541df2 100644 --- a/docs/sdks/novutopics/README.md +++ b/docs/sdks/novutopics/README.md @@ -14,6 +14,7 @@ Retrieve subscriber's topic subscriptions by its unique key identifier **subscri ### Example Usage + ```php declare(strict_types=1); diff --git a/docs/sdks/preferences/README.md b/docs/sdks/preferences/README.md new file mode 100644 index 0000000..1ecccd4 --- /dev/null +++ b/docs/sdks/preferences/README.md @@ -0,0 +1,67 @@ +# Preferences +(*subscribers->preferences*) + +## Overview + +### Available Operations + +* [bulkUpdate](#bulkupdate) - Bulk update subscriber preferences + +## bulkUpdate + +Bulk update subscriber preferences by its unique key identifier **subscriberId**. + This API allows updating multiple workflow preferences in a single request. + +### Example Usage + + +```php +declare(strict_types=1); + +require 'vendor/autoload.php'; + +use novu; +use novu\Models\Components; + +$sdk = novu\Novu::builder() + ->setSecurity( + 'YOUR_SECRET_KEY_HERE' + ) + ->build(); + +$bulkUpdateSubscriberPreferencesDto = new Components\BulkUpdateSubscriberPreferencesDto( + preferences: [], +); + +$response = $sdk->subscribers->preferences->bulkUpdate( + subscriberId: '', + bulkUpdateSubscriberPreferencesDto: $bulkUpdateSubscriberPreferencesDto + +); + +if ($response->getPreferencesResponseDtos !== null) { + // handle response +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| `subscriberId` | *string* | :heavy_check_mark: | N/A | +| `bulkUpdateSubscriberPreferencesDto` | [Components\BulkUpdateSubscriberPreferencesDto](../../Models/Components/BulkUpdateSubscriberPreferencesDto.md) | :heavy_check_mark: | N/A | +| `idempotencyKey` | *?string* | :heavy_minus_sign: | A header for idempotency purposes | + +### Response + +**[?Operations\SubscribersControllerBulkUpdateSubscriberPreferencesResponse](../../Models/Operations/SubscribersControllerBulkUpdateSubscriberPreferencesResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| Errors\ErrorDto | 414 | application/json | +| Errors\ErrorDto | 400, 401, 403, 404, 405, 409, 413, 415 | application/json | +| Errors\ValidationErrorDto | 422 | application/json | +| Errors\ErrorDto | 500 | application/json | +| Errors\APIException | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/steps/README.md b/docs/sdks/steps/README.md index cf7e934..96b80e0 100644 --- a/docs/sdks/steps/README.md +++ b/docs/sdks/steps/README.md @@ -13,6 +13,7 @@ Retrieves data for a specific step in a workflow ### Example Usage + ```php declare(strict_types=1); diff --git a/docs/sdks/subscribers/README.md b/docs/sdks/subscribers/README.md index 75e5184..2caaaee 100644 --- a/docs/sdks/subscribers/README.md +++ b/docs/sdks/subscribers/README.md @@ -12,7 +12,7 @@ * [delete](#delete) - Delete a subscriber * [createBulk](#createbulk) - Bulk create subscribers * [updatePreferences](#updatepreferences) - Update subscriber preferences -* [updateCredentials](#updatecredentials) - Update provider credentials +* [updateCredentials](#updatecredentials) - Upsert provider credentials * [updateOnlineStatus](#updateonlinestatus) - Update subscriber online status ## search @@ -22,6 +22,7 @@ Search subscribers by their **email**, **phone**, **subscriberId** and **name**. ### Example Usage + ```php declare(strict_types=1); @@ -73,6 +74,7 @@ Create a subscriber with the subscriber attributes. ### Example Usage + ```php declare(strict_types=1); @@ -105,6 +107,7 @@ if ($response->subscriberResponseDto !== null) { | Parameter | Type | Required | Description | | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | | `createSubscriberRequestDto` | [Components\CreateSubscriberRequestDto](../../Models/Components/CreateSubscriberRequestDto.md) | :heavy_check_mark: | N/A | +| `failIfExists` | *?bool* | :heavy_minus_sign: | If true, the request will fail if a subscriber with the same subscriberId already exists | | `idempotencyKey` | *?string* | :heavy_minus_sign: | A header for idempotency purposes | ### Response @@ -113,13 +116,14 @@ if ($response->subscriberResponseDto !== null) { ### Errors -| Error Type | Status Code | Content Type | -| -------------------------------------- | -------------------------------------- | -------------------------------------- | -| Errors\ErrorDto | 414 | application/json | -| Errors\ErrorDto | 400, 401, 403, 404, 405, 409, 413, 415 | application/json | -| Errors\ValidationErrorDto | 422 | application/json | -| Errors\ErrorDto | 500 | application/json | -| Errors\APIException | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| Errors\SubscriberResponseDto | 409 | application/json | +| Errors\ErrorDto | 414 | application/json | +| Errors\ErrorDto | 400, 401, 403, 404, 405, 413, 415 | application/json | +| Errors\ValidationErrorDto | 422 | application/json | +| Errors\ErrorDto | 500 | application/json | +| Errors\APIException | 4XX, 5XX | \*/\* | ## get @@ -128,6 +132,7 @@ Retrieve a subscriber by its unique key identifier **subscriberId**. ### Example Usage + ```php declare(strict_types=1); @@ -180,6 +185,7 @@ Update a subscriber by its unique key identifier **subscriberId**. ### Example Usage + ```php declare(strict_types=1); @@ -236,6 +242,7 @@ Deletes a subscriber entity from the Novu platform along with associated message ### Example Usage + ```php declare(strict_types=1); @@ -289,6 +296,7 @@ if ($response->removeSubscriberResponseDto !== null) { ### Example Usage + ```php declare(strict_types=1); @@ -349,6 +357,7 @@ Update subscriber preferences by its unique key identifier **subscriberId**. ### Example Usage + ```php declare(strict_types=1); @@ -402,11 +411,12 @@ if ($response->getSubscriberPreferencesDto !== null) { ## updateCredentials -Update credentials for a provider such as slack and push tokens. - **providerId** is required field. This API appends the **deviceTokens** to the existing ones. +Upsert credentials for a provider such as slack and push tokens. + **providerId** is required field. This API creates **deviceTokens** or appends to the existing ones. ### Example Usage + ```php declare(strict_types=1); @@ -478,6 +488,7 @@ Update the subscriber online status by its unique key identifier **subscriberId* ### Example Usage + ```php declare(strict_types=1); diff --git a/docs/sdks/subscriberscredentials/README.md b/docs/sdks/subscriberscredentials/README.md index f399756..d20ec67 100644 --- a/docs/sdks/subscriberscredentials/README.md +++ b/docs/sdks/subscriberscredentials/README.md @@ -5,16 +5,17 @@ ### Available Operations -* [append](#append) - Upsert provider credentials +* [append](#append) - Update provider credentials * [deleteProvider](#deleteprovider) - Delete provider credentials ## append Update credentials for a provider such as **slack** and **FCM**. - **providerId** is required field. This API replaces the existing deviceTokens with the provided ones. + **providerId** is required field. This API creates the **deviceTokens** or replaces the existing ones. ### Example Usage + ```php declare(strict_types=1); @@ -87,6 +88,7 @@ Delete subscriber credentials for a provider such as **slack** and **FCM** by ** ### Example Usage + ```php declare(strict_types=1); diff --git a/docs/sdks/subscribersmessages/README.md b/docs/sdks/subscribersmessages/README.md index 36b9a64..75ef04f 100644 --- a/docs/sdks/subscribersmessages/README.md +++ b/docs/sdks/subscribersmessages/README.md @@ -13,6 +13,7 @@ Update all subscriber in-app (inbox) notifications state such as read, unread, s ### Example Usage + ```php declare(strict_types=1); diff --git a/docs/sdks/subscribersnotifications/README.md b/docs/sdks/subscribersnotifications/README.md index 496ad1f..c498d50 100644 --- a/docs/sdks/subscribersnotifications/README.md +++ b/docs/sdks/subscribersnotifications/README.md @@ -13,6 +13,7 @@ Retrieve unseen in-app (inbox) notifications count for a subscriber by its uniqu ### Example Usage + ```php declare(strict_types=1); diff --git a/docs/sdks/subscriberspreferences/README.md b/docs/sdks/subscriberspreferences/README.md index d120812..5495dd3 100644 --- a/docs/sdks/subscriberspreferences/README.md +++ b/docs/sdks/subscriberspreferences/README.md @@ -14,12 +14,14 @@ Retrieve subscriber channel preferences by its unique key identifier **subscribe ### Example Usage + ```php declare(strict_types=1); require 'vendor/autoload.php'; use novu; +use novu\Models\Operations; $sdk = novu\Novu::builder() ->setSecurity( @@ -30,7 +32,9 @@ $sdk = novu\Novu::builder() $response = $sdk->subscribersPreferences->list( - subscriberId: '' + subscriberId: '', + criticality: Operations\Criticality::All + ); if ($response->getSubscriberPreferencesDto !== null) { @@ -40,10 +44,11 @@ if ($response->getSubscriberPreferencesDto !== null) { ### Parameters -| Parameter | Type | Required | Description | -| --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | -| `subscriberId` | *string* | :heavy_check_mark: | N/A | -| `idempotencyKey` | *?string* | :heavy_minus_sign: | A header for idempotency purposes | +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `subscriberId` | *string* | :heavy_check_mark: | N/A | +| `criticality` | [Operations\Criticality](../../Models/Operations/Criticality.md) | :heavy_check_mark: | N/A | +| `idempotencyKey` | *?string* | :heavy_minus_sign: | A header for idempotency purposes | ### Response diff --git a/docs/sdks/subscriptions/README.md b/docs/sdks/subscriptions/README.md index 29a1186..bd4f0fd 100644 --- a/docs/sdks/subscriptions/README.md +++ b/docs/sdks/subscriptions/README.md @@ -16,6 +16,7 @@ List all subscriptions of subscribers for a topic. ### Example Usage + ```php declare(strict_types=1); @@ -70,6 +71,7 @@ This api will create subscription for subscriberIds for a topic. ### Example Usage + ```php declare(strict_types=1); @@ -130,6 +132,7 @@ Delete subscriptions for subscriberIds for a topic. ### Example Usage + ```php declare(strict_types=1); diff --git a/docs/sdks/topics/README.md b/docs/sdks/topics/README.md index 0f8bf40..9784a10 100644 --- a/docs/sdks/topics/README.md +++ b/docs/sdks/topics/README.md @@ -22,6 +22,7 @@ This api returns a paginated list of topics. ### Example Usage + ```php declare(strict_types=1); @@ -68,10 +69,11 @@ if ($response->listTopicsResponseDto !== null) { ## create -Creates a new topic if it does not exist, or updates an existing topic if it already exists +Creates a new topic if it does not exist, or updates an existing topic if it already exists. Use ?failIfExists=true to prevent updates. ### Example Usage + ```php declare(strict_types=1); @@ -105,6 +107,7 @@ if ($response->topicResponseDto !== null) { | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | | `createUpdateTopicRequestDto` | [Components\CreateUpdateTopicRequestDto](../../Models/Components/CreateUpdateTopicRequestDto.md) | :heavy_check_mark: | N/A | +| `failIfExists` | *?bool* | :heavy_minus_sign: | If true, the request will fail if a topic with the same key already exists | | `idempotencyKey` | *?string* | :heavy_minus_sign: | A header for idempotency purposes | ### Response @@ -113,13 +116,14 @@ if ($response->topicResponseDto !== null) { ### Errors -| Error Type | Status Code | Content Type | -| -------------------------------------- | -------------------------------------- | -------------------------------------- | -| Errors\ErrorDto | 414 | application/json | -| Errors\ErrorDto | 400, 401, 403, 404, 405, 409, 413, 415 | application/json | -| Errors\ValidationErrorDto | 422 | application/json | -| Errors\ErrorDto | 500 | application/json | -| Errors\APIException | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| Errors\TopicResponseDto | 409 | application/json | +| Errors\ErrorDto | 414 | application/json | +| Errors\ErrorDto | 400, 401, 403, 404, 405, 413, 415 | application/json | +| Errors\ValidationErrorDto | 422 | application/json | +| Errors\ErrorDto | 500 | application/json | +| Errors\APIException | 4XX, 5XX | \*/\* | ## get @@ -127,6 +131,7 @@ Retrieve a topic by its unique key identifier **topicKey** ### Example Usage + ```php declare(strict_types=1); @@ -178,6 +183,7 @@ Update a topic name by its unique key identifier **topicKey** ### Example Usage + ```php declare(strict_types=1); @@ -236,6 +242,7 @@ Delete a topic by its unique key identifier **topicKey**. ### Example Usage + ```php declare(strict_types=1); diff --git a/docs/sdks/topicssubscribers/README.md b/docs/sdks/topicssubscribers/README.md index 2bc1b4e..72aed95 100644 --- a/docs/sdks/topicssubscribers/README.md +++ b/docs/sdks/topicssubscribers/README.md @@ -13,6 +13,7 @@ Check if a subscriber belongs to a certain topic ### Example Usage + ```php declare(strict_types=1); diff --git a/docs/sdks/workflows/README.md b/docs/sdks/workflows/README.md index 20e587d..4a1822e 100644 --- a/docs/sdks/workflows/README.md +++ b/docs/sdks/workflows/README.md @@ -22,6 +22,7 @@ Creates a new workflow in the Novu Cloud environment ### Example Usage + ```php declare(strict_types=1); @@ -50,7 +51,7 @@ $createWorkflowDto = new Components\CreateWorkflowDto( ), ], ), - workflow: new Components\Workflow( + workflow: new Components\PreferencesRequestDtoWorkflow( all: new Components\WorkflowPreferenceDto(), channels: [ 'email' => new Components\ChannelPreferenceDto(), @@ -98,6 +99,7 @@ Retrieves a list of workflows with optional filtering and pagination ### Example Usage + ```php declare(strict_types=1); @@ -148,6 +150,7 @@ Updates the details of an existing workflow, here **workflowId** is the identifi ### Example Usage + ```php declare(strict_types=1); @@ -175,7 +178,7 @@ $updateWorkflowDto = new Components\UpdateWorkflowDto( ), ], ), - workflow: new Components\Workflow( + workflow: new Components\PreferencesRequestDtoWorkflow( all: new Components\WorkflowPreferenceDto(), channels: [ 'email' => new Components\ChannelPreferenceDto(), @@ -227,6 +230,7 @@ Fetches details of a specific workflow by its unique identifier **workflowId** ### Example Usage + ```php declare(strict_types=1); @@ -279,6 +283,7 @@ Removes a specific workflow by its unique identifier **workflowId** ### Example Usage + ```php declare(strict_types=1); @@ -330,6 +335,7 @@ Partially updates a workflow by its unique identifier **workflowId** ### Example Usage + ```php declare(strict_types=1); @@ -385,6 +391,7 @@ Synchronizes a workflow to the target environment ### Example Usage + ```php declare(strict_types=1); diff --git a/src/Environments.php b/src/Environments.php index 94a727c..fbec3dc 100644 --- a/src/Environments.php +++ b/src/Environments.php @@ -636,4 +636,150 @@ public function update(Components\UpdateEnvironmentRequestDto $updateEnvironment } } + /** + * Get environment tags + * + * Retrieve all unique tags used in workflows within the specified environment. These tags can be used for filtering workflows. + * + * @param string $environmentId + * @param ?string $idempotencyKey + * @return Operations\EnvironmentsControllerGetEnvironmentTagsResponse + * @throws \novu\Models\Errors\APIException + */ + public function getTags(string $environmentId, ?string $idempotencyKey = null, ?Options $options = null): Operations\EnvironmentsControllerGetEnvironmentTagsResponse + { + $retryConfig = null; + if ($options) { + $retryConfig = $options->retryConfig; + } + if ($retryConfig === null && $this->sdkConfiguration->retryConfig) { + $retryConfig = $this->sdkConfiguration->retryConfig; + } else { + $retryConfig = new Retry\RetryConfigBackoff( + initialIntervalMs: 1000, + maxIntervalMs: 30000, + exponent: 1.5, + maxElapsedTimeMs: 3600000, + retryConnectionErrors: true, + ); + } + $retryCodes = null; + if ($options) { + $retryCodes = $options->retryCodes; + } + if ($retryCodes === null) { + $retryCodes = [ + '408', + '409', + '429', + '5XX', + ]; + } + $request = new Operations\EnvironmentsControllerGetEnvironmentTagsRequest( + environmentId: $environmentId, + idempotencyKey: $idempotencyKey, + ); + $baseUrl = $this->sdkConfiguration->getTemplatedServerUrl(); + $url = Utils\Utils::generateUrl($baseUrl, '/v2/environments/{environmentId}/tags', Operations\EnvironmentsControllerGetEnvironmentTagsRequest::class, $request); + $urlOverride = null; + $httpOptions = ['http_errors' => false]; + $httpOptions = array_merge_recursive($httpOptions, Utils\Utils::getHeaders($request)); + if (! array_key_exists('headers', $httpOptions)) { + $httpOptions['headers'] = []; + } + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); + $hookContext = new HookContext($this->sdkConfiguration, $baseUrl, 'EnvironmentsController_getEnvironmentTags', [], $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = RetryUtils::retryWrapper(fn () => $this->sdkConfiguration->client->send($httpRequest, $httpOptions), $retryConfig, $retryCodes); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + $httpResponse = $res; + } + $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; + + $statusCode = $httpResponse->getStatusCode(); + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '403', '404', '405', '409', '413', '414', '415', '422', '429', '4XX', '500', '503', '5XX'])) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + $httpResponse = $res; + } + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, 'array<\novu\Models\Components\GetEnvironmentTagsDto>', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $response = new Operations\EnvironmentsControllerGetEnvironmentTagsResponse( + statusCode: $statusCode, + contentType: $contentType, + rawResponse: $httpResponse, + headers: $httpResponse->getHeaders(), + getEnvironmentTagsDtos: $obj); + + return $response; + } else { + throw new \novu\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['414'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\novu\Models\Errors\ErrorDto', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + throw $obj->toException(); + } else { + throw new \novu\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '403', '404', '405', '409', '413', '415'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\novu\Models\Errors\ErrorDto', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + throw $obj->toException(); + } else { + throw new \novu\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\novu\Models\Errors\ValidationErrorDto', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + throw $obj->toException(); + } else { + throw new \novu\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['429'])) { + throw new \novu\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['500'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\novu\Models\Errors\ErrorDto', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + throw $obj->toException(); + } else { + throw new \novu\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['503'])) { + throw new \novu\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \novu\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { + throw new \novu\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \novu\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } + } \ No newline at end of file diff --git a/src/Models/Components/ActivityNotificationExecutionDetailResponseDto.php b/src/Models/Components/ActivityNotificationExecutionDetailResponseDto.php index b5970e7..4dde312 100644 --- a/src/Models/Components/ActivityNotificationExecutionDetailResponseDto.php +++ b/src/Models/Components/ActivityNotificationExecutionDetailResponseDto.php @@ -52,15 +52,6 @@ class ActivityNotificationExecutionDetailResponseDto #[\Speakeasy\Serializer\Annotation\SerializedName('isTest')] public bool $isTest; - /** - * Provider ID of the job - * - * @var ProvidersIdEnum $providerId - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('providerId')] - #[\Speakeasy\Serializer\Annotation\Type('\novu\Models\Components\ProvidersIdEnum')] - public ProvidersIdEnum $providerId; - /** * Source of the execution detail * @@ -79,6 +70,16 @@ class ActivityNotificationExecutionDetailResponseDto #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $createdAt = null; + /** + * Provider ID of the job + * + * @var ?ProvidersIdEnum $providerId + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('providerId')] + #[\Speakeasy\Serializer\Annotation\Type('\novu\Models\Components\ProvidersIdEnum|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?ProvidersIdEnum $providerId = null; + /** * Raw data of the execution * @@ -94,22 +95,22 @@ class ActivityNotificationExecutionDetailResponseDto * @param string $detail * @param bool $isRetry * @param bool $isTest - * @param ProvidersIdEnum $providerId * @param ExecutionDetailsSourceEnum $source * @param ?string $createdAt + * @param ?ProvidersIdEnum $providerId * @param ?string $raw * @phpstan-pure */ - public function __construct(string $id, ExecutionDetailsStatusEnum $status, string $detail, bool $isRetry, bool $isTest, ProvidersIdEnum $providerId, ExecutionDetailsSourceEnum $source, ?string $createdAt = null, ?string $raw = null) + public function __construct(string $id, ExecutionDetailsStatusEnum $status, string $detail, bool $isRetry, bool $isTest, ExecutionDetailsSourceEnum $source, ?string $createdAt = null, ?ProvidersIdEnum $providerId = null, ?string $raw = null) { $this->id = $id; $this->status = $status; $this->detail = $detail; $this->isRetry = $isRetry; $this->isTest = $isTest; - $this->providerId = $providerId; $this->source = $source; $this->createdAt = $createdAt; + $this->providerId = $providerId; $this->raw = $raw; } } \ No newline at end of file diff --git a/src/Models/Components/BulkUpdateSubscriberPreferenceItemDto.php b/src/Models/Components/BulkUpdateSubscriberPreferenceItemDto.php new file mode 100644 index 0000000..1dedbbc --- /dev/null +++ b/src/Models/Components/BulkUpdateSubscriberPreferenceItemDto.php @@ -0,0 +1,41 @@ +channels = $channels; + $this->workflowId = $workflowId; + } +} \ No newline at end of file diff --git a/src/Models/Components/BulkUpdateSubscriberPreferencesDto.php b/src/Models/Components/BulkUpdateSubscriberPreferencesDto.php new file mode 100644 index 0000000..34418e9 --- /dev/null +++ b/src/Models/Components/BulkUpdateSubscriberPreferencesDto.php @@ -0,0 +1,31 @@ + $preferences + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('preferences')] + #[\Speakeasy\Serializer\Annotation\Type('array<\novu\Models\Components\BulkUpdateSubscriberPreferenceItemDto>')] + public array $preferences; + + /** + * @param array $preferences + * @phpstan-pure + */ + public function __construct(array $preferences) + { + $this->preferences = $preferences; + } +} \ No newline at end of file diff --git a/src/Models/Components/Channels.php b/src/Models/Components/Channels.php new file mode 100644 index 0000000..73b8f84 --- /dev/null +++ b/src/Models/Components/Channels.php @@ -0,0 +1,33 @@ +email = $email; + } +} \ No newline at end of file diff --git a/src/Models/Components/ChatOrPushProviderEnum.php b/src/Models/Components/ChatOrPushProviderEnum.php index c607849..60c7ddb 100644 --- a/src/Models/Components/ChatOrPushProviderEnum.php +++ b/src/Models/Components/ChatOrPushProviderEnum.php @@ -23,6 +23,7 @@ enum ChatOrPushProviderEnum: string case RocketChat = 'rocket-chat'; case WhatsappBusiness = 'whatsapp-business'; case ChatWebhook = 'chat-webhook'; + case NovuSlack = 'novu-slack'; case Fcm = 'fcm'; case Apns = 'apns'; case Expo = 'expo'; diff --git a/src/Models/Components/StepContentIssueEnum.php b/src/Models/Components/ContentIssueEnum.php similarity index 92% rename from src/Models/Components/StepContentIssueEnum.php rename to src/Models/Components/ContentIssueEnum.php index da5d5a2..65ab23f 100644 --- a/src/Models/Components/StepContentIssueEnum.php +++ b/src/Models/Components/ContentIssueEnum.php @@ -10,7 +10,7 @@ /** Type of step content issue */ -enum StepContentIssueEnum: string +enum ContentIssueEnum: string { case IllegalVariableInControlValue = 'ILLEGAL_VARIABLE_IN_CONTROL_VALUE'; case InvalidFilterArgInVariable = 'INVALID_FILTER_ARG_IN_VARIABLE'; diff --git a/src/Models/Components/CreateWorkflowDto.php b/src/Models/Components/CreateWorkflowDto.php index 46276c8..208fed6 100644 --- a/src/Models/Components/CreateWorkflowDto.php +++ b/src/Models/Components/CreateWorkflowDto.php @@ -55,6 +55,15 @@ class CreateWorkflowDto #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $tags = null; + /** + * Enable or disable payload schema validation + * + * @var ?bool $validatePayload + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('validatePayload')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $validatePayload = null; + /** * Workflow preferences * @@ -76,22 +85,22 @@ class CreateWorkflowDto public ?array $payloadSchema = null; /** - * Enable or disable payload schema validation + * Whether the workflow is active * - * @var ?bool $validatePayload + * @var ?bool $active */ - #[\Speakeasy\Serializer\Annotation\SerializedName('validatePayload')] + #[\Speakeasy\Serializer\Annotation\SerializedName('active')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $validatePayload = null; + public ?bool $active = null; /** - * Whether the workflow is active + * Enable or disable translations for this workflow * - * @var ?bool $active + * @var ?bool $isTranslationEnabled */ - #[\Speakeasy\Serializer\Annotation\SerializedName('active')] + #[\Speakeasy\Serializer\Annotation\SerializedName('isTranslationEnabled')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $active = null; + public ?bool $isTranslationEnabled = null; /** * Source of workflow creation @@ -110,23 +119,25 @@ class CreateWorkflowDto * @param ?string $description * @param ?array $tags * @param ?bool $active + * @param ?bool $validatePayload + * @param ?bool $isTranslationEnabled * @param ?WorkflowCreationSourceEnum $source * @param ?PreferencesRequestDto $preferences * @param ?array $payloadSchema - * @param ?bool $validatePayload * @phpstan-pure */ - public function __construct(string $name, string $workflowId, array $steps, ?string $description = null, ?array $tags = null, ?PreferencesRequestDto $preferences = null, ?array $payloadSchema = null, ?bool $validatePayload = null, ?bool $active = false, ?WorkflowCreationSourceEnum $source = WorkflowCreationSourceEnum::Editor) + public function __construct(string $name, string $workflowId, array $steps, ?string $description = null, ?array $tags = null, ?bool $validatePayload = null, ?PreferencesRequestDto $preferences = null, ?array $payloadSchema = null, ?bool $active = false, ?bool $isTranslationEnabled = false, ?WorkflowCreationSourceEnum $source = WorkflowCreationSourceEnum::Editor) { $this->name = $name; $this->workflowId = $workflowId; $this->steps = $steps; $this->description = $description; $this->tags = $tags; + $this->validatePayload = $validatePayload; $this->preferences = $preferences; $this->payloadSchema = $payloadSchema; - $this->validatePayload = $validatePayload; $this->active = $active; + $this->isTranslationEnabled = $isTranslationEnabled; $this->source = $source; } } \ No newline at end of file diff --git a/src/Models/Components/CredentialsDto.php b/src/Models/Components/CredentialsDto.php index d060dda..04a0dff 100644 --- a/src/Models/Components/CredentialsDto.php +++ b/src/Models/Components/CredentialsDto.php @@ -348,6 +348,22 @@ class CredentialsDto #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $accessKey = null; + /** + * + * @var ?string $appSid + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('appSid')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?string $appSid = null; + + /** + * + * @var ?string $senderId + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('senderId')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?string $senderId = null; + /** * @param ?string $apiKey * @param ?string $user @@ -391,9 +407,11 @@ class CredentialsDto * @param ?string $channelId * @param ?string $phoneNumberIdentification * @param ?string $accessKey + * @param ?string $appSid + * @param ?string $senderId * @phpstan-pure */ - public function __construct(?string $apiKey = null, ?string $user = null, ?string $secretKey = null, ?string $domain = null, ?string $password = null, ?string $host = null, ?string $port = null, ?bool $secure = null, ?string $region = null, ?string $accountSid = null, ?string $messageProfileId = null, ?string $token = null, ?string $from = null, ?string $senderName = null, ?string $projectName = null, ?string $applicationId = null, ?string $clientId = null, ?bool $requireTls = null, ?bool $ignoreTls = null, ?TlsOptions $tlsOptions = null, ?string $baseUrl = null, ?string $webhookUrl = null, ?string $redirectUrl = null, ?bool $hmac = null, ?string $serviceAccount = null, ?string $ipPoolName = null, ?string $apiKeyRequestHeader = null, ?string $secretKeyRequestHeader = null, ?string $idPath = null, ?string $datePath = null, ?string $apiToken = null, ?bool $authenticateByToken = null, ?string $authenticationTokenKey = null, ?string $instanceId = null, ?string $alertUid = null, ?string $title = null, ?string $imageUrl = null, ?string $state = null, ?string $externalLink = null, ?string $channelId = null, ?string $phoneNumberIdentification = null, ?string $accessKey = null) + public function __construct(?string $apiKey = null, ?string $user = null, ?string $secretKey = null, ?string $domain = null, ?string $password = null, ?string $host = null, ?string $port = null, ?bool $secure = null, ?string $region = null, ?string $accountSid = null, ?string $messageProfileId = null, ?string $token = null, ?string $from = null, ?string $senderName = null, ?string $projectName = null, ?string $applicationId = null, ?string $clientId = null, ?bool $requireTls = null, ?bool $ignoreTls = null, ?TlsOptions $tlsOptions = null, ?string $baseUrl = null, ?string $webhookUrl = null, ?string $redirectUrl = null, ?bool $hmac = null, ?string $serviceAccount = null, ?string $ipPoolName = null, ?string $apiKeyRequestHeader = null, ?string $secretKeyRequestHeader = null, ?string $idPath = null, ?string $datePath = null, ?string $apiToken = null, ?bool $authenticateByToken = null, ?string $authenticationTokenKey = null, ?string $instanceId = null, ?string $alertUid = null, ?string $title = null, ?string $imageUrl = null, ?string $state = null, ?string $externalLink = null, ?string $channelId = null, ?string $phoneNumberIdentification = null, ?string $accessKey = null, ?string $appSid = null, ?string $senderId = null) { $this->apiKey = $apiKey; $this->user = $user; @@ -437,5 +455,7 @@ public function __construct(?string $apiKey = null, ?string $user = null, ?strin $this->channelId = $channelId; $this->phoneNumberIdentification = $phoneNumberIdentification; $this->accessKey = $accessKey; + $this->appSid = $appSid; + $this->senderId = $senderId; } } \ No newline at end of file diff --git a/src/Models/Components/EmailChannelOverrides.php b/src/Models/Components/EmailChannelOverrides.php new file mode 100644 index 0000000..1bf1ac7 --- /dev/null +++ b/src/Models/Components/EmailChannelOverrides.php @@ -0,0 +1,31 @@ +layoutId = $layoutId; + } +} \ No newline at end of file diff --git a/src/Models/Components/EmailControlDto.php b/src/Models/Components/EmailControlDto.php index f7fc877..7dc0e80 100644 --- a/src/Models/Components/EmailControlDto.php +++ b/src/Models/Components/EmailControlDto.php @@ -29,6 +29,15 @@ class EmailControlDto #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $skip = null; + /** + * Layout ID to use for the email. Null means no layout, undefined means default layout. + * + * @var ?string $layoutId + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('layoutId')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?string $layoutId = null; + /** * Body content of the email, either a valid Maily JSON object, or html string. * @@ -63,12 +72,14 @@ class EmailControlDto * @param ?string $body * @param ?EditorType $editorType * @param ?bool $disableOutputSanitization + * @param ?string $layoutId * @phpstan-pure */ - public function __construct(string $subject, ?array $skip = null, ?string $body = '', ?EditorType $editorType = EditorType::Block, ?bool $disableOutputSanitization = false) + public function __construct(string $subject, ?array $skip = null, ?string $layoutId = null, ?string $body = '', ?EditorType $editorType = EditorType::Block, ?bool $disableOutputSanitization = false) { $this->subject = $subject; $this->skip = $skip; + $this->layoutId = $layoutId; $this->body = $body; $this->editorType = $editorType; $this->disableOutputSanitization = $disableOutputSanitization; diff --git a/src/Models/Components/EmailStepResponseDtoControlValues.php b/src/Models/Components/EmailStepResponseDtoControlValues.php index 3c0d5e8..3338023 100644 --- a/src/Models/Components/EmailStepResponseDtoControlValues.php +++ b/src/Models/Components/EmailStepResponseDtoControlValues.php @@ -40,6 +40,15 @@ class EmailStepResponseDtoControlValues #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $additionalProperties = null; + /** + * Layout ID to use for the email. Null means no layout, undefined means default layout. + * + * @var ?string $layoutId + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('layoutId')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?string $layoutId = null; + /** * Body content of the email, either a valid Maily JSON object, or html string. * @@ -75,13 +84,15 @@ class EmailStepResponseDtoControlValues * @param ?EmailStepResponseDtoEditorType $editorType * @param ?bool $disableOutputSanitization * @param ?array $additionalProperties + * @param ?string $layoutId * @phpstan-pure */ - public function __construct(string $subject, ?array $skip = null, ?array $additionalProperties = null, ?string $body = '', ?EmailStepResponseDtoEditorType $editorType = EmailStepResponseDtoEditorType::Block, ?bool $disableOutputSanitization = false) + public function __construct(string $subject, ?array $skip = null, ?array $additionalProperties = null, ?string $layoutId = null, ?string $body = '', ?EmailStepResponseDtoEditorType $editorType = EmailStepResponseDtoEditorType::Block, ?bool $disableOutputSanitization = false) { $this->subject = $subject; $this->skip = $skip; $this->additionalProperties = $additionalProperties; + $this->layoutId = $layoutId; $this->body = $body; $this->editorType = $editorType; $this->disableOutputSanitization = $disableOutputSanitization; diff --git a/src/Models/Components/EnvironmentResponseDto.php b/src/Models/Components/EnvironmentResponseDto.php index 12cb5ef..024f06e 100644 --- a/src/Models/Components/EnvironmentResponseDto.php +++ b/src/Models/Components/EnvironmentResponseDto.php @@ -71,6 +71,16 @@ class EnvironmentResponseDto #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?string $slug = null; + /** + * Type of the environment + * + * @var ?EnvironmentResponseDtoType $type + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('type')] + #[\Speakeasy\Serializer\Annotation\Type('\novu\Models\Components\EnvironmentResponseDtoType|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?EnvironmentResponseDtoType $type = null; + /** * @param string $id * @param string $name @@ -79,9 +89,10 @@ class EnvironmentResponseDto * @param ?array $apiKeys * @param ?string $parentId * @param ?string $slug + * @param ?EnvironmentResponseDtoType $type * @phpstan-pure */ - public function __construct(string $id, string $name, string $organizationId, string $identifier, ?array $apiKeys = null, ?string $parentId = null, ?string $slug = null) + public function __construct(string $id, string $name, string $organizationId, string $identifier, ?array $apiKeys = null, ?string $parentId = null, ?string $slug = null, ?EnvironmentResponseDtoType $type = null) { $this->id = $id; $this->name = $name; @@ -90,5 +101,6 @@ public function __construct(string $id, string $name, string $organizationId, st $this->apiKeys = $apiKeys; $this->parentId = $parentId; $this->slug = $slug; + $this->type = $type; } } \ No newline at end of file diff --git a/src/Models/Components/EnvironmentResponseDtoType.php b/src/Models/Components/EnvironmentResponseDtoType.php new file mode 100644 index 0000000..352efcf --- /dev/null +++ b/src/Models/Components/EnvironmentResponseDtoType.php @@ -0,0 +1,17 @@ +name = $name; + } +} \ No newline at end of file diff --git a/src/Models/Components/GetPreferencesResponseDto.php b/src/Models/Components/GetPreferencesResponseDto.php new file mode 100644 index 0000000..95e8544 --- /dev/null +++ b/src/Models/Components/GetPreferencesResponseDto.php @@ -0,0 +1,64 @@ +level = $level; + $this->enabled = $enabled; + $this->channels = $channels; + $this->workflow = $workflow; + } +} \ No newline at end of file diff --git a/src/Models/Components/GetPreferencesResponseDtoData.php b/src/Models/Components/GetPreferencesResponseDtoData.php new file mode 100644 index 0000000..116e425 --- /dev/null +++ b/src/Models/Components/GetPreferencesResponseDtoData.php @@ -0,0 +1,19 @@ +id = $id; + $this->firstName = $firstName; + $this->lastName = $lastName; + $this->externalId = $externalId; + } +} \ No newline at end of file diff --git a/src/Models/Components/MessageResponseDto.php b/src/Models/Components/MessageResponseDto.php index 59f2cee..c3f2dd0 100644 --- a/src/Models/Components/MessageResponseDto.php +++ b/src/Models/Components/MessageResponseDto.php @@ -11,14 +11,6 @@ class MessageResponseDto { - /** - * Template ID associated with the message - * - * @var string $templateId - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('_templateId')] - public string $templateId; - /** * Environment ID where the message is sent * @@ -27,14 +19,6 @@ class MessageResponseDto #[\Speakeasy\Serializer\Annotation\SerializedName('_environmentId')] public string $environmentId; - /** - * Message template ID - * - * @var string $messageTemplateId - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('_messageTemplateId')] - public string $messageTemplateId; - /** * Organization ID associated with the message * @@ -67,15 +51,6 @@ class MessageResponseDto #[\Speakeasy\Serializer\Annotation\SerializedName('createdAt')] public string $createdAt; - /** - * Content of the message, can be an email block or a string - * - * @var array|string $content - */ - #[\Speakeasy\Serializer\Annotation\SerializedName('content')] - #[\Speakeasy\Serializer\Annotation\Type('array<\novu\Models\Components\EmailBlock>|string')] - public array|string $content; - /** * Transaction ID associated with the message * @@ -304,6 +279,34 @@ class MessageResponseDto #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?MessageResponseDtoOverrides $overrides = null; + /** + * Template ID associated with the message + * + * @var ?string $templateId + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('_templateId')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?string $templateId = null; + + /** + * Message template ID + * + * @var ?string $messageTemplateId + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('_messageTemplateId')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?string $messageTemplateId = null; + + /** + * Content of the message, can be an email block or a string + * + * @var array|string|null $content + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('content')] + #[\Speakeasy\Serializer\Annotation\Type('array<\novu\Models\Components\EmailBlock>|string|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public array|string|null $content = null; + /** * Feed ID associated with the message, if applicable * @@ -314,14 +317,11 @@ class MessageResponseDto public ?string $feedId = null; /** - * @param string $templateId * @param string $environmentId - * @param string $messageTemplateId * @param string $organizationId * @param string $notificationId * @param string $subscriberId * @param string $createdAt - * @param array|string $content * @param string $transactionId * @param ChannelTypeEnum $channel * @param bool $read @@ -347,19 +347,19 @@ class MessageResponseDto * @param ?string $errorText * @param ?MessageResponseDtoPayload $payload * @param ?MessageResponseDtoOverrides $overrides + * @param ?string $templateId + * @param ?string $messageTemplateId + * @param array|string|null $content * @param ?string $feedId * @phpstan-pure */ - public function __construct(string $templateId, string $environmentId, string $messageTemplateId, string $organizationId, string $notificationId, string $subscriberId, string $createdAt, array|string $content, string $transactionId, ChannelTypeEnum $channel, bool $read, bool $seen, MessageCTA $cta, MessageStatusEnum $status, ?string $id = null, ?SubscriberResponseDto $subscriber = null, ?WorkflowResponse $template = null, ?string $templateIdentifier = null, ?array $deliveredAt = null, ?string $lastSeenDate = null, ?string $lastReadDate = null, ?string $subject = null, ?string $snoozedUntil = null, ?string $email = null, ?string $phone = null, ?string $directWebhookUrl = null, ?string $providerId = null, ?array $deviceTokens = null, ?string $title = null, ?string $errorId = null, ?string $errorText = null, ?MessageResponseDtoPayload $payload = null, ?MessageResponseDtoOverrides $overrides = null, ?string $feedId = null) + public function __construct(string $environmentId, string $organizationId, string $notificationId, string $subscriberId, string $createdAt, string $transactionId, ChannelTypeEnum $channel, bool $read, bool $seen, MessageCTA $cta, MessageStatusEnum $status, ?string $id = null, ?SubscriberResponseDto $subscriber = null, ?WorkflowResponse $template = null, ?string $templateIdentifier = null, ?array $deliveredAt = null, ?string $lastSeenDate = null, ?string $lastReadDate = null, ?string $subject = null, ?string $snoozedUntil = null, ?string $email = null, ?string $phone = null, ?string $directWebhookUrl = null, ?string $providerId = null, ?array $deviceTokens = null, ?string $title = null, ?string $errorId = null, ?string $errorText = null, ?MessageResponseDtoPayload $payload = null, ?MessageResponseDtoOverrides $overrides = null, ?string $templateId = null, ?string $messageTemplateId = null, array|string|null $content = null, ?string $feedId = null) { - $this->templateId = $templateId; $this->environmentId = $environmentId; - $this->messageTemplateId = $messageTemplateId; $this->organizationId = $organizationId; $this->notificationId = $notificationId; $this->subscriberId = $subscriberId; $this->createdAt = $createdAt; - $this->content = $content; $this->transactionId = $transactionId; $this->channel = $channel; $this->read = $read; @@ -385,6 +385,9 @@ public function __construct(string $templateId, string $environmentId, string $m $this->errorText = $errorText; $this->payload = $payload; $this->overrides = $overrides; + $this->templateId = $templateId; + $this->messageTemplateId = $messageTemplateId; + $this->content = $content; $this->feedId = $feedId; } } \ No newline at end of file diff --git a/src/Models/Components/Overrides.php b/src/Models/Components/Overrides.php index b3adbc9..1f7551d 100644 --- a/src/Models/Components/Overrides.php +++ b/src/Models/Components/Overrides.php @@ -13,7 +13,7 @@ class Overrides { /** - * This could be used to override provider specific configurations + * This could be used to override provider specific configurations or layout at the step level * * @var ?array $steps */ @@ -22,6 +22,16 @@ class Overrides #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $steps = null; + /** + * Channel-specific overrides that apply to all steps of a particular channel type. Step-level overrides take precedence over channel-level overrides. + * + * @var ?Channels $channels + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('channels')] + #[\Speakeasy\Serializer\Annotation\Type('\novu\Models\Components\Channels|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?Channels $channels = null; + /** * Overrides the provider configuration for the entire workflow and all steps * @@ -88,6 +98,7 @@ class Overrides /** * @param ?array $steps + * @param ?Channels $channels * @param ?array> $providers * @param ?array $email * @param ?array $push @@ -96,9 +107,10 @@ class Overrides * @param ?string $layoutIdentifier * @phpstan-pure */ - public function __construct(?array $steps = null, ?array $providers = null, ?array $email = null, ?array $push = null, ?array $sms = null, ?array $chat = null, ?string $layoutIdentifier = null) + public function __construct(?array $steps = null, ?Channels $channels = null, ?array $providers = null, ?array $email = null, ?array $push = null, ?array $sms = null, ?array $chat = null, ?string $layoutIdentifier = null) { $this->steps = $steps; + $this->channels = $channels; $this->providers = $providers; $this->email = $email; $this->push = $push; diff --git a/src/Models/Components/PatchWorkflowDto.php b/src/Models/Components/PatchWorkflowDto.php index bb94727..efdc74b 100644 --- a/src/Models/Components/PatchWorkflowDto.php +++ b/src/Models/Components/PatchWorkflowDto.php @@ -49,40 +49,51 @@ class PatchWorkflowDto public ?array $tags = null; /** - * The payload JSON Schema for the workflow + * Enable or disable payload schema validation * - * @var ?array $payloadSchema + * @var ?bool $validatePayload */ - #[\Speakeasy\Serializer\Annotation\SerializedName('payloadSchema')] - #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\SerializedName('validatePayload')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?array $payloadSchema = null; + public ?bool $validatePayload = null; /** - * Enable or disable payload schema validation + * Enable or disable translations for this workflow * - * @var ?bool $validatePayload + * @var ?bool $isTranslationEnabled */ - #[\Speakeasy\Serializer\Annotation\SerializedName('validatePayload')] + #[\Speakeasy\Serializer\Annotation\SerializedName('isTranslationEnabled')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $validatePayload = null; + public ?bool $isTranslationEnabled = null; + + /** + * The payload JSON Schema for the workflow + * + * @var ?array $payloadSchema + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('payloadSchema')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?array $payloadSchema = null; /** * @param ?bool $active * @param ?string $name * @param ?string $description * @param ?array $tags - * @param ?array $payloadSchema * @param ?bool $validatePayload + * @param ?bool $isTranslationEnabled + * @param ?array $payloadSchema * @phpstan-pure */ - public function __construct(?bool $active = null, ?string $name = null, ?string $description = null, ?array $tags = null, ?array $payloadSchema = null, ?bool $validatePayload = null) + public function __construct(?bool $active = null, ?string $name = null, ?string $description = null, ?array $tags = null, ?bool $validatePayload = null, ?bool $isTranslationEnabled = null, ?array $payloadSchema = null) { $this->active = $active; $this->name = $name; $this->description = $description; $this->tags = $tags; - $this->payloadSchema = $payloadSchema; $this->validatePayload = $validatePayload; + $this->isTranslationEnabled = $isTranslationEnabled; + $this->payloadSchema = $payloadSchema; } } \ No newline at end of file diff --git a/src/Models/Components/PreferenceLevelEnum.php b/src/Models/Components/PreferenceLevelEnum.php new file mode 100644 index 0000000..d3ec609 --- /dev/null +++ b/src/Models/Components/PreferenceLevelEnum.php @@ -0,0 +1,17 @@ +user = $user; $this->workflow = $workflow; diff --git a/src/Models/Components/PreferencesRequestDtoWorkflow.php b/src/Models/Components/PreferencesRequestDtoWorkflow.php new file mode 100644 index 0000000..3edf4ca --- /dev/null +++ b/src/Models/Components/PreferencesRequestDtoWorkflow.php @@ -0,0 +1,43 @@ + $channels + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('channels')] + #[\Speakeasy\Serializer\Annotation\Type('array')] + public array $channels; + + /** + * @param WorkflowPreferenceDto $all + * @param array $channels + * @phpstan-pure + */ + public function __construct(WorkflowPreferenceDto $all, array $channels) + { + $this->all = $all; + $this->channels = $channels; + } +} \ No newline at end of file diff --git a/src/Models/Components/ProviderId.php b/src/Models/Components/ProviderId.php index a826018..f2d3157 100644 --- a/src/Models/Components/ProviderId.php +++ b/src/Models/Components/ProviderId.php @@ -23,6 +23,7 @@ enum ProviderId: string case RocketChat = 'rocket-chat'; case WhatsappBusiness = 'whatsapp-business'; case ChatWebhook = 'chat-webhook'; + case NovuSlack = 'novu-slack'; case Fcm = 'fcm'; case Apns = 'apns'; case Expo = 'expo'; diff --git a/src/Models/Components/ProvidersIdEnum.php b/src/Models/Components/ProvidersIdEnum.php index a6bc0ef..f42d17b 100644 --- a/src/Models/Components/ProvidersIdEnum.php +++ b/src/Models/Components/ProvidersIdEnum.php @@ -64,6 +64,9 @@ enum ProvidersIdEnum: string case EazySms = 'eazy-sms'; case Mobishastra = 'mobishastra'; case AfroMessage = 'afro-message'; + case Unifonic = 'unifonic'; + case Smsmode = 'smsmode'; + case Imedia = 'imedia'; case Fcm = 'fcm'; case Apns = 'apns'; case Expo = 'expo'; @@ -83,4 +86,5 @@ enum ProvidersIdEnum: string case RocketChat = 'rocket-chat'; case WhatsappBusiness = 'whatsapp-business'; case ChatWebhook = 'chat-webhook'; + case NovuSlack = 'novu-slack'; } diff --git a/src/Models/Components/SeverityLevelEnum.php b/src/Models/Components/SeverityLevelEnum.php new file mode 100644 index 0000000..fd2e555 --- /dev/null +++ b/src/Models/Components/SeverityLevelEnum.php @@ -0,0 +1,19 @@ +issueType = $issueType; $this->message = $message; diff --git a/src/Models/Components/StepIntegrationIssue.php b/src/Models/Components/StepIntegrationIssue.php index efa792b..e558788 100644 --- a/src/Models/Components/StepIntegrationIssue.php +++ b/src/Models/Components/StepIntegrationIssue.php @@ -14,11 +14,11 @@ class StepIntegrationIssue /** * Type of integration issue * - * @var StepIntegrationIssueEnum $issueType + * @var IntegrationIssueEnum $issueType */ #[\Speakeasy\Serializer\Annotation\SerializedName('issueType')] - #[\Speakeasy\Serializer\Annotation\Type('\novu\Models\Components\StepIntegrationIssueEnum')] - public StepIntegrationIssueEnum $issueType; + #[\Speakeasy\Serializer\Annotation\Type('\novu\Models\Components\IntegrationIssueEnum')] + public IntegrationIssueEnum $issueType; /** * Detailed message describing the issue @@ -38,12 +38,12 @@ class StepIntegrationIssue public ?string $variableName = null; /** - * @param StepIntegrationIssueEnum $issueType + * @param IntegrationIssueEnum $issueType * @param string $message * @param ?string $variableName * @phpstan-pure */ - public function __construct(StepIntegrationIssueEnum $issueType, string $message, ?string $variableName = null) + public function __construct(IntegrationIssueEnum $issueType, string $message, ?string $variableName = null) { $this->issueType = $issueType; $this->message = $message; diff --git a/src/Models/Components/StepsOverrides.php b/src/Models/Components/StepsOverrides.php index 3d69123..0483acd 100644 --- a/src/Models/Components/StepsOverrides.php +++ b/src/Models/Components/StepsOverrides.php @@ -14,18 +14,30 @@ class StepsOverrides /** * Passing the provider id and the provider specific configurations * - * @var array> $providers + * @var ?array> $providers */ #[\Speakeasy\Serializer\Annotation\SerializedName('providers')] - #[\Speakeasy\Serializer\Annotation\Type('array>')] - public array $providers; + #[\Speakeasy\Serializer\Annotation\Type('array>|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?array $providers = null; /** - * @param array> $providers + * Override the or remove the layout for this specific step + * + * @var ?string $layoutId + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('layoutId')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?string $layoutId = null; + + /** + * @param ?array> $providers + * @param ?string $layoutId * @phpstan-pure */ - public function __construct(array $providers) + public function __construct(?array $providers = null, ?string $layoutId = null) { $this->providers = $providers; + $this->layoutId = $layoutId; } } \ No newline at end of file diff --git a/src/Models/Components/TriggerEventRequestDto.php b/src/Models/Components/TriggerEventRequestDto.php index 75161ae..cd8e60c 100644 --- a/src/Models/Components/TriggerEventRequestDto.php +++ b/src/Models/Components/TriggerEventRequestDto.php @@ -52,7 +52,9 @@ class TriggerEventRequestDto public ?Overrides $overrides = null; /** - * A unique identifier for this transaction, we will generate a UUID if not provided. + * A unique identifier for deduplication. If the same **transactionId** is sent again, + * + * the trigger is ignored. Useful to prevent duplicate notifications. The retention period depends on your billing tier. * * @var ?string $transactionId */ diff --git a/src/Models/Components/TriggerEventToAllRequestDtoChannels.php b/src/Models/Components/TriggerEventToAllRequestDtoChannels.php new file mode 100644 index 0000000..b2a4015 --- /dev/null +++ b/src/Models/Components/TriggerEventToAllRequestDtoChannels.php @@ -0,0 +1,33 @@ +email = $email; + } +} \ No newline at end of file diff --git a/src/Models/Components/TriggerEventToAllRequestDtoOverrides.php b/src/Models/Components/TriggerEventToAllRequestDtoOverrides.php index 2db3396..0454bee 100644 --- a/src/Models/Components/TriggerEventToAllRequestDtoOverrides.php +++ b/src/Models/Components/TriggerEventToAllRequestDtoOverrides.php @@ -13,7 +13,7 @@ class TriggerEventToAllRequestDtoOverrides { /** - * This could be used to override provider specific configurations + * This could be used to override provider specific configurations or layout at the step level * * @var ?array $steps */ @@ -22,6 +22,16 @@ class TriggerEventToAllRequestDtoOverrides #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $steps = null; + /** + * Channel-specific overrides that apply to all steps of a particular channel type. Step-level overrides take precedence over channel-level overrides. + * + * @var ?TriggerEventToAllRequestDtoChannels $channels + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('channels')] + #[\Speakeasy\Serializer\Annotation\Type('\novu\Models\Components\TriggerEventToAllRequestDtoChannels|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?TriggerEventToAllRequestDtoChannels $channels = null; + /** * Overrides the provider configuration for the entire workflow and all steps * @@ -98,6 +108,7 @@ class TriggerEventToAllRequestDtoOverrides /** * @param ?array $steps + * @param ?TriggerEventToAllRequestDtoChannels $channels * @param ?array> $providers * @param ?array $email * @param ?array $push @@ -107,9 +118,10 @@ class TriggerEventToAllRequestDtoOverrides * @param ?array> $additionalProperties * @phpstan-pure */ - public function __construct(?array $steps = null, ?array $providers = null, ?array $email = null, ?array $push = null, ?array $sms = null, ?array $chat = null, ?string $layoutIdentifier = null, ?array $additionalProperties = null) + public function __construct(?array $steps = null, ?TriggerEventToAllRequestDtoChannels $channels = null, ?array $providers = null, ?array $email = null, ?array $push = null, ?array $sms = null, ?array $chat = null, ?string $layoutIdentifier = null, ?array $additionalProperties = null) { $this->steps = $steps; + $this->channels = $channels; $this->providers = $providers; $this->email = $email; $this->push = $push; diff --git a/src/Models/Components/UpdateWorkflowDto.php b/src/Models/Components/UpdateWorkflowDto.php index a0b71f8..17c3ad6 100644 --- a/src/Models/Components/UpdateWorkflowDto.php +++ b/src/Models/Components/UpdateWorkflowDto.php @@ -65,6 +65,15 @@ class UpdateWorkflowDto #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $tags = null; + /** + * Enable or disable payload schema validation + * + * @var ?bool $validatePayload + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('validatePayload')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $validatePayload = null; + /** * Workflow ID (allowed only for code-first workflows) * @@ -85,22 +94,22 @@ class UpdateWorkflowDto public ?array $payloadSchema = null; /** - * Enable or disable payload schema validation + * Whether the workflow is active * - * @var ?bool $validatePayload + * @var ?bool $active */ - #[\Speakeasy\Serializer\Annotation\SerializedName('validatePayload')] + #[\Speakeasy\Serializer\Annotation\SerializedName('active')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $validatePayload = null; + public ?bool $active = null; /** - * Whether the workflow is active + * Enable or disable translations for this workflow * - * @var ?bool $active + * @var ?bool $isTranslationEnabled */ - #[\Speakeasy\Serializer\Annotation\SerializedName('active')] + #[\Speakeasy\Serializer\Annotation\SerializedName('isTranslationEnabled')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $active = null; + public ?bool $isTranslationEnabled = null; /** * @param string $name @@ -110,12 +119,13 @@ class UpdateWorkflowDto * @param ?string $description * @param ?array $tags * @param ?bool $active + * @param ?bool $validatePayload + * @param ?bool $isTranslationEnabled * @param ?string $workflowId * @param ?array $payloadSchema - * @param ?bool $validatePayload * @phpstan-pure */ - public function __construct(string $name, array $steps, PreferencesRequestDto $preferences, ResourceOriginEnum $origin, ?string $description = null, ?array $tags = null, ?string $workflowId = null, ?array $payloadSchema = null, ?bool $validatePayload = null, ?bool $active = false) + public function __construct(string $name, array $steps, PreferencesRequestDto $preferences, ResourceOriginEnum $origin, ?string $description = null, ?array $tags = null, ?bool $validatePayload = null, ?string $workflowId = null, ?array $payloadSchema = null, ?bool $active = false, ?bool $isTranslationEnabled = false) { $this->name = $name; $this->steps = $steps; @@ -123,9 +133,10 @@ public function __construct(string $name, array $steps, PreferencesRequestDto $p $this->origin = $origin; $this->description = $description; $this->tags = $tags; + $this->validatePayload = $validatePayload; $this->workflowId = $workflowId; $this->payloadSchema = $payloadSchema; - $this->validatePayload = $validatePayload; $this->active = $active; + $this->isTranslationEnabled = $isTranslationEnabled; } } \ No newline at end of file diff --git a/src/Models/Components/UpdatedBy.php b/src/Models/Components/UpdatedBy.php new file mode 100644 index 0000000..651571a --- /dev/null +++ b/src/Models/Components/UpdatedBy.php @@ -0,0 +1,65 @@ +id = $id; + $this->firstName = $firstName; + $this->lastName = $lastName; + $this->externalId = $externalId; + } +} \ No newline at end of file diff --git a/src/Models/Components/Workflow.php b/src/Models/Components/Workflow.php index 24f553f..21d1bfd 100644 --- a/src/Models/Components/Workflow.php +++ b/src/Models/Components/Workflow.php @@ -9,35 +9,88 @@ namespace novu\Models\Components; -/** Workflow - Workflow-specific preferences */ +/** Workflow - Workflow information if this is a template-level preference */ class Workflow { /** - * A preference for the workflow. The values specified here will be used if no preference is specified for a channel. + * Unique identifier of the workflow * - * @var WorkflowPreferenceDto $all + * @var string $id */ - #[\Speakeasy\Serializer\Annotation\SerializedName('all')] - #[\Speakeasy\Serializer\Annotation\Type('\novu\Models\Components\WorkflowPreferenceDto')] - public WorkflowPreferenceDto $all; + #[\Speakeasy\Serializer\Annotation\SerializedName('id')] + public string $id; /** - * Preferences for different communication channels + * Workflow identifier used for triggering * - * @var array $channels + * @var string $identifier */ - #[\Speakeasy\Serializer\Annotation\SerializedName('channels')] - #[\Speakeasy\Serializer\Annotation\Type('array')] - public array $channels; + #[\Speakeasy\Serializer\Annotation\SerializedName('identifier')] + public string $identifier; /** - * @param WorkflowPreferenceDto $all - * @param array $channels + * Human-readable name of the workflow + * + * @var string $name + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('name')] + public string $name; + + /** + * Whether this workflow is marked as critical + * + * @var bool $critical + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('critical')] + public bool $critical; + + /** + * Severity level of the workflow + * + * @var SeverityLevelEnum $severity + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('severity')] + #[\Speakeasy\Serializer\Annotation\Type('\novu\Models\Components\SeverityLevelEnum')] + public SeverityLevelEnum $severity; + + /** + * Tags associated with the workflow + * + * @var ?array $tags + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('tags')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?array $tags = null; + + /** + * Custom data associated with the workflow + * + * @var ?GetPreferencesResponseDtoData $data + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('data')] + #[\Speakeasy\Serializer\Annotation\Type('\novu\Models\Components\GetPreferencesResponseDtoData|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?GetPreferencesResponseDtoData $data = null; + + /** + * @param string $id + * @param string $identifier + * @param string $name + * @param bool $critical + * @param SeverityLevelEnum $severity + * @param ?array $tags + * @param ?GetPreferencesResponseDtoData $data * @phpstan-pure */ - public function __construct(WorkflowPreferenceDto $all, array $channels) + public function __construct(string $id, string $identifier, string $name, bool $critical, SeverityLevelEnum $severity, ?array $tags = null, ?GetPreferencesResponseDtoData $data = null) { - $this->all = $all; - $this->channels = $channels; + $this->id = $id; + $this->identifier = $identifier; + $this->name = $name; + $this->critical = $critical; + $this->severity = $severity; + $this->tags = $tags; + $this->data = $data; } } \ No newline at end of file diff --git a/src/Models/Components/WorkflowListResponseDto.php b/src/Models/Components/WorkflowListResponseDto.php index b5f561d..b35d2ad 100644 --- a/src/Models/Components/WorkflowListResponseDto.php +++ b/src/Models/Components/WorkflowListResponseDto.php @@ -96,6 +96,44 @@ class WorkflowListResponseDto #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $tags = null; + /** + * Is translation enabled for the workflow + * + * @var ?bool $isTranslationEnabled + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('isTranslationEnabled')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $isTranslationEnabled = null; + + /** + * User who last updated the workflow + * + * @var ?WorkflowListResponseDtoUpdatedBy $updatedBy + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('updatedBy')] + #[\Speakeasy\Serializer\Annotation\Type('\novu\Models\Components\WorkflowListResponseDtoUpdatedBy|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?WorkflowListResponseDtoUpdatedBy $updatedBy = null; + + /** + * Timestamp of the last workflow publication + * + * @var ?string $lastPublishedAt + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('lastPublishedAt')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?string $lastPublishedAt = null; + + /** + * User who last published the workflow + * + * @var ?WorkflowListResponseDtoLastPublishedBy $lastPublishedBy + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('lastPublishedBy')] + #[\Speakeasy\Serializer\Annotation\Type('\novu\Models\Components\WorkflowListResponseDtoLastPublishedBy|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?WorkflowListResponseDtoLastPublishedBy $lastPublishedBy = null; + /** * Timestamp of the last workflow trigger * @@ -116,10 +154,14 @@ class WorkflowListResponseDto * @param ResourceOriginEnum $origin * @param array $stepTypeOverviews * @param ?array $tags + * @param ?bool $isTranslationEnabled + * @param ?WorkflowListResponseDtoUpdatedBy $updatedBy + * @param ?string $lastPublishedAt + * @param ?WorkflowListResponseDtoLastPublishedBy $lastPublishedBy * @param ?string $lastTriggeredAt * @phpstan-pure */ - public function __construct(string $name, string $updatedAt, string $createdAt, string $id, string $workflowId, string $slug, WorkflowStatusEnum $status, ResourceOriginEnum $origin, array $stepTypeOverviews, ?array $tags = null, ?string $lastTriggeredAt = null) + public function __construct(string $name, string $updatedAt, string $createdAt, string $id, string $workflowId, string $slug, WorkflowStatusEnum $status, ResourceOriginEnum $origin, array $stepTypeOverviews, ?array $tags = null, ?bool $isTranslationEnabled = null, ?WorkflowListResponseDtoUpdatedBy $updatedBy = null, ?string $lastPublishedAt = null, ?WorkflowListResponseDtoLastPublishedBy $lastPublishedBy = null, ?string $lastTriggeredAt = null) { $this->name = $name; $this->updatedAt = $updatedAt; @@ -131,6 +173,10 @@ public function __construct(string $name, string $updatedAt, string $createdAt, $this->origin = $origin; $this->stepTypeOverviews = $stepTypeOverviews; $this->tags = $tags; + $this->isTranslationEnabled = $isTranslationEnabled; + $this->updatedBy = $updatedBy; + $this->lastPublishedAt = $lastPublishedAt; + $this->lastPublishedBy = $lastPublishedBy; $this->lastTriggeredAt = $lastTriggeredAt; } } \ No newline at end of file diff --git a/src/Models/Components/WorkflowListResponseDtoLastName.php b/src/Models/Components/WorkflowListResponseDtoLastName.php new file mode 100644 index 0000000..6cd532f --- /dev/null +++ b/src/Models/Components/WorkflowListResponseDtoLastName.php @@ -0,0 +1,19 @@ +id = $id; + $this->firstName = $firstName; + $this->lastName = $lastName; + $this->externalId = $externalId; + } +} \ No newline at end of file diff --git a/src/Models/Components/WorkflowListResponseDtoLastPublishedByLastName.php b/src/Models/Components/WorkflowListResponseDtoLastPublishedByLastName.php new file mode 100644 index 0000000..aa04539 --- /dev/null +++ b/src/Models/Components/WorkflowListResponseDtoLastPublishedByLastName.php @@ -0,0 +1,19 @@ +id = $id; + $this->firstName = $firstName; + $this->lastName = $lastName; + $this->externalId = $externalId; + } +} \ No newline at end of file diff --git a/src/Models/Components/WorkflowResponseDto.php b/src/Models/Components/WorkflowResponseDto.php index 3e8c2d7..bc6e3d8 100644 --- a/src/Models/Components/WorkflowResponseDto.php +++ b/src/Models/Components/WorkflowResponseDto.php @@ -115,6 +115,15 @@ class WorkflowResponseDto #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?array $tags = null; + /** + * Enable or disable payload schema validation + * + * @var ?bool $validatePayload + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('validatePayload')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $validatePayload = null; + /** * Runtime issues for workflow creation and update * @@ -126,32 +135,52 @@ class WorkflowResponseDto public ?array $issues = null; /** - * Whether payload schema validation is enabled + * The payload JSON Schema for the workflow * - * @var ?bool $validatePayload + * @var ?array $payloadSchema */ - #[\Speakeasy\Serializer\Annotation\SerializedName('validatePayload')] + #[\Speakeasy\Serializer\Annotation\SerializedName('payloadSchema')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?bool $validatePayload = null; + public ?array $payloadSchema = null; /** - * Timestamp of the last workflow trigger + * User who last updated the workflow * - * @var ?string $lastTriggeredAt + * @var ?UpdatedBy $updatedBy */ - #[\Speakeasy\Serializer\Annotation\SerializedName('lastTriggeredAt')] + #[\Speakeasy\Serializer\Annotation\SerializedName('updatedBy')] + #[\Speakeasy\Serializer\Annotation\Type('\novu\Models\Components\UpdatedBy|null')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?string $lastTriggeredAt = null; + public ?UpdatedBy $updatedBy = null; /** - * The payload JSON Schema for the workflow + * Timestamp of the last workflow publication * - * @var ?array $payloadSchema + * @var ?string $lastPublishedAt */ - #[\Speakeasy\Serializer\Annotation\SerializedName('payloadSchema')] - #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\SerializedName('lastPublishedAt')] #[\Speakeasy\Serializer\Annotation\SkipWhenNull] - public ?array $payloadSchema = null; + public ?string $lastPublishedAt = null; + + /** + * User who last published the workflow + * + * @var ?LastPublishedBy $lastPublishedBy + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('lastPublishedBy')] + #[\Speakeasy\Serializer\Annotation\Type('\novu\Models\Components\LastPublishedBy|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?LastPublishedBy $lastPublishedBy = null; + + /** + * Timestamp of the last workflow trigger + * + * @var ?string $lastTriggeredAt + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('lastTriggeredAt')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?string $lastTriggeredAt = null; /** * Generated payload example based on the payload schema @@ -172,6 +201,15 @@ class WorkflowResponseDto #[\Speakeasy\Serializer\Annotation\SkipWhenNull] public ?bool $active = null; + /** + * Enable or disable translations for this workflow + * + * @var ?bool $isTranslationEnabled + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('isTranslationEnabled')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $isTranslationEnabled = null; + /** * @param string $name * @param string $id @@ -186,14 +224,18 @@ class WorkflowResponseDto * @param ?string $description * @param ?array $tags * @param ?bool $active - * @param ?array $issues * @param ?bool $validatePayload - * @param ?string $lastTriggeredAt + * @param ?bool $isTranslationEnabled + * @param ?array $issues * @param ?array $payloadSchema + * @param ?UpdatedBy $updatedBy + * @param ?string $lastPublishedAt + * @param ?LastPublishedBy $lastPublishedBy + * @param ?string $lastTriggeredAt * @param ?array $payloadExample * @phpstan-pure */ - public function __construct(string $name, string $id, string $workflowId, Slug $slug, string $updatedAt, string $createdAt, array $steps, ResourceOriginEnum $origin, WorkflowPreferencesResponseDto $preferences, WorkflowStatusEnum $status, ?string $description = null, ?array $tags = null, ?array $issues = null, ?bool $validatePayload = null, ?string $lastTriggeredAt = null, ?array $payloadSchema = null, ?array $payloadExample = null, ?bool $active = false) + public function __construct(string $name, string $id, string $workflowId, Slug $slug, string $updatedAt, string $createdAt, array $steps, ResourceOriginEnum $origin, WorkflowPreferencesResponseDto $preferences, WorkflowStatusEnum $status, ?string $description = null, ?array $tags = null, ?bool $validatePayload = null, ?array $issues = null, ?array $payloadSchema = null, ?UpdatedBy $updatedBy = null, ?string $lastPublishedAt = null, ?LastPublishedBy $lastPublishedBy = null, ?string $lastTriggeredAt = null, ?array $payloadExample = null, ?bool $active = false, ?bool $isTranslationEnabled = false) { $this->name = $name; $this->id = $id; @@ -207,11 +249,15 @@ public function __construct(string $name, string $id, string $workflowId, Slug $ $this->status = $status; $this->description = $description; $this->tags = $tags; - $this->issues = $issues; $this->validatePayload = $validatePayload; - $this->lastTriggeredAt = $lastTriggeredAt; + $this->issues = $issues; $this->payloadSchema = $payloadSchema; + $this->updatedBy = $updatedBy; + $this->lastPublishedAt = $lastPublishedAt; + $this->lastPublishedBy = $lastPublishedBy; + $this->lastTriggeredAt = $lastTriggeredAt; $this->payloadExample = $payloadExample; $this->active = $active; + $this->isTranslationEnabled = $isTranslationEnabled; } } \ No newline at end of file diff --git a/src/Models/Components/WorkflowResponseDtoLastName.php b/src/Models/Components/WorkflowResponseDtoLastName.php new file mode 100644 index 0000000..d3fb18d --- /dev/null +++ b/src/Models/Components/WorkflowResponseDtoLastName.php @@ -0,0 +1,19 @@ + $channels + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('channels')] + #[\Speakeasy\Serializer\Annotation\Type('array<\novu\Models\Components\ChannelSettingsDto>|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?array $channels = null; + + /** + * An array of topics that the subscriber is subscribed to. + * + * @var ?array $topics + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('topics')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?array $topics = null; + + /** + * Indicates whether the subscriber is currently online. + * + * @var ?bool $isOnline + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('isOnline')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $isOnline = null; + + /** + * The timestamp indicating when the subscriber was last online, in ISO 8601 format. + * + * @var ?string $lastOnlineAt + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('lastOnlineAt')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?string $lastOnlineAt = null; + + /** + * The version of the subscriber document. + * + * @var ?float $v + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('__v')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?float $v = null; + + /** + * Additional custom data for the subscriber + * + * @var ?array $data + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('data')] + #[\Speakeasy\Serializer\Annotation\Type('array|null')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?array $data = null; + + /** + * Timezone of the subscriber + * + * @var ?string $timezone + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('timezone')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?string $timezone = null; + + /** + * The identifier used to create this subscriber, which typically corresponds to the user ID in your system. + * + * @var string $subscriberId + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('subscriberId')] + public string $subscriberId; + + /** + * The unique identifier of the organization to which the subscriber belongs. + * + * @var string $organizationId + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('_organizationId')] + public string $organizationId; + + /** + * The unique identifier of the environment associated with this subscriber. + * + * @var string $environmentId + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('_environmentId')] + public string $environmentId; + + /** + * Indicates whether the subscriber has been deleted. + * + * @var bool $deleted + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('deleted')] + public bool $deleted; + + /** + * The timestamp indicating when the subscriber was created, in ISO 8601 format. + * + * @var string $createdAt + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('createdAt')] + public string $createdAt; + + /** + * The timestamp indicating when the subscriber was last updated, in ISO 8601 format. + * + * @var string $updatedAt + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('updatedAt')] + public string $updatedAt; + + /** + * @param string $subscriberId + * @param string $organizationId + * @param string $environmentId + * @param bool $deleted + * @param string $createdAt + * @param string $updatedAt + * @param ?string $id + * @param ?array $channels + * @param ?array $topics + * @param ?float $v + * @param ?string $firstName + * @param ?string $lastName + * @param ?string $email + * @param ?string $phone + * @param ?string $avatar + * @param ?string $locale + * @param ?bool $isOnline + * @param ?string $lastOnlineAt + * @param ?array $data + * @param ?string $timezone + * @phpstan-pure + */ + public function __construct(string $subscriberId, string $organizationId, string $environmentId, bool $deleted, string $createdAt, string $updatedAt, ?string $id = null, ?array $channels = null, ?array $topics = null, ?float $v = null, ?string $firstName = null, ?string $lastName = null, ?string $email = null, ?string $phone = null, ?string $avatar = null, ?string $locale = null, ?bool $isOnline = null, ?string $lastOnlineAt = null, ?array $data = null, ?string $timezone = null) + { + $this->id = $id; + $this->firstName = $firstName; + $this->lastName = $lastName; + $this->email = $email; + $this->phone = $phone; + $this->avatar = $avatar; + $this->locale = $locale; + $this->channels = $channels; + $this->topics = $topics; + $this->isOnline = $isOnline; + $this->lastOnlineAt = $lastOnlineAt; + $this->v = $v; + $this->data = $data; + $this->timezone = $timezone; + $this->subscriberId = $subscriberId; + $this->organizationId = $organizationId; + $this->environmentId = $environmentId; + $this->deleted = $deleted; + $this->createdAt = $createdAt; + $this->updatedAt = $updatedAt; + } + + public function toException(): SubscriberResponseDtoThrowable + { + $serializer = Utils\JSON::createSerializer(); + $message = $serializer->serialize($this, 'json'); + $code = -1; + + return new SubscriberResponseDtoThrowable($message, (int) $code, $this); + } +} \ No newline at end of file diff --git a/src/Models/Errors/SubscriberResponseDtoThrowable.php b/src/Models/Errors/SubscriberResponseDtoThrowable.php new file mode 100644 index 0000000..a9ad38b --- /dev/null +++ b/src/Models/Errors/SubscriberResponseDtoThrowable.php @@ -0,0 +1,20 @@ +container = $container; + } +} \ No newline at end of file diff --git a/src/Models/Errors/TopicResponseDto.php b/src/Models/Errors/TopicResponseDto.php new file mode 100644 index 0000000..fb2238b --- /dev/null +++ b/src/Models/Errors/TopicResponseDto.php @@ -0,0 +1,82 @@ +id = $id; + $this->key = $key; + $this->name = $name; + $this->createdAt = $createdAt; + $this->updatedAt = $updatedAt; + } + + public function toException(): TopicResponseDtoThrowable + { + $serializer = Utils\JSON::createSerializer(); + $message = $serializer->serialize($this, 'json'); + $code = -1; + + return new TopicResponseDtoThrowable($message, (int) $code, $this); + } +} \ No newline at end of file diff --git a/src/Models/Errors/TopicResponseDtoThrowable.php b/src/Models/Errors/TopicResponseDtoThrowable.php new file mode 100644 index 0000000..acfc13c --- /dev/null +++ b/src/Models/Errors/TopicResponseDtoThrowable.php @@ -0,0 +1,20 @@ +container = $container; + } +} \ No newline at end of file diff --git a/src/Models/Operations/Criticality.php b/src/Models/Operations/Criticality.php new file mode 100644 index 0000000..5ce10d9 --- /dev/null +++ b/src/Models/Operations/Criticality.php @@ -0,0 +1,18 @@ +environmentId = $environmentId; + $this->idempotencyKey = $idempotencyKey; + } +} \ No newline at end of file diff --git a/src/Models/Operations/EnvironmentsControllerGetEnvironmentTagsResponse.php b/src/Models/Operations/EnvironmentsControllerGetEnvironmentTagsResponse.php new file mode 100644 index 0000000..3121fef --- /dev/null +++ b/src/Models/Operations/EnvironmentsControllerGetEnvironmentTagsResponse.php @@ -0,0 +1,65 @@ +> $headers + */ + public array $headers; + + /** + * OK + * + * @var ?array $getEnvironmentTagsDtos + */ + public ?array $getEnvironmentTagsDtos = null; + + /** + * @param string $contentType + * @param int $statusCode + * @param \Psr\Http\Message\ResponseInterface $rawResponse + * @param array> $headers + * @param ?array $getEnvironmentTagsDtos + * @phpstan-pure + */ + public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?array $getEnvironmentTagsDtos = null, ?array $headers = []) + { + $this->contentType = $contentType; + $this->statusCode = $statusCode; + $this->rawResponse = $rawResponse; + $this->headers = $headers; + $this->getEnvironmentTagsDtos = $getEnvironmentTagsDtos; + } +} \ No newline at end of file diff --git a/src/Models/Operations/InboundWebhooksControllerHandleWebhookRequest.php b/src/Models/Operations/InboundWebhooksControllerHandleWebhookRequest.php new file mode 100644 index 0000000..b88f69c --- /dev/null +++ b/src/Models/Operations/InboundWebhooksControllerHandleWebhookRequest.php @@ -0,0 +1,48 @@ +environmentId = $environmentId; + $this->integrationId = $integrationId; + $this->idempotencyKey = $idempotencyKey; + } +} \ No newline at end of file diff --git a/src/Models/Operations/InboundWebhooksControllerHandleWebhookResponse.php b/src/Models/Operations/InboundWebhooksControllerHandleWebhookResponse.php new file mode 100644 index 0000000..d092933 --- /dev/null +++ b/src/Models/Operations/InboundWebhooksControllerHandleWebhookResponse.php @@ -0,0 +1,47 @@ +contentType = $contentType; + $this->statusCode = $statusCode; + $this->rawResponse = $rawResponse; + } +} \ No newline at end of file diff --git a/src/Models/Operations/NotificationsControllerListNotificationsRequest.php b/src/Models/Operations/NotificationsControllerListNotificationsRequest.php index 290ff6e..6328615 100644 --- a/src/Models/Operations/NotificationsControllerListNotificationsRequest.php +++ b/src/Models/Operations/NotificationsControllerListNotificationsRequest.php @@ -54,7 +54,7 @@ class NotificationsControllerListNotificationsRequest public ?array $subscriberIds = null; /** - * Transaction ID for filtering + * The transaction ID to filter by * * @var ?string $transactionId */ diff --git a/src/Models/Operations/SubscribersControllerBulkUpdateSubscriberPreferencesRequest.php b/src/Models/Operations/SubscribersControllerBulkUpdateSubscriberPreferencesRequest.php new file mode 100644 index 0000000..1532903 --- /dev/null +++ b/src/Models/Operations/SubscribersControllerBulkUpdateSubscriberPreferencesRequest.php @@ -0,0 +1,49 @@ +subscriberId = $subscriberId; + $this->bulkUpdateSubscriberPreferencesDto = $bulkUpdateSubscriberPreferencesDto; + $this->idempotencyKey = $idempotencyKey; + } +} \ No newline at end of file diff --git a/src/Models/Operations/SubscribersControllerBulkUpdateSubscriberPreferencesResponse.php b/src/Models/Operations/SubscribersControllerBulkUpdateSubscriberPreferencesResponse.php new file mode 100644 index 0000000..06c5c2c --- /dev/null +++ b/src/Models/Operations/SubscribersControllerBulkUpdateSubscriberPreferencesResponse.php @@ -0,0 +1,65 @@ +> $headers + */ + public array $headers; + + /** + * OK + * + * @var ?array $getPreferencesResponseDtos + */ + public ?array $getPreferencesResponseDtos = null; + + /** + * @param string $contentType + * @param int $statusCode + * @param \Psr\Http\Message\ResponseInterface $rawResponse + * @param array> $headers + * @param ?array $getPreferencesResponseDtos + * @phpstan-pure + */ + public function __construct(string $contentType, int $statusCode, \Psr\Http\Message\ResponseInterface $rawResponse, ?array $getPreferencesResponseDtos = null, ?array $headers = []) + { + $this->contentType = $contentType; + $this->statusCode = $statusCode; + $this->rawResponse = $rawResponse; + $this->headers = $headers; + $this->getPreferencesResponseDtos = $getPreferencesResponseDtos; + } +} \ No newline at end of file diff --git a/src/Models/Operations/SubscribersControllerCreateSubscriberRequest.php b/src/Models/Operations/SubscribersControllerCreateSubscriberRequest.php index a9f6830..9be0840 100644 --- a/src/Models/Operations/SubscribersControllerCreateSubscriberRequest.php +++ b/src/Models/Operations/SubscribersControllerCreateSubscriberRequest.php @@ -19,6 +19,14 @@ class SubscribersControllerCreateSubscriberRequest #[SpeakeasyMetadata('request:mediaType=application/json')] public Components\CreateSubscriberRequestDto $createSubscriberRequestDto; + /** + * If true, the request will fail if a subscriber with the same subscriberId already exists + * + * @var ?bool $failIfExists + */ + #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=failIfExists')] + public ?bool $failIfExists = null; + /** * A header for idempotency purposes * @@ -29,12 +37,14 @@ class SubscribersControllerCreateSubscriberRequest /** * @param Components\CreateSubscriberRequestDto $createSubscriberRequestDto + * @param ?bool $failIfExists * @param ?string $idempotencyKey * @phpstan-pure */ - public function __construct(Components\CreateSubscriberRequestDto $createSubscriberRequestDto, ?string $idempotencyKey = null) + public function __construct(Components\CreateSubscriberRequestDto $createSubscriberRequestDto, ?bool $failIfExists = null, ?string $idempotencyKey = null) { $this->createSubscriberRequestDto = $createSubscriberRequestDto; + $this->failIfExists = $failIfExists; $this->idempotencyKey = $idempotencyKey; } } \ No newline at end of file diff --git a/src/Models/Operations/SubscribersControllerGetSubscriberPreferencesRequest.php b/src/Models/Operations/SubscribersControllerGetSubscriberPreferencesRequest.php index f8ea014..80dd2b8 100644 --- a/src/Models/Operations/SubscribersControllerGetSubscriberPreferencesRequest.php +++ b/src/Models/Operations/SubscribersControllerGetSubscriberPreferencesRequest.php @@ -18,6 +18,13 @@ class SubscribersControllerGetSubscriberPreferencesRequest #[SpeakeasyMetadata('pathParam:style=simple,explode=false,name=subscriberId')] public string $subscriberId; + /** + * + * @var Criticality $criticality + */ + #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=criticality')] + public Criticality $criticality; + /** * A header for idempotency purposes * @@ -28,12 +35,14 @@ class SubscribersControllerGetSubscriberPreferencesRequest /** * @param string $subscriberId + * @param Criticality $criticality * @param ?string $idempotencyKey * @phpstan-pure */ - public function __construct(string $subscriberId, ?string $idempotencyKey = null) + public function __construct(string $subscriberId, Criticality $criticality, ?string $idempotencyKey = null) { $this->subscriberId = $subscriberId; + $this->criticality = $criticality; $this->idempotencyKey = $idempotencyKey; } } \ No newline at end of file diff --git a/src/Models/Operations/TopicsControllerUpsertTopicRequest.php b/src/Models/Operations/TopicsControllerUpsertTopicRequest.php index 1575d65..55caa1b 100644 --- a/src/Models/Operations/TopicsControllerUpsertTopicRequest.php +++ b/src/Models/Operations/TopicsControllerUpsertTopicRequest.php @@ -19,6 +19,14 @@ class TopicsControllerUpsertTopicRequest #[SpeakeasyMetadata('request:mediaType=application/json')] public Components\CreateUpdateTopicRequestDto $createUpdateTopicRequestDto; + /** + * If true, the request will fail if a topic with the same key already exists + * + * @var ?bool $failIfExists + */ + #[SpeakeasyMetadata('queryParam:style=form,explode=true,name=failIfExists')] + public ?bool $failIfExists = null; + /** * A header for idempotency purposes * @@ -29,12 +37,14 @@ class TopicsControllerUpsertTopicRequest /** * @param Components\CreateUpdateTopicRequestDto $createUpdateTopicRequestDto + * @param ?bool $failIfExists * @param ?string $idempotencyKey * @phpstan-pure */ - public function __construct(Components\CreateUpdateTopicRequestDto $createUpdateTopicRequestDto, ?string $idempotencyKey = null) + public function __construct(Components\CreateUpdateTopicRequestDto $createUpdateTopicRequestDto, ?bool $failIfExists = null, ?string $idempotencyKey = null) { $this->createUpdateTopicRequestDto = $createUpdateTopicRequestDto; + $this->failIfExists = $failIfExists; $this->idempotencyKey = $idempotencyKey; } } \ No newline at end of file diff --git a/src/Novu.php b/src/Novu.php index c2920eb..07e9b0f 100644 --- a/src/Novu.php +++ b/src/Novu.php @@ -30,6 +30,13 @@ class Novu 'https://eu.api.novu.co', ]; + /** + * Environments allow you to manage different stages of your application development lifecycle. Each environment has its own set of API keys and configurations, enabling you to separate development, staging, and production workflows. + * + * @var Environments $$environments + */ + public Environments $environments; + public Subscribers $subscribers; public SubscribersPreferences $subscribersPreferences; @@ -48,13 +55,6 @@ class Novu */ public Workflows $workflows; - /** - * Environments allow you to manage different stages of your application development lifecycle. Each environment has its own set of API keys and configurations, enabling you to separate development, staging, and production workflows. - * - * @var Environments $$environments - */ - public Environments $environments; - /** * 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. * @@ -95,11 +95,11 @@ public static function builder(): NovuBuilder public function __construct( public SDKConfiguration $sdkConfiguration, ) { + $this->environments = new Environments($this->sdkConfiguration); $this->subscribers = new Subscribers($this->sdkConfiguration); $this->subscribersPreferences = new SubscribersPreferences($this->sdkConfiguration); $this->topics = new Topics($this->sdkConfiguration); $this->workflows = new Workflows($this->sdkConfiguration); - $this->environments = new Environments($this->sdkConfiguration); $this->integrations = new Integrations($this->sdkConfiguration); $this->messages = new Messages($this->sdkConfiguration); $this->notifications = new Notifications($this->sdkConfiguration); @@ -437,11 +437,8 @@ public function cancel(string $transactionId, ?string $idempotencyKey = null, ?O /** * Trigger event * - * - * 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. - * + * 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. + * To prevent duplicate triggers, you can optionally pass a **transactionId** in the request body. If the same **transactionId** is used again, the trigger will be ignored. The retention period depends on your billing tier. * * @param Components\TriggerEventRequestDto $triggerEventRequestDto * @param ?string $idempotencyKey @@ -764,4 +761,92 @@ public function triggerBulk(Components\BulkTriggerEventDto $bulkTriggerEventDto, throw new \novu\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } } + + /** + * inboundWebhooksControllerHandleWebhook + * + * @param string $environmentId + * @param string $integrationId + * @param ?string $idempotencyKey + * @return Operations\InboundWebhooksControllerHandleWebhookResponse + * @throws \novu\Models\Errors\APIException + */ + public function inboundWebhooksControllerHandleWebhook(string $environmentId, string $integrationId, ?string $idempotencyKey = null, ?Options $options = null): Operations\InboundWebhooksControllerHandleWebhookResponse + { + $retryConfig = null; + if ($options) { + $retryConfig = $options->retryConfig; + } + if ($retryConfig === null && $this->sdkConfiguration->retryConfig) { + $retryConfig = $this->sdkConfiguration->retryConfig; + } else { + $retryConfig = new Retry\RetryConfigBackoff( + initialIntervalMs: 1000, + maxIntervalMs: 30000, + exponent: 1.5, + maxElapsedTimeMs: 3600000, + retryConnectionErrors: true, + ); + } + $retryCodes = null; + if ($options) { + $retryCodes = $options->retryCodes; + } + if ($retryCodes === null) { + $retryCodes = [ + '408', + '409', + '429', + '5XX', + ]; + } + $request = new Operations\InboundWebhooksControllerHandleWebhookRequest( + environmentId: $environmentId, + integrationId: $integrationId, + idempotencyKey: $idempotencyKey, + ); + $baseUrl = $this->sdkConfiguration->getTemplatedServerUrl(); + $url = Utils\Utils::generateUrl($baseUrl, '/v2/inbound-webhooks/delivery-providers/{environmentId}/{integrationId}', Operations\InboundWebhooksControllerHandleWebhookRequest::class, $request); + $urlOverride = null; + $httpOptions = ['http_errors' => false]; + $httpOptions = array_merge_recursive($httpOptions, Utils\Utils::getHeaders($request)); + if (! array_key_exists('headers', $httpOptions)) { + $httpOptions['headers'] = []; + } + $httpOptions['headers']['Accept'] = '*/*'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); + $hookContext = new HookContext($this->sdkConfiguration, $baseUrl, 'InboundWebhooksController_handleWebhook', [], $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = RetryUtils::retryWrapper(fn () => $this->sdkConfiguration->client->send($httpRequest, $httpOptions), $retryConfig, $retryCodes); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + $httpResponse = $res; + } + $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; + + $statusCode = $httpResponse->getStatusCode(); + if (Utils\Utils::matchStatusCodes($statusCode, ['4XX', '5XX'])) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + $httpResponse = $res; + } + if (Utils\Utils::matchStatusCodes($statusCode, ['201'])) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + return new Operations\InboundWebhooksControllerHandleWebhookResponse( + statusCode: $statusCode, + contentType: $contentType, + rawResponse: $httpResponse + ); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \novu\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { + throw new \novu\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \novu\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } } \ No newline at end of file diff --git a/src/Preferences.php b/src/Preferences.php new file mode 100644 index 0000000..5a3cf27 --- /dev/null +++ b/src/Preferences.php @@ -0,0 +1,204 @@ +sdkConfiguration = $sdkConfig; + } + /** + * @param string $baseUrl + * @param array $urlVariables + * + * @return string + */ + public function getUrl(string $baseUrl, array $urlVariables): string + { + $serverDetails = $this->sdkConfiguration->getServerDetails(); + + if ($baseUrl == null) { + $baseUrl = $serverDetails->baseUrl; + } + + if ($urlVariables == null) { + $urlVariables = $serverDetails->options; + } + + return Utils\Utils::templateUrl($baseUrl, $urlVariables); + } + + /** + * Bulk update subscriber preferences + * + * Bulk update subscriber preferences by its unique key identifier **subscriberId**. + * This API allows updating multiple workflow preferences in a single request. + * + * @param Components\BulkUpdateSubscriberPreferencesDto $bulkUpdateSubscriberPreferencesDto + * @param string $subscriberId + * @param ?string $idempotencyKey + * @return Operations\SubscribersControllerBulkUpdateSubscriberPreferencesResponse + * @throws \novu\Models\Errors\APIException + */ + public function bulkUpdate(Components\BulkUpdateSubscriberPreferencesDto $bulkUpdateSubscriberPreferencesDto, string $subscriberId, ?string $idempotencyKey = null, ?Options $options = null): Operations\SubscribersControllerBulkUpdateSubscriberPreferencesResponse + { + $retryConfig = null; + if ($options) { + $retryConfig = $options->retryConfig; + } + if ($retryConfig === null && $this->sdkConfiguration->retryConfig) { + $retryConfig = $this->sdkConfiguration->retryConfig; + } else { + $retryConfig = new Retry\RetryConfigBackoff( + initialIntervalMs: 1000, + maxIntervalMs: 30000, + exponent: 1.5, + maxElapsedTimeMs: 3600000, + retryConnectionErrors: true, + ); + } + $retryCodes = null; + if ($options) { + $retryCodes = $options->retryCodes; + } + if ($retryCodes === null) { + $retryCodes = [ + '408', + '409', + '429', + '5XX', + ]; + } + $request = new Operations\SubscribersControllerBulkUpdateSubscriberPreferencesRequest( + subscriberId: $subscriberId, + bulkUpdateSubscriberPreferencesDto: $bulkUpdateSubscriberPreferencesDto, + idempotencyKey: $idempotencyKey, + ); + $baseUrl = $this->sdkConfiguration->getTemplatedServerUrl(); + $url = Utils\Utils::generateUrl($baseUrl, '/v2/subscribers/{subscriberId}/preferences/bulk', Operations\SubscribersControllerBulkUpdateSubscriberPreferencesRequest::class, $request); + $urlOverride = null; + $httpOptions = ['http_errors' => false]; + $body = Utils\Utils::serializeRequestBody($request, 'bulkUpdateSubscriberPreferencesDto', 'json'); + if ($body === null) { + throw new \Exception('Request body is required'); + } + $httpOptions = array_merge_recursive($httpOptions, $body); + $httpOptions = array_merge_recursive($httpOptions, Utils\Utils::getHeaders($request)); + if (! array_key_exists('headers', $httpOptions)) { + $httpOptions['headers'] = []; + } + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpRequest = new \GuzzleHttp\Psr7\Request('PATCH', $url); + $hookContext = new HookContext($this->sdkConfiguration, $baseUrl, 'SubscribersController_bulkUpdateSubscriberPreferences', [], $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); + $httpRequest = Utils\Utils::removeHeaders($httpRequest); + try { + $httpResponse = RetryUtils::retryWrapper(fn () => $this->sdkConfiguration->client->send($httpRequest, $httpOptions), $retryConfig, $retryCodes); + } catch (\GuzzleHttp\Exception\GuzzleException $error) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error); + $httpResponse = $res; + } + $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; + + $statusCode = $httpResponse->getStatusCode(); + if (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '403', '404', '405', '409', '413', '414', '415', '422', '429', '4XX', '500', '503', '5XX'])) { + $res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null); + $httpResponse = $res; + } + if (Utils\Utils::matchStatusCodes($statusCode, ['200'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, 'array<\novu\Models\Components\GetPreferencesResponseDto>', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + $response = new Operations\SubscribersControllerBulkUpdateSubscriberPreferencesResponse( + statusCode: $statusCode, + contentType: $contentType, + rawResponse: $httpResponse, + headers: $httpResponse->getHeaders(), + getPreferencesResponseDtos: $obj); + + return $response; + } else { + throw new \novu\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['414'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\novu\Models\Errors\ErrorDto', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + throw $obj->toException(); + } else { + throw new \novu\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '403', '404', '405', '409', '413', '415'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\novu\Models\Errors\ErrorDto', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + throw $obj->toException(); + } else { + throw new \novu\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['422'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\novu\Models\Errors\ValidationErrorDto', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + throw $obj->toException(); + } else { + throw new \novu\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['429'])) { + throw new \novu\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['500'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\novu\Models\Errors\ErrorDto', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + throw $obj->toException(); + } else { + throw new \novu\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['503'])) { + throw new \novu\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['4XX'])) { + throw new \novu\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['5XX'])) { + throw new \novu\Models\Errors\APIException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } else { + throw new \novu\Models\Errors\APIException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } + +} \ No newline at end of file diff --git a/src/SDKConfiguration.php b/src/SDKConfiguration.php index 486cf30..17b7625 100644 --- a/src/SDKConfiguration.php +++ b/src/SDKConfiguration.php @@ -24,11 +24,11 @@ class SDKConfiguration public string $openapiDocVersion = '2.3.0'; - public string $sdkVersion = '1.3.0'; + public string $sdkVersion = '1.3.1'; - public string $genVersion = '2.644.1'; + public string $genVersion = '2.687.13'; - public string $userAgent = 'speakeasy-sdk/php 1.3.0 2.644.1 2.3.0 novuhq/novu'; + public string $userAgent = 'speakeasy-sdk/php 1.3.1 2.687.13 2.3.0 novuhq/novu'; public ?RetryConfig $retryConfig = null; diff --git a/src/Subscribers.php b/src/Subscribers.php index 7fb6c0c..5fd455e 100644 --- a/src/Subscribers.php +++ b/src/Subscribers.php @@ -19,6 +19,8 @@ class Subscribers { private SDKConfiguration $sdkConfiguration; + public Preferences $preferences; + public NovuTopics $topics; public NovuMessages $messages; @@ -31,6 +33,7 @@ class Subscribers public function __construct(public SDKConfiguration $sdkConfig) { $this->sdkConfiguration = $sdkConfig; + $this->preferences = new Preferences($this->sdkConfiguration); $this->topics = new NovuTopics($this->sdkConfiguration); $this->messages = new NovuMessages($this->sdkConfiguration); $this->notifications = new NovuNotifications($this->sdkConfiguration); @@ -63,11 +66,12 @@ public function getUrl(string $baseUrl, array $urlVariables): string * **subscriberId** is a required field, rest other fields are optional, if the subscriber already exists, it will be updated * * @param Components\CreateSubscriberRequestDto $createSubscriberRequestDto + * @param ?bool $failIfExists * @param ?string $idempotencyKey * @return Operations\SubscribersControllerCreateSubscriberResponse * @throws \novu\Models\Errors\APIException */ - public function create(Components\CreateSubscriberRequestDto $createSubscriberRequestDto, ?string $idempotencyKey = null, ?Options $options = null): Operations\SubscribersControllerCreateSubscriberResponse + public function create(Components\CreateSubscriberRequestDto $createSubscriberRequestDto, ?bool $failIfExists = null, ?string $idempotencyKey = null, ?Options $options = null): Operations\SubscribersControllerCreateSubscriberResponse { $retryConfig = null; if ($options) { @@ -98,6 +102,7 @@ public function create(Components\CreateSubscriberRequestDto $createSubscriberRe } $request = new Operations\SubscribersControllerCreateSubscriberRequest( createSubscriberRequestDto: $createSubscriberRequestDto, + failIfExists: $failIfExists, idempotencyKey: $idempotencyKey, ); $baseUrl = $this->sdkConfiguration->getTemplatedServerUrl(); @@ -109,6 +114,8 @@ public function create(Components\CreateSubscriberRequestDto $createSubscriberRe throw new \Exception('Request body is required'); } $httpOptions = array_merge_recursive($httpOptions, $body); + + $qp = Utils\Utils::getQueryParams(Operations\SubscribersControllerCreateSubscriberRequest::class, $request, $urlOverride); $httpOptions = array_merge_recursive($httpOptions, Utils\Utils::getHeaders($request)); if (! array_key_exists('headers', $httpOptions)) { $httpOptions['headers'] = []; @@ -118,6 +125,7 @@ public function create(Components\CreateSubscriberRequestDto $createSubscriberRe $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); $hookContext = new HookContext($this->sdkConfiguration, $baseUrl, 'SubscribersController_createSubscriber', [], $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $httpOptions['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { @@ -151,6 +159,17 @@ public function create(Components\CreateSubscriberRequestDto $createSubscriberRe } else { throw new \novu\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['409'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\novu\Models\Errors\SubscriberResponseDto', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + throw $obj->toException(); + } else { + throw new \novu\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } } elseif (Utils\Utils::matchStatusCodes($statusCode, ['414'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -162,7 +181,7 @@ public function create(Components\CreateSubscriberRequestDto $createSubscriberRe } else { throw new \novu\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '403', '404', '405', '409', '413', '415'])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '403', '404', '405', '413', '415'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -1110,10 +1129,10 @@ public function createBulk(Components\BulkSubscriberCreateDto $bulkSubscriberCre } /** - * Update provider credentials + * Upsert provider credentials * - * Update credentials for a provider such as slack and push tokens. - * **providerId** is required field. This API appends the **deviceTokens** to the existing ones. + * Upsert credentials for a provider such as slack and push tokens. + * **providerId** is required field. This API creates **deviceTokens** or appends to the existing ones. * * @param Components\UpdateSubscriberChannelRequestDto $updateSubscriberChannelRequestDto * @param string $subscriberId diff --git a/src/SubscribersCredentials.php b/src/SubscribersCredentials.php index f9deb39..54df7ee 100644 --- a/src/SubscribersCredentials.php +++ b/src/SubscribersCredentials.php @@ -187,10 +187,10 @@ public function deleteProvider(string $subscriberId, string $providerId, ?string } /** - * Upsert provider credentials + * Update provider credentials * * Update credentials for a provider such as **slack** and **FCM**. - * **providerId** is required field. This API replaces the existing deviceTokens with the provided ones. + * **providerId** is required field. This API creates the **deviceTokens** or replaces the existing ones. * * @param Components\UpdateSubscriberChannelRequestDto $updateSubscriberChannelRequestDto * @param string $subscriberId diff --git a/src/SubscribersPreferences.php b/src/SubscribersPreferences.php index a1f6c34..d868aca 100644 --- a/src/SubscribersPreferences.php +++ b/src/SubscribersPreferences.php @@ -53,11 +53,12 @@ public function getUrl(string $baseUrl, array $urlVariables): string * This API returns all five channels preferences for all workflows and global preferences. * * @param string $subscriberId + * @param Operations\Criticality $criticality * @param ?string $idempotencyKey * @return Operations\SubscribersControllerGetSubscriberPreferencesResponse * @throws \novu\Models\Errors\APIException */ - public function list(string $subscriberId, ?string $idempotencyKey = null, ?Options $options = null): Operations\SubscribersControllerGetSubscriberPreferencesResponse + public function list(string $subscriberId, Operations\Criticality $criticality, ?string $idempotencyKey = null, ?Options $options = null): Operations\SubscribersControllerGetSubscriberPreferencesResponse { $retryConfig = null; if ($options) { @@ -88,12 +89,15 @@ public function list(string $subscriberId, ?string $idempotencyKey = null, ?Opti } $request = new Operations\SubscribersControllerGetSubscriberPreferencesRequest( subscriberId: $subscriberId, + criticality: $criticality, idempotencyKey: $idempotencyKey, ); $baseUrl = $this->sdkConfiguration->getTemplatedServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v2/subscribers/{subscriberId}/preferences', Operations\SubscribersControllerGetSubscriberPreferencesRequest::class, $request); $urlOverride = null; $httpOptions = ['http_errors' => false]; + + $qp = Utils\Utils::getQueryParams(Operations\SubscribersControllerGetSubscriberPreferencesRequest::class, $request, $urlOverride); $httpOptions = array_merge_recursive($httpOptions, Utils\Utils::getHeaders($request)); if (! array_key_exists('headers', $httpOptions)) { $httpOptions['headers'] = []; @@ -103,6 +107,7 @@ public function list(string $subscriberId, ?string $idempotencyKey = null, ?Opti $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); $hookContext = new HookContext($this->sdkConfiguration, $baseUrl, 'SubscribersController_getSubscriberPreferences', [], $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $httpOptions['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { diff --git a/src/Topics.php b/src/Topics.php index 2cc4baa..a6ff64d 100644 --- a/src/Topics.php +++ b/src/Topics.php @@ -645,14 +645,15 @@ public function update(Components\UpdateTopicRequestDto $updateTopicRequestDto, /** * Create a topic * - * Creates a new topic if it does not exist, or updates an existing topic if it already exists + * Creates a new topic if it does not exist, or updates an existing topic if it already exists. Use ?failIfExists=true to prevent updates. * * @param Components\CreateUpdateTopicRequestDto $createUpdateTopicRequestDto + * @param ?bool $failIfExists * @param ?string $idempotencyKey * @return Operations\TopicsControllerUpsertTopicResponse * @throws \novu\Models\Errors\APIException */ - public function create(Components\CreateUpdateTopicRequestDto $createUpdateTopicRequestDto, ?string $idempotencyKey = null, ?Options $options = null): Operations\TopicsControllerUpsertTopicResponse + public function create(Components\CreateUpdateTopicRequestDto $createUpdateTopicRequestDto, ?bool $failIfExists = null, ?string $idempotencyKey = null, ?Options $options = null): Operations\TopicsControllerUpsertTopicResponse { $retryConfig = null; if ($options) { @@ -683,6 +684,7 @@ public function create(Components\CreateUpdateTopicRequestDto $createUpdateTopic } $request = new Operations\TopicsControllerUpsertTopicRequest( createUpdateTopicRequestDto: $createUpdateTopicRequestDto, + failIfExists: $failIfExists, idempotencyKey: $idempotencyKey, ); $baseUrl = $this->sdkConfiguration->getTemplatedServerUrl(); @@ -694,6 +696,8 @@ public function create(Components\CreateUpdateTopicRequestDto $createUpdateTopic throw new \Exception('Request body is required'); } $httpOptions = array_merge_recursive($httpOptions, $body); + + $qp = Utils\Utils::getQueryParams(Operations\TopicsControllerUpsertTopicRequest::class, $request, $urlOverride); $httpOptions = array_merge_recursive($httpOptions, Utils\Utils::getHeaders($request)); if (! array_key_exists('headers', $httpOptions)) { $httpOptions['headers'] = []; @@ -703,6 +707,7 @@ public function create(Components\CreateUpdateTopicRequestDto $createUpdateTopic $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); $hookContext = new HookContext($this->sdkConfiguration, $baseUrl, 'TopicsController_upsertTopic', [], $this->sdkConfiguration->securitySource); $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $httpOptions['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp); $httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions); $httpRequest = Utils\Utils::removeHeaders($httpRequest); try { @@ -736,6 +741,17 @@ public function create(Components\CreateUpdateTopicRequestDto $createUpdateTopic } else { throw new \novu\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['409'])) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\novu\Models\Errors\TopicResponseDto', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + throw $obj->toException(); + } else { + throw new \novu\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } } elseif (Utils\Utils::matchStatusCodes($statusCode, ['414'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -747,7 +763,7 @@ public function create(Components\CreateUpdateTopicRequestDto $createUpdateTopic } else { throw new \novu\Models\Errors\APIException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '403', '404', '405', '409', '413', '415'])) { + } elseif (Utils\Utils::matchStatusCodes($statusCode, ['400', '401', '403', '404', '405', '413', '415'])) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse);