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,127 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import * as BusinessesAPI from '../businesses';
|
|
5
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
6
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
7
|
+
import { path } from '../../../internal/utils/path';
|
|
8
|
+
|
|
9
|
+
export class Category extends APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Retrieve businesses for a specific category with pagination support. Results are
|
|
12
|
+
* optimized for list display.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* const response =
|
|
17
|
+
* await client.customer.discovery.category.getBusinesses(
|
|
18
|
+
* 'restaurant',
|
|
19
|
+
* );
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
getBusinesses(
|
|
23
|
+
category: string,
|
|
24
|
+
query: CategoryGetBusinessesParams | null | undefined = {},
|
|
25
|
+
options?: RequestOptions,
|
|
26
|
+
): APIPromise<CategoryGetBusinessesResponse> {
|
|
27
|
+
return this._client.get(path`/customer/discovery/category/${category}/businesses`, { query, ...options });
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface CategoryGetBusinessesResponse {
|
|
32
|
+
data: CategoryGetBusinessesResponse.Data;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export namespace CategoryGetBusinessesResponse {
|
|
36
|
+
export interface Data {
|
|
37
|
+
businesses: Array<Data.Business>;
|
|
38
|
+
|
|
39
|
+
category: string;
|
|
40
|
+
|
|
41
|
+
filters: Data.Filters;
|
|
42
|
+
|
|
43
|
+
pagination: BusinessesAPI.Pagination;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export namespace Data {
|
|
47
|
+
export interface Business {
|
|
48
|
+
id: string;
|
|
49
|
+
|
|
50
|
+
badges: Business.Badges;
|
|
51
|
+
|
|
52
|
+
bio: string;
|
|
53
|
+
|
|
54
|
+
category: string;
|
|
55
|
+
|
|
56
|
+
created_at: string;
|
|
57
|
+
|
|
58
|
+
description: string;
|
|
59
|
+
|
|
60
|
+
handle: string;
|
|
61
|
+
|
|
62
|
+
has_bulletins: string;
|
|
63
|
+
|
|
64
|
+
latest_bulletin: Business.LatestBulletin | null;
|
|
65
|
+
|
|
66
|
+
location: Business.Location;
|
|
67
|
+
|
|
68
|
+
logo: string;
|
|
69
|
+
|
|
70
|
+
name: string;
|
|
71
|
+
|
|
72
|
+
photos: string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export namespace Business {
|
|
76
|
+
export interface Badges {
|
|
77
|
+
founding_partner: string;
|
|
78
|
+
|
|
79
|
+
staff_pick: string;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface LatestBulletin {
|
|
83
|
+
content: string;
|
|
84
|
+
|
|
85
|
+
published_at: string;
|
|
86
|
+
|
|
87
|
+
title: string;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export interface Location {
|
|
91
|
+
city: string;
|
|
92
|
+
|
|
93
|
+
state: string;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export interface Filters {
|
|
98
|
+
category: string;
|
|
99
|
+
|
|
100
|
+
search: string;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export interface CategoryGetBusinessesParams {
|
|
106
|
+
/**
|
|
107
|
+
* Page number for pagination
|
|
108
|
+
*/
|
|
109
|
+
page?: number;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Number of businesses per page
|
|
113
|
+
*/
|
|
114
|
+
per_page?: number;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Search term for business name or description
|
|
118
|
+
*/
|
|
119
|
+
search?: string;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export declare namespace Category {
|
|
123
|
+
export {
|
|
124
|
+
type CategoryGetBusinessesResponse as CategoryGetBusinessesResponse,
|
|
125
|
+
type CategoryGetBusinessesParams as CategoryGetBusinessesParams,
|
|
126
|
+
};
|
|
127
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import * as CategoryAPI from './category';
|
|
5
|
+
import { Category, CategoryGetBusinessesParams, CategoryGetBusinessesResponse } from './category';
|
|
6
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
7
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
8
|
+
|
|
9
|
+
export class Discovery extends APIResource {
|
|
10
|
+
category: CategoryAPI.Category = new CategoryAPI.Category(this._client);
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Retrieve a list of all business categories that have businesses. This endpoint
|
|
14
|
+
* is used to populate category filters and navigation.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* const response =
|
|
19
|
+
* await client.customer.discovery.listCategories();
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
listCategories(options?: RequestOptions): APIPromise<DiscoveryListCategoriesResponse> {
|
|
23
|
+
return this._client.get('/customer/discovery/categories', options);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface DiscoveryListCategoriesResponse {
|
|
28
|
+
data: DiscoveryListCategoriesResponse.Data;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export namespace DiscoveryListCategoriesResponse {
|
|
32
|
+
export interface Data {
|
|
33
|
+
business_count: string;
|
|
34
|
+
|
|
35
|
+
label: string;
|
|
36
|
+
|
|
37
|
+
value: string;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
Discovery.Category = Category;
|
|
42
|
+
|
|
43
|
+
export declare namespace Discovery {
|
|
44
|
+
export { type DiscoveryListCategoriesResponse as DiscoveryListCategoriesResponse };
|
|
45
|
+
|
|
46
|
+
export {
|
|
47
|
+
Category as Category,
|
|
48
|
+
type CategoryGetBusinessesResponse as CategoryGetBusinessesResponse,
|
|
49
|
+
type CategoryGetBusinessesParams as CategoryGetBusinessesParams,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export { Category, type CategoryGetBusinessesResponse, type CategoryGetBusinessesParams } from './category';
|
|
4
|
+
export { Discovery, type DiscoveryListCategoriesResponse } from './discovery';
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
6
|
+
|
|
7
|
+
export class Explore extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Retrieve businesses within the specified map bounds for map view. Results are
|
|
10
|
+
* optimized for map display with essential business information.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const response =
|
|
15
|
+
* await client.customer.explore.listBusinesses({
|
|
16
|
+
* bounds: 'bounds',
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
listBusinesses(
|
|
21
|
+
query: ExploreListBusinessesParams,
|
|
22
|
+
options?: RequestOptions,
|
|
23
|
+
): APIPromise<ExploreListBusinessesResponse> {
|
|
24
|
+
return this._client.get('/customer/explore/businesses', { query, ...options });
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface ExploreListBusinessesResponse {
|
|
29
|
+
data: ExploreListBusinessesResponse.Data;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export namespace ExploreListBusinessesResponse {
|
|
33
|
+
export interface Data {
|
|
34
|
+
bounds: Data.Bounds;
|
|
35
|
+
|
|
36
|
+
businesses: Array<Data.Business>;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export namespace Data {
|
|
40
|
+
export interface Bounds {
|
|
41
|
+
east: string;
|
|
42
|
+
|
|
43
|
+
north: string;
|
|
44
|
+
|
|
45
|
+
south: string;
|
|
46
|
+
|
|
47
|
+
west: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface Business {
|
|
51
|
+
id: string;
|
|
52
|
+
|
|
53
|
+
category: string;
|
|
54
|
+
|
|
55
|
+
handle: string;
|
|
56
|
+
|
|
57
|
+
has_bulletins: string;
|
|
58
|
+
|
|
59
|
+
latitude: number | null;
|
|
60
|
+
|
|
61
|
+
logo: string;
|
|
62
|
+
|
|
63
|
+
longitude: number | null;
|
|
64
|
+
|
|
65
|
+
name: string;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface ExploreListBusinessesParams {
|
|
71
|
+
/**
|
|
72
|
+
* Map bounds in format "north,south,east,west"
|
|
73
|
+
*/
|
|
74
|
+
bounds: string;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Map zoom level for optimization
|
|
78
|
+
*/
|
|
79
|
+
zoom_level?: number;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export declare namespace Explore {
|
|
83
|
+
export {
|
|
84
|
+
type ExploreListBusinessesResponse as ExploreListBusinessesResponse,
|
|
85
|
+
type ExploreListBusinessesParams as ExploreListBusinessesParams,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export {
|
|
4
|
+
Businesses,
|
|
5
|
+
type Image,
|
|
6
|
+
type Pagination,
|
|
7
|
+
type BusinessGetBulletinsResponse,
|
|
8
|
+
type BusinessGetEventsResponse,
|
|
9
|
+
type BusinessGetMenusResponse,
|
|
10
|
+
type BusinessGetPhotosResponse,
|
|
11
|
+
type BusinessRetrieveProfileResponse,
|
|
12
|
+
type BusinessGetBulletinsParams,
|
|
13
|
+
type BusinessGetEventsParams,
|
|
14
|
+
type BusinessGetMenusParams,
|
|
15
|
+
type BusinessGetPhotosParams,
|
|
16
|
+
} from './businesses';
|
|
17
|
+
export { Channels, type ChannelAuthenticateResponse, type ChannelAuthenticateParams } from './channels';
|
|
18
|
+
export {
|
|
19
|
+
Customer,
|
|
20
|
+
type LoginResponse,
|
|
21
|
+
type User,
|
|
22
|
+
type CustomerLoginResponse,
|
|
23
|
+
type CustomerLogoutResponse,
|
|
24
|
+
type CustomerLogoutAllResponse,
|
|
25
|
+
type CustomerRegisterResponse,
|
|
26
|
+
type CustomerRetrieveUserResponse,
|
|
27
|
+
type CustomerLoginParams,
|
|
28
|
+
type CustomerRegisterParams,
|
|
29
|
+
} from './customer';
|
|
30
|
+
export { Discovery, type DiscoveryListCategoriesResponse } from './discovery/index';
|
|
31
|
+
export { Explore, type ExploreListBusinessesResponse, type ExploreListBusinessesParams } from './explore';
|
|
32
|
+
export { Messaging } from './messaging/index';
|
|
33
|
+
export { Tokens, type TokenListResponse, type TokenRevokeResponse } from './tokens';
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../../core/resource';
|
|
4
|
+
import * as MessagesAPI from './messages';
|
|
5
|
+
import {
|
|
6
|
+
Message,
|
|
7
|
+
MessageGetUnreadCountResponse,
|
|
8
|
+
MessageListParams,
|
|
9
|
+
MessageListResponse,
|
|
10
|
+
MessageMarkReadResponse,
|
|
11
|
+
MessageSendParams,
|
|
12
|
+
MessageSendResponse,
|
|
13
|
+
Messages,
|
|
14
|
+
} from './messages';
|
|
15
|
+
import { APIPromise } from '../../../../core/api-promise';
|
|
16
|
+
import { RequestOptions } from '../../../../internal/request-options';
|
|
17
|
+
import { path } from '../../../../internal/utils/path';
|
|
18
|
+
|
|
19
|
+
export class Conversations extends APIResource {
|
|
20
|
+
messages: MessagesAPI.Messages = new MessagesAPI.Messages(this._client);
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Retrieve details of a specific conversation including the business information
|
|
24
|
+
* and the latest message.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* const conversation =
|
|
29
|
+
* await client.customer.messaging.conversations.retrieve(
|
|
30
|
+
* '550e8400-e29b-41d4-a716-446655440000',
|
|
31
|
+
* );
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
retrieve(conversation: string, options?: RequestOptions): APIPromise<ConversationRetrieveResponse> {
|
|
35
|
+
return this._client.get(path`/customer/messaging/conversations/${conversation}`, options);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Retrieve a paginated list of all conversations for the authenticated customer,
|
|
40
|
+
* ordered by the most recent message first.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* const conversations =
|
|
45
|
+
* await client.customer.messaging.conversations.list();
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
list(
|
|
49
|
+
query: ConversationListParams | null | undefined = {},
|
|
50
|
+
options?: RequestOptions,
|
|
51
|
+
): APIPromise<ConversationListResponse> {
|
|
52
|
+
return this._client.get('/customer/messaging/conversations', { query, ...options });
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Permanently delete a conversation and all its messages. This action cannot be
|
|
57
|
+
* undone.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* const conversation =
|
|
62
|
+
* await client.customer.messaging.conversations.delete(
|
|
63
|
+
* '550e8400-e29b-41d4-a716-446655440000',
|
|
64
|
+
* );
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
delete(conversation: string, options?: RequestOptions): APIPromise<ConversationDeleteResponse> {
|
|
68
|
+
return this._client.delete(path`/customer/messaging/conversations/${conversation}`, options);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Create a new conversation between the authenticated customer and the specified
|
|
73
|
+
* business. If a conversation already exists, it will be returned instead of
|
|
74
|
+
* creating a duplicate.
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```ts
|
|
78
|
+
* const response =
|
|
79
|
+
* await client.customer.messaging.conversations.start(
|
|
80
|
+
* 'marios-pizza',
|
|
81
|
+
* );
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
start(business: string, options?: RequestOptions): APIPromise<ConversationStartResponse> {
|
|
85
|
+
return this._client.post(path`/customer/messaging/conversations/${business}`, options);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface Conversation {
|
|
90
|
+
id: string;
|
|
91
|
+
|
|
92
|
+
business: Conversation.Business;
|
|
93
|
+
|
|
94
|
+
created_at: string;
|
|
95
|
+
|
|
96
|
+
last_message_at: string;
|
|
97
|
+
|
|
98
|
+
updated_at: string;
|
|
99
|
+
|
|
100
|
+
last_message?: Conversation.LastMessage | null;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export namespace Conversation {
|
|
104
|
+
export interface Business {
|
|
105
|
+
id: string;
|
|
106
|
+
|
|
107
|
+
handle: string;
|
|
108
|
+
|
|
109
|
+
logo_url: string;
|
|
110
|
+
|
|
111
|
+
name: string;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export interface LastMessage {
|
|
115
|
+
id: string;
|
|
116
|
+
|
|
117
|
+
content: string;
|
|
118
|
+
|
|
119
|
+
created_at: string;
|
|
120
|
+
|
|
121
|
+
sender_type: string;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export interface ConversationRetrieveResponse {
|
|
126
|
+
data: Conversation;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export interface ConversationListResponse {
|
|
130
|
+
data: Array<Conversation>;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export type ConversationDeleteResponse = 204;
|
|
134
|
+
|
|
135
|
+
export interface ConversationStartResponse {
|
|
136
|
+
data: Conversation;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export interface ConversationListParams {
|
|
140
|
+
/**
|
|
141
|
+
* Page number for pagination
|
|
142
|
+
*/
|
|
143
|
+
page?: number;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Number of conversations per page
|
|
147
|
+
*/
|
|
148
|
+
per_page?: number;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
Conversations.Messages = Messages;
|
|
152
|
+
|
|
153
|
+
export declare namespace Conversations {
|
|
154
|
+
export {
|
|
155
|
+
type Conversation as Conversation,
|
|
156
|
+
type ConversationRetrieveResponse as ConversationRetrieveResponse,
|
|
157
|
+
type ConversationListResponse as ConversationListResponse,
|
|
158
|
+
type ConversationDeleteResponse as ConversationDeleteResponse,
|
|
159
|
+
type ConversationStartResponse as ConversationStartResponse,
|
|
160
|
+
type ConversationListParams as ConversationListParams,
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
export {
|
|
164
|
+
Messages as Messages,
|
|
165
|
+
type Message as Message,
|
|
166
|
+
type MessageListResponse as MessageListResponse,
|
|
167
|
+
type MessageGetUnreadCountResponse as MessageGetUnreadCountResponse,
|
|
168
|
+
type MessageMarkReadResponse as MessageMarkReadResponse,
|
|
169
|
+
type MessageSendResponse as MessageSendResponse,
|
|
170
|
+
type MessageListParams as MessageListParams,
|
|
171
|
+
type MessageSendParams as MessageSendParams,
|
|
172
|
+
};
|
|
173
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export {
|
|
4
|
+
Conversations,
|
|
5
|
+
type Conversation,
|
|
6
|
+
type ConversationRetrieveResponse,
|
|
7
|
+
type ConversationListResponse,
|
|
8
|
+
type ConversationDeleteResponse,
|
|
9
|
+
type ConversationStartResponse,
|
|
10
|
+
type ConversationListParams,
|
|
11
|
+
} from './conversations';
|
|
12
|
+
export {
|
|
13
|
+
Messages,
|
|
14
|
+
type Message,
|
|
15
|
+
type MessageListResponse,
|
|
16
|
+
type MessageGetUnreadCountResponse,
|
|
17
|
+
type MessageMarkReadResponse,
|
|
18
|
+
type MessageSendResponse,
|
|
19
|
+
type MessageListParams,
|
|
20
|
+
type MessageSendParams,
|
|
21
|
+
} from './messages';
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../../../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../../../../internal/request-options';
|
|
6
|
+
import { path } from '../../../../internal/utils/path';
|
|
7
|
+
|
|
8
|
+
export class Messages extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Retrieve a paginated list of all messages in a specific conversation, ordered by
|
|
11
|
+
* creation time (oldest first).
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const messages =
|
|
16
|
+
* await client.customer.messaging.conversations.messages.list(
|
|
17
|
+
* '550e8400-e29b-41d4-a716-446655440000',
|
|
18
|
+
* );
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
list(
|
|
22
|
+
conversation: string,
|
|
23
|
+
query: MessageListParams | null | undefined = {},
|
|
24
|
+
options?: RequestOptions,
|
|
25
|
+
): APIPromise<MessageListResponse> {
|
|
26
|
+
return this._client.get(path`/customer/messaging/conversations/${conversation}/messages`, {
|
|
27
|
+
query,
|
|
28
|
+
...options,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Get the count of unread messages in a specific conversation for the
|
|
34
|
+
* authenticated customer.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* const response =
|
|
39
|
+
* await client.customer.messaging.conversations.messages.getUnreadCount(
|
|
40
|
+
* '550e8400-e29b-41d4-a716-446655440000',
|
|
41
|
+
* );
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
getUnreadCount(conversation: string, options?: RequestOptions): APIPromise<MessageGetUnreadCountResponse> {
|
|
45
|
+
return this._client.get(
|
|
46
|
+
path`/customer/messaging/conversations/${conversation}/messages/unread-count`,
|
|
47
|
+
options,
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Mark all messages in a conversation as read by the authenticated customer. This
|
|
53
|
+
* is typically called when the customer opens a conversation.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```ts
|
|
57
|
+
* const response =
|
|
58
|
+
* await client.customer.messaging.conversations.messages.markRead(
|
|
59
|
+
* '550e8400-e29b-41d4-a716-446655440000',
|
|
60
|
+
* );
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
markRead(conversation: string, options?: RequestOptions): APIPromise<MessageMarkReadResponse> {
|
|
64
|
+
return this._client.post(
|
|
65
|
+
path`/customer/messaging/conversations/${conversation}/messages/mark-read`,
|
|
66
|
+
options,
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Send a new message to a specific conversation. The message will be marked as
|
|
72
|
+
* sent by the authenticated customer.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```ts
|
|
76
|
+
* const response =
|
|
77
|
+
* await client.customer.messaging.conversations.messages.send(
|
|
78
|
+
* '550e8400-e29b-41d4-a716-446655440000',
|
|
79
|
+
* {
|
|
80
|
+
* content: 'Hello! I have a question about your menu.',
|
|
81
|
+
* },
|
|
82
|
+
* );
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
send(
|
|
86
|
+
conversation: string,
|
|
87
|
+
body: MessageSendParams,
|
|
88
|
+
options?: RequestOptions,
|
|
89
|
+
): APIPromise<MessageSendResponse> {
|
|
90
|
+
return this._client.post(path`/customer/messaging/conversations/${conversation}/messages`, {
|
|
91
|
+
body,
|
|
92
|
+
...options,
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export interface Message {
|
|
98
|
+
id: string;
|
|
99
|
+
|
|
100
|
+
content: string;
|
|
101
|
+
|
|
102
|
+
conversation_id: string;
|
|
103
|
+
|
|
104
|
+
created_at: string;
|
|
105
|
+
|
|
106
|
+
edited_at: string;
|
|
107
|
+
|
|
108
|
+
is_edited: boolean;
|
|
109
|
+
|
|
110
|
+
message_type: string;
|
|
111
|
+
|
|
112
|
+
metadata: Array<unknown> | null;
|
|
113
|
+
|
|
114
|
+
sender_id: string;
|
|
115
|
+
|
|
116
|
+
sender_type: string;
|
|
117
|
+
|
|
118
|
+
updated_at: string;
|
|
119
|
+
|
|
120
|
+
sender?: Message.Sender;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export namespace Message {
|
|
124
|
+
export interface Sender {
|
|
125
|
+
id: string;
|
|
126
|
+
|
|
127
|
+
email: string;
|
|
128
|
+
|
|
129
|
+
name: string;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export interface MessageListResponse {
|
|
134
|
+
data: Array<Message>;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export type MessageGetUnreadCountResponse = 200;
|
|
138
|
+
|
|
139
|
+
export type MessageMarkReadResponse = 200;
|
|
140
|
+
|
|
141
|
+
export interface MessageSendResponse {
|
|
142
|
+
data: Message;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export interface MessageListParams {
|
|
146
|
+
/**
|
|
147
|
+
* Page number for pagination
|
|
148
|
+
*/
|
|
149
|
+
page?: number;
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Number of messages per page
|
|
153
|
+
*/
|
|
154
|
+
per_page?: number;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export interface MessageSendParams {
|
|
158
|
+
/**
|
|
159
|
+
* The message content
|
|
160
|
+
*/
|
|
161
|
+
content: string;
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* The type of message
|
|
165
|
+
*/
|
|
166
|
+
message_type?: string;
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Additional metadata for the message
|
|
170
|
+
*/
|
|
171
|
+
metadata?: unknown;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export declare namespace Messages {
|
|
175
|
+
export {
|
|
176
|
+
type Message as Message,
|
|
177
|
+
type MessageListResponse as MessageListResponse,
|
|
178
|
+
type MessageGetUnreadCountResponse as MessageGetUnreadCountResponse,
|
|
179
|
+
type MessageMarkReadResponse as MessageMarkReadResponse,
|
|
180
|
+
type MessageSendResponse as MessageSendResponse,
|
|
181
|
+
type MessageListParams as MessageListParams,
|
|
182
|
+
type MessageSendParams as MessageSendParams,
|
|
183
|
+
};
|
|
184
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export {
|
|
4
|
+
Conversations,
|
|
5
|
+
type Conversation,
|
|
6
|
+
type ConversationRetrieveResponse,
|
|
7
|
+
type ConversationListResponse,
|
|
8
|
+
type ConversationDeleteResponse,
|
|
9
|
+
type ConversationStartResponse,
|
|
10
|
+
type ConversationListParams,
|
|
11
|
+
} from './conversations/index';
|
|
12
|
+
export { Messaging } from './messaging';
|