eat518 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/LICENSE +201 -0
- package/README.md +391 -0
- package/api-promise.d.mts +2 -0
- package/api-promise.d.mts.map +1 -0
- package/api-promise.d.ts +2 -0
- package/api-promise.d.ts.map +1 -0
- package/api-promise.js +6 -0
- package/api-promise.js.map +1 -0
- package/api-promise.mjs +2 -0
- package/api-promise.mjs.map +1 -0
- package/client.d.mts +180 -0
- package/client.d.mts.map +1 -0
- package/client.d.ts +180 -0
- package/client.d.ts.map +1 -0
- package/client.js +461 -0
- package/client.js.map +1 -0
- package/client.mjs +457 -0
- package/client.mjs.map +1 -0
- package/core/api-promise.d.mts +46 -0
- package/core/api-promise.d.mts.map +1 -0
- package/core/api-promise.d.ts +46 -0
- package/core/api-promise.d.ts.map +1 -0
- package/core/api-promise.js +74 -0
- package/core/api-promise.js.map +1 -0
- package/core/api-promise.mjs +70 -0
- package/core/api-promise.mjs.map +1 -0
- package/core/error.d.mts +46 -0
- package/core/error.d.mts.map +1 -0
- package/core/error.d.ts +46 -0
- package/core/error.d.ts.map +1 -0
- package/core/error.js +113 -0
- package/core/error.js.map +1 -0
- package/core/error.mjs +97 -0
- package/core/error.mjs.map +1 -0
- package/core/resource.d.mts +6 -0
- package/core/resource.d.mts.map +1 -0
- package/core/resource.d.ts +6 -0
- package/core/resource.d.ts.map +1 -0
- package/core/resource.js +11 -0
- package/core/resource.js.map +1 -0
- package/core/resource.mjs +7 -0
- package/core/resource.mjs.map +1 -0
- package/core/uploads.d.mts +3 -0
- package/core/uploads.d.mts.map +1 -0
- package/core/uploads.d.ts +3 -0
- package/core/uploads.d.ts.map +1 -0
- package/core/uploads.js +6 -0
- package/core/uploads.js.map +1 -0
- package/core/uploads.mjs +2 -0
- package/core/uploads.mjs.map +1 -0
- package/error.d.mts +2 -0
- package/error.d.mts.map +1 -0
- package/error.d.ts +2 -0
- package/error.d.ts.map +1 -0
- package/error.js +6 -0
- package/error.js.map +1 -0
- package/error.mjs +2 -0
- package/error.mjs.map +1 -0
- package/index.d.mts +6 -0
- package/index.d.mts.map +1 -0
- package/index.d.ts +6 -0
- package/index.d.ts.map +1 -0
- package/index.js +30 -0
- package/index.js.map +1 -0
- package/index.mjs +7 -0
- package/index.mjs.map +1 -0
- package/internal/builtin-types.d.mts +73 -0
- package/internal/builtin-types.d.mts.map +1 -0
- package/internal/builtin-types.d.ts +73 -0
- package/internal/builtin-types.d.ts.map +1 -0
- package/internal/builtin-types.js +4 -0
- package/internal/builtin-types.js.map +1 -0
- package/internal/builtin-types.mjs +3 -0
- package/internal/builtin-types.mjs.map +1 -0
- package/internal/detect-platform.d.mts +15 -0
- package/internal/detect-platform.d.mts.map +1 -0
- package/internal/detect-platform.d.ts +15 -0
- package/internal/detect-platform.d.ts.map +1 -0
- package/internal/detect-platform.js +162 -0
- package/internal/detect-platform.js.map +1 -0
- package/internal/detect-platform.mjs +157 -0
- package/internal/detect-platform.mjs.map +1 -0
- package/internal/errors.d.mts +3 -0
- package/internal/errors.d.mts.map +1 -0
- package/internal/errors.d.ts +3 -0
- package/internal/errors.d.ts.map +1 -0
- package/internal/errors.js +41 -0
- package/internal/errors.js.map +1 -0
- package/internal/errors.mjs +36 -0
- package/internal/errors.mjs.map +1 -0
- package/internal/headers.d.mts +20 -0
- package/internal/headers.d.mts.map +1 -0
- package/internal/headers.d.ts +20 -0
- package/internal/headers.d.ts.map +1 -0
- package/internal/headers.js +79 -0
- package/internal/headers.js.map +1 -0
- package/internal/headers.mjs +74 -0
- package/internal/headers.mjs.map +1 -0
- package/internal/parse.d.mts +12 -0
- package/internal/parse.d.mts.map +1 -0
- package/internal/parse.d.ts +12 -0
- package/internal/parse.d.ts.map +1 -0
- package/internal/parse.js +35 -0
- package/internal/parse.js.map +1 -0
- package/internal/parse.mjs +32 -0
- package/internal/parse.mjs.map +1 -0
- package/internal/request-options.d.mts +75 -0
- package/internal/request-options.d.mts.map +1 -0
- package/internal/request-options.d.ts +75 -0
- package/internal/request-options.d.ts.map +1 -0
- package/internal/request-options.js +14 -0
- package/internal/request-options.js.map +1 -0
- package/internal/request-options.mjs +10 -0
- package/internal/request-options.mjs.map +1 -0
- package/internal/shim-types.d.mts +17 -0
- package/internal/shim-types.d.mts.map +1 -0
- package/internal/shim-types.d.ts +17 -0
- package/internal/shim-types.d.ts.map +1 -0
- package/internal/shim-types.js +4 -0
- package/internal/shim-types.js.map +1 -0
- package/internal/shim-types.mjs +3 -0
- package/internal/shim-types.mjs.map +1 -0
- package/internal/shims.d.mts +20 -0
- package/internal/shims.d.mts.map +1 -0
- package/internal/shims.d.ts +20 -0
- package/internal/shims.d.ts.map +1 -0
- package/internal/shims.js +92 -0
- package/internal/shims.js.map +1 -0
- package/internal/shims.mjs +85 -0
- package/internal/shims.mjs.map +1 -0
- package/internal/to-file.d.mts +45 -0
- package/internal/to-file.d.mts.map +1 -0
- package/internal/to-file.d.ts +45 -0
- package/internal/to-file.d.ts.map +1 -0
- package/internal/to-file.js +91 -0
- package/internal/to-file.js.map +1 -0
- package/internal/to-file.mjs +88 -0
- package/internal/to-file.mjs.map +1 -0
- package/internal/tslib.js +81 -0
- package/internal/tslib.mjs +17 -0
- package/internal/types.d.mts +69 -0
- package/internal/types.d.mts.map +1 -0
- package/internal/types.d.ts +69 -0
- package/internal/types.d.ts.map +1 -0
- package/internal/types.js +4 -0
- package/internal/types.js.map +1 -0
- package/internal/types.mjs +3 -0
- package/internal/types.mjs.map +1 -0
- package/internal/uploads.d.mts +42 -0
- package/internal/uploads.d.mts.map +1 -0
- package/internal/uploads.d.ts +42 -0
- package/internal/uploads.d.ts.map +1 -0
- package/internal/uploads.js +141 -0
- package/internal/uploads.js.map +1 -0
- package/internal/uploads.mjs +131 -0
- package/internal/uploads.mjs.map +1 -0
- package/internal/utils/base64.d.mts +3 -0
- package/internal/utils/base64.d.mts.map +1 -0
- package/internal/utils/base64.d.ts +3 -0
- package/internal/utils/base64.d.ts.map +1 -0
- package/internal/utils/base64.js +38 -0
- package/internal/utils/base64.js.map +1 -0
- package/internal/utils/base64.mjs +33 -0
- package/internal/utils/base64.mjs.map +1 -0
- package/internal/utils/bytes.d.mts +4 -0
- package/internal/utils/bytes.d.mts.map +1 -0
- package/internal/utils/bytes.d.ts +4 -0
- package/internal/utils/bytes.d.ts.map +1 -0
- package/internal/utils/bytes.js +31 -0
- package/internal/utils/bytes.js.map +1 -0
- package/internal/utils/bytes.mjs +26 -0
- package/internal/utils/bytes.mjs.map +1 -0
- package/internal/utils/env.d.mts +9 -0
- package/internal/utils/env.d.mts.map +1 -0
- package/internal/utils/env.d.ts +9 -0
- package/internal/utils/env.d.ts.map +1 -0
- package/internal/utils/env.js +22 -0
- package/internal/utils/env.js.map +1 -0
- package/internal/utils/env.mjs +18 -0
- package/internal/utils/env.mjs.map +1 -0
- package/internal/utils/log.d.mts +37 -0
- package/internal/utils/log.d.mts.map +1 -0
- package/internal/utils/log.d.ts +37 -0
- package/internal/utils/log.d.ts.map +1 -0
- package/internal/utils/log.js +85 -0
- package/internal/utils/log.js.map +1 -0
- package/internal/utils/log.mjs +79 -0
- package/internal/utils/log.mjs.map +1 -0
- package/internal/utils/path.d.mts +15 -0
- package/internal/utils/path.d.mts.map +1 -0
- package/internal/utils/path.d.ts +15 -0
- package/internal/utils/path.d.ts.map +1 -0
- package/internal/utils/path.js +79 -0
- package/internal/utils/path.js.map +1 -0
- package/internal/utils/path.mjs +74 -0
- package/internal/utils/path.mjs.map +1 -0
- package/internal/utils/sleep.d.mts +2 -0
- package/internal/utils/sleep.d.mts.map +1 -0
- package/internal/utils/sleep.d.ts +2 -0
- package/internal/utils/sleep.d.ts.map +1 -0
- package/internal/utils/sleep.js +7 -0
- package/internal/utils/sleep.js.map +1 -0
- package/internal/utils/sleep.mjs +3 -0
- package/internal/utils/sleep.mjs.map +1 -0
- package/internal/utils/uuid.d.mts +5 -0
- package/internal/utils/uuid.d.mts.map +1 -0
- package/internal/utils/uuid.d.ts +5 -0
- package/internal/utils/uuid.d.ts.map +1 -0
- package/internal/utils/uuid.js +19 -0
- package/internal/utils/uuid.js.map +1 -0
- package/internal/utils/uuid.mjs +15 -0
- package/internal/utils/uuid.mjs.map +1 -0
- package/internal/utils/values.d.mts +18 -0
- package/internal/utils/values.d.mts.map +1 -0
- package/internal/utils/values.d.ts +18 -0
- package/internal/utils/values.d.ts.map +1 -0
- package/internal/utils/values.js +112 -0
- package/internal/utils/values.js.map +1 -0
- package/internal/utils/values.mjs +94 -0
- package/internal/utils/values.mjs.map +1 -0
- package/internal/utils.d.mts +7 -0
- package/internal/utils.d.mts.map +1 -0
- package/internal/utils.d.ts +7 -0
- package/internal/utils.d.ts.map +1 -0
- package/internal/utils.js +11 -0
- package/internal/utils.js.map +1 -0
- package/internal/utils.mjs +8 -0
- package/internal/utils.mjs.map +1 -0
- package/package.json +138 -0
- package/resource.d.mts +2 -0
- package/resource.d.mts.map +1 -0
- package/resource.d.ts +2 -0
- package/resource.d.ts.map +1 -0
- package/resource.js +6 -0
- package/resource.js.map +1 -0
- package/resource.mjs +2 -0
- package/resource.mjs.map +1 -0
- package/resources/customer/businesses.d.mts +260 -0
- package/resources/customer/businesses.d.mts.map +1 -0
- package/resources/customer/businesses.d.ts +260 -0
- package/resources/customer/businesses.d.ts.map +1 -0
- package/resources/customer/businesses.js +77 -0
- package/resources/customer/businesses.js.map +1 -0
- package/resources/customer/businesses.mjs +73 -0
- package/resources/customer/businesses.mjs.map +1 -0
- package/resources/customer/channels.d.mts +34 -0
- package/resources/customer/channels.d.mts.map +1 -0
- package/resources/customer/channels.d.ts +34 -0
- package/resources/customer/channels.d.ts.map +1 -0
- package/resources/customer/channels.js +25 -0
- package/resources/customer/channels.js.map +1 -0
- package/resources/customer/channels.mjs +21 -0
- package/resources/customer/channels.mjs.map +1 -0
- package/resources/customer/customer.d.mts +151 -0
- package/resources/customer/customer.d.mts.map +1 -0
- package/resources/customer/customer.d.ts +151 -0
- package/resources/customer/customer.d.ts.map +1 -0
- package/resources/customer/customer.js +104 -0
- package/resources/customer/customer.js.map +1 -0
- package/resources/customer/customer.mjs +99 -0
- package/resources/customer/customer.mjs.map +1 -0
- package/resources/customer/discovery/category.d.mts +84 -0
- package/resources/customer/discovery/category.d.mts.map +1 -0
- package/resources/customer/discovery/category.d.ts +84 -0
- package/resources/customer/discovery/category.d.ts.map +1 -0
- package/resources/customer/discovery/category.js +25 -0
- package/resources/customer/discovery/category.js.map +1 -0
- package/resources/customer/discovery/category.mjs +21 -0
- package/resources/customer/discovery/category.mjs.map +1 -0
- package/resources/customer/discovery/discovery.d.mts +34 -0
- package/resources/customer/discovery/discovery.d.mts.map +1 -0
- package/resources/customer/discovery/discovery.d.ts +34 -0
- package/resources/customer/discovery/discovery.d.ts.map +1 -0
- package/resources/customer/discovery/discovery.js +30 -0
- package/resources/customer/discovery/discovery.js.map +1 -0
- package/resources/customer/discovery/discovery.mjs +25 -0
- package/resources/customer/discovery/discovery.mjs.map +1 -0
- package/resources/customer/discovery/index.d.mts +3 -0
- package/resources/customer/discovery/index.d.mts.map +1 -0
- package/resources/customer/discovery/index.d.ts +3 -0
- package/resources/customer/discovery/index.d.ts.map +1 -0
- package/resources/customer/discovery/index.js +9 -0
- package/resources/customer/discovery/index.js.map +1 -0
- package/resources/customer/discovery/index.mjs +4 -0
- package/resources/customer/discovery/index.mjs.map +1 -0
- package/resources/customer/discovery.d.mts +2 -0
- package/resources/customer/discovery.d.mts.map +1 -0
- package/resources/customer/discovery.d.ts +2 -0
- package/resources/customer/discovery.d.ts.map +1 -0
- package/resources/customer/discovery.js +6 -0
- package/resources/customer/discovery.js.map +1 -0
- package/resources/customer/discovery.mjs +3 -0
- package/resources/customer/discovery.mjs.map +1 -0
- package/resources/customer/explore.d.mts +59 -0
- package/resources/customer/explore.d.mts.map +1 -0
- package/resources/customer/explore.d.ts +59 -0
- package/resources/customer/explore.d.ts.map +1 -0
- package/resources/customer/explore.js +24 -0
- package/resources/customer/explore.js.map +1 -0
- package/resources/customer/explore.mjs +20 -0
- package/resources/customer/explore.mjs.map +1 -0
- package/resources/customer/index.d.mts +8 -0
- package/resources/customer/index.d.mts.map +1 -0
- package/resources/customer/index.d.ts +8 -0
- package/resources/customer/index.d.ts.map +1 -0
- package/resources/customer/index.js +19 -0
- package/resources/customer/index.js.map +1 -0
- package/resources/customer/index.mjs +9 -0
- package/resources/customer/index.mjs.map +1 -0
- package/resources/customer/messaging/conversations/conversations.d.mts +106 -0
- package/resources/customer/messaging/conversations/conversations.d.mts.map +1 -0
- package/resources/customer/messaging/conversations/conversations.d.ts +106 -0
- package/resources/customer/messaging/conversations/conversations.d.ts.map +1 -0
- package/resources/customer/messaging/conversations/conversations.js +77 -0
- package/resources/customer/messaging/conversations/conversations.js.map +1 -0
- package/resources/customer/messaging/conversations/conversations.mjs +72 -0
- package/resources/customer/messaging/conversations/conversations.mjs.map +1 -0
- package/resources/customer/messaging/conversations/index.d.mts +3 -0
- package/resources/customer/messaging/conversations/index.d.mts.map +1 -0
- package/resources/customer/messaging/conversations/index.d.ts +3 -0
- package/resources/customer/messaging/conversations/index.d.ts.map +1 -0
- package/resources/customer/messaging/conversations/index.js +9 -0
- package/resources/customer/messaging/conversations/index.js.map +1 -0
- package/resources/customer/messaging/conversations/index.mjs +4 -0
- package/resources/customer/messaging/conversations/index.mjs.map +1 -0
- package/resources/customer/messaging/conversations/messages.d.mts +117 -0
- package/resources/customer/messaging/conversations/messages.d.mts.map +1 -0
- package/resources/customer/messaging/conversations/messages.d.ts +117 -0
- package/resources/customer/messaging/conversations/messages.d.ts.map +1 -0
- package/resources/customer/messaging/conversations/messages.js +79 -0
- package/resources/customer/messaging/conversations/messages.js.map +1 -0
- package/resources/customer/messaging/conversations/messages.mjs +75 -0
- package/resources/customer/messaging/conversations/messages.mjs.map +1 -0
- package/resources/customer/messaging/conversations.d.mts +2 -0
- package/resources/customer/messaging/conversations.d.mts.map +1 -0
- package/resources/customer/messaging/conversations.d.ts +2 -0
- package/resources/customer/messaging/conversations.d.ts.map +1 -0
- package/resources/customer/messaging/conversations.js +6 -0
- package/resources/customer/messaging/conversations.js.map +1 -0
- package/resources/customer/messaging/conversations.mjs +3 -0
- package/resources/customer/messaging/conversations.mjs.map +1 -0
- package/resources/customer/messaging/index.d.mts +3 -0
- package/resources/customer/messaging/index.d.mts.map +1 -0
- package/resources/customer/messaging/index.d.ts +3 -0
- package/resources/customer/messaging/index.d.ts.map +1 -0
- package/resources/customer/messaging/index.js +9 -0
- package/resources/customer/messaging/index.js.map +1 -0
- package/resources/customer/messaging/index.mjs +4 -0
- package/resources/customer/messaging/index.mjs.map +1 -0
- package/resources/customer/messaging/messaging.d.mts +10 -0
- package/resources/customer/messaging/messaging.d.mts.map +1 -0
- package/resources/customer/messaging/messaging.d.ts +10 -0
- package/resources/customer/messaging/messaging.d.ts.map +1 -0
- package/resources/customer/messaging/messaging.js +17 -0
- package/resources/customer/messaging/messaging.js.map +1 -0
- package/resources/customer/messaging/messaging.mjs +12 -0
- package/resources/customer/messaging/messaging.mjs.map +1 -0
- package/resources/customer/messaging.d.mts +2 -0
- package/resources/customer/messaging.d.mts.map +1 -0
- package/resources/customer/messaging.d.ts +2 -0
- package/resources/customer/messaging.d.ts.map +1 -0
- package/resources/customer/messaging.js +6 -0
- package/resources/customer/messaging.js.map +1 -0
- package/resources/customer/messaging.mjs +3 -0
- package/resources/customer/messaging.mjs.map +1 -0
- package/resources/customer/tokens.d.mts +43 -0
- package/resources/customer/tokens.d.mts.map +1 -0
- package/resources/customer/tokens.d.ts +43 -0
- package/resources/customer/tokens.d.ts.map +1 -0
- package/resources/customer/tokens.js +34 -0
- package/resources/customer/tokens.js.map +1 -0
- package/resources/customer/tokens.mjs +30 -0
- package/resources/customer/tokens.mjs.map +1 -0
- package/resources/customer.d.mts +2 -0
- package/resources/customer.d.mts.map +1 -0
- package/resources/customer.d.ts +2 -0
- package/resources/customer.d.ts.map +1 -0
- package/resources/customer.js +6 -0
- package/resources/customer.js.map +1 -0
- package/resources/customer.mjs +3 -0
- package/resources/customer.mjs.map +1 -0
- package/resources/index.d.mts +2 -0
- package/resources/index.d.mts.map +1 -0
- package/resources/index.d.ts +2 -0
- package/resources/index.d.ts.map +1 -0
- package/resources/index.js +7 -0
- package/resources/index.js.map +1 -0
- package/resources/index.mjs +3 -0
- package/resources/index.mjs.map +1 -0
- package/resources.d.mts +2 -0
- package/resources.d.mts.map +1 -0
- package/resources.d.ts +2 -0
- package/resources.d.ts.map +1 -0
- package/resources.js +5 -0
- package/resources.js.map +1 -0
- package/resources.mjs +2 -0
- package/resources.mjs.map +1 -0
- package/src/api-promise.ts +2 -0
- package/src/client.ts +748 -0
- package/src/core/README.md +3 -0
- package/src/core/api-promise.ts +92 -0
- package/src/core/error.ts +130 -0
- package/src/core/resource.ts +11 -0
- package/src/core/uploads.ts +2 -0
- package/src/error.ts +2 -0
- package/src/index.ts +22 -0
- package/src/internal/README.md +3 -0
- package/src/internal/builtin-types.ts +93 -0
- package/src/internal/detect-platform.ts +196 -0
- package/src/internal/errors.ts +33 -0
- package/src/internal/headers.ts +97 -0
- package/src/internal/parse.ts +50 -0
- package/src/internal/request-options.ts +91 -0
- package/src/internal/shim-types.ts +26 -0
- package/src/internal/shims.ts +107 -0
- package/src/internal/to-file.ts +154 -0
- package/src/internal/types.ts +95 -0
- package/src/internal/uploads.ts +187 -0
- package/src/internal/utils/base64.ts +40 -0
- package/src/internal/utils/bytes.ts +32 -0
- package/src/internal/utils/env.ts +18 -0
- package/src/internal/utils/log.ts +126 -0
- package/src/internal/utils/path.ts +88 -0
- package/src/internal/utils/sleep.ts +3 -0
- package/src/internal/utils/uuid.ts +17 -0
- package/src/internal/utils/values.ts +105 -0
- package/src/internal/utils.ts +8 -0
- package/src/lib/.keep +4 -0
- package/src/resource.ts +2 -0
- package/src/resources/customer/businesses.ts +397 -0
- package/src/resources/customer/channels.ts +45 -0
- package/src/resources/customer/customer.ts +249 -0
- package/src/resources/customer/discovery/category.ts +127 -0
- package/src/resources/customer/discovery/discovery.ts +51 -0
- package/src/resources/customer/discovery/index.ts +4 -0
- package/src/resources/customer/discovery.ts +3 -0
- package/src/resources/customer/explore.ts +87 -0
- package/src/resources/customer/index.ts +33 -0
- package/src/resources/customer/messaging/conversations/conversations.ts +173 -0
- package/src/resources/customer/messaging/conversations/index.ts +21 -0
- package/src/resources/customer/messaging/conversations/messages.ts +184 -0
- package/src/resources/customer/messaging/conversations.ts +3 -0
- package/src/resources/customer/messaging/index.ts +12 -0
- package/src/resources/customer/messaging/messaging.ts +31 -0
- package/src/resources/customer/messaging.ts +3 -0
- package/src/resources/customer/tokens.ts +58 -0
- package/src/resources/customer.ts +3 -0
- package/src/resources/index.ts +14 -0
- package/src/resources.ts +1 -0
- package/src/tsconfig.json +11 -0
- package/src/uploads.ts +2 -0
- package/src/version.ts +1 -0
- package/uploads.d.mts +2 -0
- package/uploads.d.mts.map +1 -0
- package/uploads.d.ts +2 -0
- package/uploads.d.ts.map +1 -0
- package/uploads.js +6 -0
- package/uploads.js.map +1 -0
- package/uploads.mjs +2 -0
- package/uploads.mjs.map +1 -0
- package/version.d.mts +2 -0
- package/version.d.mts.map +1 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +5 -0
- package/version.js.map +1 -0
- package/version.mjs +2 -0
- package/version.mjs.map +1 -0
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { APIResource } from "../../../../core/resource.mjs";
|
|
2
|
+
import * as MessagesAPI from "./messages.mjs";
|
|
3
|
+
import { Message, MessageGetUnreadCountResponse, MessageListParams, MessageListResponse, MessageMarkReadResponse, MessageSendParams, MessageSendResponse, Messages } from "./messages.mjs";
|
|
4
|
+
import { APIPromise } from "../../../../core/api-promise.mjs";
|
|
5
|
+
import { RequestOptions } from "../../../../internal/request-options.mjs";
|
|
6
|
+
export declare class Conversations extends APIResource {
|
|
7
|
+
messages: MessagesAPI.Messages;
|
|
8
|
+
/**
|
|
9
|
+
* Retrieve details of a specific conversation including the business information
|
|
10
|
+
* and the latest message.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const conversation =
|
|
15
|
+
* await client.customer.messaging.conversations.retrieve(
|
|
16
|
+
* '550e8400-e29b-41d4-a716-446655440000',
|
|
17
|
+
* );
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
retrieve(conversation: string, options?: RequestOptions): APIPromise<ConversationRetrieveResponse>;
|
|
21
|
+
/**
|
|
22
|
+
* Retrieve a paginated list of all conversations for the authenticated customer,
|
|
23
|
+
* ordered by the most recent message first.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* const conversations =
|
|
28
|
+
* await client.customer.messaging.conversations.list();
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
list(query?: ConversationListParams | null | undefined, options?: RequestOptions): APIPromise<ConversationListResponse>;
|
|
32
|
+
/**
|
|
33
|
+
* Permanently delete a conversation and all its messages. This action cannot be
|
|
34
|
+
* undone.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* const conversation =
|
|
39
|
+
* await client.customer.messaging.conversations.delete(
|
|
40
|
+
* '550e8400-e29b-41d4-a716-446655440000',
|
|
41
|
+
* );
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
delete(conversation: string, options?: RequestOptions): APIPromise<ConversationDeleteResponse>;
|
|
45
|
+
/**
|
|
46
|
+
* Create a new conversation between the authenticated customer and the specified
|
|
47
|
+
* business. If a conversation already exists, it will be returned instead of
|
|
48
|
+
* creating a duplicate.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```ts
|
|
52
|
+
* const response =
|
|
53
|
+
* await client.customer.messaging.conversations.start(
|
|
54
|
+
* 'marios-pizza',
|
|
55
|
+
* );
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
start(business: string, options?: RequestOptions): APIPromise<ConversationStartResponse>;
|
|
59
|
+
}
|
|
60
|
+
export interface Conversation {
|
|
61
|
+
id: string;
|
|
62
|
+
business: Conversation.Business;
|
|
63
|
+
created_at: string;
|
|
64
|
+
last_message_at: string;
|
|
65
|
+
updated_at: string;
|
|
66
|
+
last_message?: Conversation.LastMessage | null;
|
|
67
|
+
}
|
|
68
|
+
export declare namespace Conversation {
|
|
69
|
+
interface Business {
|
|
70
|
+
id: string;
|
|
71
|
+
handle: string;
|
|
72
|
+
logo_url: string;
|
|
73
|
+
name: string;
|
|
74
|
+
}
|
|
75
|
+
interface LastMessage {
|
|
76
|
+
id: string;
|
|
77
|
+
content: string;
|
|
78
|
+
created_at: string;
|
|
79
|
+
sender_type: string;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
export interface ConversationRetrieveResponse {
|
|
83
|
+
data: Conversation;
|
|
84
|
+
}
|
|
85
|
+
export interface ConversationListResponse {
|
|
86
|
+
data: Array<Conversation>;
|
|
87
|
+
}
|
|
88
|
+
export type ConversationDeleteResponse = 204;
|
|
89
|
+
export interface ConversationStartResponse {
|
|
90
|
+
data: Conversation;
|
|
91
|
+
}
|
|
92
|
+
export interface ConversationListParams {
|
|
93
|
+
/**
|
|
94
|
+
* Page number for pagination
|
|
95
|
+
*/
|
|
96
|
+
page?: number;
|
|
97
|
+
/**
|
|
98
|
+
* Number of conversations per page
|
|
99
|
+
*/
|
|
100
|
+
per_page?: number;
|
|
101
|
+
}
|
|
102
|
+
export declare namespace Conversations {
|
|
103
|
+
export { type Conversation as Conversation, type ConversationRetrieveResponse as ConversationRetrieveResponse, type ConversationListResponse as ConversationListResponse, type ConversationDeleteResponse as ConversationDeleteResponse, type ConversationStartResponse as ConversationStartResponse, type ConversationListParams as ConversationListParams, };
|
|
104
|
+
export { Messages as Messages, type Message as Message, type MessageListResponse as MessageListResponse, type MessageGetUnreadCountResponse as MessageGetUnreadCountResponse, type MessageMarkReadResponse as MessageMarkReadResponse, type MessageSendResponse as MessageSendResponse, type MessageListParams as MessageListParams, type MessageSendParams as MessageSendParams, };
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=conversations.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversations.d.mts","sourceRoot":"","sources":["../../../../src/resources/customer/messaging/conversations/conversations.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,WAAW;OAChB,EACL,OAAO,EACP,6BAA6B,EAC7B,iBAAiB,EACjB,mBAAmB,EACnB,uBAAuB,EACvB,iBAAiB,EACjB,mBAAmB,EACnB,QAAQ,EACT;OACM,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,aAAc,SAAQ,WAAW;IAC5C,QAAQ,EAAE,WAAW,CAAC,QAAQ,CAA0C;IAExE;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,4BAA4B,CAAC;IAIlG;;;;;;;;;OASG;IACH,IAAI,CACF,KAAK,GAAE,sBAAsB,GAAG,IAAI,GAAG,SAAc,EACrD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,wBAAwB,CAAC;IAIvC;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,0BAA0B,CAAC;IAI9F;;;;;;;;;;;;OAYG;IACH,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,yBAAyB,CAAC;CAGzF;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IAEX,QAAQ,EAAE,YAAY,CAAC,QAAQ,CAAC;IAEhC,UAAU,EAAE,MAAM,CAAC;IAEnB,eAAe,EAAE,MAAM,CAAC;IAExB,UAAU,EAAE,MAAM,CAAC;IAEnB,YAAY,CAAC,EAAE,YAAY,CAAC,WAAW,GAAG,IAAI,CAAC;CAChD;AAED,yBAAiB,YAAY,CAAC;IAC5B,UAAiB,QAAQ;QACvB,EAAE,EAAE,MAAM,CAAC;QAEX,MAAM,EAAE,MAAM,CAAC;QAEf,QAAQ,EAAE,MAAM,CAAC;QAEjB,IAAI,EAAE,MAAM,CAAC;KACd;IAED,UAAiB,WAAW;QAC1B,EAAE,EAAE,MAAM,CAAC;QAEX,OAAO,EAAE,MAAM,CAAC;QAEhB,UAAU,EAAE,MAAM,CAAC;QAEnB,WAAW,EAAE,MAAM,CAAC;KACrB;CACF;AAED,MAAM,WAAW,4BAA4B;IAC3C,IAAI,EAAE,YAAY,CAAC;CACpB;AAED,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;CAC3B;AAED,MAAM,MAAM,0BAA0B,GAAG,GAAG,CAAC;AAE7C,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,YAAY,CAAC;CACpB;AAED,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAID,MAAM,CAAC,OAAO,WAAW,aAAa,CAAC;IACrC,OAAO,EACL,KAAK,YAAY,IAAI,YAAY,EACjC,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;IAEF,OAAO,EACL,QAAQ,IAAI,QAAQ,EACpB,KAAK,OAAO,IAAI,OAAO,EACvB,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;CACH"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { APIResource } from "../../../../core/resource.js";
|
|
2
|
+
import * as MessagesAPI from "./messages.js";
|
|
3
|
+
import { Message, MessageGetUnreadCountResponse, MessageListParams, MessageListResponse, MessageMarkReadResponse, MessageSendParams, MessageSendResponse, Messages } from "./messages.js";
|
|
4
|
+
import { APIPromise } from "../../../../core/api-promise.js";
|
|
5
|
+
import { RequestOptions } from "../../../../internal/request-options.js";
|
|
6
|
+
export declare class Conversations extends APIResource {
|
|
7
|
+
messages: MessagesAPI.Messages;
|
|
8
|
+
/**
|
|
9
|
+
* Retrieve details of a specific conversation including the business information
|
|
10
|
+
* and the latest message.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const conversation =
|
|
15
|
+
* await client.customer.messaging.conversations.retrieve(
|
|
16
|
+
* '550e8400-e29b-41d4-a716-446655440000',
|
|
17
|
+
* );
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
retrieve(conversation: string, options?: RequestOptions): APIPromise<ConversationRetrieveResponse>;
|
|
21
|
+
/**
|
|
22
|
+
* Retrieve a paginated list of all conversations for the authenticated customer,
|
|
23
|
+
* ordered by the most recent message first.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* const conversations =
|
|
28
|
+
* await client.customer.messaging.conversations.list();
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
list(query?: ConversationListParams | null | undefined, options?: RequestOptions): APIPromise<ConversationListResponse>;
|
|
32
|
+
/**
|
|
33
|
+
* Permanently delete a conversation and all its messages. This action cannot be
|
|
34
|
+
* undone.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* const conversation =
|
|
39
|
+
* await client.customer.messaging.conversations.delete(
|
|
40
|
+
* '550e8400-e29b-41d4-a716-446655440000',
|
|
41
|
+
* );
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
delete(conversation: string, options?: RequestOptions): APIPromise<ConversationDeleteResponse>;
|
|
45
|
+
/**
|
|
46
|
+
* Create a new conversation between the authenticated customer and the specified
|
|
47
|
+
* business. If a conversation already exists, it will be returned instead of
|
|
48
|
+
* creating a duplicate.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```ts
|
|
52
|
+
* const response =
|
|
53
|
+
* await client.customer.messaging.conversations.start(
|
|
54
|
+
* 'marios-pizza',
|
|
55
|
+
* );
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
start(business: string, options?: RequestOptions): APIPromise<ConversationStartResponse>;
|
|
59
|
+
}
|
|
60
|
+
export interface Conversation {
|
|
61
|
+
id: string;
|
|
62
|
+
business: Conversation.Business;
|
|
63
|
+
created_at: string;
|
|
64
|
+
last_message_at: string;
|
|
65
|
+
updated_at: string;
|
|
66
|
+
last_message?: Conversation.LastMessage | null;
|
|
67
|
+
}
|
|
68
|
+
export declare namespace Conversation {
|
|
69
|
+
interface Business {
|
|
70
|
+
id: string;
|
|
71
|
+
handle: string;
|
|
72
|
+
logo_url: string;
|
|
73
|
+
name: string;
|
|
74
|
+
}
|
|
75
|
+
interface LastMessage {
|
|
76
|
+
id: string;
|
|
77
|
+
content: string;
|
|
78
|
+
created_at: string;
|
|
79
|
+
sender_type: string;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
export interface ConversationRetrieveResponse {
|
|
83
|
+
data: Conversation;
|
|
84
|
+
}
|
|
85
|
+
export interface ConversationListResponse {
|
|
86
|
+
data: Array<Conversation>;
|
|
87
|
+
}
|
|
88
|
+
export type ConversationDeleteResponse = 204;
|
|
89
|
+
export interface ConversationStartResponse {
|
|
90
|
+
data: Conversation;
|
|
91
|
+
}
|
|
92
|
+
export interface ConversationListParams {
|
|
93
|
+
/**
|
|
94
|
+
* Page number for pagination
|
|
95
|
+
*/
|
|
96
|
+
page?: number;
|
|
97
|
+
/**
|
|
98
|
+
* Number of conversations per page
|
|
99
|
+
*/
|
|
100
|
+
per_page?: number;
|
|
101
|
+
}
|
|
102
|
+
export declare namespace Conversations {
|
|
103
|
+
export { type Conversation as Conversation, type ConversationRetrieveResponse as ConversationRetrieveResponse, type ConversationListResponse as ConversationListResponse, type ConversationDeleteResponse as ConversationDeleteResponse, type ConversationStartResponse as ConversationStartResponse, type ConversationListParams as ConversationListParams, };
|
|
104
|
+
export { Messages as Messages, type Message as Message, type MessageListResponse as MessageListResponse, type MessageGetUnreadCountResponse as MessageGetUnreadCountResponse, type MessageMarkReadResponse as MessageMarkReadResponse, type MessageSendResponse as MessageSendResponse, type MessageListParams as MessageListParams, type MessageSendParams as MessageSendParams, };
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=conversations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversations.d.ts","sourceRoot":"","sources":["../../../../src/resources/customer/messaging/conversations/conversations.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,WAAW;OAChB,EACL,OAAO,EACP,6BAA6B,EAC7B,iBAAiB,EACjB,mBAAmB,EACnB,uBAAuB,EACvB,iBAAiB,EACjB,mBAAmB,EACnB,QAAQ,EACT;OACM,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,aAAc,SAAQ,WAAW;IAC5C,QAAQ,EAAE,WAAW,CAAC,QAAQ,CAA0C;IAExE;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,4BAA4B,CAAC;IAIlG;;;;;;;;;OASG;IACH,IAAI,CACF,KAAK,GAAE,sBAAsB,GAAG,IAAI,GAAG,SAAc,EACrD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,wBAAwB,CAAC;IAIvC;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,0BAA0B,CAAC;IAI9F;;;;;;;;;;;;OAYG;IACH,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,yBAAyB,CAAC;CAGzF;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IAEX,QAAQ,EAAE,YAAY,CAAC,QAAQ,CAAC;IAEhC,UAAU,EAAE,MAAM,CAAC;IAEnB,eAAe,EAAE,MAAM,CAAC;IAExB,UAAU,EAAE,MAAM,CAAC;IAEnB,YAAY,CAAC,EAAE,YAAY,CAAC,WAAW,GAAG,IAAI,CAAC;CAChD;AAED,yBAAiB,YAAY,CAAC;IAC5B,UAAiB,QAAQ;QACvB,EAAE,EAAE,MAAM,CAAC;QAEX,MAAM,EAAE,MAAM,CAAC;QAEf,QAAQ,EAAE,MAAM,CAAC;QAEjB,IAAI,EAAE,MAAM,CAAC;KACd;IAED,UAAiB,WAAW;QAC1B,EAAE,EAAE,MAAM,CAAC;QAEX,OAAO,EAAE,MAAM,CAAC;QAEhB,UAAU,EAAE,MAAM,CAAC;QAEnB,WAAW,EAAE,MAAM,CAAC;KACrB;CACF;AAED,MAAM,WAAW,4BAA4B;IAC3C,IAAI,EAAE,YAAY,CAAC;CACpB;AAED,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;CAC3B;AAED,MAAM,MAAM,0BAA0B,GAAG,GAAG,CAAC;AAE7C,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,YAAY,CAAC;CACpB;AAED,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAID,MAAM,CAAC,OAAO,WAAW,aAAa,CAAC;IACrC,OAAO,EACL,KAAK,YAAY,IAAI,YAAY,EACjC,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;IAEF,OAAO,EACL,QAAQ,IAAI,QAAQ,EACpB,KAAK,OAAO,IAAI,OAAO,EACvB,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;CACH"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Conversations = void 0;
|
|
5
|
+
const tslib_1 = require("../../../../internal/tslib.js");
|
|
6
|
+
const resource_1 = require("../../../../core/resource.js");
|
|
7
|
+
const MessagesAPI = tslib_1.__importStar(require("./messages.js"));
|
|
8
|
+
const messages_1 = require("./messages.js");
|
|
9
|
+
const path_1 = require("../../../../internal/utils/path.js");
|
|
10
|
+
class Conversations extends resource_1.APIResource {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this.messages = new MessagesAPI.Messages(this._client);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Retrieve details of a specific conversation including the business information
|
|
17
|
+
* and the latest message.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* const conversation =
|
|
22
|
+
* await client.customer.messaging.conversations.retrieve(
|
|
23
|
+
* '550e8400-e29b-41d4-a716-446655440000',
|
|
24
|
+
* );
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
retrieve(conversation, options) {
|
|
28
|
+
return this._client.get((0, path_1.path) `/customer/messaging/conversations/${conversation}`, options);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Retrieve a paginated list of all conversations for the authenticated customer,
|
|
32
|
+
* ordered by the most recent message first.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* const conversations =
|
|
37
|
+
* await client.customer.messaging.conversations.list();
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
list(query = {}, options) {
|
|
41
|
+
return this._client.get('/customer/messaging/conversations', { query, ...options });
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Permanently delete a conversation and all its messages. This action cannot be
|
|
45
|
+
* undone.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* const conversation =
|
|
50
|
+
* await client.customer.messaging.conversations.delete(
|
|
51
|
+
* '550e8400-e29b-41d4-a716-446655440000',
|
|
52
|
+
* );
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
delete(conversation, options) {
|
|
56
|
+
return this._client.delete((0, path_1.path) `/customer/messaging/conversations/${conversation}`, options);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Create a new conversation between the authenticated customer and the specified
|
|
60
|
+
* business. If a conversation already exists, it will be returned instead of
|
|
61
|
+
* creating a duplicate.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```ts
|
|
65
|
+
* const response =
|
|
66
|
+
* await client.customer.messaging.conversations.start(
|
|
67
|
+
* 'marios-pizza',
|
|
68
|
+
* );
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
start(business, options) {
|
|
72
|
+
return this._client.post((0, path_1.path) `/customer/messaging/conversations/${business}`, options);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
exports.Conversations = Conversations;
|
|
76
|
+
Conversations.Messages = messages_1.Messages;
|
|
77
|
+
//# sourceMappingURL=conversations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversations.js","sourceRoot":"","sources":["../../../../src/resources/customer/messaging/conversations/conversations.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,2DAAwD;AACxD,mEAA0C;AAC1C,4CASoB;AAGpB,6DAAuD;AAEvD,MAAa,aAAc,SAAQ,sBAAW;IAA9C;;QACE,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAmE1E,CAAC;IAjEC;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,YAAoB,EAAE,OAAwB;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,qCAAqC,YAAY,EAAE,EAAE,OAAO,CAAC,CAAC;IAC5F,CAAC;IAED;;;;;;;;;OASG;IACH,IAAI,CACF,QAAmD,EAAE,EACrD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,mCAAmC,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACtF,CAAC;IAED;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,YAAoB,EAAE,OAAwB;QACnD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,qCAAqC,YAAY,EAAE,EAAE,OAAO,CAAC,CAAC;IAC/F,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,KAAK,CAAC,QAAgB,EAAE,OAAwB;QAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,qCAAqC,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC;IACzF,CAAC;CACF;AApED,sCAoEC;AAgED,aAAa,CAAC,QAAQ,GAAG,mBAAQ,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../../../core/resource.mjs";
|
|
3
|
+
import * as MessagesAPI from "./messages.mjs";
|
|
4
|
+
import { Messages, } from "./messages.mjs";
|
|
5
|
+
import { path } from "../../../../internal/utils/path.mjs";
|
|
6
|
+
export class Conversations extends APIResource {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.messages = new MessagesAPI.Messages(this._client);
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Retrieve details of a specific conversation including the business information
|
|
13
|
+
* and the latest message.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const conversation =
|
|
18
|
+
* await client.customer.messaging.conversations.retrieve(
|
|
19
|
+
* '550e8400-e29b-41d4-a716-446655440000',
|
|
20
|
+
* );
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
retrieve(conversation, options) {
|
|
24
|
+
return this._client.get(path `/customer/messaging/conversations/${conversation}`, options);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Retrieve a paginated list of all conversations for the authenticated customer,
|
|
28
|
+
* ordered by the most recent message first.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* const conversations =
|
|
33
|
+
* await client.customer.messaging.conversations.list();
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
list(query = {}, options) {
|
|
37
|
+
return this._client.get('/customer/messaging/conversations', { query, ...options });
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Permanently delete a conversation and all its messages. This action cannot be
|
|
41
|
+
* undone.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```ts
|
|
45
|
+
* const conversation =
|
|
46
|
+
* await client.customer.messaging.conversations.delete(
|
|
47
|
+
* '550e8400-e29b-41d4-a716-446655440000',
|
|
48
|
+
* );
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
delete(conversation, options) {
|
|
52
|
+
return this._client.delete(path `/customer/messaging/conversations/${conversation}`, options);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Create a new conversation between the authenticated customer and the specified
|
|
56
|
+
* business. If a conversation already exists, it will be returned instead of
|
|
57
|
+
* creating a duplicate.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* const response =
|
|
62
|
+
* await client.customer.messaging.conversations.start(
|
|
63
|
+
* 'marios-pizza',
|
|
64
|
+
* );
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
start(business, options) {
|
|
68
|
+
return this._client.post(path `/customer/messaging/conversations/${business}`, options);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
Conversations.Messages = Messages;
|
|
72
|
+
//# sourceMappingURL=conversations.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversations.mjs","sourceRoot":"","sources":["../../../../src/resources/customer/messaging/conversations/conversations.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,WAAW;OAChB,EAQL,QAAQ,GACT;OAGM,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,aAAc,SAAQ,WAAW;IAA9C;;QACE,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAmE1E,CAAC;IAjEC;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,YAAoB,EAAE,OAAwB;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,qCAAqC,YAAY,EAAE,EAAE,OAAO,CAAC,CAAC;IAC5F,CAAC;IAED;;;;;;;;;OASG;IACH,IAAI,CACF,QAAmD,EAAE,EACrD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,mCAAmC,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACtF,CAAC;IAED;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,YAAoB,EAAE,OAAwB;QACnD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,qCAAqC,YAAY,EAAE,EAAE,OAAO,CAAC,CAAC;IAC/F,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,KAAK,CAAC,QAAgB,EAAE,OAAwB;QAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,qCAAqC,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC;IACzF,CAAC;CACF;AAgED,aAAa,CAAC,QAAQ,GAAG,QAAQ,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { Conversations, type Conversation, type ConversationRetrieveResponse, type ConversationListResponse, type ConversationDeleteResponse, type ConversationStartResponse, type ConversationListParams, } from "./conversations.mjs";
|
|
2
|
+
export { Messages, type Message, type MessageListResponse, type MessageGetUnreadCountResponse, type MessageMarkReadResponse, type MessageSendResponse, type MessageListParams, type MessageSendParams, } from "./messages.mjs";
|
|
3
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../../src/resources/customer/messaging/conversations/index.ts"],"names":[],"mappings":"OAEO,EACL,aAAa,EACb,KAAK,YAAY,EACjB,KAAK,4BAA4B,EACjC,KAAK,wBAAwB,EAC7B,KAAK,0BAA0B,EAC/B,KAAK,yBAAyB,EAC9B,KAAK,sBAAsB,GAC5B;OACM,EACL,QAAQ,EACR,KAAK,OAAO,EACZ,KAAK,mBAAmB,EACxB,KAAK,6BAA6B,EAClC,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,GACvB"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { Conversations, type Conversation, type ConversationRetrieveResponse, type ConversationListResponse, type ConversationDeleteResponse, type ConversationStartResponse, type ConversationListParams, } from "./conversations.js";
|
|
2
|
+
export { Messages, type Message, type MessageListResponse, type MessageGetUnreadCountResponse, type MessageMarkReadResponse, type MessageSendResponse, type MessageListParams, type MessageSendParams, } from "./messages.js";
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/resources/customer/messaging/conversations/index.ts"],"names":[],"mappings":"OAEO,EACL,aAAa,EACb,KAAK,YAAY,EACjB,KAAK,4BAA4B,EACjC,KAAK,wBAAwB,EAC7B,KAAK,0BAA0B,EAC/B,KAAK,yBAAyB,EAC9B,KAAK,sBAAsB,GAC5B;OACM,EACL,QAAQ,EACR,KAAK,OAAO,EACZ,KAAK,mBAAmB,EACxB,KAAK,6BAA6B,EAClC,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,GACvB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Messages = exports.Conversations = void 0;
|
|
5
|
+
var conversations_1 = require("./conversations.js");
|
|
6
|
+
Object.defineProperty(exports, "Conversations", { enumerable: true, get: function () { return conversations_1.Conversations; } });
|
|
7
|
+
var messages_1 = require("./messages.js");
|
|
8
|
+
Object.defineProperty(exports, "Messages", { enumerable: true, get: function () { return messages_1.Messages; } });
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/resources/customer/messaging/conversations/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,oDAQyB;AAPvB,8GAAA,aAAa,OAAA;AAQf,0CASoB;AARlB,oGAAA,QAAQ,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../../src/resources/customer/messaging/conversations/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,aAAa,GAOd;OACM,EACL,QAAQ,GAQT"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { APIResource } from "../../../../core/resource.mjs";
|
|
2
|
+
import { APIPromise } from "../../../../core/api-promise.mjs";
|
|
3
|
+
import { RequestOptions } from "../../../../internal/request-options.mjs";
|
|
4
|
+
export declare class Messages extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Retrieve a paginated list of all messages in a specific conversation, ordered by
|
|
7
|
+
* creation time (oldest first).
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* const messages =
|
|
12
|
+
* await client.customer.messaging.conversations.messages.list(
|
|
13
|
+
* '550e8400-e29b-41d4-a716-446655440000',
|
|
14
|
+
* );
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
list(conversation: string, query?: MessageListParams | null | undefined, options?: RequestOptions): APIPromise<MessageListResponse>;
|
|
18
|
+
/**
|
|
19
|
+
* Get the count of unread messages in a specific conversation for the
|
|
20
|
+
* authenticated customer.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* const response =
|
|
25
|
+
* await client.customer.messaging.conversations.messages.getUnreadCount(
|
|
26
|
+
* '550e8400-e29b-41d4-a716-446655440000',
|
|
27
|
+
* );
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
getUnreadCount(conversation: string, options?: RequestOptions): APIPromise<MessageGetUnreadCountResponse>;
|
|
31
|
+
/**
|
|
32
|
+
* Mark all messages in a conversation as read by the authenticated customer. This
|
|
33
|
+
* is typically called when the customer opens a conversation.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```ts
|
|
37
|
+
* const response =
|
|
38
|
+
* await client.customer.messaging.conversations.messages.markRead(
|
|
39
|
+
* '550e8400-e29b-41d4-a716-446655440000',
|
|
40
|
+
* );
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
markRead(conversation: string, options?: RequestOptions): APIPromise<MessageMarkReadResponse>;
|
|
44
|
+
/**
|
|
45
|
+
* Send a new message to a specific conversation. The message will be marked as
|
|
46
|
+
* sent by the authenticated customer.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* const response =
|
|
51
|
+
* await client.customer.messaging.conversations.messages.send(
|
|
52
|
+
* '550e8400-e29b-41d4-a716-446655440000',
|
|
53
|
+
* {
|
|
54
|
+
* content: 'Hello! I have a question about your menu.',
|
|
55
|
+
* },
|
|
56
|
+
* );
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
send(conversation: string, body: MessageSendParams, options?: RequestOptions): APIPromise<MessageSendResponse>;
|
|
60
|
+
}
|
|
61
|
+
export interface Message {
|
|
62
|
+
id: string;
|
|
63
|
+
content: string;
|
|
64
|
+
conversation_id: string;
|
|
65
|
+
created_at: string;
|
|
66
|
+
edited_at: string;
|
|
67
|
+
is_edited: boolean;
|
|
68
|
+
message_type: string;
|
|
69
|
+
metadata: Array<unknown> | null;
|
|
70
|
+
sender_id: string;
|
|
71
|
+
sender_type: string;
|
|
72
|
+
updated_at: string;
|
|
73
|
+
sender?: Message.Sender;
|
|
74
|
+
}
|
|
75
|
+
export declare namespace Message {
|
|
76
|
+
interface Sender {
|
|
77
|
+
id: string;
|
|
78
|
+
email: string;
|
|
79
|
+
name: string;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
export interface MessageListResponse {
|
|
83
|
+
data: Array<Message>;
|
|
84
|
+
}
|
|
85
|
+
export type MessageGetUnreadCountResponse = 200;
|
|
86
|
+
export type MessageMarkReadResponse = 200;
|
|
87
|
+
export interface MessageSendResponse {
|
|
88
|
+
data: Message;
|
|
89
|
+
}
|
|
90
|
+
export interface MessageListParams {
|
|
91
|
+
/**
|
|
92
|
+
* Page number for pagination
|
|
93
|
+
*/
|
|
94
|
+
page?: number;
|
|
95
|
+
/**
|
|
96
|
+
* Number of messages per page
|
|
97
|
+
*/
|
|
98
|
+
per_page?: number;
|
|
99
|
+
}
|
|
100
|
+
export interface MessageSendParams {
|
|
101
|
+
/**
|
|
102
|
+
* The message content
|
|
103
|
+
*/
|
|
104
|
+
content: string;
|
|
105
|
+
/**
|
|
106
|
+
* The type of message
|
|
107
|
+
*/
|
|
108
|
+
message_type?: string;
|
|
109
|
+
/**
|
|
110
|
+
* Additional metadata for the message
|
|
111
|
+
*/
|
|
112
|
+
metadata?: unknown;
|
|
113
|
+
}
|
|
114
|
+
export declare namespace Messages {
|
|
115
|
+
export { type Message as Message, type MessageListResponse as MessageListResponse, type MessageGetUnreadCountResponse as MessageGetUnreadCountResponse, type MessageMarkReadResponse as MessageMarkReadResponse, type MessageSendResponse as MessageSendResponse, type MessageListParams as MessageListParams, type MessageSendParams as MessageSendParams, };
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=messages.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.d.mts","sourceRoot":"","sources":["../../../../src/resources/customer/messaging/conversations/messages.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;OAWG;IACH,IAAI,CACF,YAAY,EAAE,MAAM,EACpB,KAAK,GAAE,iBAAiB,GAAG,IAAI,GAAG,SAAc,EAChD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,mBAAmB,CAAC;IAOlC;;;;;;;;;;;OAWG;IACH,cAAc,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,6BAA6B,CAAC;IAOzG;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,uBAAuB,CAAC;IAO7F;;;;;;;;;;;;;;OAcG;IACH,IAAI,CACF,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,iBAAiB,EACvB,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,mBAAmB,CAAC;CAMnC;AAED,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IAEX,OAAO,EAAE,MAAM,CAAC;IAEhB,eAAe,EAAE,MAAM,CAAC;IAExB,UAAU,EAAE,MAAM,CAAC;IAEnB,SAAS,EAAE,MAAM,CAAC;IAElB,SAAS,EAAE,OAAO,CAAC;IAEnB,YAAY,EAAE,MAAM,CAAC;IAErB,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;IAEhC,SAAS,EAAE,MAAM,CAAC;IAElB,WAAW,EAAE,MAAM,CAAC;IAEpB,UAAU,EAAE,MAAM,CAAC;IAEnB,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC;CACzB;AAED,yBAAiB,OAAO,CAAC;IACvB,UAAiB,MAAM;QACrB,EAAE,EAAE,MAAM,CAAC;QAEX,KAAK,EAAE,MAAM,CAAC;QAEd,IAAI,EAAE,MAAM,CAAC;KACd;CACF;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;CACtB;AAED,MAAM,MAAM,6BAA6B,GAAG,GAAG,CAAC;AAEhD,MAAM,MAAM,uBAAuB,GAAG,GAAG,CAAC;AAE1C,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,OAAO,CAAC;CACf;AAED,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,OAAO,IAAI,OAAO,EACvB,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;CACH"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { APIResource } from "../../../../core/resource.js";
|
|
2
|
+
import { APIPromise } from "../../../../core/api-promise.js";
|
|
3
|
+
import { RequestOptions } from "../../../../internal/request-options.js";
|
|
4
|
+
export declare class Messages extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Retrieve a paginated list of all messages in a specific conversation, ordered by
|
|
7
|
+
* creation time (oldest first).
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* const messages =
|
|
12
|
+
* await client.customer.messaging.conversations.messages.list(
|
|
13
|
+
* '550e8400-e29b-41d4-a716-446655440000',
|
|
14
|
+
* );
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
list(conversation: string, query?: MessageListParams | null | undefined, options?: RequestOptions): APIPromise<MessageListResponse>;
|
|
18
|
+
/**
|
|
19
|
+
* Get the count of unread messages in a specific conversation for the
|
|
20
|
+
* authenticated customer.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* const response =
|
|
25
|
+
* await client.customer.messaging.conversations.messages.getUnreadCount(
|
|
26
|
+
* '550e8400-e29b-41d4-a716-446655440000',
|
|
27
|
+
* );
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
getUnreadCount(conversation: string, options?: RequestOptions): APIPromise<MessageGetUnreadCountResponse>;
|
|
31
|
+
/**
|
|
32
|
+
* Mark all messages in a conversation as read by the authenticated customer. This
|
|
33
|
+
* is typically called when the customer opens a conversation.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```ts
|
|
37
|
+
* const response =
|
|
38
|
+
* await client.customer.messaging.conversations.messages.markRead(
|
|
39
|
+
* '550e8400-e29b-41d4-a716-446655440000',
|
|
40
|
+
* );
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
markRead(conversation: string, options?: RequestOptions): APIPromise<MessageMarkReadResponse>;
|
|
44
|
+
/**
|
|
45
|
+
* Send a new message to a specific conversation. The message will be marked as
|
|
46
|
+
* sent by the authenticated customer.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* const response =
|
|
51
|
+
* await client.customer.messaging.conversations.messages.send(
|
|
52
|
+
* '550e8400-e29b-41d4-a716-446655440000',
|
|
53
|
+
* {
|
|
54
|
+
* content: 'Hello! I have a question about your menu.',
|
|
55
|
+
* },
|
|
56
|
+
* );
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
send(conversation: string, body: MessageSendParams, options?: RequestOptions): APIPromise<MessageSendResponse>;
|
|
60
|
+
}
|
|
61
|
+
export interface Message {
|
|
62
|
+
id: string;
|
|
63
|
+
content: string;
|
|
64
|
+
conversation_id: string;
|
|
65
|
+
created_at: string;
|
|
66
|
+
edited_at: string;
|
|
67
|
+
is_edited: boolean;
|
|
68
|
+
message_type: string;
|
|
69
|
+
metadata: Array<unknown> | null;
|
|
70
|
+
sender_id: string;
|
|
71
|
+
sender_type: string;
|
|
72
|
+
updated_at: string;
|
|
73
|
+
sender?: Message.Sender;
|
|
74
|
+
}
|
|
75
|
+
export declare namespace Message {
|
|
76
|
+
interface Sender {
|
|
77
|
+
id: string;
|
|
78
|
+
email: string;
|
|
79
|
+
name: string;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
export interface MessageListResponse {
|
|
83
|
+
data: Array<Message>;
|
|
84
|
+
}
|
|
85
|
+
export type MessageGetUnreadCountResponse = 200;
|
|
86
|
+
export type MessageMarkReadResponse = 200;
|
|
87
|
+
export interface MessageSendResponse {
|
|
88
|
+
data: Message;
|
|
89
|
+
}
|
|
90
|
+
export interface MessageListParams {
|
|
91
|
+
/**
|
|
92
|
+
* Page number for pagination
|
|
93
|
+
*/
|
|
94
|
+
page?: number;
|
|
95
|
+
/**
|
|
96
|
+
* Number of messages per page
|
|
97
|
+
*/
|
|
98
|
+
per_page?: number;
|
|
99
|
+
}
|
|
100
|
+
export interface MessageSendParams {
|
|
101
|
+
/**
|
|
102
|
+
* The message content
|
|
103
|
+
*/
|
|
104
|
+
content: string;
|
|
105
|
+
/**
|
|
106
|
+
* The type of message
|
|
107
|
+
*/
|
|
108
|
+
message_type?: string;
|
|
109
|
+
/**
|
|
110
|
+
* Additional metadata for the message
|
|
111
|
+
*/
|
|
112
|
+
metadata?: unknown;
|
|
113
|
+
}
|
|
114
|
+
export declare namespace Messages {
|
|
115
|
+
export { type Message as Message, type MessageListResponse as MessageListResponse, type MessageGetUnreadCountResponse as MessageGetUnreadCountResponse, type MessageMarkReadResponse as MessageMarkReadResponse, type MessageSendResponse as MessageSendResponse, type MessageListParams as MessageListParams, type MessageSendParams as MessageSendParams, };
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=messages.d.ts.map
|