@51eat/sdk 0.0.19 → 0.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -18
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/Client.d.ts +6 -0
- package/dist/cjs/Client.js +20 -10
- package/dist/cjs/api/resources/business/client/Client.d.ts +6 -0
- package/dist/cjs/api/resources/business/client/Client.js +14 -4
- package/dist/cjs/api/resources/business/resources/gallery/client/Client.d.ts +86 -0
- package/dist/cjs/api/resources/business/resources/gallery/client/Client.js +364 -0
- package/dist/cjs/api/resources/business/resources/gallery/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/gallery/client/index.js +17 -0
- package/dist/cjs/api/resources/business/resources/gallery/client/requests/DeleteGalleryRequest.d.ts +10 -0
- package/dist/cjs/api/resources/business/resources/gallery/client/requests/DeleteGalleryRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/gallery/client/requests/ReorderGalleryRequest.d.ts +21 -0
- package/dist/cjs/api/resources/business/resources/gallery/client/requests/ReorderGalleryRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/gallery/client/requests/StoreGalleryPhotoRequest.d.ts +11 -0
- package/dist/cjs/api/resources/business/resources/gallery/client/requests/StoreGalleryPhotoRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/gallery/client/requests/UpdateGalleryPhotoRequest.d.ts +11 -0
- package/dist/cjs/api/resources/business/resources/gallery/client/requests/UpdateGalleryPhotoRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/gallery/client/requests/index.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/gallery/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/business/resources/gallery/exports.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/gallery/exports.js +21 -0
- package/dist/cjs/api/resources/business/resources/gallery/index.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/gallery/index.js +18 -0
- package/dist/cjs/api/resources/business/resources/gallery/types/DeleteGalleryResponse.d.ts +9 -0
- package/dist/cjs/api/resources/business/resources/gallery/types/DeleteGalleryResponse.js +10 -0
- package/dist/cjs/api/resources/business/resources/gallery/types/ListGalleryResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/gallery/types/ListGalleryResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/gallery/types/ReorderGalleryResponse.d.ts +9 -0
- package/dist/cjs/api/resources/business/resources/gallery/types/ReorderGalleryResponse.js +10 -0
- package/dist/cjs/api/resources/business/resources/gallery/types/UpdateGalleryResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/gallery/types/UpdateGalleryResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/gallery/types/UploadGalleryResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/gallery/types/UploadGalleryResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/gallery/types/index.d.ts +5 -0
- package/dist/cjs/api/resources/business/resources/gallery/types/index.js +21 -0
- package/dist/cjs/api/resources/business/resources/index.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/index.js +5 -1
- package/dist/cjs/api/resources/business/resources/messaging/client/Client.d.ts +15 -0
- package/dist/cjs/api/resources/business/resources/messaging/client/Client.js +21 -0
- package/dist/cjs/api/resources/business/resources/messaging/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/messaging/client/index.js +2 -0
- package/dist/cjs/api/resources/business/resources/messaging/exports.d.ts +3 -0
- package/dist/cjs/api/resources/business/resources/messaging/exports.js +22 -0
- package/dist/cjs/api/resources/business/resources/messaging/index.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/messaging/index.js +18 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/conversations/client/Client.d.ts +45 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/conversations/client/Client.js +182 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/conversations/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/conversations/client/index.js +17 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/conversations/client/requests/GetConversationsRequest.d.ts +10 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/conversations/client/requests/GetConversationsRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/conversations/client/requests/ListConversationsRequest.d.ts +10 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/conversations/client/requests/ListConversationsRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/conversations/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/conversations/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/conversations/exports.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/conversations/exports.js +21 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/conversations/index.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/conversations/index.js +18 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/conversations/types/GetConversationsResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/conversations/types/GetConversationsResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/conversations/types/ListConversationsResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/conversations/types/ListConversationsResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/conversations/types/index.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/conversations/types/index.js +18 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/index.d.ts +6 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/index.js +45 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/messages/client/Client.d.ts +81 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/messages/client/Client.js +312 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/messages/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/messages/client/index.js +17 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/messages/client/requests/ListMessagesRequest.d.ts +14 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/messages/client/requests/ListMessagesRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/messages/client/requests/MarkAsReadMessagesRequest.d.ts +10 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/messages/client/requests/MarkAsReadMessagesRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/messages/client/requests/StoreMessageRequest.d.ts +22 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/messages/client/requests/StoreMessageRequest.js +12 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/messages/client/requests/UnreadCountMessagesRequest.d.ts +10 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/messages/client/requests/UnreadCountMessagesRequest.js +3 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/messages/client/requests/index.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/messages/client/requests/index.js +5 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/messages/exports.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/messages/exports.js +21 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/messages/index.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/messages/index.js +18 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/messages/types/ListMessagesResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/messages/types/ListMessagesResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/messages/types/SendMessagesResponse.d.ts +4 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/messages/types/SendMessagesResponse.js +3 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/messages/types/index.d.ts +2 -0
- package/dist/cjs/api/resources/business/resources/messaging/resources/messages/types/index.js +18 -0
- package/dist/cjs/api/resources/businessMessaging/client/Client.d.ts +32 -0
- package/dist/cjs/api/resources/businessMessaging/client/Client.js +118 -0
- package/dist/cjs/api/resources/businessMessaging/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/businessMessaging/client/index.js +17 -0
- package/dist/cjs/api/resources/businessMessaging/client/requests/BusinessChannelAuthAuthenticateRequest.d.ts +13 -0
- package/dist/cjs/api/resources/businessMessaging/client/requests/BusinessChannelAuthAuthenticateRequest.js +3 -0
- package/dist/cjs/api/resources/businessMessaging/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/businessMessaging/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/businessMessaging/exports.d.ts +2 -0
- package/dist/cjs/api/resources/businessMessaging/exports.js +21 -0
- package/dist/cjs/api/resources/businessMessaging/index.d.ts +1 -0
- package/dist/cjs/api/resources/businessMessaging/index.js +17 -0
- package/dist/cjs/api/resources/businessPushNotifications/client/Client.d.ts +47 -0
- package/dist/cjs/api/resources/businessPushNotifications/client/Client.js +182 -0
- package/dist/cjs/api/resources/businessPushNotifications/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/businessPushNotifications/client/index.js +17 -0
- package/dist/cjs/api/resources/businessPushNotifications/client/requests/UnregisterBusinessPushTokenRequest.d.ts +9 -0
- package/dist/cjs/api/resources/businessPushNotifications/client/requests/UnregisterBusinessPushTokenRequest.js +3 -0
- package/dist/cjs/api/resources/businessPushNotifications/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/businessPushNotifications/client/requests/index.js +5 -0
- package/dist/cjs/api/resources/businessPushNotifications/exports.d.ts +2 -0
- package/dist/cjs/api/resources/businessPushNotifications/exports.js +21 -0
- package/dist/cjs/api/resources/businessPushNotifications/index.d.ts +2 -0
- package/dist/cjs/api/resources/businessPushNotifications/index.js +18 -0
- package/dist/cjs/api/resources/businessPushNotifications/types/RegisterBusinessPushTokenResponse.d.ts +7 -0
- package/dist/cjs/api/resources/businessPushNotifications/types/RegisterBusinessPushTokenResponse.js +3 -0
- package/dist/cjs/api/resources/businessPushNotifications/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/businessPushNotifications/types/index.js +17 -0
- package/dist/cjs/api/resources/customer/resources/pushNotifications/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/customer/resources/pushNotifications/client/Client.js +1 -1
- package/dist/cjs/api/resources/customer/resources/pushNotifications/client/requests/AppHttpRequestsApiV1CustomerPushTokensStorePushTokenRequest.d.ts +19 -0
- package/dist/cjs/api/resources/customer/resources/pushNotifications/client/requests/AppHttpRequestsApiV1CustomerPushTokensStorePushTokenRequest.js +11 -0
- package/dist/cjs/api/resources/customer/resources/pushNotifications/client/requests/index.d.ts +1 -1
- package/dist/cjs/api/resources/customer/resources/pushNotifications/client/requests/index.js +3 -3
- package/dist/cjs/api/resources/index.d.ts +5 -0
- package/dist/cjs/api/resources/index.js +6 -1
- package/dist/cjs/api/types/BusinessConversation.d.ts +20 -0
- package/dist/cjs/api/types/BusinessConversation.js +3 -0
- package/dist/cjs/api/types/BusinessMessage.d.ts +20 -0
- package/dist/cjs/api/types/BusinessMessage.js +3 -0
- package/dist/cjs/api/types/BusinessPhoto.d.ts +9 -0
- package/dist/cjs/api/types/BusinessPhoto.js +3 -0
- package/dist/cjs/api/types/index.d.ts +3 -0
- package/dist/cjs/api/types/index.js +3 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/Client.d.mts +6 -0
- package/dist/esm/Client.mjs +10 -0
- package/dist/esm/api/resources/business/client/Client.d.mts +6 -0
- package/dist/esm/api/resources/business/client/Client.mjs +10 -0
- package/dist/esm/api/resources/business/resources/gallery/client/Client.d.mts +86 -0
- package/dist/esm/api/resources/business/resources/gallery/client/Client.mjs +327 -0
- package/dist/esm/api/resources/business/resources/gallery/client/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/gallery/client/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/gallery/client/requests/DeleteGalleryRequest.d.mts +10 -0
- package/dist/esm/api/resources/business/resources/gallery/client/requests/DeleteGalleryRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/gallery/client/requests/ReorderGalleryRequest.d.mts +21 -0
- package/dist/esm/api/resources/business/resources/gallery/client/requests/ReorderGalleryRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/gallery/client/requests/StoreGalleryPhotoRequest.d.mts +11 -0
- package/dist/esm/api/resources/business/resources/gallery/client/requests/StoreGalleryPhotoRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/gallery/client/requests/UpdateGalleryPhotoRequest.d.mts +11 -0
- package/dist/esm/api/resources/business/resources/gallery/client/requests/UpdateGalleryPhotoRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/gallery/client/requests/index.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/gallery/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/gallery/exports.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/gallery/exports.mjs +3 -0
- package/dist/esm/api/resources/business/resources/gallery/index.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/gallery/index.mjs +2 -0
- package/dist/esm/api/resources/business/resources/gallery/types/DeleteGalleryResponse.d.mts +9 -0
- package/dist/esm/api/resources/business/resources/gallery/types/DeleteGalleryResponse.mjs +7 -0
- package/dist/esm/api/resources/business/resources/gallery/types/ListGalleryResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/gallery/types/ListGalleryResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/gallery/types/ReorderGalleryResponse.d.mts +9 -0
- package/dist/esm/api/resources/business/resources/gallery/types/ReorderGalleryResponse.mjs +7 -0
- package/dist/esm/api/resources/business/resources/gallery/types/UpdateGalleryResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/gallery/types/UpdateGalleryResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/gallery/types/UploadGalleryResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/gallery/types/UploadGalleryResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/gallery/types/index.d.mts +5 -0
- package/dist/esm/api/resources/business/resources/gallery/types/index.mjs +5 -0
- package/dist/esm/api/resources/business/resources/index.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/index.mjs +4 -0
- package/dist/esm/api/resources/business/resources/messaging/client/Client.d.mts +15 -0
- package/dist/esm/api/resources/business/resources/messaging/client/Client.mjs +17 -0
- package/dist/esm/api/resources/business/resources/messaging/client/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/messaging/client/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/messaging/exports.d.mts +3 -0
- package/dist/esm/api/resources/business/resources/messaging/exports.mjs +4 -0
- package/dist/esm/api/resources/business/resources/messaging/index.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/messaging/index.mjs +2 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/conversations/client/Client.d.mts +45 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/conversations/client/Client.mjs +145 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/conversations/client/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/conversations/client/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/conversations/client/requests/GetConversationsRequest.d.mts +10 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/conversations/client/requests/GetConversationsRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/conversations/client/requests/ListConversationsRequest.d.mts +10 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/conversations/client/requests/ListConversationsRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/conversations/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/conversations/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/conversations/exports.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/conversations/exports.mjs +3 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/conversations/index.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/conversations/index.mjs +2 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/conversations/types/GetConversationsResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/conversations/types/GetConversationsResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/conversations/types/ListConversationsResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/conversations/types/ListConversationsResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/conversations/types/index.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/conversations/types/index.mjs +2 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/index.d.mts +6 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/index.mjs +6 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/messages/client/Client.d.mts +81 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/messages/client/Client.mjs +275 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/messages/client/index.d.mts +1 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/messages/client/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/messages/client/requests/ListMessagesRequest.d.mts +14 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/messages/client/requests/ListMessagesRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/messages/client/requests/MarkAsReadMessagesRequest.d.mts +10 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/messages/client/requests/MarkAsReadMessagesRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/messages/client/requests/StoreMessageRequest.d.mts +22 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/messages/client/requests/StoreMessageRequest.mjs +9 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/messages/client/requests/UnreadCountMessagesRequest.d.mts +10 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/messages/client/requests/UnreadCountMessagesRequest.mjs +2 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/messages/client/requests/index.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/messages/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/messages/exports.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/messages/exports.mjs +3 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/messages/index.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/messages/index.mjs +2 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/messages/types/ListMessagesResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/messages/types/ListMessagesResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/messages/types/SendMessagesResponse.d.mts +4 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/messages/types/SendMessagesResponse.mjs +2 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/messages/types/index.d.mts +2 -0
- package/dist/esm/api/resources/business/resources/messaging/resources/messages/types/index.mjs +2 -0
- package/dist/esm/api/resources/businessMessaging/client/Client.d.mts +32 -0
- package/dist/esm/api/resources/businessMessaging/client/Client.mjs +81 -0
- package/dist/esm/api/resources/businessMessaging/client/index.d.mts +1 -0
- package/dist/esm/api/resources/businessMessaging/client/index.mjs +1 -0
- package/dist/esm/api/resources/businessMessaging/client/requests/BusinessChannelAuthAuthenticateRequest.d.mts +13 -0
- package/dist/esm/api/resources/businessMessaging/client/requests/BusinessChannelAuthAuthenticateRequest.mjs +2 -0
- package/dist/esm/api/resources/businessMessaging/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/businessMessaging/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/businessMessaging/exports.d.mts +2 -0
- package/dist/esm/api/resources/businessMessaging/exports.mjs +3 -0
- package/dist/esm/api/resources/businessMessaging/index.d.mts +1 -0
- package/dist/esm/api/resources/businessMessaging/index.mjs +1 -0
- package/dist/esm/api/resources/businessPushNotifications/client/Client.d.mts +47 -0
- package/dist/esm/api/resources/businessPushNotifications/client/Client.mjs +145 -0
- package/dist/esm/api/resources/businessPushNotifications/client/index.d.mts +1 -0
- package/dist/esm/api/resources/businessPushNotifications/client/index.mjs +1 -0
- package/dist/esm/api/resources/businessPushNotifications/client/requests/UnregisterBusinessPushTokenRequest.d.mts +9 -0
- package/dist/esm/api/resources/businessPushNotifications/client/requests/UnregisterBusinessPushTokenRequest.mjs +2 -0
- package/dist/esm/api/resources/businessPushNotifications/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/businessPushNotifications/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/businessPushNotifications/exports.d.mts +2 -0
- package/dist/esm/api/resources/businessPushNotifications/exports.mjs +3 -0
- package/dist/esm/api/resources/businessPushNotifications/index.d.mts +2 -0
- package/dist/esm/api/resources/businessPushNotifications/index.mjs +2 -0
- package/dist/esm/api/resources/businessPushNotifications/types/RegisterBusinessPushTokenResponse.d.mts +7 -0
- package/dist/esm/api/resources/businessPushNotifications/types/RegisterBusinessPushTokenResponse.mjs +2 -0
- package/dist/esm/api/resources/businessPushNotifications/types/index.d.mts +1 -0
- package/dist/esm/api/resources/businessPushNotifications/types/index.mjs +1 -0
- package/dist/esm/api/resources/customer/resources/pushNotifications/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/customer/resources/pushNotifications/client/Client.mjs +1 -1
- package/dist/esm/api/resources/customer/resources/pushNotifications/client/requests/AppHttpRequestsApiV1CustomerPushTokensStorePushTokenRequest.d.mts +19 -0
- package/dist/esm/api/resources/customer/resources/pushNotifications/client/requests/AppHttpRequestsApiV1CustomerPushTokensStorePushTokenRequest.mjs +8 -0
- package/dist/esm/api/resources/customer/resources/pushNotifications/client/requests/index.d.mts +1 -1
- package/dist/esm/api/resources/customer/resources/pushNotifications/client/requests/index.mjs +1 -1
- package/dist/esm/api/resources/index.d.mts +5 -0
- package/dist/esm/api/resources/index.mjs +5 -0
- package/dist/esm/api/types/BusinessConversation.d.mts +20 -0
- package/dist/esm/api/types/BusinessConversation.mjs +2 -0
- package/dist/esm/api/types/BusinessMessage.d.mts +20 -0
- package/dist/esm/api/types/BusinessMessage.mjs +2 -0
- package/dist/esm/api/types/BusinessPhoto.d.mts +9 -0
- package/dist/esm/api/types/BusinessPhoto.mjs +2 -0
- package/dist/esm/api/types/index.d.mts +3 -0
- package/dist/esm/api/types/index.mjs +3 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +67 -1
- package/reference.md +1116 -271
- /package/dist/cjs/api/resources/{customer/resources/pushNotifications → businessPushNotifications}/client/requests/StorePushTokenRequest.d.ts +0 -0
- /package/dist/cjs/api/resources/{customer/resources/pushNotifications → businessPushNotifications}/client/requests/StorePushTokenRequest.js +0 -0
- /package/dist/esm/api/resources/{customer/resources/pushNotifications → businessPushNotifications}/client/requests/StorePushTokenRequest.d.mts +0 -0
- /package/dist/esm/api/resources/{customer/resources/pushNotifications → businessPushNotifications}/client/requests/StorePushTokenRequest.mjs +0 -0
package/dist/esm/api/resources/business/resources/messaging/resources/messages/client/Client.mjs
ADDED
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
+
t[p[i]] = s[p[i]];
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
};
|
|
22
|
+
import { normalizeClientOptionsWithAuth, } from "../../../../../../../../BaseClient.mjs";
|
|
23
|
+
import { mergeHeaders } from "../../../../../../../../core/headers.mjs";
|
|
24
|
+
import * as core from "../../../../../../../../core/index.mjs";
|
|
25
|
+
import * as environments from "../../../../../../../../environments.mjs";
|
|
26
|
+
import { handleNonStatusCodeError } from "../../../../../../../../errors/handleNonStatusCodeError.mjs";
|
|
27
|
+
import * as errors from "../../../../../../../../errors/index.mjs";
|
|
28
|
+
import * as FiveOneEat from "../../../../../../../index.mjs";
|
|
29
|
+
export class MessagesClient {
|
|
30
|
+
constructor(options = {}) {
|
|
31
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Retrieve a paginated list of all messages in a specific conversation,
|
|
35
|
+
* ordered by creation time (oldest first).
|
|
36
|
+
*
|
|
37
|
+
* @param {FiveOneEat.business.messaging.ListMessagesRequest} request
|
|
38
|
+
* @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
39
|
+
*
|
|
40
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
41
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
42
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* await client.business.messaging.messages.list({
|
|
46
|
+
* conversation: "550e8400-e29b-41d4-a716-446655440000"
|
|
47
|
+
* })
|
|
48
|
+
*/
|
|
49
|
+
list(request, requestOptions) {
|
|
50
|
+
return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions));
|
|
51
|
+
}
|
|
52
|
+
__list(request, requestOptions) {
|
|
53
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
54
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
55
|
+
const { conversation, page, per_page: perPage } = request;
|
|
56
|
+
const _queryParams = {
|
|
57
|
+
page,
|
|
58
|
+
per_page: perPage,
|
|
59
|
+
};
|
|
60
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
61
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
62
|
+
const _response = yield core.fetcher({
|
|
63
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production, `business/messaging/conversations/${core.url.encodePathParam(conversation)}/messages`),
|
|
64
|
+
method: "GET",
|
|
65
|
+
headers: _headers,
|
|
66
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
67
|
+
queryString: core.url
|
|
68
|
+
.queryBuilder()
|
|
69
|
+
.addMany(_queryParams)
|
|
70
|
+
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
71
|
+
.build(),
|
|
72
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
73
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
74
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
75
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
76
|
+
logging: this._options.logging,
|
|
77
|
+
});
|
|
78
|
+
if (_response.ok) {
|
|
79
|
+
return {
|
|
80
|
+
data: _response.body,
|
|
81
|
+
rawResponse: _response.rawResponse,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
if (_response.error.reason === "status-code") {
|
|
85
|
+
switch (_response.error.statusCode) {
|
|
86
|
+
case 401:
|
|
87
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
88
|
+
case 403:
|
|
89
|
+
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
90
|
+
case 422:
|
|
91
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
92
|
+
default:
|
|
93
|
+
throw new errors.FiveOneEatError({
|
|
94
|
+
statusCode: _response.error.statusCode,
|
|
95
|
+
body: _response.error.body,
|
|
96
|
+
rawResponse: _response.rawResponse,
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/business/messaging/conversations/{conversation}/messages");
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Send a new message to a specific conversation as the business.
|
|
105
|
+
*
|
|
106
|
+
* @param {FiveOneEat.business.messaging.StoreMessageRequest} request
|
|
107
|
+
* @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
108
|
+
*
|
|
109
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
110
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
111
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* await client.business.messaging.messages.send({
|
|
115
|
+
* conversation: "550e8400-e29b-41d4-a716-446655440000",
|
|
116
|
+
* content: "content"
|
|
117
|
+
* })
|
|
118
|
+
*/
|
|
119
|
+
send(request, requestOptions) {
|
|
120
|
+
return core.HttpResponsePromise.fromPromise(this.__send(request, requestOptions));
|
|
121
|
+
}
|
|
122
|
+
__send(request, requestOptions) {
|
|
123
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
124
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
125
|
+
const { conversation } = request, _body = __rest(request, ["conversation"]);
|
|
126
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
127
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
128
|
+
const _response = yield core.fetcher({
|
|
129
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production, `business/messaging/conversations/${core.url.encodePathParam(conversation)}/messages`),
|
|
130
|
+
method: "POST",
|
|
131
|
+
headers: _headers,
|
|
132
|
+
contentType: "application/json",
|
|
133
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
134
|
+
requestType: "json",
|
|
135
|
+
body: _body,
|
|
136
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
137
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
138
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
139
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
140
|
+
logging: this._options.logging,
|
|
141
|
+
});
|
|
142
|
+
if (_response.ok) {
|
|
143
|
+
return {
|
|
144
|
+
data: _response.body,
|
|
145
|
+
rawResponse: _response.rawResponse,
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
if (_response.error.reason === "status-code") {
|
|
149
|
+
switch (_response.error.statusCode) {
|
|
150
|
+
case 401:
|
|
151
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
152
|
+
case 403:
|
|
153
|
+
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
154
|
+
case 422:
|
|
155
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
156
|
+
default:
|
|
157
|
+
throw new errors.FiveOneEatError({
|
|
158
|
+
statusCode: _response.error.statusCode,
|
|
159
|
+
body: _response.error.body,
|
|
160
|
+
rawResponse: _response.rawResponse,
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/business/messaging/conversations/{conversation}/messages");
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Mark all messages from the customer as read by the business user.
|
|
169
|
+
*
|
|
170
|
+
* @param {FiveOneEat.business.messaging.MarkAsReadMessagesRequest} request
|
|
171
|
+
* @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
172
|
+
*
|
|
173
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
174
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
175
|
+
*
|
|
176
|
+
* @example
|
|
177
|
+
* await client.business.messaging.messages.markAsRead({
|
|
178
|
+
* conversation: "550e8400-e29b-41d4-a716-446655440000"
|
|
179
|
+
* })
|
|
180
|
+
*/
|
|
181
|
+
markAsRead(request, requestOptions) {
|
|
182
|
+
return core.HttpResponsePromise.fromPromise(this.__markAsRead(request, requestOptions));
|
|
183
|
+
}
|
|
184
|
+
__markAsRead(request, requestOptions) {
|
|
185
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
186
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
187
|
+
const { conversation } = request;
|
|
188
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
189
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
190
|
+
const _response = yield core.fetcher({
|
|
191
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production, `business/messaging/conversations/${core.url.encodePathParam(conversation)}/messages/mark-read`),
|
|
192
|
+
method: "POST",
|
|
193
|
+
headers: _headers,
|
|
194
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
195
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
196
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
197
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
198
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
199
|
+
logging: this._options.logging,
|
|
200
|
+
});
|
|
201
|
+
if (_response.ok) {
|
|
202
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
203
|
+
}
|
|
204
|
+
if (_response.error.reason === "status-code") {
|
|
205
|
+
switch (_response.error.statusCode) {
|
|
206
|
+
case 401:
|
|
207
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
208
|
+
case 403:
|
|
209
|
+
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
210
|
+
default:
|
|
211
|
+
throw new errors.FiveOneEatError({
|
|
212
|
+
statusCode: _response.error.statusCode,
|
|
213
|
+
body: _response.error.body,
|
|
214
|
+
rawResponse: _response.rawResponse,
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/business/messaging/conversations/{conversation}/messages/mark-read");
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Get the count of unread messages from the customer in a specific conversation.
|
|
223
|
+
*
|
|
224
|
+
* @param {FiveOneEat.business.messaging.UnreadCountMessagesRequest} request
|
|
225
|
+
* @param {MessagesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
226
|
+
*
|
|
227
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
228
|
+
* @throws {@link FiveOneEat.ForbiddenError}
|
|
229
|
+
*
|
|
230
|
+
* @example
|
|
231
|
+
* await client.business.messaging.messages.unreadCount({
|
|
232
|
+
* conversation: "550e8400-e29b-41d4-a716-446655440000"
|
|
233
|
+
* })
|
|
234
|
+
*/
|
|
235
|
+
unreadCount(request, requestOptions) {
|
|
236
|
+
return core.HttpResponsePromise.fromPromise(this.__unreadCount(request, requestOptions));
|
|
237
|
+
}
|
|
238
|
+
__unreadCount(request, requestOptions) {
|
|
239
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
240
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
241
|
+
const { conversation } = request;
|
|
242
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
243
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
244
|
+
const _response = yield core.fetcher({
|
|
245
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production, `business/messaging/conversations/${core.url.encodePathParam(conversation)}/messages/unread-count`),
|
|
246
|
+
method: "GET",
|
|
247
|
+
headers: _headers,
|
|
248
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
249
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
250
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
251
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
252
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
253
|
+
logging: this._options.logging,
|
|
254
|
+
});
|
|
255
|
+
if (_response.ok) {
|
|
256
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
257
|
+
}
|
|
258
|
+
if (_response.error.reason === "status-code") {
|
|
259
|
+
switch (_response.error.statusCode) {
|
|
260
|
+
case 401:
|
|
261
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
262
|
+
case 403:
|
|
263
|
+
throw new FiveOneEat.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
264
|
+
default:
|
|
265
|
+
throw new errors.FiveOneEatError({
|
|
266
|
+
statusCode: _response.error.statusCode,
|
|
267
|
+
body: _response.error.body,
|
|
268
|
+
rawResponse: _response.rawResponse,
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/business/messaging/conversations/{conversation}/messages/unread-count");
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
}
|
package/dist/esm/api/resources/business/resources/messaging/resources/messages/client/index.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
package/dist/esm/api/resources/business/resources/messaging/resources/messages/client/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* conversation: "550e8400-e29b-41d4-a716-446655440000"
|
|
5
|
+
* }
|
|
6
|
+
*/
|
|
7
|
+
export interface ListMessagesRequest {
|
|
8
|
+
/** The conversation ID */
|
|
9
|
+
conversation: string;
|
|
10
|
+
/** Page number for pagination */
|
|
11
|
+
page?: number;
|
|
12
|
+
/** Number of messages per page */
|
|
13
|
+
per_page?: number;
|
|
14
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* conversation: "550e8400-e29b-41d4-a716-446655440000",
|
|
5
|
+
* content: "content"
|
|
6
|
+
* }
|
|
7
|
+
*/
|
|
8
|
+
export interface StoreMessageRequest {
|
|
9
|
+
/** The conversation ID */
|
|
10
|
+
conversation: string;
|
|
11
|
+
content: string;
|
|
12
|
+
message_type?: StoreMessageRequest.MessageType | null;
|
|
13
|
+
metadata?: string[] | null;
|
|
14
|
+
}
|
|
15
|
+
export declare namespace StoreMessageRequest {
|
|
16
|
+
const MessageType: {
|
|
17
|
+
readonly Text: "text";
|
|
18
|
+
readonly Image: "image";
|
|
19
|
+
readonly File: "file";
|
|
20
|
+
};
|
|
21
|
+
type MessageType = (typeof MessageType)[keyof typeof MessageType];
|
|
22
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
export var StoreMessageRequest;
|
|
3
|
+
(function (StoreMessageRequest) {
|
|
4
|
+
StoreMessageRequest.MessageType = {
|
|
5
|
+
Text: "text",
|
|
6
|
+
Image: "image",
|
|
7
|
+
File: "file",
|
|
8
|
+
};
|
|
9
|
+
})(StoreMessageRequest || (StoreMessageRequest = {}));
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type { ListMessagesRequest } from "./ListMessagesRequest.mjs";
|
|
2
|
+
export type { MarkAsReadMessagesRequest } from "./MarkAsReadMessagesRequest.mjs";
|
|
3
|
+
export { StoreMessageRequest } from "./StoreMessageRequest.mjs";
|
|
4
|
+
export type { UnreadCountMessagesRequest } from "./UnreadCountMessagesRequest.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { StoreMessageRequest } from "./StoreMessageRequest.mjs";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
3
|
+
import * as core from "../../../../core/index.mjs";
|
|
4
|
+
import * as FiveOneEat from "../../../index.mjs";
|
|
5
|
+
export declare namespace BusinessMessagingClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class BusinessMessagingClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<BusinessMessagingClient.Options>;
|
|
12
|
+
constructor(options?: BusinessMessagingClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* This endpoint is used by the business companion mobile app to authenticate with
|
|
15
|
+
* Pusher channels. It validates that the authenticated business user has
|
|
16
|
+
* permission to access the requested channel, scoped to their active business.
|
|
17
|
+
*
|
|
18
|
+
* @param {FiveOneEat.BusinessChannelAuthAuthenticateRequest} request
|
|
19
|
+
* @param {BusinessMessagingClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
20
|
+
*
|
|
21
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
22
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* await client.businessMessaging.businessChannelAuthAuthenticate({
|
|
26
|
+
* channel_name: "channel_name",
|
|
27
|
+
* socket_id: "socket_id"
|
|
28
|
+
* })
|
|
29
|
+
*/
|
|
30
|
+
businessChannelAuthAuthenticate(request: FiveOneEat.BusinessChannelAuthAuthenticateRequest, requestOptions?: BusinessMessagingClient.RequestOptions): core.HttpResponsePromise<number>;
|
|
31
|
+
private __businessChannelAuthAuthenticate;
|
|
32
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
12
|
+
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
13
|
+
import * as core from "../../../../core/index.mjs";
|
|
14
|
+
import * as environments from "../../../../environments.mjs";
|
|
15
|
+
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
|
|
16
|
+
import * as errors from "../../../../errors/index.mjs";
|
|
17
|
+
import * as FiveOneEat from "../../../index.mjs";
|
|
18
|
+
export class BusinessMessagingClient {
|
|
19
|
+
constructor(options = {}) {
|
|
20
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* This endpoint is used by the business companion mobile app to authenticate with
|
|
24
|
+
* Pusher channels. It validates that the authenticated business user has
|
|
25
|
+
* permission to access the requested channel, scoped to their active business.
|
|
26
|
+
*
|
|
27
|
+
* @param {FiveOneEat.BusinessChannelAuthAuthenticateRequest} request
|
|
28
|
+
* @param {BusinessMessagingClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
29
|
+
*
|
|
30
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
31
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* await client.businessMessaging.businessChannelAuthAuthenticate({
|
|
35
|
+
* channel_name: "channel_name",
|
|
36
|
+
* socket_id: "socket_id"
|
|
37
|
+
* })
|
|
38
|
+
*/
|
|
39
|
+
businessChannelAuthAuthenticate(request, requestOptions) {
|
|
40
|
+
return core.HttpResponsePromise.fromPromise(this.__businessChannelAuthAuthenticate(request, requestOptions));
|
|
41
|
+
}
|
|
42
|
+
__businessChannelAuthAuthenticate(request, requestOptions) {
|
|
43
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
45
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
46
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
47
|
+
const _response = yield core.fetcher({
|
|
48
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FiveOneEatEnvironment.Production, "business/channels/auth"),
|
|
49
|
+
method: "POST",
|
|
50
|
+
headers: _headers,
|
|
51
|
+
contentType: "application/json",
|
|
52
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
53
|
+
requestType: "json",
|
|
54
|
+
body: request,
|
|
55
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
56
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
57
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
58
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
59
|
+
logging: this._options.logging,
|
|
60
|
+
});
|
|
61
|
+
if (_response.ok) {
|
|
62
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
63
|
+
}
|
|
64
|
+
if (_response.error.reason === "status-code") {
|
|
65
|
+
switch (_response.error.statusCode) {
|
|
66
|
+
case 401:
|
|
67
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
68
|
+
case 422:
|
|
69
|
+
throw new FiveOneEat.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
70
|
+
default:
|
|
71
|
+
throw new errors.FiveOneEatError({
|
|
72
|
+
statusCode: _response.error.statusCode,
|
|
73
|
+
body: _response.error.body,
|
|
74
|
+
rawResponse: _response.rawResponse,
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/business/channels/auth");
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { BusinessChannelAuthAuthenticateRequest } from "./BusinessChannelAuthAuthenticateRequest.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
3
|
+
import * as core from "../../../../core/index.mjs";
|
|
4
|
+
import * as FiveOneEat from "../../../index.mjs";
|
|
5
|
+
export declare namespace BusinessPushNotificationsClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class BusinessPushNotificationsClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<BusinessPushNotificationsClient.Options>;
|
|
12
|
+
constructor(options?: BusinessPushNotificationsClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* Register (or update) the authenticated business user's Expo push token for a
|
|
15
|
+
* device. If a `device_id` is provided, an existing registration for that device
|
|
16
|
+
* is updated.
|
|
17
|
+
*
|
|
18
|
+
* @param {FiveOneEat.StorePushTokenRequest} request
|
|
19
|
+
* @param {BusinessPushNotificationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
20
|
+
*
|
|
21
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
22
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* await client.businessPushNotifications.registerBusinessPushToken({
|
|
26
|
+
* token: "token"
|
|
27
|
+
* })
|
|
28
|
+
*/
|
|
29
|
+
registerBusinessPushToken(request: FiveOneEat.StorePushTokenRequest, requestOptions?: BusinessPushNotificationsClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.RegisterBusinessPushTokenResponse>;
|
|
30
|
+
private __registerBusinessPushToken;
|
|
31
|
+
/**
|
|
32
|
+
* Delete the authenticated business user's Expo push token registration.
|
|
33
|
+
*
|
|
34
|
+
* @param {FiveOneEat.UnregisterBusinessPushTokenRequest} request
|
|
35
|
+
* @param {BusinessPushNotificationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
36
|
+
*
|
|
37
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
38
|
+
* @throws {@link FiveOneEat.UnprocessableEntityError}
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* await client.businessPushNotifications.unregisterBusinessPushToken({
|
|
42
|
+
* token: "token"
|
|
43
|
+
* })
|
|
44
|
+
*/
|
|
45
|
+
unregisterBusinessPushToken(request: FiveOneEat.UnregisterBusinessPushTokenRequest, requestOptions?: BusinessPushNotificationsClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
46
|
+
private __unregisterBusinessPushToken;
|
|
47
|
+
}
|