featurebase-node 0.0.2
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 +356 -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 +274 -0
- package/client.d.mts.map +1 -0
- package/client.d.ts +274 -0
- package/client.d.ts.map +1 -0
- package/client.js +569 -0
- package/client.js.map +1 -0
- package/client.mjs +565 -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 +40 -0
- package/internal/parse.js.map +1 -0
- package/internal/parse.mjs +37 -0
- package/internal/parse.mjs.map +1 -0
- package/internal/qs/formats.d.mts +7 -0
- package/internal/qs/formats.d.mts.map +1 -0
- package/internal/qs/formats.d.ts +7 -0
- package/internal/qs/formats.d.ts.map +1 -0
- package/internal/qs/formats.js +13 -0
- package/internal/qs/formats.js.map +1 -0
- package/internal/qs/formats.mjs +9 -0
- package/internal/qs/formats.mjs.map +1 -0
- package/internal/qs/index.d.mts +10 -0
- package/internal/qs/index.d.mts.map +1 -0
- package/internal/qs/index.d.ts +10 -0
- package/internal/qs/index.d.ts.map +1 -0
- package/internal/qs/index.js +14 -0
- package/internal/qs/index.js.map +1 -0
- package/internal/qs/index.mjs +10 -0
- package/internal/qs/index.mjs.map +1 -0
- package/internal/qs/stringify.d.mts +3 -0
- package/internal/qs/stringify.d.mts.map +1 -0
- package/internal/qs/stringify.d.ts +3 -0
- package/internal/qs/stringify.d.ts.map +1 -0
- package/internal/qs/stringify.js +277 -0
- package/internal/qs/stringify.js.map +1 -0
- package/internal/qs/stringify.mjs +274 -0
- package/internal/qs/stringify.mjs.map +1 -0
- package/internal/qs/types.d.mts +57 -0
- package/internal/qs/types.d.mts.map +1 -0
- package/internal/qs/types.d.ts +57 -0
- package/internal/qs/types.d.ts.map +1 -0
- package/internal/qs/types.js +3 -0
- package/internal/qs/types.js.map +1 -0
- package/internal/qs/types.mjs +2 -0
- package/internal/qs/types.mjs.map +1 -0
- package/internal/qs/utils.d.mts +15 -0
- package/internal/qs/utils.d.mts.map +1 -0
- package/internal/qs/utils.d.ts +15 -0
- package/internal/qs/utils.d.ts.map +1 -0
- package/internal/qs/utils.js +230 -0
- package/internal/qs/utils.js.map +1 -0
- package/internal/qs/utils.mjs +217 -0
- package/internal/qs/utils.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/query.d.mts +2 -0
- package/internal/utils/query.d.mts.map +1 -0
- package/internal/utils/query.d.ts +2 -0
- package/internal/utils/query.d.ts.map +1 -0
- package/internal/utils/query.js +10 -0
- package/internal/utils/query.js.map +1 -0
- package/internal/utils/query.mjs +6 -0
- package/internal/utils/query.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 +8 -0
- package/internal/utils.d.mts.map +1 -0
- package/internal/utils.d.ts +8 -0
- package/internal/utils.d.ts.map +1 -0
- package/internal/utils.js +12 -0
- package/internal/utils.js.map +1 -0
- package/internal/utils.mjs +9 -0
- package/internal/utils.mjs.map +1 -0
- package/package.json +143 -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/admins.d.mts +437 -0
- package/resources/admins.d.mts.map +1 -0
- package/resources/admins.d.ts +437 -0
- package/resources/admins.d.ts.map +1 -0
- package/resources/admins.js +157 -0
- package/resources/admins.js.map +1 -0
- package/resources/admins.mjs +153 -0
- package/resources/admins.mjs.map +1 -0
- package/resources/boards.d.mts +202 -0
- package/resources/boards.d.mts.map +1 -0
- package/resources/boards.d.ts +202 -0
- package/resources/boards.d.ts.map +1 -0
- package/resources/boards.js +52 -0
- package/resources/boards.js.map +1 -0
- package/resources/boards.mjs +48 -0
- package/resources/boards.mjs.map +1 -0
- package/resources/brands.d.mts +180 -0
- package/resources/brands.d.mts.map +1 -0
- package/resources/brands.d.ts +180 -0
- package/resources/brands.d.ts.map +1 -0
- package/resources/brands.js +130 -0
- package/resources/brands.js.map +1 -0
- package/resources/brands.mjs +126 -0
- package/resources/brands.mjs.map +1 -0
- package/resources/changelogs/changelogs.d.mts +723 -0
- package/resources/changelogs/changelogs.d.mts.map +1 -0
- package/resources/changelogs/changelogs.d.ts +723 -0
- package/resources/changelogs/changelogs.d.ts.map +1 -0
- package/resources/changelogs/changelogs.js +406 -0
- package/resources/changelogs/changelogs.js.map +1 -0
- package/resources/changelogs/changelogs.mjs +401 -0
- package/resources/changelogs/changelogs.mjs.map +1 -0
- package/resources/changelogs/index.d.mts +3 -0
- package/resources/changelogs/index.d.mts.map +1 -0
- package/resources/changelogs/index.d.ts +3 -0
- package/resources/changelogs/index.d.ts.map +1 -0
- package/resources/changelogs/index.js +9 -0
- package/resources/changelogs/index.js.map +1 -0
- package/resources/changelogs/index.mjs +4 -0
- package/resources/changelogs/index.mjs.map +1 -0
- package/resources/changelogs/subscribers.d.mts +145 -0
- package/resources/changelogs/subscribers.d.mts.map +1 -0
- package/resources/changelogs/subscribers.d.ts +145 -0
- package/resources/changelogs/subscribers.d.ts.map +1 -0
- package/resources/changelogs/subscribers.js +119 -0
- package/resources/changelogs/subscribers.js.map +1 -0
- package/resources/changelogs/subscribers.mjs +115 -0
- package/resources/changelogs/subscribers.mjs.map +1 -0
- package/resources/changelogs.d.mts +2 -0
- package/resources/changelogs.d.mts.map +1 -0
- package/resources/changelogs.d.ts +2 -0
- package/resources/changelogs.d.ts.map +1 -0
- package/resources/changelogs.js +6 -0
- package/resources/changelogs.js.map +1 -0
- package/resources/changelogs.mjs +3 -0
- package/resources/changelogs.mjs.map +1 -0
- package/resources/comments.d.mts +632 -0
- package/resources/comments.d.mts.map +1 -0
- package/resources/comments.d.ts +632 -0
- package/resources/comments.d.ts.map +1 -0
- package/resources/comments.js +397 -0
- package/resources/comments.js.map +1 -0
- package/resources/comments.mjs +393 -0
- package/resources/comments.mjs.map +1 -0
- package/resources/companies/companies.d.mts +497 -0
- package/resources/companies/companies.d.mts.map +1 -0
- package/resources/companies/companies.d.ts +497 -0
- package/resources/companies/companies.d.ts.map +1 -0
- package/resources/companies/companies.js +368 -0
- package/resources/companies/companies.js.map +1 -0
- package/resources/companies/companies.mjs +363 -0
- package/resources/companies/companies.mjs.map +1 -0
- package/resources/companies/contacts.d.mts +236 -0
- package/resources/companies/contacts.d.mts.map +1 -0
- package/resources/companies/contacts.d.ts +236 -0
- package/resources/companies/contacts.d.ts.map +1 -0
- package/resources/companies/contacts.js +218 -0
- package/resources/companies/contacts.js.map +1 -0
- package/resources/companies/contacts.mjs +214 -0
- package/resources/companies/contacts.mjs.map +1 -0
- package/resources/companies/index.d.mts +3 -0
- package/resources/companies/index.d.mts.map +1 -0
- package/resources/companies/index.d.ts +3 -0
- package/resources/companies/index.d.ts.map +1 -0
- package/resources/companies/index.js +9 -0
- package/resources/companies/index.js.map +1 -0
- package/resources/companies/index.mjs +4 -0
- package/resources/companies/index.mjs.map +1 -0
- package/resources/companies.d.mts +2 -0
- package/resources/companies.d.mts.map +1 -0
- package/resources/companies.d.ts +2 -0
- package/resources/companies.d.ts.map +1 -0
- package/resources/companies.js +6 -0
- package/resources/companies.js.map +1 -0
- package/resources/companies.mjs +3 -0
- package/resources/companies.mjs.map +1 -0
- package/resources/contacts/by-user-id/by-user-id.d.mts +147 -0
- package/resources/contacts/by-user-id/by-user-id.d.mts.map +1 -0
- package/resources/contacts/by-user-id/by-user-id.d.ts +147 -0
- package/resources/contacts/by-user-id/by-user-id.d.ts.map +1 -0
- package/resources/contacts/by-user-id/by-user-id.js +152 -0
- package/resources/contacts/by-user-id/by-user-id.js.map +1 -0
- package/resources/contacts/by-user-id/by-user-id.mjs +147 -0
- package/resources/contacts/by-user-id/by-user-id.mjs.map +1 -0
- package/resources/contacts/by-user-id/email-preferences.d.mts +199 -0
- package/resources/contacts/by-user-id/email-preferences.d.mts.map +1 -0
- package/resources/contacts/by-user-id/email-preferences.d.ts +199 -0
- package/resources/contacts/by-user-id/email-preferences.d.ts.map +1 -0
- package/resources/contacts/by-user-id/email-preferences.js +176 -0
- package/resources/contacts/by-user-id/email-preferences.js.map +1 -0
- package/resources/contacts/by-user-id/email-preferences.mjs +172 -0
- package/resources/contacts/by-user-id/email-preferences.mjs.map +1 -0
- package/resources/contacts/by-user-id/index.d.mts +3 -0
- package/resources/contacts/by-user-id/index.d.mts.map +1 -0
- package/resources/contacts/by-user-id/index.d.ts +3 -0
- package/resources/contacts/by-user-id/index.d.ts.map +1 -0
- package/resources/contacts/by-user-id/index.js +9 -0
- package/resources/contacts/by-user-id/index.js.map +1 -0
- package/resources/contacts/by-user-id/index.mjs +4 -0
- package/resources/contacts/by-user-id/index.mjs.map +1 -0
- package/resources/contacts/by-user-id.d.mts +2 -0
- package/resources/contacts/by-user-id.d.mts.map +1 -0
- package/resources/contacts/by-user-id.d.ts +2 -0
- package/resources/contacts/by-user-id.d.ts.map +1 -0
- package/resources/contacts/by-user-id.js +6 -0
- package/resources/contacts/by-user-id.js.map +1 -0
- package/resources/contacts/by-user-id.mjs +3 -0
- package/resources/contacts/by-user-id.mjs.map +1 -0
- package/resources/contacts/contacts.d.mts +708 -0
- package/resources/contacts/contacts.d.mts.map +1 -0
- package/resources/contacts/contacts.d.ts +708 -0
- package/resources/contacts/contacts.d.ts.map +1 -0
- package/resources/contacts/contacts.js +444 -0
- package/resources/contacts/contacts.js.map +1 -0
- package/resources/contacts/contacts.mjs +439 -0
- package/resources/contacts/contacts.mjs.map +1 -0
- package/resources/contacts/email-preferences.d.mts +334 -0
- package/resources/contacts/email-preferences.d.mts.map +1 -0
- package/resources/contacts/email-preferences.d.ts +334 -0
- package/resources/contacts/email-preferences.d.ts.map +1 -0
- package/resources/contacts/email-preferences.js +219 -0
- package/resources/contacts/email-preferences.js.map +1 -0
- package/resources/contacts/email-preferences.mjs +215 -0
- package/resources/contacts/email-preferences.mjs.map +1 -0
- package/resources/contacts/index.d.mts +4 -0
- package/resources/contacts/index.d.mts.map +1 -0
- package/resources/contacts/index.d.ts +4 -0
- package/resources/contacts/index.d.ts.map +1 -0
- package/resources/contacts/index.js +11 -0
- package/resources/contacts/index.js.map +1 -0
- package/resources/contacts/index.mjs +5 -0
- package/resources/contacts/index.mjs.map +1 -0
- package/resources/contacts.d.mts +2 -0
- package/resources/contacts.d.mts.map +1 -0
- package/resources/contacts.d.ts +2 -0
- package/resources/contacts.d.ts.map +1 -0
- package/resources/contacts.js +6 -0
- package/resources/contacts.js.map +1 -0
- package/resources/contacts.mjs +3 -0
- package/resources/contacts.mjs.map +1 -0
- package/resources/conversations/conversations.d.mts +2235 -0
- package/resources/conversations/conversations.d.mts.map +1 -0
- package/resources/conversations/conversations.d.ts +2235 -0
- package/resources/conversations/conversations.d.ts.map +1 -0
- package/resources/conversations/conversations.js +753 -0
- package/resources/conversations/conversations.js.map +1 -0
- package/resources/conversations/conversations.mjs +748 -0
- package/resources/conversations/conversations.mjs.map +1 -0
- package/resources/conversations/index.d.mts +4 -0
- package/resources/conversations/index.d.mts.map +1 -0
- package/resources/conversations/index.d.ts +4 -0
- package/resources/conversations/index.d.ts.map +1 -0
- package/resources/conversations/index.js +11 -0
- package/resources/conversations/index.js.map +1 -0
- package/resources/conversations/index.mjs +5 -0
- package/resources/conversations/index.mjs.map +1 -0
- package/resources/conversations/participants.d.mts +217 -0
- package/resources/conversations/participants.d.mts.map +1 -0
- package/resources/conversations/participants.d.ts +217 -0
- package/resources/conversations/participants.d.ts.map +1 -0
- package/resources/conversations/participants.js +185 -0
- package/resources/conversations/participants.js.map +1 -0
- package/resources/conversations/participants.mjs +181 -0
- package/resources/conversations/participants.mjs.map +1 -0
- package/resources/conversations/tags.d.mts +200 -0
- package/resources/conversations/tags.d.mts.map +1 -0
- package/resources/conversations/tags.d.ts +200 -0
- package/resources/conversations/tags.d.ts.map +1 -0
- package/resources/conversations/tags.js +138 -0
- package/resources/conversations/tags.js.map +1 -0
- package/resources/conversations/tags.mjs +134 -0
- package/resources/conversations/tags.mjs.map +1 -0
- package/resources/conversations.d.mts +2 -0
- package/resources/conversations.d.mts.map +1 -0
- package/resources/conversations.d.ts +2 -0
- package/resources/conversations.d.ts.map +1 -0
- package/resources/conversations.js +6 -0
- package/resources/conversations.js.map +1 -0
- package/resources/conversations.mjs +3 -0
- package/resources/conversations.mjs.map +1 -0
- package/resources/custom-fields.d.mts +189 -0
- package/resources/custom-fields.d.mts.map +1 -0
- package/resources/custom-fields.d.ts +189 -0
- package/resources/custom-fields.d.ts.map +1 -0
- package/resources/custom-fields.js +92 -0
- package/resources/custom-fields.js.map +1 -0
- package/resources/custom-fields.mjs +88 -0
- package/resources/custom-fields.mjs.map +1 -0
- package/resources/help-center/articles.d.mts +770 -0
- package/resources/help-center/articles.d.mts.map +1 -0
- package/resources/help-center/articles.d.ts +770 -0
- package/resources/help-center/articles.d.ts.map +1 -0
- package/resources/help-center/articles.js +296 -0
- package/resources/help-center/articles.js.map +1 -0
- package/resources/help-center/articles.mjs +292 -0
- package/resources/help-center/articles.mjs.map +1 -0
- package/resources/help-center/collections.d.mts +669 -0
- package/resources/help-center/collections.d.mts.map +1 -0
- package/resources/help-center/collections.d.ts +669 -0
- package/resources/help-center/collections.d.ts.map +1 -0
- package/resources/help-center/collections.js +278 -0
- package/resources/help-center/collections.js.map +1 -0
- package/resources/help-center/collections.mjs +274 -0
- package/resources/help-center/collections.mjs.map +1 -0
- package/resources/help-center/help-center.d.mts +22 -0
- package/resources/help-center/help-center.d.mts.map +1 -0
- package/resources/help-center/help-center.d.ts +22 -0
- package/resources/help-center/help-center.d.ts.map +1 -0
- package/resources/help-center/help-center.js +29 -0
- package/resources/help-center/help-center.js.map +1 -0
- package/resources/help-center/help-center.mjs +24 -0
- package/resources/help-center/help-center.mjs.map +1 -0
- package/resources/help-center/help-centers.d.mts +312 -0
- package/resources/help-center/help-centers.d.mts.map +1 -0
- package/resources/help-center/help-centers.d.ts +312 -0
- package/resources/help-center/help-centers.d.ts.map +1 -0
- package/resources/help-center/help-centers.js +111 -0
- package/resources/help-center/help-centers.js.map +1 -0
- package/resources/help-center/help-centers.mjs +107 -0
- package/resources/help-center/help-centers.mjs.map +1 -0
- package/resources/help-center/index.d.mts +6 -0
- package/resources/help-center/index.d.mts.map +1 -0
- package/resources/help-center/index.d.ts +6 -0
- package/resources/help-center/index.d.ts.map +1 -0
- package/resources/help-center/index.js +15 -0
- package/resources/help-center/index.js.map +1 -0
- package/resources/help-center/index.mjs +7 -0
- package/resources/help-center/index.mjs.map +1 -0
- package/resources/help-center/redirect-rules.d.mts +417 -0
- package/resources/help-center/redirect-rules.d.mts.map +1 -0
- package/resources/help-center/redirect-rules.d.ts +417 -0
- package/resources/help-center/redirect-rules.d.ts.map +1 -0
- package/resources/help-center/redirect-rules.js +297 -0
- package/resources/help-center/redirect-rules.js.map +1 -0
- package/resources/help-center/redirect-rules.mjs +293 -0
- package/resources/help-center/redirect-rules.mjs.map +1 -0
- package/resources/help-center.d.mts +2 -0
- package/resources/help-center.d.mts.map +1 -0
- package/resources/help-center.d.ts +2 -0
- package/resources/help-center.d.ts.map +1 -0
- package/resources/help-center.js +6 -0
- package/resources/help-center.js.map +1 -0
- package/resources/help-center.mjs +3 -0
- package/resources/help-center.mjs.map +1 -0
- package/resources/index.d.mts +18 -0
- package/resources/index.d.mts.map +1 -0
- package/resources/index.d.ts +18 -0
- package/resources/index.d.ts.map +1 -0
- package/resources/index.js +39 -0
- package/resources/index.js.map +1 -0
- package/resources/index.mjs +19 -0
- package/resources/index.mjs.map +1 -0
- package/resources/post-statuses.d.mts +74 -0
- package/resources/post-statuses.d.mts.map +1 -0
- package/resources/post-statuses.d.ts +74 -0
- package/resources/post-statuses.d.ts.map +1 -0
- package/resources/post-statuses.js +53 -0
- package/resources/post-statuses.js.map +1 -0
- package/resources/post-statuses.mjs +49 -0
- package/resources/post-statuses.mjs.map +1 -0
- package/resources/posts/index.d.mts +3 -0
- package/resources/posts/index.d.mts.map +1 -0
- package/resources/posts/index.d.ts +3 -0
- package/resources/posts/index.d.ts.map +1 -0
- package/resources/posts/index.js +9 -0
- package/resources/posts/index.js.map +1 -0
- package/resources/posts/index.mjs +4 -0
- package/resources/posts/index.mjs.map +1 -0
- package/resources/posts/posts.d.mts +799 -0
- package/resources/posts/posts.d.mts.map +1 -0
- package/resources/posts/posts.d.ts +799 -0
- package/resources/posts/posts.d.ts.map +1 -0
- package/resources/posts/posts.js +271 -0
- package/resources/posts/posts.js.map +1 -0
- package/resources/posts/posts.mjs +266 -0
- package/resources/posts/posts.mjs.map +1 -0
- package/resources/posts/voters.d.mts +359 -0
- package/resources/posts/voters.d.mts.map +1 -0
- package/resources/posts/voters.d.ts +359 -0
- package/resources/posts/voters.d.ts.map +1 -0
- package/resources/posts/voters.js +171 -0
- package/resources/posts/voters.js.map +1 -0
- package/resources/posts/voters.mjs +167 -0
- package/resources/posts/voters.mjs.map +1 -0
- package/resources/posts.d.mts +2 -0
- package/resources/posts.d.mts.map +1 -0
- package/resources/posts.d.ts +2 -0
- package/resources/posts.d.ts.map +1 -0
- package/resources/posts.js +6 -0
- package/resources/posts.js.map +1 -0
- package/resources/posts.mjs +3 -0
- package/resources/posts.mjs.map +1 -0
- package/resources/surveys.d.mts +451 -0
- package/resources/surveys.d.mts.map +1 -0
- package/resources/surveys.d.ts +451 -0
- package/resources/surveys.d.ts.map +1 -0
- package/resources/surveys.js +149 -0
- package/resources/surveys.js.map +1 -0
- package/resources/surveys.mjs +145 -0
- package/resources/surveys.mjs.map +1 -0
- package/resources/tags.d.mts +147 -0
- package/resources/tags.d.mts.map +1 -0
- package/resources/tags.d.ts +147 -0
- package/resources/tags.d.ts.map +1 -0
- package/resources/tags.js +100 -0
- package/resources/tags.js.map +1 -0
- package/resources/tags.mjs +96 -0
- package/resources/tags.mjs.map +1 -0
- package/resources/teams.d.mts +165 -0
- package/resources/teams.d.mts.map +1 -0
- package/resources/teams.d.ts +165 -0
- package/resources/teams.d.ts.map +1 -0
- package/resources/teams.js +120 -0
- package/resources/teams.js.map +1 -0
- package/resources/teams.mjs +116 -0
- package/resources/teams.mjs.map +1 -0
- package/resources/tickets/categories.d.mts +63 -0
- package/resources/tickets/categories.d.mts.map +1 -0
- package/resources/tickets/categories.d.ts +63 -0
- package/resources/tickets/categories.d.ts.map +1 -0
- package/resources/tickets/categories.js +67 -0
- package/resources/tickets/categories.js.map +1 -0
- package/resources/tickets/categories.mjs +63 -0
- package/resources/tickets/categories.mjs.map +1 -0
- package/resources/tickets/custom-fields.d.mts +80 -0
- package/resources/tickets/custom-fields.d.mts.map +1 -0
- package/resources/tickets/custom-fields.d.ts +80 -0
- package/resources/tickets/custom-fields.d.ts.map +1 -0
- package/resources/tickets/custom-fields.js +85 -0
- package/resources/tickets/custom-fields.js.map +1 -0
- package/resources/tickets/custom-fields.mjs +81 -0
- package/resources/tickets/custom-fields.mjs.map +1 -0
- package/resources/tickets/index.d.mts +5 -0
- package/resources/tickets/index.d.mts.map +1 -0
- package/resources/tickets/index.d.ts +5 -0
- package/resources/tickets/index.d.ts.map +1 -0
- package/resources/tickets/index.js +13 -0
- package/resources/tickets/index.js.map +1 -0
- package/resources/tickets/index.mjs +6 -0
- package/resources/tickets/index.mjs.map +1 -0
- package/resources/tickets/statuses.d.mts +59 -0
- package/resources/tickets/statuses.d.mts.map +1 -0
- package/resources/tickets/statuses.d.ts +59 -0
- package/resources/tickets/statuses.d.ts.map +1 -0
- package/resources/tickets/statuses.js +63 -0
- package/resources/tickets/statuses.js.map +1 -0
- package/resources/tickets/statuses.mjs +59 -0
- package/resources/tickets/statuses.mjs.map +1 -0
- package/resources/tickets/tickets.d.mts +794 -0
- package/resources/tickets/tickets.d.mts.map +1 -0
- package/resources/tickets/tickets.d.ts +794 -0
- package/resources/tickets/tickets.d.ts.map +1 -0
- package/resources/tickets/tickets.js +327 -0
- package/resources/tickets/tickets.js.map +1 -0
- package/resources/tickets/tickets.mjs +322 -0
- package/resources/tickets/tickets.mjs.map +1 -0
- package/resources/tickets.d.mts +2 -0
- package/resources/tickets.d.mts.map +1 -0
- package/resources/tickets.d.ts +2 -0
- package/resources/tickets.d.ts.map +1 -0
- package/resources/tickets.js +6 -0
- package/resources/tickets.js.map +1 -0
- package/resources/tickets.mjs +3 -0
- package/resources/tickets.mjs.map +1 -0
- package/resources/webhooks.d.mts +626 -0
- package/resources/webhooks.d.mts.map +1 -0
- package/resources/webhooks.d.ts +626 -0
- package/resources/webhooks.d.ts.map +1 -0
- package/resources/webhooks.js +442 -0
- package/resources/webhooks.js.map +1 -0
- package/resources/webhooks.mjs +438 -0
- package/resources/webhooks.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 +1169 -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 +56 -0
- package/src/internal/qs/LICENSE.md +13 -0
- package/src/internal/qs/README.md +3 -0
- package/src/internal/qs/formats.ts +10 -0
- package/src/internal/qs/index.ts +13 -0
- package/src/internal/qs/stringify.ts +385 -0
- package/src/internal/qs/types.ts +71 -0
- package/src/internal/qs/utils.ts +265 -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/query.ts +7 -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 +9 -0
- package/src/lib/.keep +4 -0
- package/src/resource.ts +2 -0
- package/src/resources/admins.ts +557 -0
- package/src/resources/boards.ts +259 -0
- package/src/resources/brands.ts +232 -0
- package/src/resources/changelogs/changelogs.ts +1139 -0
- package/src/resources/changelogs/index.ts +23 -0
- package/src/resources/changelogs/subscribers.ts +226 -0
- package/src/resources/changelogs.ts +3 -0
- package/src/resources/comments.ts +786 -0
- package/src/resources/companies/companies.ts +632 -0
- package/src/resources/companies/contacts.ts +299 -0
- package/src/resources/companies/index.ts +21 -0
- package/src/resources/companies.ts +3 -0
- package/src/resources/contacts/by-user-id/by-user-id.ts +200 -0
- package/src/resources/contacts/by-user-id/email-preferences.ts +243 -0
- package/src/resources/contacts/by-user-id/index.ts +13 -0
- package/src/resources/contacts/by-user-id.ts +3 -0
- package/src/resources/contacts/contacts.ts +908 -0
- package/src/resources/contacts/email-preferences.ts +399 -0
- package/src/resources/contacts/index.ts +32 -0
- package/src/resources/contacts.ts +3 -0
- package/src/resources/conversations/conversations.ts +2721 -0
- package/src/resources/conversations/index.ts +31 -0
- package/src/resources/conversations/participants.ts +263 -0
- package/src/resources/conversations/tags.ts +252 -0
- package/src/resources/conversations.ts +3 -0
- package/src/resources/custom-fields.ts +249 -0
- package/src/resources/help-center/articles.ts +1231 -0
- package/src/resources/help-center/collections.ts +1065 -0
- package/src/resources/help-center/help-center.ts +125 -0
- package/src/resources/help-center/help-centers.ts +558 -0
- package/src/resources/help-center/index.ts +52 -0
- package/src/resources/help-center/redirect-rules.ts +711 -0
- package/src/resources/help-center.ts +3 -0
- package/src/resources/index.ts +179 -0
- package/src/resources/post-statuses.ts +119 -0
- package/src/resources/posts/index.ts +22 -0
- package/src/resources/posts/posts.ts +1019 -0
- package/src/resources/posts/voters.ts +453 -0
- package/src/resources/posts.ts +3 -0
- package/src/resources/surveys.ts +576 -0
- package/src/resources/tags.ts +226 -0
- package/src/resources/teams.ts +213 -0
- package/src/resources/tickets/categories.ts +101 -0
- package/src/resources/tickets/custom-fields.ts +116 -0
- package/src/resources/tickets/index.ts +28 -0
- package/src/resources/tickets/statuses.ts +97 -0
- package/src/resources/tickets/tickets.ts +1019 -0
- package/src/resources/tickets.ts +3 -0
- package/src/resources/webhooks.ts +850 -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
package/src/client.ts
ADDED
|
@@ -0,0 +1,1169 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import type { RequestInit, RequestInfo, BodyInit } from './internal/builtin-types';
|
|
4
|
+
import type { HTTPMethod, PromiseOrValue, MergedRequestInit, FinalizedRequestInit } from './internal/types';
|
|
5
|
+
import { uuid4 } from './internal/utils/uuid';
|
|
6
|
+
import { validatePositiveInteger, isAbsoluteURL, safeJSON } from './internal/utils/values';
|
|
7
|
+
import { sleep } from './internal/utils/sleep';
|
|
8
|
+
export type { Logger, LogLevel } from './internal/utils/log';
|
|
9
|
+
import { castToError, isAbortError } from './internal/errors';
|
|
10
|
+
import type { APIResponseProps } from './internal/parse';
|
|
11
|
+
import { getPlatformHeaders } from './internal/detect-platform';
|
|
12
|
+
import * as Shims from './internal/shims';
|
|
13
|
+
import * as Opts from './internal/request-options';
|
|
14
|
+
import { stringifyQuery } from './internal/utils/query';
|
|
15
|
+
import { VERSION } from './version';
|
|
16
|
+
import * as Errors from './core/error';
|
|
17
|
+
import * as Uploads from './core/uploads';
|
|
18
|
+
import * as API from './resources/index';
|
|
19
|
+
import { APIPromise } from './core/api-promise';
|
|
20
|
+
import {
|
|
21
|
+
Admin,
|
|
22
|
+
AdminListParams,
|
|
23
|
+
AdminListResponse,
|
|
24
|
+
AdminListRolesParams,
|
|
25
|
+
AdminListRolesResponse,
|
|
26
|
+
AdminRetrieveParams,
|
|
27
|
+
Admins,
|
|
28
|
+
} from './resources/admins';
|
|
29
|
+
import { Board, BoardListParams, BoardListResponse, BoardRetrieveParams, Boards } from './resources/boards';
|
|
30
|
+
import { Brand, BrandListParams, BrandListResponse, BrandRetrieveParams, Brands } from './resources/brands';
|
|
31
|
+
import {
|
|
32
|
+
Comment,
|
|
33
|
+
CommentCreateParams,
|
|
34
|
+
CommentDelete0Params,
|
|
35
|
+
CommentDelete0Response,
|
|
36
|
+
CommentDelete1Params,
|
|
37
|
+
CommentDelete1Response,
|
|
38
|
+
CommentListParams,
|
|
39
|
+
CommentListResponse,
|
|
40
|
+
CommentRetrieveParams,
|
|
41
|
+
CommentUpdateParams,
|
|
42
|
+
Comments,
|
|
43
|
+
} from './resources/comments';
|
|
44
|
+
import {
|
|
45
|
+
CustomField,
|
|
46
|
+
CustomFieldList,
|
|
47
|
+
CustomFieldListParams,
|
|
48
|
+
CustomFieldRetrieveParams,
|
|
49
|
+
CustomFields,
|
|
50
|
+
} from './resources/custom-fields';
|
|
51
|
+
import {
|
|
52
|
+
PostStatus,
|
|
53
|
+
PostStatusListParams,
|
|
54
|
+
PostStatusListResponse,
|
|
55
|
+
PostStatusRetrieveParams,
|
|
56
|
+
PostStatuses,
|
|
57
|
+
} from './resources/post-statuses';
|
|
58
|
+
import {
|
|
59
|
+
Survey,
|
|
60
|
+
SurveyListParams,
|
|
61
|
+
SurveyListResponse,
|
|
62
|
+
SurveyNextAction,
|
|
63
|
+
SurveyRetrieveParams,
|
|
64
|
+
SurveyRetrieveResponsesParams,
|
|
65
|
+
SurveyRetrieveResponsesResponse,
|
|
66
|
+
Surveys,
|
|
67
|
+
} from './resources/surveys';
|
|
68
|
+
import {
|
|
69
|
+
ConversationTag,
|
|
70
|
+
TagCreateOrRenameParams,
|
|
71
|
+
TagDeleteParams,
|
|
72
|
+
TagDeleteResponse,
|
|
73
|
+
TagListParams,
|
|
74
|
+
TagListResponse,
|
|
75
|
+
TagRetrieveParams,
|
|
76
|
+
Tags,
|
|
77
|
+
} from './resources/tags';
|
|
78
|
+
import { Team, TeamListParams, TeamListResponse, TeamRetrieveParams, Teams } from './resources/teams';
|
|
79
|
+
import {
|
|
80
|
+
Webhook,
|
|
81
|
+
WebhookCreateParams,
|
|
82
|
+
WebhookDeleteParams,
|
|
83
|
+
WebhookDeleteResponse,
|
|
84
|
+
WebhookListParams,
|
|
85
|
+
WebhookListResponse,
|
|
86
|
+
WebhookRefreshSecretParams,
|
|
87
|
+
WebhookRequestConfigInput,
|
|
88
|
+
WebhookRetrieveParams,
|
|
89
|
+
WebhookUpdateParams,
|
|
90
|
+
Webhooks,
|
|
91
|
+
} from './resources/webhooks';
|
|
92
|
+
import {
|
|
93
|
+
Changelog,
|
|
94
|
+
ChangelogCreateParams,
|
|
95
|
+
ChangelogDeleteParams,
|
|
96
|
+
ChangelogDeleteResponse,
|
|
97
|
+
ChangelogListParams,
|
|
98
|
+
ChangelogListResponse,
|
|
99
|
+
ChangelogPublishParams,
|
|
100
|
+
ChangelogRetrieveParams,
|
|
101
|
+
ChangelogUnpublishParams,
|
|
102
|
+
ChangelogUpdateParams,
|
|
103
|
+
Changelogs,
|
|
104
|
+
PublishUnpublishSuccess,
|
|
105
|
+
} from './resources/changelogs/changelogs';
|
|
106
|
+
import {
|
|
107
|
+
Companies,
|
|
108
|
+
Company,
|
|
109
|
+
CompanyCreateOrUpdateParams,
|
|
110
|
+
CompanyDeleteByCompanyIDParams,
|
|
111
|
+
CompanyDeleteParams,
|
|
112
|
+
CompanyListParams,
|
|
113
|
+
CompanyListResponse,
|
|
114
|
+
CompanyRetrieveParams,
|
|
115
|
+
DeletedCompany,
|
|
116
|
+
} from './resources/companies/companies';
|
|
117
|
+
import {
|
|
118
|
+
Contact,
|
|
119
|
+
ContactBlockParams,
|
|
120
|
+
ContactBlockResponse,
|
|
121
|
+
ContactCreateOrUpdateParams,
|
|
122
|
+
ContactCreateOrUpdateResponse,
|
|
123
|
+
ContactDeleteParams,
|
|
124
|
+
ContactList,
|
|
125
|
+
ContactListParams,
|
|
126
|
+
ContactRetrieveParams,
|
|
127
|
+
ContactRetrieveResponse,
|
|
128
|
+
ContactUnblockParams,
|
|
129
|
+
ContactUnblockResponse,
|
|
130
|
+
Contacts,
|
|
131
|
+
DeletedContact,
|
|
132
|
+
} from './resources/contacts/contacts';
|
|
133
|
+
import {
|
|
134
|
+
Conversation,
|
|
135
|
+
ConversationCreateParams,
|
|
136
|
+
ConversationDeleteParams,
|
|
137
|
+
ConversationDeleteResponse,
|
|
138
|
+
ConversationListParams,
|
|
139
|
+
ConversationListResponse,
|
|
140
|
+
ConversationPart,
|
|
141
|
+
ConversationPartAuthor,
|
|
142
|
+
ConversationParticipant,
|
|
143
|
+
ConversationRedactParams,
|
|
144
|
+
ConversationReplyParams,
|
|
145
|
+
ConversationRetrieveParams,
|
|
146
|
+
ConversationTagApplication,
|
|
147
|
+
ConversationUpdateParams,
|
|
148
|
+
Conversations,
|
|
149
|
+
CsatEmailDelivery,
|
|
150
|
+
CsatRatedAgent,
|
|
151
|
+
CsatWorkflowLink,
|
|
152
|
+
EmailRecipients,
|
|
153
|
+
} from './resources/conversations/conversations';
|
|
154
|
+
import { HelpCenter } from './resources/help-center/help-center';
|
|
155
|
+
import {
|
|
156
|
+
Post,
|
|
157
|
+
PostCreateParams,
|
|
158
|
+
PostDeleteParams,
|
|
159
|
+
PostDeleteResponse,
|
|
160
|
+
PostListParams,
|
|
161
|
+
PostListResponse,
|
|
162
|
+
PostRetrieveParams,
|
|
163
|
+
PostUpdateParams,
|
|
164
|
+
Posts,
|
|
165
|
+
} from './resources/posts/posts';
|
|
166
|
+
import {
|
|
167
|
+
AuthorInput,
|
|
168
|
+
Ticket,
|
|
169
|
+
TicketCreateParams,
|
|
170
|
+
TicketDeleteParams,
|
|
171
|
+
TicketDeleteResponse,
|
|
172
|
+
TicketListParams,
|
|
173
|
+
TicketListResponse,
|
|
174
|
+
TicketReplyParams,
|
|
175
|
+
TicketRetrieveParams,
|
|
176
|
+
TicketUpdateParams,
|
|
177
|
+
Tickets,
|
|
178
|
+
} from './resources/tickets/tickets';
|
|
179
|
+
import { type Fetch } from './internal/builtin-types';
|
|
180
|
+
import { HeadersLike, NullableHeaders, buildHeaders } from './internal/headers';
|
|
181
|
+
import { FinalRequestOptions, RequestOptions } from './internal/request-options';
|
|
182
|
+
import { readEnv } from './internal/utils/env';
|
|
183
|
+
import {
|
|
184
|
+
type LogLevel,
|
|
185
|
+
type Logger,
|
|
186
|
+
formatRequestDetails,
|
|
187
|
+
loggerFor,
|
|
188
|
+
parseLogLevel,
|
|
189
|
+
} from './internal/utils/log';
|
|
190
|
+
import { isEmptyObj } from './internal/utils/values';
|
|
191
|
+
|
|
192
|
+
export interface ClientOptions {
|
|
193
|
+
/**
|
|
194
|
+
* API key as Bearer token. Use: Authorization: Bearer sk_...
|
|
195
|
+
*/
|
|
196
|
+
apiKey?: string | undefined;
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Override the default base URL for the API, e.g., "https://api.example.com/v2/"
|
|
200
|
+
*
|
|
201
|
+
* Defaults to process.env['FEATUREBASE_BASE_URL'].
|
|
202
|
+
*/
|
|
203
|
+
baseURL?: string | null | undefined;
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* The maximum amount of time (in milliseconds) that the client should wait for a response
|
|
207
|
+
* from the server before timing out a single request.
|
|
208
|
+
*
|
|
209
|
+
* Note that request timeouts are retried by default, so in a worst-case scenario you may wait
|
|
210
|
+
* much longer than this timeout before the promise succeeds or fails.
|
|
211
|
+
*
|
|
212
|
+
* @unit milliseconds
|
|
213
|
+
*/
|
|
214
|
+
timeout?: number | undefined;
|
|
215
|
+
/**
|
|
216
|
+
* Additional `RequestInit` options to be passed to `fetch` calls.
|
|
217
|
+
* Properties will be overridden by per-request `fetchOptions`.
|
|
218
|
+
*/
|
|
219
|
+
fetchOptions?: MergedRequestInit | undefined;
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Specify a custom `fetch` function implementation.
|
|
223
|
+
*
|
|
224
|
+
* If not provided, we expect that `fetch` is defined globally.
|
|
225
|
+
*/
|
|
226
|
+
fetch?: Fetch | undefined;
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* The maximum number of times that the client will retry a request in case of a
|
|
230
|
+
* temporary failure, like a network error or a 5XX error from the server.
|
|
231
|
+
*
|
|
232
|
+
* @default 2
|
|
233
|
+
*/
|
|
234
|
+
maxRetries?: number | undefined;
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Default headers to include with every request to the API.
|
|
238
|
+
*
|
|
239
|
+
* These can be removed in individual requests by explicitly setting the
|
|
240
|
+
* header to `null` in request options.
|
|
241
|
+
*/
|
|
242
|
+
defaultHeaders?: HeadersLike | undefined;
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Default query parameters to include with every request to the API.
|
|
246
|
+
*
|
|
247
|
+
* These can be removed in individual requests by explicitly setting the
|
|
248
|
+
* param to `undefined` in request options.
|
|
249
|
+
*/
|
|
250
|
+
defaultQuery?: Record<string, string | undefined> | undefined;
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Set the log level.
|
|
254
|
+
*
|
|
255
|
+
* Defaults to process.env['FEATUREBASE_LOG'] or 'warn' if it isn't set.
|
|
256
|
+
*/
|
|
257
|
+
logLevel?: LogLevel | undefined;
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Set the logger.
|
|
261
|
+
*
|
|
262
|
+
* Defaults to globalThis.console.
|
|
263
|
+
*/
|
|
264
|
+
logger?: Logger | undefined;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* API Client for interfacing with the Featurebase API.
|
|
269
|
+
*/
|
|
270
|
+
export class Featurebase {
|
|
271
|
+
apiKey: string;
|
|
272
|
+
|
|
273
|
+
baseURL: string;
|
|
274
|
+
maxRetries: number;
|
|
275
|
+
timeout: number;
|
|
276
|
+
logger: Logger;
|
|
277
|
+
logLevel: LogLevel | undefined;
|
|
278
|
+
fetchOptions: MergedRequestInit | undefined;
|
|
279
|
+
|
|
280
|
+
private fetch: Fetch;
|
|
281
|
+
#encoder: Opts.RequestEncoder;
|
|
282
|
+
protected idempotencyHeader?: string;
|
|
283
|
+
private _options: ClientOptions;
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* API Client for interfacing with the Featurebase API.
|
|
287
|
+
*
|
|
288
|
+
* @param {string | undefined} [opts.apiKey=process.env['FEATUREBASE_API_KEY'] ?? undefined]
|
|
289
|
+
* @param {string} [opts.baseURL=process.env['FEATUREBASE_BASE_URL'] ?? https://do.featurebase.app] - Override the default base URL for the API.
|
|
290
|
+
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
291
|
+
* @param {MergedRequestInit} [opts.fetchOptions] - Additional `RequestInit` options to be passed to `fetch` calls.
|
|
292
|
+
* @param {Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
|
|
293
|
+
* @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
|
|
294
|
+
* @param {HeadersLike} opts.defaultHeaders - Default headers to include with every request to the API.
|
|
295
|
+
* @param {Record<string, string | undefined>} opts.defaultQuery - Default query parameters to include with every request to the API.
|
|
296
|
+
*/
|
|
297
|
+
constructor({
|
|
298
|
+
baseURL = readEnv('FEATUREBASE_BASE_URL'),
|
|
299
|
+
apiKey = readEnv('FEATUREBASE_API_KEY'),
|
|
300
|
+
...opts
|
|
301
|
+
}: ClientOptions = {}) {
|
|
302
|
+
if (apiKey === undefined) {
|
|
303
|
+
throw new Errors.FeaturebaseError(
|
|
304
|
+
"The FEATUREBASE_API_KEY environment variable is missing or empty; either provide it, or instantiate the Featurebase client with an apiKey option, like new Featurebase({ apiKey: 'My API Key' }).",
|
|
305
|
+
);
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
const options: ClientOptions = {
|
|
309
|
+
apiKey,
|
|
310
|
+
...opts,
|
|
311
|
+
baseURL: baseURL || `https://do.featurebase.app`,
|
|
312
|
+
};
|
|
313
|
+
|
|
314
|
+
this.baseURL = options.baseURL!;
|
|
315
|
+
this.timeout = options.timeout ?? Featurebase.DEFAULT_TIMEOUT /* 1 minute */;
|
|
316
|
+
this.logger = options.logger ?? console;
|
|
317
|
+
const defaultLogLevel = 'warn';
|
|
318
|
+
// Set default logLevel early so that we can log a warning in parseLogLevel.
|
|
319
|
+
this.logLevel = defaultLogLevel;
|
|
320
|
+
this.logLevel =
|
|
321
|
+
parseLogLevel(options.logLevel, 'ClientOptions.logLevel', this) ??
|
|
322
|
+
parseLogLevel(readEnv('FEATUREBASE_LOG'), "process.env['FEATUREBASE_LOG']", this) ??
|
|
323
|
+
defaultLogLevel;
|
|
324
|
+
this.fetchOptions = options.fetchOptions;
|
|
325
|
+
this.maxRetries = options.maxRetries ?? 2;
|
|
326
|
+
this.fetch = options.fetch ?? Shims.getDefaultFetch();
|
|
327
|
+
this.#encoder = Opts.FallbackEncoder;
|
|
328
|
+
|
|
329
|
+
const customHeadersEnv = readEnv('FEATUREBASE_CUSTOM_HEADERS');
|
|
330
|
+
if (customHeadersEnv) {
|
|
331
|
+
const parsed: Record<string, string> = {};
|
|
332
|
+
for (const line of customHeadersEnv.split('\n')) {
|
|
333
|
+
const colon = line.indexOf(':');
|
|
334
|
+
if (colon >= 0) {
|
|
335
|
+
parsed[line.substring(0, colon).trim()] = line.substring(colon + 1).trim();
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
options.defaultHeaders = { ...parsed, ...options.defaultHeaders };
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
this._options = options;
|
|
342
|
+
|
|
343
|
+
this.apiKey = apiKey;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Create a new client instance re-using the same options given to the current client with optional overriding.
|
|
348
|
+
*/
|
|
349
|
+
withOptions(options: Partial<ClientOptions>): this {
|
|
350
|
+
const client = new (this.constructor as any as new (props: ClientOptions) => typeof this)({
|
|
351
|
+
...this._options,
|
|
352
|
+
baseURL: this.baseURL,
|
|
353
|
+
maxRetries: this.maxRetries,
|
|
354
|
+
timeout: this.timeout,
|
|
355
|
+
logger: this.logger,
|
|
356
|
+
logLevel: this.logLevel,
|
|
357
|
+
fetch: this.fetch,
|
|
358
|
+
fetchOptions: this.fetchOptions,
|
|
359
|
+
apiKey: this.apiKey,
|
|
360
|
+
...options,
|
|
361
|
+
});
|
|
362
|
+
return client;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* Check whether the base URL is set to its default.
|
|
367
|
+
*/
|
|
368
|
+
#baseURLOverridden(): boolean {
|
|
369
|
+
return this.baseURL !== 'https://do.featurebase.app';
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
protected defaultQuery(): Record<string, string | undefined> | undefined {
|
|
373
|
+
return this._options.defaultQuery;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
protected validateHeaders({ values, nulls }: NullableHeaders) {
|
|
377
|
+
return;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
protected async authHeaders(opts: FinalRequestOptions): Promise<NullableHeaders | undefined> {
|
|
381
|
+
return buildHeaders([{ Authorization: `Bearer ${this.apiKey}` }]);
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
protected stringifyQuery(query: object | Record<string, unknown>): string {
|
|
385
|
+
return stringifyQuery(query);
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
private getUserAgent(): string {
|
|
389
|
+
return `${this.constructor.name}/JS ${VERSION}`;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
protected defaultIdempotencyKey(): string {
|
|
393
|
+
return `stainless-node-retry-${uuid4()}`;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
protected makeStatusError(
|
|
397
|
+
status: number,
|
|
398
|
+
error: Object,
|
|
399
|
+
message: string | undefined,
|
|
400
|
+
headers: Headers,
|
|
401
|
+
): Errors.APIError {
|
|
402
|
+
return Errors.APIError.generate(status, error, message, headers);
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
buildURL(
|
|
406
|
+
path: string,
|
|
407
|
+
query: Record<string, unknown> | null | undefined,
|
|
408
|
+
defaultBaseURL?: string | undefined,
|
|
409
|
+
): string {
|
|
410
|
+
const baseURL = (!this.#baseURLOverridden() && defaultBaseURL) || this.baseURL;
|
|
411
|
+
const url =
|
|
412
|
+
isAbsoluteURL(path) ?
|
|
413
|
+
new URL(path)
|
|
414
|
+
: new URL(baseURL + (baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path));
|
|
415
|
+
|
|
416
|
+
const defaultQuery = this.defaultQuery();
|
|
417
|
+
const pathQuery = Object.fromEntries(url.searchParams);
|
|
418
|
+
if (!isEmptyObj(defaultQuery) || !isEmptyObj(pathQuery)) {
|
|
419
|
+
query = { ...pathQuery, ...defaultQuery, ...query };
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
if (typeof query === 'object' && query && !Array.isArray(query)) {
|
|
423
|
+
url.search = this.stringifyQuery(query);
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
return url.toString();
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* Used as a callback for mutating the given `FinalRequestOptions` object.
|
|
431
|
+
*/
|
|
432
|
+
protected async prepareOptions(options: FinalRequestOptions): Promise<void> {}
|
|
433
|
+
|
|
434
|
+
/**
|
|
435
|
+
* Used as a callback for mutating the given `RequestInit` object.
|
|
436
|
+
*
|
|
437
|
+
* This is useful for cases where you want to add certain headers based off of
|
|
438
|
+
* the request properties, e.g. `method` or `url`.
|
|
439
|
+
*/
|
|
440
|
+
protected async prepareRequest(
|
|
441
|
+
request: RequestInit,
|
|
442
|
+
{ url, options }: { url: string; options: FinalRequestOptions },
|
|
443
|
+
): Promise<void> {}
|
|
444
|
+
|
|
445
|
+
get<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp> {
|
|
446
|
+
return this.methodRequest('get', path, opts);
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
post<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp> {
|
|
450
|
+
return this.methodRequest('post', path, opts);
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
patch<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp> {
|
|
454
|
+
return this.methodRequest('patch', path, opts);
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
put<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp> {
|
|
458
|
+
return this.methodRequest('put', path, opts);
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
delete<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp> {
|
|
462
|
+
return this.methodRequest('delete', path, opts);
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
private methodRequest<Rsp>(
|
|
466
|
+
method: HTTPMethod,
|
|
467
|
+
path: string,
|
|
468
|
+
opts?: PromiseOrValue<RequestOptions>,
|
|
469
|
+
): APIPromise<Rsp> {
|
|
470
|
+
return this.request(
|
|
471
|
+
Promise.resolve(opts).then((opts) => {
|
|
472
|
+
return { method, path, ...opts };
|
|
473
|
+
}),
|
|
474
|
+
);
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
request<Rsp>(
|
|
478
|
+
options: PromiseOrValue<FinalRequestOptions>,
|
|
479
|
+
remainingRetries: number | null = null,
|
|
480
|
+
): APIPromise<Rsp> {
|
|
481
|
+
return new APIPromise(this, this.makeRequest(options, remainingRetries, undefined));
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
private async makeRequest(
|
|
485
|
+
optionsInput: PromiseOrValue<FinalRequestOptions>,
|
|
486
|
+
retriesRemaining: number | null,
|
|
487
|
+
retryOfRequestLogID: string | undefined,
|
|
488
|
+
): Promise<APIResponseProps> {
|
|
489
|
+
const options = await optionsInput;
|
|
490
|
+
const maxRetries = options.maxRetries ?? this.maxRetries;
|
|
491
|
+
if (retriesRemaining == null) {
|
|
492
|
+
retriesRemaining = maxRetries;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
await this.prepareOptions(options);
|
|
496
|
+
|
|
497
|
+
const { req, url, timeout } = await this.buildRequest(options, {
|
|
498
|
+
retryCount: maxRetries - retriesRemaining,
|
|
499
|
+
});
|
|
500
|
+
|
|
501
|
+
await this.prepareRequest(req, { url, options });
|
|
502
|
+
|
|
503
|
+
/** Not an API request ID, just for correlating local log entries. */
|
|
504
|
+
const requestLogID = 'log_' + ((Math.random() * (1 << 24)) | 0).toString(16).padStart(6, '0');
|
|
505
|
+
const retryLogStr = retryOfRequestLogID === undefined ? '' : `, retryOf: ${retryOfRequestLogID}`;
|
|
506
|
+
const startTime = Date.now();
|
|
507
|
+
|
|
508
|
+
loggerFor(this).debug(
|
|
509
|
+
`[${requestLogID}] sending request`,
|
|
510
|
+
formatRequestDetails({
|
|
511
|
+
retryOfRequestLogID,
|
|
512
|
+
method: options.method,
|
|
513
|
+
url,
|
|
514
|
+
options,
|
|
515
|
+
headers: req.headers,
|
|
516
|
+
}),
|
|
517
|
+
);
|
|
518
|
+
|
|
519
|
+
if (options.signal?.aborted) {
|
|
520
|
+
throw new Errors.APIUserAbortError();
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
const controller = new AbortController();
|
|
524
|
+
const response = await this.fetchWithTimeout(url, req, timeout, controller).catch(castToError);
|
|
525
|
+
const headersTime = Date.now();
|
|
526
|
+
|
|
527
|
+
if (response instanceof globalThis.Error) {
|
|
528
|
+
const retryMessage = `retrying, ${retriesRemaining} attempts remaining`;
|
|
529
|
+
if (options.signal?.aborted) {
|
|
530
|
+
throw new Errors.APIUserAbortError();
|
|
531
|
+
}
|
|
532
|
+
// detect native connection timeout errors
|
|
533
|
+
// deno throws "TypeError: error sending request for url (https://example/): client error (Connect): tcp connect error: Operation timed out (os error 60): Operation timed out (os error 60)"
|
|
534
|
+
// undici throws "TypeError: fetch failed" with cause "ConnectTimeoutError: Connect Timeout Error (attempted address: example:443, timeout: 1ms)"
|
|
535
|
+
// others do not provide enough information to distinguish timeouts from other connection errors
|
|
536
|
+
const isTimeout =
|
|
537
|
+
isAbortError(response) ||
|
|
538
|
+
/timed? ?out/i.test(String(response) + ('cause' in response ? String(response.cause) : ''));
|
|
539
|
+
if (retriesRemaining) {
|
|
540
|
+
loggerFor(this).info(
|
|
541
|
+
`[${requestLogID}] connection ${isTimeout ? 'timed out' : 'failed'} - ${retryMessage}`,
|
|
542
|
+
);
|
|
543
|
+
loggerFor(this).debug(
|
|
544
|
+
`[${requestLogID}] connection ${isTimeout ? 'timed out' : 'failed'} (${retryMessage})`,
|
|
545
|
+
formatRequestDetails({
|
|
546
|
+
retryOfRequestLogID,
|
|
547
|
+
url,
|
|
548
|
+
durationMs: headersTime - startTime,
|
|
549
|
+
message: response.message,
|
|
550
|
+
}),
|
|
551
|
+
);
|
|
552
|
+
return this.retryRequest(options, retriesRemaining, retryOfRequestLogID ?? requestLogID);
|
|
553
|
+
}
|
|
554
|
+
loggerFor(this).info(
|
|
555
|
+
`[${requestLogID}] connection ${isTimeout ? 'timed out' : 'failed'} - error; no more retries left`,
|
|
556
|
+
);
|
|
557
|
+
loggerFor(this).debug(
|
|
558
|
+
`[${requestLogID}] connection ${isTimeout ? 'timed out' : 'failed'} (error; no more retries left)`,
|
|
559
|
+
formatRequestDetails({
|
|
560
|
+
retryOfRequestLogID,
|
|
561
|
+
url,
|
|
562
|
+
durationMs: headersTime - startTime,
|
|
563
|
+
message: response.message,
|
|
564
|
+
}),
|
|
565
|
+
);
|
|
566
|
+
if (isTimeout) {
|
|
567
|
+
throw new Errors.APIConnectionTimeoutError();
|
|
568
|
+
}
|
|
569
|
+
throw new Errors.APIConnectionError({ cause: response });
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
const responseInfo = `[${requestLogID}${retryLogStr}] ${req.method} ${url} ${
|
|
573
|
+
response.ok ? 'succeeded' : 'failed'
|
|
574
|
+
} with status ${response.status} in ${headersTime - startTime}ms`;
|
|
575
|
+
|
|
576
|
+
if (!response.ok) {
|
|
577
|
+
const shouldRetry = await this.shouldRetry(response);
|
|
578
|
+
if (retriesRemaining && shouldRetry) {
|
|
579
|
+
const retryMessage = `retrying, ${retriesRemaining} attempts remaining`;
|
|
580
|
+
|
|
581
|
+
// We don't need the body of this response.
|
|
582
|
+
await Shims.CancelReadableStream(response.body);
|
|
583
|
+
loggerFor(this).info(`${responseInfo} - ${retryMessage}`);
|
|
584
|
+
loggerFor(this).debug(
|
|
585
|
+
`[${requestLogID}] response error (${retryMessage})`,
|
|
586
|
+
formatRequestDetails({
|
|
587
|
+
retryOfRequestLogID,
|
|
588
|
+
url: response.url,
|
|
589
|
+
status: response.status,
|
|
590
|
+
headers: response.headers,
|
|
591
|
+
durationMs: headersTime - startTime,
|
|
592
|
+
}),
|
|
593
|
+
);
|
|
594
|
+
return this.retryRequest(
|
|
595
|
+
options,
|
|
596
|
+
retriesRemaining,
|
|
597
|
+
retryOfRequestLogID ?? requestLogID,
|
|
598
|
+
response.headers,
|
|
599
|
+
);
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
const retryMessage = shouldRetry ? `error; no more retries left` : `error; not retryable`;
|
|
603
|
+
|
|
604
|
+
loggerFor(this).info(`${responseInfo} - ${retryMessage}`);
|
|
605
|
+
|
|
606
|
+
const errText = await response.text().catch((err: any) => castToError(err).message);
|
|
607
|
+
const errJSON = safeJSON(errText) as any;
|
|
608
|
+
const errMessage = errJSON ? undefined : errText;
|
|
609
|
+
|
|
610
|
+
loggerFor(this).debug(
|
|
611
|
+
`[${requestLogID}] response error (${retryMessage})`,
|
|
612
|
+
formatRequestDetails({
|
|
613
|
+
retryOfRequestLogID,
|
|
614
|
+
url: response.url,
|
|
615
|
+
status: response.status,
|
|
616
|
+
headers: response.headers,
|
|
617
|
+
message: errMessage,
|
|
618
|
+
durationMs: Date.now() - startTime,
|
|
619
|
+
}),
|
|
620
|
+
);
|
|
621
|
+
|
|
622
|
+
const err = this.makeStatusError(response.status, errJSON, errMessage, response.headers);
|
|
623
|
+
throw err;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
loggerFor(this).info(responseInfo);
|
|
627
|
+
loggerFor(this).debug(
|
|
628
|
+
`[${requestLogID}] response start`,
|
|
629
|
+
formatRequestDetails({
|
|
630
|
+
retryOfRequestLogID,
|
|
631
|
+
url: response.url,
|
|
632
|
+
status: response.status,
|
|
633
|
+
headers: response.headers,
|
|
634
|
+
durationMs: headersTime - startTime,
|
|
635
|
+
}),
|
|
636
|
+
);
|
|
637
|
+
|
|
638
|
+
return { response, options, controller, requestLogID, retryOfRequestLogID, startTime };
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
async fetchWithTimeout(
|
|
642
|
+
url: RequestInfo,
|
|
643
|
+
init: RequestInit | undefined,
|
|
644
|
+
ms: number,
|
|
645
|
+
controller: AbortController,
|
|
646
|
+
): Promise<Response> {
|
|
647
|
+
const { signal, method, ...options } = init || {};
|
|
648
|
+
const abort = this._makeAbort(controller);
|
|
649
|
+
if (signal) signal.addEventListener('abort', abort, { once: true });
|
|
650
|
+
|
|
651
|
+
const timeout = setTimeout(abort, ms);
|
|
652
|
+
|
|
653
|
+
const isReadableBody =
|
|
654
|
+
((globalThis as any).ReadableStream && options.body instanceof (globalThis as any).ReadableStream) ||
|
|
655
|
+
(typeof options.body === 'object' && options.body !== null && Symbol.asyncIterator in options.body);
|
|
656
|
+
|
|
657
|
+
const fetchOptions: RequestInit = {
|
|
658
|
+
signal: controller.signal as any,
|
|
659
|
+
...(isReadableBody ? { duplex: 'half' } : {}),
|
|
660
|
+
method: 'GET',
|
|
661
|
+
...options,
|
|
662
|
+
};
|
|
663
|
+
if (method) {
|
|
664
|
+
// Custom methods like 'patch' need to be uppercased
|
|
665
|
+
// See https://github.com/nodejs/undici/issues/2294
|
|
666
|
+
fetchOptions.method = method.toUpperCase();
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
try {
|
|
670
|
+
// use undefined this binding; fetch errors if bound to something else in browser/cloudflare
|
|
671
|
+
return await this.fetch.call(undefined, url, fetchOptions);
|
|
672
|
+
} finally {
|
|
673
|
+
clearTimeout(timeout);
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
private async shouldRetry(response: Response): Promise<boolean> {
|
|
678
|
+
// Note this is not a standard header.
|
|
679
|
+
const shouldRetryHeader = response.headers.get('x-should-retry');
|
|
680
|
+
|
|
681
|
+
// If the server explicitly says whether or not to retry, obey.
|
|
682
|
+
if (shouldRetryHeader === 'true') return true;
|
|
683
|
+
if (shouldRetryHeader === 'false') return false;
|
|
684
|
+
|
|
685
|
+
// Retry on request timeouts.
|
|
686
|
+
if (response.status === 408) return true;
|
|
687
|
+
|
|
688
|
+
// Retry on lock timeouts.
|
|
689
|
+
if (response.status === 409) return true;
|
|
690
|
+
|
|
691
|
+
// Retry on rate limits.
|
|
692
|
+
if (response.status === 429) return true;
|
|
693
|
+
|
|
694
|
+
// Retry internal errors.
|
|
695
|
+
if (response.status >= 500) return true;
|
|
696
|
+
|
|
697
|
+
return false;
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
private async retryRequest(
|
|
701
|
+
options: FinalRequestOptions,
|
|
702
|
+
retriesRemaining: number,
|
|
703
|
+
requestLogID: string,
|
|
704
|
+
responseHeaders?: Headers | undefined,
|
|
705
|
+
): Promise<APIResponseProps> {
|
|
706
|
+
let timeoutMillis: number | undefined;
|
|
707
|
+
|
|
708
|
+
// Note the `retry-after-ms` header may not be standard, but is a good idea and we'd like proactive support for it.
|
|
709
|
+
const retryAfterMillisHeader = responseHeaders?.get('retry-after-ms');
|
|
710
|
+
if (retryAfterMillisHeader) {
|
|
711
|
+
const timeoutMs = parseFloat(retryAfterMillisHeader);
|
|
712
|
+
if (!Number.isNaN(timeoutMs)) {
|
|
713
|
+
timeoutMillis = timeoutMs;
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
// About the Retry-After header: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After
|
|
718
|
+
const retryAfterHeader = responseHeaders?.get('retry-after');
|
|
719
|
+
if (retryAfterHeader && !timeoutMillis) {
|
|
720
|
+
const timeoutSeconds = parseFloat(retryAfterHeader);
|
|
721
|
+
if (!Number.isNaN(timeoutSeconds)) {
|
|
722
|
+
timeoutMillis = timeoutSeconds * 1000;
|
|
723
|
+
} else {
|
|
724
|
+
timeoutMillis = Date.parse(retryAfterHeader) - Date.now();
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
// If the API asks us to wait a certain amount of time, just do what it
|
|
729
|
+
// says, but otherwise calculate a default
|
|
730
|
+
if (timeoutMillis === undefined) {
|
|
731
|
+
const maxRetries = options.maxRetries ?? this.maxRetries;
|
|
732
|
+
timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries);
|
|
733
|
+
}
|
|
734
|
+
await sleep(timeoutMillis);
|
|
735
|
+
|
|
736
|
+
return this.makeRequest(options, retriesRemaining - 1, requestLogID);
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
private calculateDefaultRetryTimeoutMillis(retriesRemaining: number, maxRetries: number): number {
|
|
740
|
+
const initialRetryDelay = 0.5;
|
|
741
|
+
const maxRetryDelay = 8.0;
|
|
742
|
+
|
|
743
|
+
const numRetries = maxRetries - retriesRemaining;
|
|
744
|
+
|
|
745
|
+
// Apply exponential backoff, but not more than the max.
|
|
746
|
+
const sleepSeconds = Math.min(initialRetryDelay * Math.pow(2, numRetries), maxRetryDelay);
|
|
747
|
+
|
|
748
|
+
// Apply some jitter, take up to at most 25 percent of the retry time.
|
|
749
|
+
const jitter = 1 - Math.random() * 0.25;
|
|
750
|
+
|
|
751
|
+
return sleepSeconds * jitter * 1000;
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
async buildRequest(
|
|
755
|
+
inputOptions: FinalRequestOptions,
|
|
756
|
+
{ retryCount = 0 }: { retryCount?: number } = {},
|
|
757
|
+
): Promise<{ req: FinalizedRequestInit; url: string; timeout: number }> {
|
|
758
|
+
const options = { ...inputOptions };
|
|
759
|
+
const { method, path, query, defaultBaseURL } = options;
|
|
760
|
+
|
|
761
|
+
const url = this.buildURL(path!, query as Record<string, unknown>, defaultBaseURL);
|
|
762
|
+
if ('timeout' in options) validatePositiveInteger('timeout', options.timeout);
|
|
763
|
+
options.timeout = options.timeout ?? this.timeout;
|
|
764
|
+
const { bodyHeaders, body } = this.buildBody({ options });
|
|
765
|
+
const reqHeaders = await this.buildHeaders({ options: inputOptions, method, bodyHeaders, retryCount });
|
|
766
|
+
|
|
767
|
+
const req: FinalizedRequestInit = {
|
|
768
|
+
method,
|
|
769
|
+
headers: reqHeaders,
|
|
770
|
+
...(options.signal && { signal: options.signal }),
|
|
771
|
+
...((globalThis as any).ReadableStream &&
|
|
772
|
+
body instanceof (globalThis as any).ReadableStream && { duplex: 'half' }),
|
|
773
|
+
...(body && { body }),
|
|
774
|
+
...((this.fetchOptions as any) ?? {}),
|
|
775
|
+
...((options.fetchOptions as any) ?? {}),
|
|
776
|
+
};
|
|
777
|
+
|
|
778
|
+
return { req, url, timeout: options.timeout };
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
private async buildHeaders({
|
|
782
|
+
options,
|
|
783
|
+
method,
|
|
784
|
+
bodyHeaders,
|
|
785
|
+
retryCount,
|
|
786
|
+
}: {
|
|
787
|
+
options: FinalRequestOptions;
|
|
788
|
+
method: HTTPMethod;
|
|
789
|
+
bodyHeaders: HeadersLike;
|
|
790
|
+
retryCount: number;
|
|
791
|
+
}): Promise<Headers> {
|
|
792
|
+
let idempotencyHeaders: HeadersLike = {};
|
|
793
|
+
if (this.idempotencyHeader && method !== 'get') {
|
|
794
|
+
if (!options.idempotencyKey) options.idempotencyKey = this.defaultIdempotencyKey();
|
|
795
|
+
idempotencyHeaders[this.idempotencyHeader] = options.idempotencyKey;
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
const headers = buildHeaders([
|
|
799
|
+
idempotencyHeaders,
|
|
800
|
+
{
|
|
801
|
+
Accept: 'application/json',
|
|
802
|
+
'User-Agent': this.getUserAgent(),
|
|
803
|
+
'X-Stainless-Retry-Count': String(retryCount),
|
|
804
|
+
...(options.timeout ? { 'X-Stainless-Timeout': String(Math.trunc(options.timeout / 1000)) } : {}),
|
|
805
|
+
...getPlatformHeaders(),
|
|
806
|
+
},
|
|
807
|
+
await this.authHeaders(options),
|
|
808
|
+
this._options.defaultHeaders,
|
|
809
|
+
bodyHeaders,
|
|
810
|
+
options.headers,
|
|
811
|
+
]);
|
|
812
|
+
|
|
813
|
+
this.validateHeaders(headers);
|
|
814
|
+
|
|
815
|
+
return headers.values;
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
private _makeAbort(controller: AbortController) {
|
|
819
|
+
// note: we can't just inline this method inside `fetchWithTimeout()` because then the closure
|
|
820
|
+
// would capture all request options, and cause a memory leak.
|
|
821
|
+
return () => controller.abort();
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
private buildBody({ options: { body, headers: rawHeaders } }: { options: FinalRequestOptions }): {
|
|
825
|
+
bodyHeaders: HeadersLike;
|
|
826
|
+
body: BodyInit | undefined;
|
|
827
|
+
} {
|
|
828
|
+
if (!body) {
|
|
829
|
+
return { bodyHeaders: undefined, body: undefined };
|
|
830
|
+
}
|
|
831
|
+
const headers = buildHeaders([rawHeaders]);
|
|
832
|
+
if (
|
|
833
|
+
// Pass raw type verbatim
|
|
834
|
+
ArrayBuffer.isView(body) ||
|
|
835
|
+
body instanceof ArrayBuffer ||
|
|
836
|
+
body instanceof DataView ||
|
|
837
|
+
(typeof body === 'string' &&
|
|
838
|
+
// Preserve legacy string encoding behavior for now
|
|
839
|
+
headers.values.has('content-type')) ||
|
|
840
|
+
// `Blob` is superset of `File`
|
|
841
|
+
((globalThis as any).Blob && body instanceof (globalThis as any).Blob) ||
|
|
842
|
+
// `FormData` -> `multipart/form-data`
|
|
843
|
+
body instanceof FormData ||
|
|
844
|
+
// `URLSearchParams` -> `application/x-www-form-urlencoded`
|
|
845
|
+
body instanceof URLSearchParams ||
|
|
846
|
+
// Send chunked stream (each chunk has own `length`)
|
|
847
|
+
((globalThis as any).ReadableStream && body instanceof (globalThis as any).ReadableStream)
|
|
848
|
+
) {
|
|
849
|
+
return { bodyHeaders: undefined, body: body as BodyInit };
|
|
850
|
+
} else if (
|
|
851
|
+
typeof body === 'object' &&
|
|
852
|
+
(Symbol.asyncIterator in body ||
|
|
853
|
+
(Symbol.iterator in body && 'next' in body && typeof body.next === 'function'))
|
|
854
|
+
) {
|
|
855
|
+
return { bodyHeaders: undefined, body: Shims.ReadableStreamFrom(body as AsyncIterable<Uint8Array>) };
|
|
856
|
+
} else if (
|
|
857
|
+
typeof body === 'object' &&
|
|
858
|
+
headers.values.get('content-type') === 'application/x-www-form-urlencoded'
|
|
859
|
+
) {
|
|
860
|
+
return {
|
|
861
|
+
bodyHeaders: { 'content-type': 'application/x-www-form-urlencoded' },
|
|
862
|
+
body: this.stringifyQuery(body),
|
|
863
|
+
};
|
|
864
|
+
} else {
|
|
865
|
+
return this.#encoder({ body, headers });
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
static Featurebase = this;
|
|
870
|
+
static DEFAULT_TIMEOUT = 60000; // 1 minute
|
|
871
|
+
|
|
872
|
+
static FeaturebaseError = Errors.FeaturebaseError;
|
|
873
|
+
static APIError = Errors.APIError;
|
|
874
|
+
static APIConnectionError = Errors.APIConnectionError;
|
|
875
|
+
static APIConnectionTimeoutError = Errors.APIConnectionTimeoutError;
|
|
876
|
+
static APIUserAbortError = Errors.APIUserAbortError;
|
|
877
|
+
static NotFoundError = Errors.NotFoundError;
|
|
878
|
+
static ConflictError = Errors.ConflictError;
|
|
879
|
+
static RateLimitError = Errors.RateLimitError;
|
|
880
|
+
static BadRequestError = Errors.BadRequestError;
|
|
881
|
+
static AuthenticationError = Errors.AuthenticationError;
|
|
882
|
+
static InternalServerError = Errors.InternalServerError;
|
|
883
|
+
static PermissionDeniedError = Errors.PermissionDeniedError;
|
|
884
|
+
static UnprocessableEntityError = Errors.UnprocessableEntityError;
|
|
885
|
+
|
|
886
|
+
static toFile = Uploads.toFile;
|
|
887
|
+
|
|
888
|
+
/**
|
|
889
|
+
* Boards (post categories) organize feedback into distinct containers with their own settings.
|
|
890
|
+
*/
|
|
891
|
+
boards: API.Boards = new API.Boards(this);
|
|
892
|
+
/**
|
|
893
|
+
* User-submitted feedback and feature requests. Posts belong to boards and can be upvoted, commented on, and tracked through statuses.
|
|
894
|
+
*/
|
|
895
|
+
posts: API.Posts = new API.Posts(this);
|
|
896
|
+
/**
|
|
897
|
+
* Post statuses define the workflow stages for posts (e.g., In Review, Active, Completed).
|
|
898
|
+
*/
|
|
899
|
+
postStatuses: API.PostStatuses = new API.PostStatuses(this);
|
|
900
|
+
/**
|
|
901
|
+
* Release notes and updates published by the organization. Changelogs keep users informed about new features, improvements, and fixes.
|
|
902
|
+
*/
|
|
903
|
+
changelogs: API.Changelogs = new API.Changelogs(this);
|
|
904
|
+
/**
|
|
905
|
+
* Team members who manage your Featurebase organization. Admins have roles that define their permissions.
|
|
906
|
+
*/
|
|
907
|
+
admins: API.Admins = new API.Admins(this);
|
|
908
|
+
/**
|
|
909
|
+
* Configurable input fields for posts in your Featurebase organization. Custom fields allow you to collect additional structured data when users create posts.
|
|
910
|
+
*/
|
|
911
|
+
customFields: API.CustomFields = new API.CustomFields(this);
|
|
912
|
+
/**
|
|
913
|
+
* Surveys allow you to collect targeted feedback from your users within your product. Surveys can be targeted to specific user segments or pages and can contain multiple questions with conditional logic.
|
|
914
|
+
*/
|
|
915
|
+
surveys: API.Surveys = new API.Surveys(this);
|
|
916
|
+
helpCenter: API.HelpCenter = new API.HelpCenter(this);
|
|
917
|
+
/**
|
|
918
|
+
* Contacts are the customers and leads in your Featurebase organization. Use this endpoint to list and retrieve contact information.
|
|
919
|
+
*/
|
|
920
|
+
contacts: API.Contacts = new API.Contacts(this);
|
|
921
|
+
/**
|
|
922
|
+
* Teams are groups within your Featurebase organization. Use this endpoint to list and retrieve team information for conversation assignment and organization management.
|
|
923
|
+
*/
|
|
924
|
+
teams: API.Teams = new API.Teams(this);
|
|
925
|
+
/**
|
|
926
|
+
* Companies represent organizations or businesses that your users belong to. Use this endpoint to list and retrieve company information.
|
|
927
|
+
*/
|
|
928
|
+
companies: API.Companies = new API.Companies(this);
|
|
929
|
+
/**
|
|
930
|
+
* Brands represent distinct brand identities within your organization. Each brand can have its own help center and email sending address. Use this endpoint to list and retrieve brand information.
|
|
931
|
+
*/
|
|
932
|
+
brands: API.Brands = new API.Brands(this);
|
|
933
|
+
/**
|
|
934
|
+
* Conversations are messenger/inbox conversations in your Featurebase organization. Use this endpoint to list and retrieve conversation information.
|
|
935
|
+
*/
|
|
936
|
+
conversations: API.Conversations = new API.Conversations(this);
|
|
937
|
+
/**
|
|
938
|
+
* Conversation tags let you organize, filter, and automate around inbox conversations. Use these endpoints to list, look up, create, rename, and delete workspace conversation tags.
|
|
939
|
+
*/
|
|
940
|
+
tags: API.Tags = new API.Tags(this);
|
|
941
|
+
/**
|
|
942
|
+
* Tickets represent support requests in your Featurebase organization. Create, update, reply to, and manage tickets via these endpoints.
|
|
943
|
+
*/
|
|
944
|
+
tickets: API.Tickets = new API.Tickets(this);
|
|
945
|
+
/**
|
|
946
|
+
* Webhooks allow you to receive real-time HTTP callbacks when events occur in your Featurebase organization. Configure webhook endpoints to subscribe to specific event types.
|
|
947
|
+
*/
|
|
948
|
+
webhooks: API.Webhooks = new API.Webhooks(this);
|
|
949
|
+
/**
|
|
950
|
+
* Threaded discussions on posts and changelogs. Comments support voting, moderation, and privacy controls.
|
|
951
|
+
*/
|
|
952
|
+
comments: API.Comments = new API.Comments(this);
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
Featurebase.Boards = Boards;
|
|
956
|
+
Featurebase.Posts = Posts;
|
|
957
|
+
Featurebase.PostStatuses = PostStatuses;
|
|
958
|
+
Featurebase.Changelogs = Changelogs;
|
|
959
|
+
Featurebase.Admins = Admins;
|
|
960
|
+
Featurebase.CustomFields = CustomFields;
|
|
961
|
+
Featurebase.Surveys = Surveys;
|
|
962
|
+
Featurebase.HelpCenter = HelpCenter;
|
|
963
|
+
Featurebase.Contacts = Contacts;
|
|
964
|
+
Featurebase.Teams = Teams;
|
|
965
|
+
Featurebase.Companies = Companies;
|
|
966
|
+
Featurebase.Brands = Brands;
|
|
967
|
+
Featurebase.Conversations = Conversations;
|
|
968
|
+
Featurebase.Tags = Tags;
|
|
969
|
+
Featurebase.Tickets = Tickets;
|
|
970
|
+
Featurebase.Webhooks = Webhooks;
|
|
971
|
+
Featurebase.Comments = Comments;
|
|
972
|
+
|
|
973
|
+
export declare namespace Featurebase {
|
|
974
|
+
export type RequestOptions = Opts.RequestOptions;
|
|
975
|
+
|
|
976
|
+
export {
|
|
977
|
+
Boards as Boards,
|
|
978
|
+
type Board as Board,
|
|
979
|
+
type BoardListResponse as BoardListResponse,
|
|
980
|
+
type BoardRetrieveParams as BoardRetrieveParams,
|
|
981
|
+
type BoardListParams as BoardListParams,
|
|
982
|
+
};
|
|
983
|
+
|
|
984
|
+
export {
|
|
985
|
+
Posts as Posts,
|
|
986
|
+
type Post as Post,
|
|
987
|
+
type PostListResponse as PostListResponse,
|
|
988
|
+
type PostDeleteResponse as PostDeleteResponse,
|
|
989
|
+
type PostCreateParams as PostCreateParams,
|
|
990
|
+
type PostRetrieveParams as PostRetrieveParams,
|
|
991
|
+
type PostUpdateParams as PostUpdateParams,
|
|
992
|
+
type PostListParams as PostListParams,
|
|
993
|
+
type PostDeleteParams as PostDeleteParams,
|
|
994
|
+
};
|
|
995
|
+
|
|
996
|
+
export {
|
|
997
|
+
PostStatuses as PostStatuses,
|
|
998
|
+
type PostStatus as PostStatus,
|
|
999
|
+
type PostStatusListResponse as PostStatusListResponse,
|
|
1000
|
+
type PostStatusRetrieveParams as PostStatusRetrieveParams,
|
|
1001
|
+
type PostStatusListParams as PostStatusListParams,
|
|
1002
|
+
};
|
|
1003
|
+
|
|
1004
|
+
export {
|
|
1005
|
+
Changelogs as Changelogs,
|
|
1006
|
+
type Changelog as Changelog,
|
|
1007
|
+
type PublishUnpublishSuccess as PublishUnpublishSuccess,
|
|
1008
|
+
type ChangelogListResponse as ChangelogListResponse,
|
|
1009
|
+
type ChangelogDeleteResponse as ChangelogDeleteResponse,
|
|
1010
|
+
type ChangelogCreateParams as ChangelogCreateParams,
|
|
1011
|
+
type ChangelogRetrieveParams as ChangelogRetrieveParams,
|
|
1012
|
+
type ChangelogUpdateParams as ChangelogUpdateParams,
|
|
1013
|
+
type ChangelogListParams as ChangelogListParams,
|
|
1014
|
+
type ChangelogDeleteParams as ChangelogDeleteParams,
|
|
1015
|
+
type ChangelogPublishParams as ChangelogPublishParams,
|
|
1016
|
+
type ChangelogUnpublishParams as ChangelogUnpublishParams,
|
|
1017
|
+
};
|
|
1018
|
+
|
|
1019
|
+
export {
|
|
1020
|
+
Admins as Admins,
|
|
1021
|
+
type Admin as Admin,
|
|
1022
|
+
type AdminListResponse as AdminListResponse,
|
|
1023
|
+
type AdminListRolesResponse as AdminListRolesResponse,
|
|
1024
|
+
type AdminRetrieveParams as AdminRetrieveParams,
|
|
1025
|
+
type AdminListParams as AdminListParams,
|
|
1026
|
+
type AdminListRolesParams as AdminListRolesParams,
|
|
1027
|
+
};
|
|
1028
|
+
|
|
1029
|
+
export {
|
|
1030
|
+
CustomFields as CustomFields,
|
|
1031
|
+
type CustomField as CustomField,
|
|
1032
|
+
type CustomFieldList as CustomFieldList,
|
|
1033
|
+
type CustomFieldRetrieveParams as CustomFieldRetrieveParams,
|
|
1034
|
+
type CustomFieldListParams as CustomFieldListParams,
|
|
1035
|
+
};
|
|
1036
|
+
|
|
1037
|
+
export {
|
|
1038
|
+
Surveys as Surveys,
|
|
1039
|
+
type Survey as Survey,
|
|
1040
|
+
type SurveyNextAction as SurveyNextAction,
|
|
1041
|
+
type SurveyListResponse as SurveyListResponse,
|
|
1042
|
+
type SurveyRetrieveResponsesResponse as SurveyRetrieveResponsesResponse,
|
|
1043
|
+
type SurveyRetrieveParams as SurveyRetrieveParams,
|
|
1044
|
+
type SurveyListParams as SurveyListParams,
|
|
1045
|
+
type SurveyRetrieveResponsesParams as SurveyRetrieveResponsesParams,
|
|
1046
|
+
};
|
|
1047
|
+
|
|
1048
|
+
export { HelpCenter as HelpCenter };
|
|
1049
|
+
|
|
1050
|
+
export {
|
|
1051
|
+
Contacts as Contacts,
|
|
1052
|
+
type Contact as Contact,
|
|
1053
|
+
type ContactList as ContactList,
|
|
1054
|
+
type DeletedContact as DeletedContact,
|
|
1055
|
+
type ContactRetrieveResponse as ContactRetrieveResponse,
|
|
1056
|
+
type ContactBlockResponse as ContactBlockResponse,
|
|
1057
|
+
type ContactCreateOrUpdateResponse as ContactCreateOrUpdateResponse,
|
|
1058
|
+
type ContactUnblockResponse as ContactUnblockResponse,
|
|
1059
|
+
type ContactRetrieveParams as ContactRetrieveParams,
|
|
1060
|
+
type ContactListParams as ContactListParams,
|
|
1061
|
+
type ContactDeleteParams as ContactDeleteParams,
|
|
1062
|
+
type ContactBlockParams as ContactBlockParams,
|
|
1063
|
+
type ContactCreateOrUpdateParams as ContactCreateOrUpdateParams,
|
|
1064
|
+
type ContactUnblockParams as ContactUnblockParams,
|
|
1065
|
+
};
|
|
1066
|
+
|
|
1067
|
+
export {
|
|
1068
|
+
Teams as Teams,
|
|
1069
|
+
type Team as Team,
|
|
1070
|
+
type TeamListResponse as TeamListResponse,
|
|
1071
|
+
type TeamRetrieveParams as TeamRetrieveParams,
|
|
1072
|
+
type TeamListParams as TeamListParams,
|
|
1073
|
+
};
|
|
1074
|
+
|
|
1075
|
+
export {
|
|
1076
|
+
Companies as Companies,
|
|
1077
|
+
type Company as Company,
|
|
1078
|
+
type DeletedCompany as DeletedCompany,
|
|
1079
|
+
type CompanyListResponse as CompanyListResponse,
|
|
1080
|
+
type CompanyRetrieveParams as CompanyRetrieveParams,
|
|
1081
|
+
type CompanyListParams as CompanyListParams,
|
|
1082
|
+
type CompanyDeleteParams as CompanyDeleteParams,
|
|
1083
|
+
type CompanyCreateOrUpdateParams as CompanyCreateOrUpdateParams,
|
|
1084
|
+
type CompanyDeleteByCompanyIDParams as CompanyDeleteByCompanyIDParams,
|
|
1085
|
+
};
|
|
1086
|
+
|
|
1087
|
+
export {
|
|
1088
|
+
Brands as Brands,
|
|
1089
|
+
type Brand as Brand,
|
|
1090
|
+
type BrandListResponse as BrandListResponse,
|
|
1091
|
+
type BrandRetrieveParams as BrandRetrieveParams,
|
|
1092
|
+
type BrandListParams as BrandListParams,
|
|
1093
|
+
};
|
|
1094
|
+
|
|
1095
|
+
export {
|
|
1096
|
+
Conversations as Conversations,
|
|
1097
|
+
type Conversation as Conversation,
|
|
1098
|
+
type ConversationPart as ConversationPart,
|
|
1099
|
+
type ConversationPartAuthor as ConversationPartAuthor,
|
|
1100
|
+
type ConversationParticipant as ConversationParticipant,
|
|
1101
|
+
type ConversationTagApplication as ConversationTagApplication,
|
|
1102
|
+
type CsatEmailDelivery as CsatEmailDelivery,
|
|
1103
|
+
type CsatRatedAgent as CsatRatedAgent,
|
|
1104
|
+
type CsatWorkflowLink as CsatWorkflowLink,
|
|
1105
|
+
type EmailRecipients as EmailRecipients,
|
|
1106
|
+
type ConversationListResponse as ConversationListResponse,
|
|
1107
|
+
type ConversationDeleteResponse as ConversationDeleteResponse,
|
|
1108
|
+
type ConversationCreateParams as ConversationCreateParams,
|
|
1109
|
+
type ConversationRetrieveParams as ConversationRetrieveParams,
|
|
1110
|
+
type ConversationUpdateParams as ConversationUpdateParams,
|
|
1111
|
+
type ConversationListParams as ConversationListParams,
|
|
1112
|
+
type ConversationDeleteParams as ConversationDeleteParams,
|
|
1113
|
+
type ConversationRedactParams as ConversationRedactParams,
|
|
1114
|
+
type ConversationReplyParams as ConversationReplyParams,
|
|
1115
|
+
};
|
|
1116
|
+
|
|
1117
|
+
export {
|
|
1118
|
+
Tags as Tags,
|
|
1119
|
+
type ConversationTag as ConversationTag,
|
|
1120
|
+
type TagListResponse as TagListResponse,
|
|
1121
|
+
type TagDeleteResponse as TagDeleteResponse,
|
|
1122
|
+
type TagRetrieveParams as TagRetrieveParams,
|
|
1123
|
+
type TagListParams as TagListParams,
|
|
1124
|
+
type TagDeleteParams as TagDeleteParams,
|
|
1125
|
+
type TagCreateOrRenameParams as TagCreateOrRenameParams,
|
|
1126
|
+
};
|
|
1127
|
+
|
|
1128
|
+
export {
|
|
1129
|
+
Tickets as Tickets,
|
|
1130
|
+
type AuthorInput as AuthorInput,
|
|
1131
|
+
type Ticket as Ticket,
|
|
1132
|
+
type TicketListResponse as TicketListResponse,
|
|
1133
|
+
type TicketDeleteResponse as TicketDeleteResponse,
|
|
1134
|
+
type TicketCreateParams as TicketCreateParams,
|
|
1135
|
+
type TicketRetrieveParams as TicketRetrieveParams,
|
|
1136
|
+
type TicketUpdateParams as TicketUpdateParams,
|
|
1137
|
+
type TicketListParams as TicketListParams,
|
|
1138
|
+
type TicketDeleteParams as TicketDeleteParams,
|
|
1139
|
+
type TicketReplyParams as TicketReplyParams,
|
|
1140
|
+
};
|
|
1141
|
+
|
|
1142
|
+
export {
|
|
1143
|
+
Webhooks as Webhooks,
|
|
1144
|
+
type Webhook as Webhook,
|
|
1145
|
+
type WebhookRequestConfigInput as WebhookRequestConfigInput,
|
|
1146
|
+
type WebhookListResponse as WebhookListResponse,
|
|
1147
|
+
type WebhookDeleteResponse as WebhookDeleteResponse,
|
|
1148
|
+
type WebhookCreateParams as WebhookCreateParams,
|
|
1149
|
+
type WebhookRetrieveParams as WebhookRetrieveParams,
|
|
1150
|
+
type WebhookUpdateParams as WebhookUpdateParams,
|
|
1151
|
+
type WebhookListParams as WebhookListParams,
|
|
1152
|
+
type WebhookDeleteParams as WebhookDeleteParams,
|
|
1153
|
+
type WebhookRefreshSecretParams as WebhookRefreshSecretParams,
|
|
1154
|
+
};
|
|
1155
|
+
|
|
1156
|
+
export {
|
|
1157
|
+
Comments as Comments,
|
|
1158
|
+
type Comment as Comment,
|
|
1159
|
+
type CommentListResponse as CommentListResponse,
|
|
1160
|
+
type CommentDelete0Response as CommentDelete0Response,
|
|
1161
|
+
type CommentDelete1Response as CommentDelete1Response,
|
|
1162
|
+
type CommentCreateParams as CommentCreateParams,
|
|
1163
|
+
type CommentRetrieveParams as CommentRetrieveParams,
|
|
1164
|
+
type CommentUpdateParams as CommentUpdateParams,
|
|
1165
|
+
type CommentListParams as CommentListParams,
|
|
1166
|
+
type CommentDelete0Params as CommentDelete0Params,
|
|
1167
|
+
type CommentDelete1Params as CommentDelete1Params,
|
|
1168
|
+
};
|
|
1169
|
+
}
|