featurebase-node 0.2.0 → 0.4.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 +18 -0
- package/README.md +31 -0
- package/client.d.mts +25 -10
- package/client.d.mts.map +1 -1
- package/client.d.ts +25 -10
- package/client.d.ts.map +1 -1
- package/client.js +27 -8
- package/client.js.map +1 -1
- package/client.mjs +27 -8
- package/client.mjs.map +1 -1
- package/core/pagination.d.mts +54 -0
- package/core/pagination.d.mts.map +1 -0
- package/core/pagination.d.ts +54 -0
- package/core/pagination.d.ts.map +1 -0
- package/core/pagination.js +101 -0
- package/core/pagination.js.map +1 -0
- package/core/pagination.mjs +95 -0
- package/core/pagination.mjs.map +1 -0
- package/index.d.mts +1 -0
- package/index.d.mts.map +1 -1
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/index.mjs +1 -0
- package/index.mjs.map +1 -1
- package/package.json +11 -1
- package/pagination.d.mts +2 -0
- package/pagination.d.mts.map +1 -0
- package/pagination.d.ts +2 -0
- package/pagination.d.ts.map +1 -0
- package/pagination.js +6 -0
- package/pagination.js.map +1 -0
- package/pagination.mjs +2 -0
- package/pagination.mjs.map +1 -0
- package/resources/changelogs/changelogs.d.mts +9 -53
- package/resources/changelogs/changelogs.d.mts.map +1 -1
- package/resources/changelogs/changelogs.d.ts +9 -53
- package/resources/changelogs/changelogs.d.ts.map +1 -1
- package/resources/changelogs/changelogs.js +6 -2
- package/resources/changelogs/changelogs.js.map +1 -1
- package/resources/changelogs/changelogs.mjs +6 -2
- package/resources/changelogs/changelogs.mjs.map +1 -1
- package/resources/changelogs/index.d.mts +1 -1
- package/resources/changelogs/index.d.mts.map +1 -1
- package/resources/changelogs/index.d.ts +1 -1
- package/resources/changelogs/index.d.ts.map +1 -1
- package/resources/feedback/comments.d.mts +10 -54
- package/resources/feedback/comments.d.mts.map +1 -1
- package/resources/feedback/comments.d.ts +10 -54
- package/resources/feedback/comments.d.ts.map +1 -1
- package/resources/feedback/comments.js +6 -2
- package/resources/feedback/comments.js.map +1 -1
- package/resources/feedback/comments.mjs +6 -2
- package/resources/feedback/comments.mjs.map +1 -1
- package/resources/feedback/feedback.d.mts +4 -4
- package/resources/feedback/feedback.d.mts.map +1 -1
- package/resources/feedback/feedback.d.ts +4 -4
- package/resources/feedback/feedback.d.ts.map +1 -1
- package/resources/feedback/feedback.mjs.map +1 -1
- package/resources/feedback/index.d.mts +2 -2
- package/resources/feedback/index.d.mts.map +1 -1
- package/resources/feedback/index.d.ts +2 -2
- package/resources/feedback/index.d.ts.map +1 -1
- package/resources/feedback/posts/index.d.mts +2 -2
- package/resources/feedback/posts/index.d.mts.map +1 -1
- package/resources/feedback/posts/index.d.ts +2 -2
- package/resources/feedback/posts/index.d.ts.map +1 -1
- package/resources/feedback/posts/index.js.map +1 -1
- package/resources/feedback/posts/index.mjs.map +1 -1
- package/resources/feedback/posts/posts.d.mts +12 -57
- package/resources/feedback/posts/posts.d.mts.map +1 -1
- package/resources/feedback/posts/posts.d.ts +12 -57
- package/resources/feedback/posts/posts.d.ts.map +1 -1
- package/resources/feedback/posts/posts.js +6 -2
- package/resources/feedback/posts/posts.js.map +1 -1
- package/resources/feedback/posts/posts.mjs +6 -2
- package/resources/feedback/posts/posts.mjs.map +1 -1
- package/resources/feedback/posts/voters.d.mts +79 -124
- package/resources/feedback/posts/voters.d.mts.map +1 -1
- package/resources/feedback/posts/voters.d.ts +79 -124
- package/resources/feedback/posts/voters.d.ts.map +1 -1
- package/resources/feedback/posts/voters.js +7 -3
- package/resources/feedback/posts/voters.js.map +1 -1
- package/resources/feedback/posts/voters.mjs +7 -3
- package/resources/feedback/posts/voters.mjs.map +1 -1
- package/resources/help-center/articles.d.mts +9 -27
- package/resources/help-center/articles.d.mts.map +1 -1
- package/resources/help-center/articles.d.ts +9 -27
- package/resources/help-center/articles.d.ts.map +1 -1
- package/resources/help-center/articles.js +6 -2
- package/resources/help-center/articles.js.map +1 -1
- package/resources/help-center/articles.mjs +6 -2
- package/resources/help-center/articles.mjs.map +1 -1
- package/resources/help-center/collections.d.mts +9 -28
- package/resources/help-center/collections.d.mts.map +1 -1
- package/resources/help-center/collections.d.ts +9 -28
- package/resources/help-center/collections.d.ts.map +1 -1
- package/resources/help-center/collections.js +6 -3
- package/resources/help-center/collections.js.map +1 -1
- package/resources/help-center/collections.mjs +6 -3
- package/resources/help-center/collections.mjs.map +1 -1
- package/resources/help-center/help-center.d.mts +8 -8
- package/resources/help-center/help-center.d.mts.map +1 -1
- package/resources/help-center/help-center.d.ts +8 -8
- package/resources/help-center/help-center.d.ts.map +1 -1
- package/resources/help-center/help-center.mjs.map +1 -1
- package/resources/help-center/help-centers.d.mts +9 -28
- package/resources/help-center/help-centers.d.mts.map +1 -1
- package/resources/help-center/help-centers.d.ts +9 -28
- package/resources/help-center/help-centers.d.ts.map +1 -1
- package/resources/help-center/help-centers.js +6 -3
- package/resources/help-center/help-centers.js.map +1 -1
- package/resources/help-center/help-centers.mjs +6 -3
- package/resources/help-center/help-centers.mjs.map +1 -1
- package/resources/help-center/index.d.mts +4 -4
- package/resources/help-center/index.d.mts.map +1 -1
- package/resources/help-center/index.d.ts +4 -4
- package/resources/help-center/index.d.ts.map +1 -1
- package/resources/help-center/redirect-rules.d.mts +9 -28
- package/resources/help-center/redirect-rules.d.mts.map +1 -1
- package/resources/help-center/redirect-rules.d.ts +9 -28
- package/resources/help-center/redirect-rules.d.ts.map +1 -1
- package/resources/help-center/redirect-rules.js +6 -3
- package/resources/help-center/redirect-rules.js.map +1 -1
- package/resources/help-center/redirect-rules.mjs +6 -3
- package/resources/help-center/redirect-rules.mjs.map +1 -1
- package/resources/index.d.mts +4 -3
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +4 -3
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +7 -5
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +3 -2
- package/resources/index.mjs.map +1 -1
- package/resources/organization/brands.d.mts +5 -26
- package/resources/organization/brands.d.mts.map +1 -1
- package/resources/organization/brands.d.ts +5 -26
- package/resources/organization/brands.d.ts.map +1 -1
- package/resources/organization/brands.js +2 -1
- package/resources/organization/brands.js.map +1 -1
- package/resources/organization/brands.mjs +2 -1
- package/resources/organization/brands.mjs.map +1 -1
- package/resources/organization/index.d.mts +1 -1
- package/resources/organization/index.d.mts.map +1 -1
- package/resources/organization/index.d.ts +1 -1
- package/resources/organization/index.d.ts.map +1 -1
- package/resources/organization/organization.d.mts +2 -2
- package/resources/organization/organization.d.mts.map +1 -1
- package/resources/organization/organization.d.ts +2 -2
- package/resources/organization/organization.d.ts.map +1 -1
- package/resources/organization/organization.js.map +1 -1
- package/resources/organization/organization.mjs.map +1 -1
- package/resources/{products → support}/conversation-tags.d.mts +4 -4
- package/resources/{products/conversation-tags.d.ts.map → support/conversation-tags.d.mts.map} +1 -1
- package/resources/{products → support}/conversation-tags.d.ts +4 -4
- package/resources/support/conversation-tags.d.ts.map +1 -0
- package/resources/{products → support}/conversation-tags.js +4 -4
- package/resources/support/conversation-tags.js.map +1 -0
- package/resources/{products → support}/conversation-tags.mjs +4 -4
- package/resources/support/conversation-tags.mjs.map +1 -0
- package/resources/{products → support}/conversations/conversations.d.mts +15 -34
- package/resources/support/conversations/conversations.d.mts.map +1 -0
- package/resources/{products → support}/conversations/conversations.d.ts +15 -34
- package/resources/support/conversations/conversations.d.ts.map +1 -0
- package/resources/{products → support}/conversations/conversations.js +12 -9
- package/resources/support/conversations/conversations.js.map +1 -0
- package/resources/{products → support}/conversations/conversations.mjs +12 -9
- package/resources/support/conversations/conversations.mjs.map +1 -0
- package/resources/{products → support}/conversations/index.d.mts +1 -1
- package/resources/support/conversations/index.d.mts.map +1 -0
- package/resources/{products → support}/conversations/index.d.ts +1 -1
- package/resources/support/conversations/index.d.ts.map +1 -0
- package/resources/support/conversations/index.js.map +1 -0
- package/resources/support/conversations/index.mjs.map +1 -0
- package/resources/{products → support}/conversations/participants.d.mts +2 -2
- package/resources/{products/conversations/participants.d.ts.map → support/conversations/participants.d.mts.map} +1 -1
- package/resources/{products → support}/conversations/participants.d.ts +2 -2
- package/resources/support/conversations/participants.d.ts.map +1 -0
- package/resources/{products → support}/conversations/participants.js +2 -2
- package/resources/support/conversations/participants.js.map +1 -0
- package/resources/{products → support}/conversations/participants.mjs +2 -2
- package/resources/support/conversations/participants.mjs.map +1 -0
- package/resources/{products → support}/conversations/tags.d.mts +2 -2
- package/resources/{products/conversations/tags.d.ts.map → support/conversations/tags.d.mts.map} +1 -1
- package/resources/{products → support}/conversations/tags.d.ts +2 -2
- package/resources/support/conversations/tags.d.ts.map +1 -0
- package/resources/{products → support}/conversations/tags.js +2 -2
- package/resources/support/conversations/tags.js.map +1 -0
- package/resources/{products → support}/conversations/tags.mjs +2 -2
- package/resources/support/conversations/tags.mjs.map +1 -0
- package/resources/support/conversations.d.mts.map +1 -0
- package/resources/support/conversations.d.ts.map +1 -0
- package/resources/support/conversations.js.map +1 -0
- package/resources/support/conversations.mjs.map +1 -0
- package/resources/support/index.d.mts +5 -0
- package/resources/support/index.d.mts.map +1 -0
- package/resources/support/index.d.ts +5 -0
- package/resources/support/index.d.ts.map +1 -0
- package/resources/{products → support}/index.js +3 -5
- package/resources/support/index.js.map +1 -0
- package/resources/{products → support}/index.mjs +1 -2
- package/resources/support/index.mjs.map +1 -0
- package/resources/support/support.d.mts +18 -0
- package/resources/support/support.d.mts.map +1 -0
- package/resources/support/support.d.ts +18 -0
- package/resources/support/support.d.ts.map +1 -0
- package/resources/{products/products.js → support/support.js} +7 -11
- package/resources/support/support.js.map +1 -0
- package/resources/{products/products.mjs → support/support.mjs} +5 -9
- package/resources/support/support.mjs.map +1 -0
- package/resources/{products → support}/tickets/categories.d.mts +2 -2
- package/resources/{products/tickets/categories.d.ts.map → support/tickets/categories.d.mts.map} +1 -1
- package/resources/{products → support}/tickets/categories.d.ts +2 -2
- package/resources/support/tickets/categories.d.ts.map +1 -0
- package/resources/{products → support}/tickets/categories.js +2 -2
- package/resources/support/tickets/categories.js.map +1 -0
- package/resources/{products → support}/tickets/categories.mjs +2 -2
- package/resources/support/tickets/categories.mjs.map +1 -0
- package/resources/{products → support}/tickets/custom-fields.d.mts +2 -2
- package/resources/{products/tickets/custom-fields.d.ts.map → support/tickets/custom-fields.d.mts.map} +1 -1
- package/resources/{products → support}/tickets/custom-fields.d.ts +2 -2
- package/resources/support/tickets/custom-fields.d.ts.map +1 -0
- package/resources/{products → support}/tickets/custom-fields.js +2 -2
- package/resources/support/tickets/custom-fields.js.map +1 -0
- package/resources/{products → support}/tickets/custom-fields.mjs +2 -2
- package/resources/support/tickets/custom-fields.mjs.map +1 -0
- package/resources/{products → support}/tickets/index.d.mts +1 -1
- package/resources/support/tickets/index.d.mts.map +1 -0
- package/resources/{products → support}/tickets/index.d.ts +1 -1
- package/resources/support/tickets/index.d.ts.map +1 -0
- package/resources/support/tickets/index.js.map +1 -0
- package/resources/support/tickets/index.mjs.map +1 -0
- package/resources/{products → support}/tickets/statuses.d.mts +2 -2
- package/resources/{products/tickets/statuses.d.ts.map → support/tickets/statuses.d.mts.map} +1 -1
- package/resources/{products → support}/tickets/statuses.d.ts +2 -2
- package/resources/support/tickets/statuses.d.ts.map +1 -0
- package/resources/{products → support}/tickets/statuses.js +2 -2
- package/resources/support/tickets/statuses.js.map +1 -0
- package/resources/{products → support}/tickets/statuses.mjs +2 -2
- package/resources/support/tickets/statuses.mjs.map +1 -0
- package/resources/{products → support}/tickets/tickets.d.mts +14 -31
- package/resources/support/tickets/tickets.d.mts.map +1 -0
- package/resources/{products → support}/tickets/tickets.d.ts +14 -31
- package/resources/support/tickets/tickets.d.ts.map +1 -0
- package/resources/{products → support}/tickets/tickets.js +11 -7
- package/resources/support/tickets/tickets.js.map +1 -0
- package/resources/{products → support}/tickets/tickets.mjs +11 -7
- package/resources/support/tickets/tickets.mjs.map +1 -0
- package/resources/support/tickets.d.mts.map +1 -0
- package/resources/support/tickets.d.ts.map +1 -0
- package/resources/support/tickets.js.map +1 -0
- package/resources/support/tickets.mjs.map +1 -0
- package/resources/support.d.mts +2 -0
- package/resources/support.d.mts.map +1 -0
- package/resources/support.d.ts +2 -0
- package/resources/support.d.ts.map +1 -0
- package/resources/{products.js → support.js} +2 -2
- package/resources/support.js.map +1 -0
- package/{src/resources/integrations.ts → resources/support.mjs} +2 -2
- package/resources/support.mjs.map +1 -0
- package/resources/{products/surveys.d.mts → surveys.d.mts} +38 -103
- package/resources/surveys.d.mts.map +1 -0
- package/resources/{products/surveys.d.ts → surveys.d.ts} +38 -103
- package/resources/surveys.d.ts.map +1 -0
- package/resources/{products/surveys.js → surveys.js} +7 -26
- package/resources/surveys.js.map +1 -0
- package/resources/{products/surveys.mjs → surveys.mjs} +7 -26
- package/resources/surveys.mjs.map +1 -0
- package/resources/users/companies/companies.d.mts +9 -28
- package/resources/users/companies/companies.d.mts.map +1 -1
- package/resources/users/companies/companies.d.ts +9 -28
- package/resources/users/companies/companies.d.ts.map +1 -1
- package/resources/users/companies/companies.js +6 -2
- package/resources/users/companies/companies.js.map +1 -1
- package/resources/users/companies/companies.mjs +6 -2
- package/resources/users/companies/companies.mjs.map +1 -1
- package/resources/users/companies/contacts.d.mts +11 -16
- package/resources/users/companies/contacts.d.mts.map +1 -1
- package/resources/users/companies/contacts.d.ts +11 -16
- package/resources/users/companies/contacts.d.ts.map +1 -1
- package/resources/users/companies/contacts.js +8 -5
- package/resources/users/companies/contacts.js.map +1 -1
- package/resources/users/companies/contacts.mjs +8 -5
- package/resources/users/companies/contacts.mjs.map +1 -1
- package/resources/users/companies/index.d.mts +1 -1
- package/resources/users/companies/index.d.mts.map +1 -1
- package/resources/users/companies/index.d.ts +1 -1
- package/resources/users/companies/index.d.ts.map +1 -1
- package/resources/users/contacts/contacts.d.mts +9 -13
- package/resources/users/contacts/contacts.d.mts.map +1 -1
- package/resources/users/contacts/contacts.d.ts +9 -13
- package/resources/users/contacts/contacts.d.ts.map +1 -1
- package/resources/users/contacts/contacts.js +6 -2
- package/resources/users/contacts/contacts.js.map +1 -1
- package/resources/users/contacts/contacts.mjs +6 -2
- package/resources/users/contacts/contacts.mjs.map +1 -1
- package/resources/users/contacts/index.d.mts +1 -1
- package/resources/users/contacts/index.d.mts.map +1 -1
- package/resources/users/contacts/index.d.ts +1 -1
- package/resources/users/contacts/index.d.ts.map +1 -1
- package/resources/users/contacts/index.js.map +1 -1
- package/resources/users/contacts/index.mjs.map +1 -1
- package/resources/users/index.d.mts +2 -2
- package/resources/users/index.d.mts.map +1 -1
- package/resources/users/index.d.ts +2 -2
- package/resources/users/index.d.ts.map +1 -1
- package/resources/users/index.js.map +1 -1
- package/resources/users/index.mjs.map +1 -1
- package/resources/users/users.d.mts +4 -4
- package/resources/users/users.d.mts.map +1 -1
- package/resources/users/users.d.ts +4 -4
- package/resources/users/users.d.ts.map +1 -1
- package/resources/users/users.js.map +1 -1
- package/resources/users/users.mjs.map +1 -1
- package/resources/{integrations/webhooks.d.mts → webhooks.d.mts} +19 -38
- package/resources/webhooks.d.mts.map +1 -0
- package/resources/{integrations/webhooks.d.ts → webhooks.d.ts} +19 -38
- package/resources/webhooks.d.ts.map +1 -0
- package/resources/{integrations/webhooks.js → webhooks.js} +16 -13
- package/resources/webhooks.js.map +1 -0
- package/resources/{integrations/webhooks.mjs → webhooks.mjs} +16 -13
- package/resources/webhooks.mjs.map +1 -0
- package/src/client.ts +98 -14
- package/src/core/pagination.ts +157 -0
- package/src/index.ts +1 -0
- package/src/pagination.ts +2 -0
- package/src/resources/changelogs/changelogs.ts +11 -64
- package/src/resources/changelogs/index.ts +1 -1
- package/src/resources/feedback/comments.ts +12 -65
- package/src/resources/feedback/feedback.ts +4 -4
- package/src/resources/feedback/index.ts +2 -2
- package/src/resources/feedback/posts/index.ts +2 -1
- package/src/resources/feedback/posts/posts.ts +14 -66
- package/src/resources/feedback/posts/voters.ts +87 -140
- package/src/resources/help-center/articles.ts +11 -33
- package/src/resources/help-center/collections.ts +11 -34
- package/src/resources/help-center/help-center.ts +8 -8
- package/src/resources/help-center/help-centers.ts +11 -34
- package/src/resources/help-center/index.ts +4 -4
- package/src/resources/help-center/redirect-rules.ts +11 -34
- package/src/resources/index.ts +26 -3
- package/src/resources/organization/brands.ts +7 -32
- package/src/resources/organization/index.ts +1 -1
- package/src/resources/organization/organization.ts +2 -2
- package/src/resources/{products → support}/conversation-tags.ts +4 -4
- package/src/resources/{products → support}/conversations/conversations.ts +17 -40
- package/src/resources/{products → support}/conversations/index.ts +1 -1
- package/src/resources/{products → support}/conversations/participants.ts +2 -2
- package/src/resources/{products → support}/conversations/tags.ts +2 -2
- package/src/resources/{products → support}/index.ts +3 -13
- package/src/resources/{products/products.ts → support/support.ts} +9 -33
- package/src/resources/{products → support}/tickets/categories.ts +2 -2
- package/src/resources/{products → support}/tickets/custom-fields.ts +2 -2
- package/src/resources/{products → support}/tickets/index.ts +1 -1
- package/src/resources/{products → support}/tickets/statuses.ts +2 -2
- package/src/resources/{products → support}/tickets/tickets.ts +16 -37
- package/src/resources/{products.ts → support.ts} +1 -1
- package/src/resources/{products/surveys.ts → surveys.ts} +60 -128
- package/src/resources/users/companies/companies.ts +11 -34
- package/src/resources/users/companies/contacts.ts +24 -26
- package/src/resources/users/companies/index.ts +1 -1
- package/src/resources/users/contacts/contacts.ts +14 -15
- package/src/resources/users/contacts/index.ts +1 -0
- package/src/resources/users/index.ts +2 -1
- package/src/resources/users/users.ts +4 -2
- package/src/resources/{integrations/webhooks.ts → webhooks.ts} +23 -46
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/resources/integrations/index.d.mts +0 -3
- package/resources/integrations/index.d.mts.map +0 -1
- package/resources/integrations/index.d.ts +0 -3
- package/resources/integrations/index.d.ts.map +0 -1
- package/resources/integrations/index.js +0 -9
- package/resources/integrations/index.js.map +0 -1
- package/resources/integrations/index.mjs +0 -4
- package/resources/integrations/index.mjs.map +0 -1
- package/resources/integrations/integrations.d.mts +0 -10
- package/resources/integrations/integrations.d.mts.map +0 -1
- package/resources/integrations/integrations.d.ts +0 -10
- package/resources/integrations/integrations.d.ts.map +0 -1
- package/resources/integrations/integrations.js +0 -17
- package/resources/integrations/integrations.js.map +0 -1
- package/resources/integrations/integrations.mjs +0 -12
- package/resources/integrations/integrations.mjs.map +0 -1
- package/resources/integrations/webhooks.d.mts.map +0 -1
- package/resources/integrations/webhooks.d.ts.map +0 -1
- package/resources/integrations/webhooks.js.map +0 -1
- package/resources/integrations/webhooks.mjs.map +0 -1
- package/resources/integrations.d.mts +0 -2
- package/resources/integrations.d.mts.map +0 -1
- package/resources/integrations.d.ts +0 -2
- package/resources/integrations.d.ts.map +0 -1
- package/resources/integrations.js +0 -6
- package/resources/integrations.js.map +0 -1
- package/resources/integrations.mjs +0 -3
- package/resources/integrations.mjs.map +0 -1
- package/resources/products/conversation-tags.d.mts.map +0 -1
- package/resources/products/conversation-tags.js.map +0 -1
- package/resources/products/conversation-tags.mjs.map +0 -1
- package/resources/products/conversations/conversations.d.mts.map +0 -1
- package/resources/products/conversations/conversations.d.ts.map +0 -1
- package/resources/products/conversations/conversations.js.map +0 -1
- package/resources/products/conversations/conversations.mjs.map +0 -1
- package/resources/products/conversations/index.d.mts.map +0 -1
- package/resources/products/conversations/index.d.ts.map +0 -1
- package/resources/products/conversations/index.js.map +0 -1
- package/resources/products/conversations/index.mjs.map +0 -1
- package/resources/products/conversations/participants.d.mts.map +0 -1
- package/resources/products/conversations/participants.js.map +0 -1
- package/resources/products/conversations/participants.mjs.map +0 -1
- package/resources/products/conversations/tags.d.mts.map +0 -1
- package/resources/products/conversations/tags.js.map +0 -1
- package/resources/products/conversations/tags.mjs.map +0 -1
- package/resources/products/conversations.d.mts.map +0 -1
- package/resources/products/conversations.d.ts.map +0 -1
- package/resources/products/conversations.js.map +0 -1
- package/resources/products/conversations.mjs.map +0 -1
- package/resources/products/index.d.mts +0 -6
- package/resources/products/index.d.mts.map +0 -1
- package/resources/products/index.d.ts +0 -6
- package/resources/products/index.d.ts.map +0 -1
- package/resources/products/index.js.map +0 -1
- package/resources/products/index.mjs.map +0 -1
- package/resources/products/products.d.mts +0 -22
- package/resources/products/products.d.mts.map +0 -1
- package/resources/products/products.d.ts +0 -22
- package/resources/products/products.d.ts.map +0 -1
- package/resources/products/products.js.map +0 -1
- package/resources/products/products.mjs.map +0 -1
- package/resources/products/surveys.d.mts.map +0 -1
- package/resources/products/surveys.d.ts.map +0 -1
- package/resources/products/surveys.js.map +0 -1
- package/resources/products/surveys.mjs.map +0 -1
- package/resources/products/tickets/categories.d.mts.map +0 -1
- package/resources/products/tickets/categories.js.map +0 -1
- package/resources/products/tickets/categories.mjs.map +0 -1
- package/resources/products/tickets/custom-fields.d.mts.map +0 -1
- package/resources/products/tickets/custom-fields.js.map +0 -1
- package/resources/products/tickets/custom-fields.mjs.map +0 -1
- package/resources/products/tickets/index.d.mts.map +0 -1
- package/resources/products/tickets/index.d.ts.map +0 -1
- package/resources/products/tickets/index.js.map +0 -1
- package/resources/products/tickets/index.mjs.map +0 -1
- package/resources/products/tickets/statuses.d.mts.map +0 -1
- package/resources/products/tickets/statuses.js.map +0 -1
- package/resources/products/tickets/statuses.mjs.map +0 -1
- package/resources/products/tickets/tickets.d.mts.map +0 -1
- package/resources/products/tickets/tickets.d.ts.map +0 -1
- package/resources/products/tickets/tickets.js.map +0 -1
- package/resources/products/tickets/tickets.mjs.map +0 -1
- package/resources/products/tickets.d.mts.map +0 -1
- package/resources/products/tickets.d.ts.map +0 -1
- package/resources/products/tickets.js.map +0 -1
- package/resources/products/tickets.mjs.map +0 -1
- package/resources/products.d.mts +0 -2
- package/resources/products.d.mts.map +0 -1
- package/resources/products.d.ts +0 -2
- package/resources/products.d.ts.map +0 -1
- package/resources/products.js.map +0 -1
- package/resources/products.mjs +0 -3
- package/resources/products.mjs.map +0 -1
- package/src/resources/integrations/index.ts +0 -16
- package/src/resources/integrations/integrations.ts +0 -39
- /package/resources/{products → support}/conversations/index.js +0 -0
- /package/resources/{products → support}/conversations/index.mjs +0 -0
- /package/resources/{products → support}/conversations.d.mts +0 -0
- /package/resources/{products → support}/conversations.d.ts +0 -0
- /package/resources/{products → support}/conversations.js +0 -0
- /package/resources/{products → support}/conversations.mjs +0 -0
- /package/resources/{products → support}/tickets/index.js +0 -0
- /package/resources/{products → support}/tickets/index.mjs +0 -0
- /package/resources/{products → support}/tickets.d.mts +0 -0
- /package/resources/{products → support}/tickets.d.ts +0 -0
- /package/resources/{products → support}/tickets.js +0 -0
- /package/resources/{products → support}/tickets.mjs +0 -0
- /package/src/resources/{products → support}/conversations.ts +0 -0
- /package/src/resources/{products → support}/tickets.ts +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { APIResource } from "
|
|
2
|
-
import { APIPromise } from "
|
|
3
|
-
import {
|
|
1
|
+
import { APIResource } from "../core/resource.js";
|
|
2
|
+
import { APIPromise } from "../core/api-promise.js";
|
|
3
|
+
import { CursorPage, type CursorPageParams, PagePromise } from "../core/pagination.js";
|
|
4
|
+
import { RequestOptions } from "../internal/request-options.js";
|
|
4
5
|
/**
|
|
5
6
|
* 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.
|
|
6
7
|
*/
|
|
@@ -80,7 +81,7 @@ export declare class Webhooks extends APIResource {
|
|
|
80
81
|
*
|
|
81
82
|
* @example
|
|
82
83
|
* ```ts
|
|
83
|
-
* const webhook = await client.
|
|
84
|
+
* const webhook = await client.webhooks.create({
|
|
84
85
|
* name: 'Production Webhook',
|
|
85
86
|
* topics: ['post.created', 'post.updated'],
|
|
86
87
|
* url: 'https://example.com/webhooks',
|
|
@@ -152,7 +153,7 @@ export declare class Webhooks extends APIResource {
|
|
|
152
153
|
*
|
|
153
154
|
* @example
|
|
154
155
|
* ```ts
|
|
155
|
-
* const webhook = await client.
|
|
156
|
+
* const webhook = await client.webhooks.retrieve(
|
|
156
157
|
* '507f1f77bcf86cd799439011',
|
|
157
158
|
* );
|
|
158
159
|
* ```
|
|
@@ -228,7 +229,7 @@ export declare class Webhooks extends APIResource {
|
|
|
228
229
|
*
|
|
229
230
|
* @example
|
|
230
231
|
* ```ts
|
|
231
|
-
* const webhook = await client.
|
|
232
|
+
* const webhook = await client.webhooks.update(
|
|
232
233
|
* '507f1f77bcf86cd799439011',
|
|
233
234
|
* );
|
|
234
235
|
* ```
|
|
@@ -290,10 +291,13 @@ export declare class Webhooks extends APIResource {
|
|
|
290
291
|
*
|
|
291
292
|
* @example
|
|
292
293
|
* ```ts
|
|
293
|
-
*
|
|
294
|
+
* // Automatically fetches more pages as needed.
|
|
295
|
+
* for await (const webhook of client.webhooks.list()) {
|
|
296
|
+
* // ...
|
|
297
|
+
* }
|
|
294
298
|
* ```
|
|
295
299
|
*/
|
|
296
|
-
list(params?: WebhookListParams | null | undefined, options?: RequestOptions):
|
|
300
|
+
list(params?: WebhookListParams | null | undefined, options?: RequestOptions): PagePromise<WebhooksCursorPage, Webhook>;
|
|
297
301
|
/**
|
|
298
302
|
* Permanently deletes a webhook.
|
|
299
303
|
*
|
|
@@ -325,7 +329,7 @@ export declare class Webhooks extends APIResource {
|
|
|
325
329
|
*
|
|
326
330
|
* @example
|
|
327
331
|
* ```ts
|
|
328
|
-
* const webhook = await client.
|
|
332
|
+
* const webhook = await client.webhooks.delete(
|
|
329
333
|
* '507f1f77bcf86cd799439011',
|
|
330
334
|
* );
|
|
331
335
|
* ```
|
|
@@ -370,14 +374,14 @@ export declare class Webhooks extends APIResource {
|
|
|
370
374
|
*
|
|
371
375
|
* @example
|
|
372
376
|
* ```ts
|
|
373
|
-
* const webhook =
|
|
374
|
-
*
|
|
375
|
-
*
|
|
376
|
-
* );
|
|
377
|
+
* const webhook = await client.webhooks.refreshSecret(
|
|
378
|
+
* '507f1f77bcf86cd799439011',
|
|
379
|
+
* );
|
|
377
380
|
* ```
|
|
378
381
|
*/
|
|
379
382
|
refreshSecret(id: string, params?: WebhookRefreshSecretParams | null | undefined, options?: RequestOptions): APIPromise<Webhook>;
|
|
380
383
|
}
|
|
384
|
+
export type WebhooksCursorPage = CursorPage<Webhook>;
|
|
381
385
|
export interface Webhook {
|
|
382
386
|
/**
|
|
383
387
|
* Unique identifier
|
|
@@ -494,20 +498,6 @@ export interface WebhookRequestConfigInput {
|
|
|
494
498
|
[key: string]: string;
|
|
495
499
|
};
|
|
496
500
|
}
|
|
497
|
-
export interface WebhookListResponse {
|
|
498
|
-
/**
|
|
499
|
-
* Array of webhooks
|
|
500
|
-
*/
|
|
501
|
-
data: Array<Webhook>;
|
|
502
|
-
/**
|
|
503
|
-
* Cursor for fetching the next page (cursor-based pagination)
|
|
504
|
-
*/
|
|
505
|
-
nextCursor: string | null;
|
|
506
|
-
/**
|
|
507
|
-
* Object type identifier
|
|
508
|
-
*/
|
|
509
|
-
object: 'list';
|
|
510
|
-
}
|
|
511
501
|
export interface WebhookDeleteResponse {
|
|
512
502
|
/**
|
|
513
503
|
* Unique identifier of the deleted webhook
|
|
@@ -587,16 +577,7 @@ export interface WebhookUpdateParams {
|
|
|
587
577
|
*/
|
|
588
578
|
'Featurebase-Version'?: string;
|
|
589
579
|
}
|
|
590
|
-
export interface WebhookListParams {
|
|
591
|
-
/**
|
|
592
|
-
* Query param: An opaque cursor for pagination. Use the nextCursor value from a
|
|
593
|
-
* previous response to fetch the next page of results.
|
|
594
|
-
*/
|
|
595
|
-
cursor?: string;
|
|
596
|
-
/**
|
|
597
|
-
* Query param: A limit on the number of objects to be returned, between 1 and 100.
|
|
598
|
-
*/
|
|
599
|
-
limit?: number;
|
|
580
|
+
export interface WebhookListParams extends CursorPageParams {
|
|
600
581
|
/**
|
|
601
582
|
* Query param: Filter webhooks by status
|
|
602
583
|
*/
|
|
@@ -622,6 +603,6 @@ export interface WebhookRefreshSecretParams {
|
|
|
622
603
|
'Featurebase-Version'?: string;
|
|
623
604
|
}
|
|
624
605
|
export declare namespace Webhooks {
|
|
625
|
-
export { type Webhook as Webhook, type WebhookRequestConfigInput as WebhookRequestConfigInput, type
|
|
606
|
+
export { type Webhook as Webhook, type WebhookRequestConfigInput as WebhookRequestConfigInput, type WebhookDeleteResponse as WebhookDeleteResponse, type WebhooksCursorPage as WebhooksCursorPage, type WebhookCreateParams as WebhookCreateParams, type WebhookRetrieveParams as WebhookRetrieveParams, type WebhookUpdateParams as WebhookUpdateParams, type WebhookListParams as WebhookListParams, type WebhookDeleteParams as WebhookDeleteParams, type WebhookRefreshSecretParams as WebhookRefreshSecretParams, };
|
|
626
607
|
}
|
|
627
608
|
//# sourceMappingURL=webhooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../src/resources/webhooks.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,WAAW,EAAE;OAElD,EAAE,cAAc,EAAE;AAGzB;;GAEG;AACH,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiFG;IACH,MAAM,CAAC,MAAM,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;IAYlF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoEG;IACH,QAAQ,CACN,EAAE,EAAE,MAAM,EACV,MAAM,GAAE,qBAAqB,GAAG,IAAI,GAAG,SAAc,EACrD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,OAAO,CAAC;IAWtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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K,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,0BAA0B,IAAI,0BAA0B,GAC9D,CAAC;CACH"}
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.Webhooks = void 0;
|
|
5
|
-
const resource_1 = require("
|
|
6
|
-
const
|
|
7
|
-
const
|
|
5
|
+
const resource_1 = require("../core/resource.js");
|
|
6
|
+
const pagination_1 = require("../core/pagination.js");
|
|
7
|
+
const headers_1 = require("../internal/headers.js");
|
|
8
|
+
const path_1 = require("../internal/utils/path.js");
|
|
8
9
|
/**
|
|
9
10
|
* 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.
|
|
10
11
|
*/
|
|
@@ -84,7 +85,7 @@ class Webhooks extends resource_1.APIResource {
|
|
|
84
85
|
*
|
|
85
86
|
* @example
|
|
86
87
|
* ```ts
|
|
87
|
-
* const webhook = await client.
|
|
88
|
+
* const webhook = await client.webhooks.create({
|
|
88
89
|
* name: 'Production Webhook',
|
|
89
90
|
* topics: ['post.created', 'post.updated'],
|
|
90
91
|
* url: 'https://example.com/webhooks',
|
|
@@ -166,7 +167,7 @@ class Webhooks extends resource_1.APIResource {
|
|
|
166
167
|
*
|
|
167
168
|
* @example
|
|
168
169
|
* ```ts
|
|
169
|
-
* const webhook = await client.
|
|
170
|
+
* const webhook = await client.webhooks.retrieve(
|
|
170
171
|
* '507f1f77bcf86cd799439011',
|
|
171
172
|
* );
|
|
172
173
|
* ```
|
|
@@ -251,7 +252,7 @@ class Webhooks extends resource_1.APIResource {
|
|
|
251
252
|
*
|
|
252
253
|
* @example
|
|
253
254
|
* ```ts
|
|
254
|
-
* const webhook = await client.
|
|
255
|
+
* const webhook = await client.webhooks.update(
|
|
255
256
|
* '507f1f77bcf86cd799439011',
|
|
256
257
|
* );
|
|
257
258
|
* ```
|
|
@@ -323,12 +324,15 @@ class Webhooks extends resource_1.APIResource {
|
|
|
323
324
|
*
|
|
324
325
|
* @example
|
|
325
326
|
* ```ts
|
|
326
|
-
*
|
|
327
|
+
* // Automatically fetches more pages as needed.
|
|
328
|
+
* for await (const webhook of client.webhooks.list()) {
|
|
329
|
+
* // ...
|
|
330
|
+
* }
|
|
327
331
|
* ```
|
|
328
332
|
*/
|
|
329
333
|
list(params = {}, options) {
|
|
330
334
|
const { 'Featurebase-Version': featurebaseVersion, ...query } = params ?? {};
|
|
331
|
-
return this._client.
|
|
335
|
+
return this._client.getAPIList('/v2/webhooks', (pagination_1.CursorPage), {
|
|
332
336
|
query,
|
|
333
337
|
...options,
|
|
334
338
|
headers: (0, headers_1.buildHeaders)([
|
|
@@ -368,7 +372,7 @@ class Webhooks extends resource_1.APIResource {
|
|
|
368
372
|
*
|
|
369
373
|
* @example
|
|
370
374
|
* ```ts
|
|
371
|
-
* const webhook = await client.
|
|
375
|
+
* const webhook = await client.webhooks.delete(
|
|
372
376
|
* '507f1f77bcf86cd799439011',
|
|
373
377
|
* );
|
|
374
378
|
* ```
|
|
@@ -422,10 +426,9 @@ class Webhooks extends resource_1.APIResource {
|
|
|
422
426
|
*
|
|
423
427
|
* @example
|
|
424
428
|
* ```ts
|
|
425
|
-
* const webhook =
|
|
426
|
-
*
|
|
427
|
-
*
|
|
428
|
-
* );
|
|
429
|
+
* const webhook = await client.webhooks.refreshSecret(
|
|
430
|
+
* '507f1f77bcf86cd799439011',
|
|
431
|
+
* );
|
|
429
432
|
* ```
|
|
430
433
|
*/
|
|
431
434
|
refreshSecret(id, params = {}, options) {
|
|
@@ -0,0 +1 @@
|
|
|
1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|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { APIResource } from "../core/resource.mjs";
|
|
3
|
+
import { CursorPage } from "../core/pagination.mjs";
|
|
4
|
+
import { buildHeaders } from "../internal/headers.mjs";
|
|
5
|
+
import { path } from "../internal/utils/path.mjs";
|
|
5
6
|
/**
|
|
6
7
|
* 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.
|
|
7
8
|
*/
|
|
@@ -81,7 +82,7 @@ export class Webhooks extends APIResource {
|
|
|
81
82
|
*
|
|
82
83
|
* @example
|
|
83
84
|
* ```ts
|
|
84
|
-
* const webhook = await client.
|
|
85
|
+
* const webhook = await client.webhooks.create({
|
|
85
86
|
* name: 'Production Webhook',
|
|
86
87
|
* topics: ['post.created', 'post.updated'],
|
|
87
88
|
* url: 'https://example.com/webhooks',
|
|
@@ -163,7 +164,7 @@ export class Webhooks extends APIResource {
|
|
|
163
164
|
*
|
|
164
165
|
* @example
|
|
165
166
|
* ```ts
|
|
166
|
-
* const webhook = await client.
|
|
167
|
+
* const webhook = await client.webhooks.retrieve(
|
|
167
168
|
* '507f1f77bcf86cd799439011',
|
|
168
169
|
* );
|
|
169
170
|
* ```
|
|
@@ -248,7 +249,7 @@ export class Webhooks extends APIResource {
|
|
|
248
249
|
*
|
|
249
250
|
* @example
|
|
250
251
|
* ```ts
|
|
251
|
-
* const webhook = await client.
|
|
252
|
+
* const webhook = await client.webhooks.update(
|
|
252
253
|
* '507f1f77bcf86cd799439011',
|
|
253
254
|
* );
|
|
254
255
|
* ```
|
|
@@ -320,12 +321,15 @@ export class Webhooks extends APIResource {
|
|
|
320
321
|
*
|
|
321
322
|
* @example
|
|
322
323
|
* ```ts
|
|
323
|
-
*
|
|
324
|
+
* // Automatically fetches more pages as needed.
|
|
325
|
+
* for await (const webhook of client.webhooks.list()) {
|
|
326
|
+
* // ...
|
|
327
|
+
* }
|
|
324
328
|
* ```
|
|
325
329
|
*/
|
|
326
330
|
list(params = {}, options) {
|
|
327
331
|
const { 'Featurebase-Version': featurebaseVersion, ...query } = params ?? {};
|
|
328
|
-
return this._client.
|
|
332
|
+
return this._client.getAPIList('/v2/webhooks', (CursorPage), {
|
|
329
333
|
query,
|
|
330
334
|
...options,
|
|
331
335
|
headers: buildHeaders([
|
|
@@ -365,7 +369,7 @@ export class Webhooks extends APIResource {
|
|
|
365
369
|
*
|
|
366
370
|
* @example
|
|
367
371
|
* ```ts
|
|
368
|
-
* const webhook = await client.
|
|
372
|
+
* const webhook = await client.webhooks.delete(
|
|
369
373
|
* '507f1f77bcf86cd799439011',
|
|
370
374
|
* );
|
|
371
375
|
* ```
|
|
@@ -419,10 +423,9 @@ export class Webhooks extends APIResource {
|
|
|
419
423
|
*
|
|
420
424
|
* @example
|
|
421
425
|
* ```ts
|
|
422
|
-
* const webhook =
|
|
423
|
-
*
|
|
424
|
-
*
|
|
425
|
-
* );
|
|
426
|
+
* const webhook = await client.webhooks.refreshSecret(
|
|
427
|
+
* '507f1f77bcf86cd799439011',
|
|
428
|
+
* );
|
|
426
429
|
* ```
|
|
427
430
|
*/
|
|
428
431
|
refreshSecret(id, params = {}, options) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhooks.mjs","sourceRoot":"","sources":["../src/resources/webhooks.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,EAAE,UAAU,EAAsC;OAClD,EAAE,YAAY,EAAE;OAEhB,EAAE,IAAI,EAAE;AAEf;;GAEG;AACH,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiFG;IACH,MAAM,CAAC,MAA2B,EAAE,OAAwB;QAC1D,MAAM,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACt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C,EAAE;gBAC/F,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2CG;IACH,aAAa,CACX,EAAU,EACV,SAAwD,EAAE,EAC1D,OAAwB;QAExB,MAAM,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,GAAG,MAAM,IAAI,EAAE,CAAC;QACnE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,gBAAgB,EAAE,SAAS,EAAE;YACxD,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC;gBACpB,EAAE,GAAG,CAAC,kBAAkB,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE;gBAC/F,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;CACF"}
|
package/src/client.ts
CHANGED
|
@@ -14,28 +14,53 @@ import * as Opts from './internal/request-options';
|
|
|
14
14
|
import { stringifyQuery } from './internal/utils/query';
|
|
15
15
|
import { VERSION } from './version';
|
|
16
16
|
import * as Errors from './core/error';
|
|
17
|
+
import * as Pagination from './core/pagination';
|
|
18
|
+
import { AbstractPage, type CursorPageParams, CursorPageResponse } from './core/pagination';
|
|
17
19
|
import * as Uploads from './core/uploads';
|
|
18
20
|
import * as API from './resources/index';
|
|
19
21
|
import { APIPromise } from './core/api-promise';
|
|
22
|
+
import {
|
|
23
|
+
Survey,
|
|
24
|
+
SurveyListParams,
|
|
25
|
+
SurveyListResponsesParams,
|
|
26
|
+
SurveyListResponsesResponse,
|
|
27
|
+
SurveyListResponsesResponsesCursorPage,
|
|
28
|
+
SurveyNextAction,
|
|
29
|
+
SurveyRetrieveParams,
|
|
30
|
+
Surveys,
|
|
31
|
+
SurveysCursorPage,
|
|
32
|
+
} from './resources/surveys';
|
|
33
|
+
import {
|
|
34
|
+
Webhook,
|
|
35
|
+
WebhookCreateParams,
|
|
36
|
+
WebhookDeleteParams,
|
|
37
|
+
WebhookDeleteResponse,
|
|
38
|
+
WebhookListParams,
|
|
39
|
+
WebhookRefreshSecretParams,
|
|
40
|
+
WebhookRequestConfigInput,
|
|
41
|
+
WebhookRetrieveParams,
|
|
42
|
+
WebhookUpdateParams,
|
|
43
|
+
Webhooks,
|
|
44
|
+
WebhooksCursorPage,
|
|
45
|
+
} from './resources/webhooks';
|
|
20
46
|
import {
|
|
21
47
|
Changelog,
|
|
22
48
|
ChangelogCreateParams,
|
|
23
49
|
ChangelogDeleteParams,
|
|
24
50
|
ChangelogDeleteResponse,
|
|
25
51
|
ChangelogListParams,
|
|
26
|
-
ChangelogListResponse,
|
|
27
52
|
ChangelogPublishParams,
|
|
28
53
|
ChangelogRetrieveParams,
|
|
29
54
|
ChangelogUnpublishParams,
|
|
30
55
|
ChangelogUpdateParams,
|
|
31
56
|
Changelogs,
|
|
57
|
+
ChangelogsCursorPage,
|
|
32
58
|
PublishUnpublishSuccess,
|
|
33
59
|
} from './resources/changelogs/changelogs';
|
|
34
60
|
import { Feedback } from './resources/feedback/feedback';
|
|
35
61
|
import { HelpCenter } from './resources/help-center/help-center';
|
|
36
|
-
import { Integrations } from './resources/integrations/integrations';
|
|
37
62
|
import { Organization } from './resources/organization/organization';
|
|
38
|
-
import {
|
|
63
|
+
import { Support } from './resources/support/support';
|
|
39
64
|
import { Users } from './resources/users/users';
|
|
40
65
|
import { type Fetch } from './internal/builtin-types';
|
|
41
66
|
import { HeadersLike, NullableHeaders, buildHeaders } from './internal/headers';
|
|
@@ -499,6 +524,30 @@ export class Featurebase {
|
|
|
499
524
|
return { response, options, controller, requestLogID, retryOfRequestLogID, startTime };
|
|
500
525
|
}
|
|
501
526
|
|
|
527
|
+
getAPIList<Item, PageClass extends Pagination.AbstractPage<Item> = Pagination.AbstractPage<Item>>(
|
|
528
|
+
path: string,
|
|
529
|
+
Page: new (...args: any[]) => PageClass,
|
|
530
|
+
opts?: PromiseOrValue<RequestOptions>,
|
|
531
|
+
): Pagination.PagePromise<PageClass, Item> {
|
|
532
|
+
return this.requestAPIList(
|
|
533
|
+
Page,
|
|
534
|
+
opts && 'then' in opts ?
|
|
535
|
+
opts.then((opts) => ({ method: 'get', path, ...opts }))
|
|
536
|
+
: { method: 'get', path, ...opts },
|
|
537
|
+
);
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
requestAPIList<
|
|
541
|
+
Item = unknown,
|
|
542
|
+
PageClass extends Pagination.AbstractPage<Item> = Pagination.AbstractPage<Item>,
|
|
543
|
+
>(
|
|
544
|
+
Page: new (...args: ConstructorParameters<typeof Pagination.AbstractPage>) => PageClass,
|
|
545
|
+
options: PromiseOrValue<FinalRequestOptions>,
|
|
546
|
+
): Pagination.PagePromise<PageClass, Item> {
|
|
547
|
+
const request = this.makeRequest(options, null, undefined);
|
|
548
|
+
return new Pagination.PagePromise<PageClass, Item>(this as any as Featurebase, request, Page);
|
|
549
|
+
}
|
|
550
|
+
|
|
502
551
|
async fetchWithTimeout(
|
|
503
552
|
url: RequestInfo,
|
|
504
553
|
init: RequestInit | undefined,
|
|
@@ -746,37 +795,50 @@ export class Featurebase {
|
|
|
746
795
|
|
|
747
796
|
static toFile = Uploads.toFile;
|
|
748
797
|
|
|
798
|
+
support: API.Support = new API.Support(this);
|
|
749
799
|
feedback: API.Feedback = new API.Feedback(this);
|
|
750
800
|
/**
|
|
751
801
|
* Release notes and updates published by the organization. Changelogs keep users informed about new features, improvements, and fixes.
|
|
752
802
|
*/
|
|
753
803
|
changelogs: API.Changelogs = new API.Changelogs(this);
|
|
804
|
+
helpCenter: API.HelpCenter = new API.HelpCenter(this);
|
|
754
805
|
organization: API.Organization = new API.Organization(this);
|
|
755
806
|
users: API.Users = new API.Users(this);
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
807
|
+
/**
|
|
808
|
+
* 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.
|
|
809
|
+
*/
|
|
810
|
+
surveys: API.Surveys = new API.Surveys(this);
|
|
811
|
+
/**
|
|
812
|
+
* 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.
|
|
813
|
+
*/
|
|
814
|
+
webhooks: API.Webhooks = new API.Webhooks(this);
|
|
759
815
|
}
|
|
760
816
|
|
|
817
|
+
Featurebase.Support = Support;
|
|
761
818
|
Featurebase.Feedback = Feedback;
|
|
762
819
|
Featurebase.Changelogs = Changelogs;
|
|
820
|
+
Featurebase.HelpCenter = HelpCenter;
|
|
763
821
|
Featurebase.Organization = Organization;
|
|
764
822
|
Featurebase.Users = Users;
|
|
765
|
-
Featurebase.
|
|
766
|
-
Featurebase.
|
|
767
|
-
Featurebase.Integrations = Integrations;
|
|
823
|
+
Featurebase.Surveys = Surveys;
|
|
824
|
+
Featurebase.Webhooks = Webhooks;
|
|
768
825
|
|
|
769
826
|
export declare namespace Featurebase {
|
|
770
827
|
export type RequestOptions = Opts.RequestOptions;
|
|
771
828
|
|
|
829
|
+
export import CursorPage = Pagination.CursorPage;
|
|
830
|
+
export { type CursorPageParams as CursorPageParams, type CursorPageResponse as CursorPageResponse };
|
|
831
|
+
|
|
832
|
+
export { Support as Support };
|
|
833
|
+
|
|
772
834
|
export { Feedback as Feedback };
|
|
773
835
|
|
|
774
836
|
export {
|
|
775
837
|
Changelogs as Changelogs,
|
|
776
838
|
type Changelog as Changelog,
|
|
777
839
|
type PublishUnpublishSuccess as PublishUnpublishSuccess,
|
|
778
|
-
type ChangelogListResponse as ChangelogListResponse,
|
|
779
840
|
type ChangelogDeleteResponse as ChangelogDeleteResponse,
|
|
841
|
+
type ChangelogsCursorPage as ChangelogsCursorPage,
|
|
780
842
|
type ChangelogCreateParams as ChangelogCreateParams,
|
|
781
843
|
type ChangelogRetrieveParams as ChangelogRetrieveParams,
|
|
782
844
|
type ChangelogUpdateParams as ChangelogUpdateParams,
|
|
@@ -786,13 +848,35 @@ export declare namespace Featurebase {
|
|
|
786
848
|
type ChangelogUnpublishParams as ChangelogUnpublishParams,
|
|
787
849
|
};
|
|
788
850
|
|
|
851
|
+
export { HelpCenter as HelpCenter };
|
|
852
|
+
|
|
789
853
|
export { Organization as Organization };
|
|
790
854
|
|
|
791
855
|
export { Users as Users };
|
|
792
856
|
|
|
793
|
-
export {
|
|
794
|
-
|
|
795
|
-
|
|
857
|
+
export {
|
|
858
|
+
Surveys as Surveys,
|
|
859
|
+
type Survey as Survey,
|
|
860
|
+
type SurveyNextAction as SurveyNextAction,
|
|
861
|
+
type SurveyListResponsesResponse as SurveyListResponsesResponse,
|
|
862
|
+
type SurveysCursorPage as SurveysCursorPage,
|
|
863
|
+
type SurveyListResponsesResponsesCursorPage as SurveyListResponsesResponsesCursorPage,
|
|
864
|
+
type SurveyRetrieveParams as SurveyRetrieveParams,
|
|
865
|
+
type SurveyListParams as SurveyListParams,
|
|
866
|
+
type SurveyListResponsesParams as SurveyListResponsesParams,
|
|
867
|
+
};
|
|
796
868
|
|
|
797
|
-
export {
|
|
869
|
+
export {
|
|
870
|
+
Webhooks as Webhooks,
|
|
871
|
+
type Webhook as Webhook,
|
|
872
|
+
type WebhookRequestConfigInput as WebhookRequestConfigInput,
|
|
873
|
+
type WebhookDeleteResponse as WebhookDeleteResponse,
|
|
874
|
+
type WebhooksCursorPage as WebhooksCursorPage,
|
|
875
|
+
type WebhookCreateParams as WebhookCreateParams,
|
|
876
|
+
type WebhookRetrieveParams as WebhookRetrieveParams,
|
|
877
|
+
type WebhookUpdateParams as WebhookUpdateParams,
|
|
878
|
+
type WebhookListParams as WebhookListParams,
|
|
879
|
+
type WebhookDeleteParams as WebhookDeleteParams,
|
|
880
|
+
type WebhookRefreshSecretParams as WebhookRefreshSecretParams,
|
|
881
|
+
};
|
|
798
882
|
}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { FeaturebaseError } from './error';
|
|
4
|
+
import { FinalRequestOptions } from '../internal/request-options';
|
|
5
|
+
import { defaultParseResponse } from '../internal/parse';
|
|
6
|
+
import { type Featurebase } from '../client';
|
|
7
|
+
import { APIPromise } from './api-promise';
|
|
8
|
+
import { type APIResponseProps } from '../internal/parse';
|
|
9
|
+
import { maybeObj } from '../internal/utils/values';
|
|
10
|
+
|
|
11
|
+
export type PageRequestOptions = Pick<FinalRequestOptions, 'query' | 'headers' | 'body' | 'path' | 'method'>;
|
|
12
|
+
|
|
13
|
+
export abstract class AbstractPage<Item> implements AsyncIterable<Item> {
|
|
14
|
+
#client: Featurebase;
|
|
15
|
+
protected options: FinalRequestOptions;
|
|
16
|
+
|
|
17
|
+
protected response: Response;
|
|
18
|
+
protected body: unknown;
|
|
19
|
+
|
|
20
|
+
constructor(client: Featurebase, response: Response, body: unknown, options: FinalRequestOptions) {
|
|
21
|
+
this.#client = client;
|
|
22
|
+
this.options = options;
|
|
23
|
+
this.response = response;
|
|
24
|
+
this.body = body;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
abstract nextPageRequestOptions(): PageRequestOptions | null;
|
|
28
|
+
|
|
29
|
+
abstract getPaginatedItems(): Item[];
|
|
30
|
+
|
|
31
|
+
hasNextPage(): boolean {
|
|
32
|
+
const items = this.getPaginatedItems();
|
|
33
|
+
if (!items.length) return false;
|
|
34
|
+
return this.nextPageRequestOptions() != null;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
async getNextPage(): Promise<this> {
|
|
38
|
+
const nextOptions = this.nextPageRequestOptions();
|
|
39
|
+
if (!nextOptions) {
|
|
40
|
+
throw new FeaturebaseError(
|
|
41
|
+
'No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.',
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return await this.#client.requestAPIList(this.constructor as any, nextOptions);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
async *iterPages(): AsyncGenerator<this> {
|
|
49
|
+
let page: this = this;
|
|
50
|
+
yield page;
|
|
51
|
+
while (page.hasNextPage()) {
|
|
52
|
+
page = await page.getNextPage();
|
|
53
|
+
yield page;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async *[Symbol.asyncIterator](): AsyncGenerator<Item> {
|
|
58
|
+
for await (const page of this.iterPages()) {
|
|
59
|
+
for (const item of page.getPaginatedItems()) {
|
|
60
|
+
yield item;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* This subclass of Promise will resolve to an instantiated Page once the request completes.
|
|
68
|
+
*
|
|
69
|
+
* It also implements AsyncIterable to allow auto-paginating iteration on an unawaited list call, eg:
|
|
70
|
+
*
|
|
71
|
+
* for await (const item of client.items.list()) {
|
|
72
|
+
* console.log(item)
|
|
73
|
+
* }
|
|
74
|
+
*/
|
|
75
|
+
export class PagePromise<
|
|
76
|
+
PageClass extends AbstractPage<Item>,
|
|
77
|
+
Item = ReturnType<PageClass['getPaginatedItems']>[number],
|
|
78
|
+
>
|
|
79
|
+
extends APIPromise<PageClass>
|
|
80
|
+
implements AsyncIterable<Item>
|
|
81
|
+
{
|
|
82
|
+
constructor(
|
|
83
|
+
client: Featurebase,
|
|
84
|
+
request: Promise<APIResponseProps>,
|
|
85
|
+
Page: new (...args: ConstructorParameters<typeof AbstractPage>) => PageClass,
|
|
86
|
+
) {
|
|
87
|
+
super(
|
|
88
|
+
client,
|
|
89
|
+
request,
|
|
90
|
+
async (client, props) =>
|
|
91
|
+
new Page(client, props.response, await defaultParseResponse(client, props), props.options),
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Allow auto-paginating iteration on an unawaited list call, eg:
|
|
97
|
+
*
|
|
98
|
+
* for await (const item of client.items.list()) {
|
|
99
|
+
* console.log(item)
|
|
100
|
+
* }
|
|
101
|
+
*/
|
|
102
|
+
async *[Symbol.asyncIterator](): AsyncGenerator<Item> {
|
|
103
|
+
const page = await this;
|
|
104
|
+
for await (const item of page) {
|
|
105
|
+
yield item;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export interface CursorPageResponse<Item> {
|
|
111
|
+
data: Array<Item>;
|
|
112
|
+
|
|
113
|
+
nextCursor: string | null;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export interface CursorPageParams {
|
|
117
|
+
cursor?: string;
|
|
118
|
+
|
|
119
|
+
limit?: number;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export class CursorPage<Item> extends AbstractPage<Item> implements CursorPageResponse<Item> {
|
|
123
|
+
data: Array<Item>;
|
|
124
|
+
|
|
125
|
+
nextCursor: string | null;
|
|
126
|
+
|
|
127
|
+
constructor(
|
|
128
|
+
client: Featurebase,
|
|
129
|
+
response: Response,
|
|
130
|
+
body: CursorPageResponse<Item>,
|
|
131
|
+
options: FinalRequestOptions,
|
|
132
|
+
) {
|
|
133
|
+
super(client, response, body, options);
|
|
134
|
+
|
|
135
|
+
this.data = body.data || [];
|
|
136
|
+
this.nextCursor = body.nextCursor || null;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
getPaginatedItems(): Item[] {
|
|
140
|
+
return this.data ?? [];
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
nextPageRequestOptions(): PageRequestOptions | null {
|
|
144
|
+
const cursor = this.nextCursor;
|
|
145
|
+
if (!cursor) {
|
|
146
|
+
return null;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
return {
|
|
150
|
+
...this.options,
|
|
151
|
+
query: {
|
|
152
|
+
...maybeObj(this.options.query),
|
|
153
|
+
cursor,
|
|
154
|
+
},
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -5,6 +5,7 @@ export { Featurebase as default } from './client';
|
|
|
5
5
|
export { type Uploadable, toFile } from './core/uploads';
|
|
6
6
|
export { APIPromise } from './core/api-promise';
|
|
7
7
|
export { Featurebase, type ClientOptions } from './client';
|
|
8
|
+
export { PagePromise } from './core/pagination';
|
|
8
9
|
export {
|
|
9
10
|
FeaturebaseError,
|
|
10
11
|
APIError,
|