magicbell-js 0.0.3 → 0.1.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/README.md +2 -3
- package/dist/commonjs/project-client/http/errors/throwable-error.d.ts +7 -0
- package/dist/commonjs/project-client/http/errors/throwable-error.d.ts.map +1 -0
- package/dist/commonjs/project-client/http/errors/throwable-error.js +25 -0
- package/dist/commonjs/project-client/http/errors/throwable-error.js.map +1 -0
- package/dist/commonjs/project-client/http/handlers/hook-handler.d.ts.map +1 -1
- package/dist/commonjs/project-client/http/handlers/hook-handler.js +2 -2
- package/dist/commonjs/project-client/http/handlers/hook-handler.js.map +1 -1
- package/dist/commonjs/project-client/http/transport/types.d.ts +2 -1
- package/dist/commonjs/project-client/http/transport/types.d.ts.map +1 -1
- package/dist/commonjs/project-client/services/broadcasts/broadcasts-service.d.ts.map +1 -1
- package/dist/commonjs/project-client/services/broadcasts/broadcasts-service.js.map +1 -1
- package/dist/commonjs/project-client/services/channels/channels-service.d.ts.map +1 -1
- package/dist/commonjs/project-client/services/channels/channels-service.js.map +1 -1
- package/dist/commonjs/project-client/services/events/events-service.d.ts.map +1 -1
- package/dist/commonjs/project-client/services/events/events-service.js.map +1 -1
- package/dist/commonjs/project-client/services/integrations/integrations-service.d.ts.map +1 -1
- package/dist/commonjs/project-client/services/integrations/integrations-service.js.map +1 -1
- package/dist/commonjs/project-client/services/jwt/jwt-service.d.ts +1 -25
- package/dist/commonjs/project-client/services/jwt/jwt-service.d.ts.map +1 -1
- package/dist/commonjs/project-client/services/jwt/jwt-service.js +0 -103
- package/dist/commonjs/project-client/services/jwt/jwt-service.js.map +1 -1
- package/dist/commonjs/project-client/services/jwt/models/index.d.ts +0 -1
- package/dist/commonjs/project-client/services/jwt/models/index.d.ts.map +1 -1
- package/dist/commonjs/project-client/services/jwt/request-params.d.ts +0 -5
- package/dist/commonjs/project-client/services/jwt/request-params.d.ts.map +1 -1
- package/dist/commonjs/project-client/services/notifications/notifications-service.d.ts.map +1 -1
- package/dist/commonjs/project-client/services/notifications/notifications-service.js.map +1 -1
- package/dist/commonjs/project-client/services/users/users-service.d.ts.map +1 -1
- package/dist/commonjs/project-client/services/users/users-service.js.map +1 -1
- package/dist/commonjs/user-client/http/errors/throwable-error.d.ts +7 -0
- package/dist/commonjs/user-client/http/errors/throwable-error.d.ts.map +1 -0
- package/dist/commonjs/user-client/http/errors/throwable-error.js +25 -0
- package/dist/commonjs/user-client/http/errors/throwable-error.js.map +1 -0
- package/dist/commonjs/user-client/http/handlers/hook-handler.d.ts.map +1 -1
- package/dist/commonjs/user-client/http/handlers/hook-handler.js +2 -2
- package/dist/commonjs/user-client/http/handlers/hook-handler.js.map +1 -1
- package/dist/commonjs/user-client/http/transport/types.d.ts +2 -1
- package/dist/commonjs/user-client/http/transport/types.d.ts.map +1 -1
- package/dist/commonjs/user-client/services/channels/channels-service.d.ts.map +1 -1
- package/dist/commonjs/user-client/services/channels/channels-service.js.map +1 -1
- package/dist/commonjs/user-client/services/integrations/integrations-service.d.ts.map +1 -1
- package/dist/commonjs/user-client/services/integrations/integrations-service.js.map +1 -1
- package/dist/commonjs/user-client/services/notifications/notifications-service.d.ts +26 -1
- package/dist/commonjs/user-client/services/notifications/notifications-service.d.ts.map +1 -1
- package/dist/commonjs/user-client/services/notifications/notifications-service.js +106 -0
- package/dist/commonjs/user-client/services/notifications/notifications-service.js.map +1 -1
- package/dist/commonjs/user-client/services/notifications/request-params.d.ts +9 -0
- package/dist/commonjs/user-client/services/notifications/request-params.d.ts.map +1 -1
- package/dist/esm/project-client/http/errors/throwable-error.d.ts +7 -0
- package/dist/esm/project-client/http/errors/throwable-error.d.ts.map +1 -0
- package/dist/esm/project-client/http/errors/throwable-error.js +21 -0
- package/dist/esm/project-client/http/errors/throwable-error.js.map +1 -0
- package/dist/esm/project-client/http/handlers/hook-handler.d.ts.map +1 -1
- package/dist/esm/project-client/http/handlers/hook-handler.js +2 -2
- package/dist/esm/project-client/http/handlers/hook-handler.js.map +1 -1
- package/dist/esm/project-client/http/transport/types.d.ts +2 -1
- package/dist/esm/project-client/http/transport/types.d.ts.map +1 -1
- package/dist/esm/project-client/services/broadcasts/broadcasts-service.d.ts.map +1 -1
- package/dist/esm/project-client/services/broadcasts/broadcasts-service.js.map +1 -1
- package/dist/esm/project-client/services/channels/channels-service.d.ts.map +1 -1
- package/dist/esm/project-client/services/channels/channels-service.js.map +1 -1
- package/dist/esm/project-client/services/events/events-service.d.ts.map +1 -1
- package/dist/esm/project-client/services/events/events-service.js.map +1 -1
- package/dist/esm/project-client/services/integrations/integrations-service.d.ts.map +1 -1
- package/dist/esm/project-client/services/integrations/integrations-service.js.map +1 -1
- package/dist/esm/project-client/services/jwt/jwt-service.d.ts +1 -25
- package/dist/esm/project-client/services/jwt/jwt-service.d.ts.map +1 -1
- package/dist/esm/project-client/services/jwt/jwt-service.js +0 -103
- package/dist/esm/project-client/services/jwt/jwt-service.js.map +1 -1
- package/dist/esm/project-client/services/jwt/models/index.d.ts +0 -1
- package/dist/esm/project-client/services/jwt/models/index.d.ts.map +1 -1
- package/dist/esm/project-client/services/jwt/request-params.d.ts +0 -5
- package/dist/esm/project-client/services/jwt/request-params.d.ts.map +1 -1
- package/dist/esm/project-client/services/notifications/notifications-service.d.ts.map +1 -1
- package/dist/esm/project-client/services/notifications/notifications-service.js.map +1 -1
- package/dist/esm/project-client/services/users/users-service.d.ts.map +1 -1
- package/dist/esm/project-client/services/users/users-service.js.map +1 -1
- package/dist/esm/user-client/http/errors/throwable-error.d.ts +7 -0
- package/dist/esm/user-client/http/errors/throwable-error.d.ts.map +1 -0
- package/dist/esm/user-client/http/errors/throwable-error.js +21 -0
- package/dist/esm/user-client/http/errors/throwable-error.js.map +1 -0
- package/dist/esm/user-client/http/handlers/hook-handler.d.ts.map +1 -1
- package/dist/esm/user-client/http/handlers/hook-handler.js +2 -2
- package/dist/esm/user-client/http/handlers/hook-handler.js.map +1 -1
- package/dist/esm/user-client/http/transport/types.d.ts +2 -1
- package/dist/esm/user-client/http/transport/types.d.ts.map +1 -1
- package/dist/esm/user-client/services/channels/channels-service.d.ts.map +1 -1
- package/dist/esm/user-client/services/channels/channels-service.js.map +1 -1
- package/dist/esm/user-client/services/integrations/integrations-service.d.ts.map +1 -1
- package/dist/esm/user-client/services/integrations/integrations-service.js.map +1 -1
- package/dist/esm/user-client/services/notifications/notifications-service.d.ts +26 -1
- package/dist/esm/user-client/services/notifications/notifications-service.d.ts.map +1 -1
- package/dist/esm/user-client/services/notifications/notifications-service.js +106 -0
- package/dist/esm/user-client/services/notifications/notifications-service.js.map +1 -1
- package/dist/esm/user-client/services/notifications/request-params.d.ts +9 -0
- package/dist/esm/user-client/services/notifications/request-params.d.ts.map +1 -1
- package/package.json +3 -1
- package/src/project-client/http/client.ts +71 -0
- package/src/project-client/http/environment.ts +3 -0
- package/src/project-client/http/error.ts +14 -0
- package/src/project-client/http/errors/throwable-error.ts +9 -0
- package/src/project-client/http/errors/validation-error.ts +25 -0
- package/src/project-client/http/handlers/handler-chain.ts +30 -0
- package/src/project-client/http/handlers/hook-handler.ts +80 -0
- package/src/project-client/http/handlers/request-validation-handler.ts +111 -0
- package/src/project-client/http/handlers/response-validation-handler.ts +203 -0
- package/src/project-client/http/handlers/retry-handler.ts +60 -0
- package/src/project-client/http/handlers/terminating-handler.ts +14 -0
- package/src/project-client/http/hooks/custom-hook.ts +25 -0
- package/src/project-client/http/hooks/hook.ts +41 -0
- package/src/project-client/http/index.ts +11 -0
- package/src/project-client/http/serialization/base-serializer.ts +139 -0
- package/src/project-client/http/serialization/header-serializer.ts +19 -0
- package/src/project-client/http/serialization/path-serializer.ts +12 -0
- package/src/project-client/http/serialization/query-serializer.ts +18 -0
- package/src/project-client/http/transport/request-builder.ts +242 -0
- package/src/project-client/http/transport/request-fetch-adapter.ts +131 -0
- package/src/project-client/http/transport/request.ts +222 -0
- package/src/project-client/http/transport/transport-hook-adapter.ts +91 -0
- package/src/project-client/http/transport/types.ts +51 -0
- package/src/project-client/http/types.ts +74 -0
- package/src/project-client/http/utils/content-type.ts +33 -0
- package/src/project-client/http/utils/line-decoder.ts +35 -0
- package/src/project-client/http/utils/response-matcher.ts +25 -0
- package/src/project-client/index.ts +94 -0
- package/src/project-client/services/base-service.ts +27 -0
- package/src/project-client/services/broadcasts/broadcasts-service.ts +116 -0
- package/src/project-client/services/broadcasts/index.ts +2 -0
- package/src/project-client/services/broadcasts/models/broadcast-collection.ts +54 -0
- package/src/project-client/services/broadcasts/models/broadcast-status.ts +60 -0
- package/src/project-client/services/broadcasts/models/broadcast.ts +143 -0
- package/src/project-client/services/broadcasts/models/email.ts +57 -0
- package/src/project-client/services/broadcasts/models/errors.ts +45 -0
- package/src/project-client/services/broadcasts/models/in-app.ts +57 -0
- package/src/project-client/services/broadcasts/models/index.ts +15 -0
- package/src/project-client/services/broadcasts/models/mobile-push.ts +57 -0
- package/src/project-client/services/broadcasts/models/overrides-channels.ts +82 -0
- package/src/project-client/services/broadcasts/models/overrides.ts +59 -0
- package/src/project-client/services/broadcasts/models/providers.ts +81 -0
- package/src/project-client/services/broadcasts/models/slack.ts +57 -0
- package/src/project-client/services/broadcasts/models/sms.ts +57 -0
- package/src/project-client/services/broadcasts/models/status-status.ts +7 -0
- package/src/project-client/services/broadcasts/models/summary.ts +51 -0
- package/src/project-client/services/broadcasts/models/web-push.ts +57 -0
- package/src/project-client/services/broadcasts/request-params.ts +5 -0
- package/src/project-client/services/channels/channels-service.ts +1018 -0
- package/src/project-client/services/channels/index.ts +2 -0
- package/src/project-client/services/channels/models/apns-token-collection.ts +54 -0
- package/src/project-client/services/channels/models/apns-token-installation-id.ts +6 -0
- package/src/project-client/services/channels/models/apns-token.ts +90 -0
- package/src/project-client/services/channels/models/category-delivery-config-channels.ts +57 -0
- package/src/project-client/services/channels/models/category-delivery-config.ts +73 -0
- package/src/project-client/services/channels/models/channel.ts +11 -0
- package/src/project-client/services/channels/models/discard-result.ts +51 -0
- package/src/project-client/services/channels/models/expo-token-collection.ts +54 -0
- package/src/project-client/services/channels/models/expo-token.ts +69 -0
- package/src/project-client/services/channels/models/fcm-token-collection.ts +54 -0
- package/src/project-client/services/channels/models/fcm-token-installation-id.ts +6 -0
- package/src/project-client/services/channels/models/fcm-token.ts +75 -0
- package/src/project-client/services/channels/models/inbox-token-response-collection.ts +59 -0
- package/src/project-client/services/channels/models/inbox-token-response.ts +75 -0
- package/src/project-client/services/channels/models/index.ts +24 -0
- package/src/project-client/services/channels/models/keys.ts +51 -0
- package/src/project-client/services/channels/models/oauth.ts +57 -0
- package/src/project-client/services/channels/models/slack-token-collection.ts +54 -0
- package/src/project-client/services/channels/models/slack-token-webhook.ts +45 -0
- package/src/project-client/services/channels/models/slack-token.ts +83 -0
- package/src/project-client/services/channels/models/teams-token-collection.ts +54 -0
- package/src/project-client/services/channels/models/teams-token-webhook.ts +45 -0
- package/src/project-client/services/channels/models/teams-token.ts +76 -0
- package/src/project-client/services/channels/models/web-push-token-collection.ts +54 -0
- package/src/project-client/services/channels/models/web-push-token.ts +77 -0
- package/src/project-client/services/channels/request-params.ts +45 -0
- package/src/project-client/services/common/index.ts +1 -0
- package/src/project-client/services/common/links.ts +57 -0
- package/src/project-client/services/events/events-service.ts +85 -0
- package/src/project-client/services/events/index.ts +2 -0
- package/src/project-client/services/events/models/event-collection.ts +54 -0
- package/src/project-client/services/events/models/event.ts +81 -0
- package/src/project-client/services/events/models/index.ts +2 -0
- package/src/project-client/services/events/request-params.ts +5 -0
- package/src/project-client/services/integrations/index.ts +2 -0
- package/src/project-client/services/integrations/integrations-service.ts +1966 -0
- package/src/project-client/services/integrations/models/apns-config-collection.ts +54 -0
- package/src/project-client/services/integrations/models/apns-config-payload.ts +81 -0
- package/src/project-client/services/integrations/models/apns-config.ts +64 -0
- package/src/project-client/services/integrations/models/awssns-config-collection.ts +54 -0
- package/src/project-client/services/integrations/models/awssns-config-payload.ts +45 -0
- package/src/project-client/services/integrations/models/awssns-config.ts +64 -0
- package/src/project-client/services/integrations/models/badge.ts +6 -0
- package/src/project-client/services/integrations/models/banner.ts +63 -0
- package/src/project-client/services/integrations/models/default-hover.ts +45 -0
- package/src/project-client/services/integrations/models/default-state.ts +45 -0
- package/src/project-client/services/integrations/models/default_.ts +90 -0
- package/src/project-client/services/integrations/models/dialog.ts +57 -0
- package/src/project-client/services/integrations/models/event-source-config-collection.ts +59 -0
- package/src/project-client/services/integrations/models/event-source-config-payload.ts +45 -0
- package/src/project-client/services/integrations/models/event-source-config.ts +64 -0
- package/src/project-client/services/integrations/models/expo-config-collection.ts +54 -0
- package/src/project-client/services/integrations/models/expo-config-payload.ts +45 -0
- package/src/project-client/services/integrations/models/expo-config.ts +64 -0
- package/src/project-client/services/integrations/models/fcm-config-collection.ts +54 -0
- package/src/project-client/services/integrations/models/fcm-config-payload.ts +105 -0
- package/src/project-client/services/integrations/models/fcm-config.ts +64 -0
- package/src/project-client/services/integrations/models/footer.ts +63 -0
- package/src/project-client/services/integrations/models/github-config-collection.ts +54 -0
- package/src/project-client/services/integrations/models/github-config-payload.ts +45 -0
- package/src/project-client/services/integrations/models/github-config.ts +64 -0
- package/src/project-client/services/integrations/models/header.ts +69 -0
- package/src/project-client/services/integrations/models/icon.ts +51 -0
- package/src/project-client/services/integrations/models/images.ts +45 -0
- package/src/project-client/services/integrations/models/inbox-config-collection.ts +54 -0
- package/src/project-client/services/integrations/models/inbox-config-payload.ts +60 -0
- package/src/project-client/services/integrations/models/inbox-config.ts +64 -0
- package/src/project-client/services/integrations/models/index.ts +75 -0
- package/src/project-client/services/integrations/models/integration-config-collection.ts +59 -0
- package/src/project-client/services/integrations/models/integration-config.ts +57 -0
- package/src/project-client/services/integrations/models/mailgun-config-collection.ts +54 -0
- package/src/project-client/services/integrations/models/mailgun-config-payload-from.ts +51 -0
- package/src/project-client/services/integrations/models/mailgun-config-payload.ts +70 -0
- package/src/project-client/services/integrations/models/mailgun-config.ts +64 -0
- package/src/project-client/services/integrations/models/notification.ts +61 -0
- package/src/project-client/services/integrations/models/payload-version.ts +6 -0
- package/src/project-client/services/integrations/models/ping-config-collection.ts +54 -0
- package/src/project-client/services/integrations/models/ping-config-payload.ts +45 -0
- package/src/project-client/services/integrations/models/ping-config.ts +64 -0
- package/src/project-client/services/integrations/models/region.ts +6 -0
- package/src/project-client/services/integrations/models/reply-to.ts +51 -0
- package/src/project-client/services/integrations/models/sendgrid-config-collection.ts +54 -0
- package/src/project-client/services/integrations/models/sendgrid-config-payload-from.ts +51 -0
- package/src/project-client/services/integrations/models/sendgrid-config-payload.ts +65 -0
- package/src/project-client/services/integrations/models/sendgrid-config.ts +64 -0
- package/src/project-client/services/integrations/models/ses-config-collection.ts +54 -0
- package/src/project-client/services/integrations/models/ses-config-payload-from.ts +51 -0
- package/src/project-client/services/integrations/models/ses-config-payload.ts +70 -0
- package/src/project-client/services/integrations/models/ses-config.ts +64 -0
- package/src/project-client/services/integrations/models/slack-config-collection.ts +54 -0
- package/src/project-client/services/integrations/models/slack-config-payload.ts +63 -0
- package/src/project-client/services/integrations/models/slack-config.ts +64 -0
- package/src/project-client/services/integrations/models/stripe-config-collection.ts +54 -0
- package/src/project-client/services/integrations/models/stripe-config-payload.ts +45 -0
- package/src/project-client/services/integrations/models/stripe-config.ts +64 -0
- package/src/project-client/services/integrations/models/templates-config-collection.ts +59 -0
- package/src/project-client/services/integrations/models/templates-config.ts +57 -0
- package/src/project-client/services/integrations/models/theme.ts +89 -0
- package/src/project-client/services/integrations/models/twilio-config-collection.ts +54 -0
- package/src/project-client/services/integrations/models/twilio-config-payload.ts +75 -0
- package/src/project-client/services/integrations/models/twilio-config.ts +64 -0
- package/src/project-client/services/integrations/models/type_.ts +5 -0
- package/src/project-client/services/integrations/models/unread-hover.ts +45 -0
- package/src/project-client/services/integrations/models/unread-state.ts +45 -0
- package/src/project-client/services/integrations/models/unread.ts +66 -0
- package/src/project-client/services/integrations/models/unseen-badge.ts +45 -0
- package/src/project-client/services/integrations/models/unseen-hover.ts +45 -0
- package/src/project-client/services/integrations/models/unseen-state.ts +45 -0
- package/src/project-client/services/integrations/models/unseen.ts +66 -0
- package/src/project-client/services/integrations/models/webpush-config-collection.ts +54 -0
- package/src/project-client/services/integrations/models/webpush-config-payload.ts +51 -0
- package/src/project-client/services/integrations/models/webpush-config.ts +64 -0
- package/src/project-client/services/integrations/request-params.ts +5 -0
- package/src/project-client/services/jwt/index.ts +2 -0
- package/src/project-client/services/jwt/jwt-service.ts +121 -0
- package/src/project-client/services/jwt/models/access-token-collection.ts +54 -0
- package/src/project-client/services/jwt/models/access-token.ts +69 -0
- package/src/project-client/services/jwt/models/create-project-token-request.ts +51 -0
- package/src/project-client/services/jwt/models/create-token-response.ts +63 -0
- package/src/project-client/services/jwt/models/discard-token-response.ts +51 -0
- package/src/project-client/services/jwt/models/index.ts +5 -0
- package/src/project-client/services/jwt/request-params.ts +5 -0
- package/src/project-client/services/notifications/index.ts +2 -0
- package/src/project-client/services/notifications/models/delivery-plan-collection.ts +54 -0
- package/src/project-client/services/notifications/models/delivery-plan.ts +93 -0
- package/src/project-client/services/notifications/models/index.ts +2 -0
- package/src/project-client/services/notifications/notifications-service.ts +45 -0
- package/src/project-client/services/users/index.ts +2 -0
- package/src/project-client/services/users/models/index.ts +2 -0
- package/src/project-client/services/users/models/user-collection.ts +54 -0
- package/src/project-client/services/users/models/user.ts +99 -0
- package/src/project-client/services/users/request-params.ts +6 -0
- package/src/project-client/services/users/users-service.ts +118 -0
- package/src/project-client.ts +1 -0
- package/src/user-client/http/client.ts +71 -0
- package/src/user-client/http/environment.ts +3 -0
- package/src/user-client/http/error.ts +14 -0
- package/src/user-client/http/errors/throwable-error.ts +9 -0
- package/src/user-client/http/errors/validation-error.ts +25 -0
- package/src/user-client/http/handlers/handler-chain.ts +30 -0
- package/src/user-client/http/handlers/hook-handler.ts +80 -0
- package/src/user-client/http/handlers/request-validation-handler.ts +111 -0
- package/src/user-client/http/handlers/response-validation-handler.ts +203 -0
- package/src/user-client/http/handlers/retry-handler.ts +60 -0
- package/src/user-client/http/handlers/terminating-handler.ts +14 -0
- package/src/user-client/http/hooks/custom-hook.ts +25 -0
- package/src/user-client/http/hooks/hook.ts +41 -0
- package/src/user-client/http/index.ts +11 -0
- package/src/user-client/http/serialization/base-serializer.ts +139 -0
- package/src/user-client/http/serialization/header-serializer.ts +19 -0
- package/src/user-client/http/serialization/path-serializer.ts +12 -0
- package/src/user-client/http/serialization/query-serializer.ts +18 -0
- package/src/user-client/http/transport/request-builder.ts +242 -0
- package/src/user-client/http/transport/request-fetch-adapter.ts +131 -0
- package/src/user-client/http/transport/request.ts +222 -0
- package/src/user-client/http/transport/transport-hook-adapter.ts +91 -0
- package/src/user-client/http/transport/types.ts +51 -0
- package/src/user-client/http/types.ts +74 -0
- package/src/user-client/http/utils/content-type.ts +33 -0
- package/src/user-client/http/utils/line-decoder.ts +35 -0
- package/src/user-client/http/utils/response-matcher.ts +25 -0
- package/src/user-client/index.ts +54 -0
- package/src/user-client/services/base-service.ts +27 -0
- package/src/user-client/services/channels/channels-service.ts +1021 -0
- package/src/user-client/services/channels/index.ts +2 -0
- package/src/user-client/services/channels/models/apns-token-collection.ts +54 -0
- package/src/user-client/services/channels/models/apns-token-installation-id.ts +6 -0
- package/src/user-client/services/channels/models/apns-token-payload-installation-id.ts +6 -0
- package/src/user-client/services/channels/models/apns-token-payload.ts +66 -0
- package/src/user-client/services/channels/models/apns-token.ts +90 -0
- package/src/user-client/services/channels/models/discard-result.ts +51 -0
- package/src/user-client/services/channels/models/expo-token-collection.ts +54 -0
- package/src/user-client/services/channels/models/expo-token-payload.ts +45 -0
- package/src/user-client/services/channels/models/expo-token.ts +69 -0
- package/src/user-client/services/channels/models/fcm-token-collection.ts +54 -0
- package/src/user-client/services/channels/models/fcm-token-installation-id.ts +6 -0
- package/src/user-client/services/channels/models/fcm-token-payload-installation-id.ts +6 -0
- package/src/user-client/services/channels/models/fcm-token-payload.ts +51 -0
- package/src/user-client/services/channels/models/fcm-token.ts +75 -0
- package/src/user-client/services/channels/models/inbox-token-response-collection.ts +59 -0
- package/src/user-client/services/channels/models/inbox-token-response.ts +75 -0
- package/src/user-client/services/channels/models/inbox-token.ts +51 -0
- package/src/user-client/services/channels/models/index.ts +33 -0
- package/src/user-client/services/channels/models/slack-token-collection.ts +54 -0
- package/src/user-client/services/channels/models/slack-token-oauth.ts +57 -0
- package/src/user-client/services/channels/models/slack-token-payload-oauth.ts +57 -0
- package/src/user-client/services/channels/models/slack-token-payload-webhook.ts +45 -0
- package/src/user-client/services/channels/models/slack-token-payload.ts +64 -0
- package/src/user-client/services/channels/models/slack-token-webhook.ts +45 -0
- package/src/user-client/services/channels/models/slack-token.ts +88 -0
- package/src/user-client/services/channels/models/teams-token-collection.ts +54 -0
- package/src/user-client/services/channels/models/teams-token-payload-webhook.ts +45 -0
- package/src/user-client/services/channels/models/teams-token-payload.ts +52 -0
- package/src/user-client/services/channels/models/teams-token-webhook.ts +45 -0
- package/src/user-client/services/channels/models/teams-token.ts +76 -0
- package/src/user-client/services/channels/models/web-push-token-collection.ts +54 -0
- package/src/user-client/services/channels/models/web-push-token-keys.ts +51 -0
- package/src/user-client/services/channels/models/web-push-token-payload-keys.ts +51 -0
- package/src/user-client/services/channels/models/web-push-token.ts +82 -0
- package/src/user-client/services/channels/request-params.ts +41 -0
- package/src/user-client/services/common/index.ts +2 -0
- package/src/user-client/services/common/links.ts +57 -0
- package/src/user-client/services/common/web-push-token-payload.ts +58 -0
- package/src/user-client/services/integrations/index.ts +2 -0
- package/src/user-client/services/integrations/integrations-service.ts +279 -0
- package/src/user-client/services/integrations/models/authed-user.ts +75 -0
- package/src/user-client/services/integrations/models/banner.ts +63 -0
- package/src/user-client/services/integrations/models/default-hover.ts +45 -0
- package/src/user-client/services/integrations/models/default-state.ts +45 -0
- package/src/user-client/services/integrations/models/default_.ts +90 -0
- package/src/user-client/services/integrations/models/dialog.ts +57 -0
- package/src/user-client/services/integrations/models/enterprise.ts +51 -0
- package/src/user-client/services/integrations/models/footer.ts +63 -0
- package/src/user-client/services/integrations/models/header.ts +69 -0
- package/src/user-client/services/integrations/models/icon.ts +51 -0
- package/src/user-client/services/integrations/models/images.ts +45 -0
- package/src/user-client/services/integrations/models/inbox-config-payload.ts +60 -0
- package/src/user-client/services/integrations/models/incoming-webhook.ts +57 -0
- package/src/user-client/services/integrations/models/index.ts +29 -0
- package/src/user-client/services/integrations/models/slack-finish-install-response.ts +57 -0
- package/src/user-client/services/integrations/models/slack-installation.ts +136 -0
- package/src/user-client/services/integrations/models/slack-start-install-response-content.ts +57 -0
- package/src/user-client/services/integrations/models/slack-start-install.ts +63 -0
- package/src/user-client/services/integrations/models/team.ts +51 -0
- package/src/user-client/services/integrations/models/templates-installation.ts +57 -0
- package/src/user-client/services/integrations/models/theme-notification.ts +61 -0
- package/src/user-client/services/integrations/models/theme.ts +94 -0
- package/src/user-client/services/integrations/models/unread-hover.ts +45 -0
- package/src/user-client/services/integrations/models/unread-state.ts +45 -0
- package/src/user-client/services/integrations/models/unread.ts +66 -0
- package/src/user-client/services/integrations/models/unseen-badge.ts +45 -0
- package/src/user-client/services/integrations/models/unseen-hover.ts +45 -0
- package/src/user-client/services/integrations/models/unseen-state.ts +45 -0
- package/src/user-client/services/integrations/models/unseen.ts +66 -0
- package/src/user-client/services/integrations/models/web-push-start-installation-response.ts +51 -0
- package/src/user-client/services/notifications/index.ts +2 -0
- package/src/user-client/services/notifications/models/index.ts +2 -0
- package/src/user-client/services/notifications/models/notification-collection.ts +54 -0
- package/src/user-client/services/notifications/models/notification.ts +129 -0
- package/src/user-client/services/notifications/notifications-service.ts +305 -0
- package/src/user-client/services/notifications/request-params.ts +18 -0
- package/src/user-client.ts +1 -0
- package/dist/commonjs/project-client/services/jwt/models/create-user-token-request.d.ts +0 -90
- package/dist/commonjs/project-client/services/jwt/models/create-user-token-request.d.ts.map +0 -1
- package/dist/commonjs/project-client/services/jwt/models/create-user-token-request.js +0 -54
- package/dist/commonjs/project-client/services/jwt/models/create-user-token-request.js.map +0 -1
- package/dist/esm/project-client/services/jwt/models/create-user-token-request.d.ts +0 -90
- package/dist/esm/project-client/services/jwt/models/create-user-token-request.d.ts.map +0 -1
- package/dist/esm/project-client/services/jwt/models/create-user-token-request.js +0 -51
- package/dist/esm/project-client/services/jwt/models/create-user-token-request.js.map +0 -1
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The shape of the model inside the application code - what the users use
|
|
5
|
+
*/
|
|
6
|
+
export const createTokenResponse = z.lazy(() => {
|
|
7
|
+
return z.object({
|
|
8
|
+
createdAt: z.string(),
|
|
9
|
+
expiresAt: z.string().optional().nullable(),
|
|
10
|
+
token: z.string(),
|
|
11
|
+
tokenId: z.string(),
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @typedef {CreateTokenResponse} createTokenResponse
|
|
18
|
+
* @property {string}
|
|
19
|
+
* @property {string}
|
|
20
|
+
* @property {string}
|
|
21
|
+
* @property {string}
|
|
22
|
+
*/
|
|
23
|
+
export type CreateTokenResponse = z.infer<typeof createTokenResponse>;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The shape of the model mapping from the api schema into the application shape.
|
|
27
|
+
* Is equal to application shape if all property names match the api schema
|
|
28
|
+
*/
|
|
29
|
+
export const createTokenResponseResponse = z.lazy(() => {
|
|
30
|
+
return z
|
|
31
|
+
.object({
|
|
32
|
+
created_at: z.string(),
|
|
33
|
+
expires_at: z.string().optional().nullable(),
|
|
34
|
+
token: z.string(),
|
|
35
|
+
token_id: z.string(),
|
|
36
|
+
})
|
|
37
|
+
.transform((data) => ({
|
|
38
|
+
createdAt: data['created_at'],
|
|
39
|
+
expiresAt: data['expires_at'],
|
|
40
|
+
token: data['token'],
|
|
41
|
+
tokenId: data['token_id'],
|
|
42
|
+
}));
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* The shape of the model mapping from the application shape into the api schema.
|
|
47
|
+
* Is equal to application shape if all property names match the api schema
|
|
48
|
+
*/
|
|
49
|
+
export const createTokenResponseRequest = z.lazy(() => {
|
|
50
|
+
return z
|
|
51
|
+
.object({
|
|
52
|
+
createdAt: z.string(),
|
|
53
|
+
expiresAt: z.string().optional().nullable(),
|
|
54
|
+
token: z.string(),
|
|
55
|
+
tokenId: z.string(),
|
|
56
|
+
})
|
|
57
|
+
.transform((data) => ({
|
|
58
|
+
created_at: data['createdAt'],
|
|
59
|
+
expires_at: data['expiresAt'],
|
|
60
|
+
token: data['token'],
|
|
61
|
+
token_id: data['tokenId'],
|
|
62
|
+
}));
|
|
63
|
+
});
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The shape of the model inside the application code - what the users use
|
|
5
|
+
*/
|
|
6
|
+
export const discardTokenResponse = z.lazy(() => {
|
|
7
|
+
return z.object({
|
|
8
|
+
discardedAt: z.string(),
|
|
9
|
+
tokenId: z.string(),
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @typedef {DiscardTokenResponse} discardTokenResponse
|
|
16
|
+
* @property {string}
|
|
17
|
+
* @property {string}
|
|
18
|
+
*/
|
|
19
|
+
export type DiscardTokenResponse = z.infer<typeof discardTokenResponse>;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The shape of the model mapping from the api schema into the application shape.
|
|
23
|
+
* Is equal to application shape if all property names match the api schema
|
|
24
|
+
*/
|
|
25
|
+
export const discardTokenResponseResponse = z.lazy(() => {
|
|
26
|
+
return z
|
|
27
|
+
.object({
|
|
28
|
+
discarded_at: z.string(),
|
|
29
|
+
token_id: z.string(),
|
|
30
|
+
})
|
|
31
|
+
.transform((data) => ({
|
|
32
|
+
discardedAt: data['discarded_at'],
|
|
33
|
+
tokenId: data['token_id'],
|
|
34
|
+
}));
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* The shape of the model mapping from the application shape into the api schema.
|
|
39
|
+
* Is equal to application shape if all property names match the api schema
|
|
40
|
+
*/
|
|
41
|
+
export const discardTokenResponseRequest = z.lazy(() => {
|
|
42
|
+
return z
|
|
43
|
+
.object({
|
|
44
|
+
discardedAt: z.string(),
|
|
45
|
+
tokenId: z.string(),
|
|
46
|
+
})
|
|
47
|
+
.transform((data) => ({
|
|
48
|
+
discarded_at: data['discardedAt'],
|
|
49
|
+
token_id: data['tokenId'],
|
|
50
|
+
}));
|
|
51
|
+
});
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type { AccessToken } from './access-token.js';
|
|
2
|
+
export type { AccessTokenCollection } from './access-token-collection.js';
|
|
3
|
+
export type { CreateProjectTokenRequest } from './create-project-token-request.js';
|
|
4
|
+
export type { CreateTokenResponse } from './create-token-response.js';
|
|
5
|
+
export type { DiscardTokenResponse } from './discard-token-response.js';
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
import { Links, links, linksRequest, linksResponse } from '../../common/links.js';
|
|
4
|
+
import { DeliveryPlan, deliveryPlan, deliveryPlanRequest, deliveryPlanResponse } from './delivery-plan.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The shape of the model inside the application code - what the users use
|
|
8
|
+
*/
|
|
9
|
+
export const deliveryPlanCollection = z.lazy(() => {
|
|
10
|
+
return z.object({
|
|
11
|
+
data: z.array(deliveryPlan).optional(),
|
|
12
|
+
links: links.optional(),
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @typedef {DeliveryPlanCollection} deliveryPlanCollection
|
|
19
|
+
* @property {DeliveryPlan[]}
|
|
20
|
+
* @property {Links}
|
|
21
|
+
*/
|
|
22
|
+
export type DeliveryPlanCollection = z.infer<typeof deliveryPlanCollection>;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The shape of the model mapping from the api schema into the application shape.
|
|
26
|
+
* Is equal to application shape if all property names match the api schema
|
|
27
|
+
*/
|
|
28
|
+
export const deliveryPlanCollectionResponse = z.lazy(() => {
|
|
29
|
+
return z
|
|
30
|
+
.object({
|
|
31
|
+
data: z.array(deliveryPlanResponse).optional(),
|
|
32
|
+
links: linksResponse.optional(),
|
|
33
|
+
})
|
|
34
|
+
.transform((data) => ({
|
|
35
|
+
data: data['data'],
|
|
36
|
+
links: data['links'],
|
|
37
|
+
}));
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* The shape of the model mapping from the application shape into the api schema.
|
|
42
|
+
* Is equal to application shape if all property names match the api schema
|
|
43
|
+
*/
|
|
44
|
+
export const deliveryPlanCollectionRequest = z.lazy(() => {
|
|
45
|
+
return z
|
|
46
|
+
.object({
|
|
47
|
+
data: z.array(deliveryPlanRequest).optional(),
|
|
48
|
+
links: linksRequest.optional(),
|
|
49
|
+
})
|
|
50
|
+
.transform((data) => ({
|
|
51
|
+
data: data['data'],
|
|
52
|
+
links: data['links'],
|
|
53
|
+
}));
|
|
54
|
+
});
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The shape of the model inside the application code - what the users use
|
|
5
|
+
*/
|
|
6
|
+
export const deliveryPlan = z.lazy(() => {
|
|
7
|
+
return z.object({
|
|
8
|
+
category: z.string().optional().nullable(),
|
|
9
|
+
completedAt: z.string().optional().nullable(),
|
|
10
|
+
id: z.string().optional(),
|
|
11
|
+
nextStep: z.number().optional(),
|
|
12
|
+
notificationId: z.string().optional(),
|
|
13
|
+
startedAt: z.string().optional().nullable(),
|
|
14
|
+
status: z.string().optional(),
|
|
15
|
+
topic: z.string().optional().nullable(),
|
|
16
|
+
userId: z.string().optional(),
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
*
|
|
22
|
+
* @typedef {DeliveryPlan} deliveryPlan
|
|
23
|
+
* @property {string}
|
|
24
|
+
* @property {string}
|
|
25
|
+
* @property {string}
|
|
26
|
+
* @property {number}
|
|
27
|
+
* @property {string}
|
|
28
|
+
* @property {string}
|
|
29
|
+
* @property {string}
|
|
30
|
+
* @property {string}
|
|
31
|
+
* @property {string}
|
|
32
|
+
*/
|
|
33
|
+
export type DeliveryPlan = z.infer<typeof deliveryPlan>;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* The shape of the model mapping from the api schema into the application shape.
|
|
37
|
+
* Is equal to application shape if all property names match the api schema
|
|
38
|
+
*/
|
|
39
|
+
export const deliveryPlanResponse = z.lazy(() => {
|
|
40
|
+
return z
|
|
41
|
+
.object({
|
|
42
|
+
category: z.string().optional().nullable(),
|
|
43
|
+
completed_at: z.string().optional().nullable(),
|
|
44
|
+
id: z.string().optional(),
|
|
45
|
+
next_step: z.number().optional(),
|
|
46
|
+
notification_id: z.string().optional(),
|
|
47
|
+
started_at: z.string().optional().nullable(),
|
|
48
|
+
status: z.string().optional(),
|
|
49
|
+
topic: z.string().optional().nullable(),
|
|
50
|
+
user_id: z.string().optional(),
|
|
51
|
+
})
|
|
52
|
+
.transform((data) => ({
|
|
53
|
+
category: data['category'],
|
|
54
|
+
completedAt: data['completed_at'],
|
|
55
|
+
id: data['id'],
|
|
56
|
+
nextStep: data['next_step'],
|
|
57
|
+
notificationId: data['notification_id'],
|
|
58
|
+
startedAt: data['started_at'],
|
|
59
|
+
status: data['status'],
|
|
60
|
+
topic: data['topic'],
|
|
61
|
+
userId: data['user_id'],
|
|
62
|
+
}));
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* The shape of the model mapping from the application shape into the api schema.
|
|
67
|
+
* Is equal to application shape if all property names match the api schema
|
|
68
|
+
*/
|
|
69
|
+
export const deliveryPlanRequest = z.lazy(() => {
|
|
70
|
+
return z
|
|
71
|
+
.object({
|
|
72
|
+
category: z.string().optional().nullable(),
|
|
73
|
+
completedAt: z.string().optional().nullable(),
|
|
74
|
+
id: z.string().optional(),
|
|
75
|
+
nextStep: z.number().optional(),
|
|
76
|
+
notificationId: z.string().optional(),
|
|
77
|
+
startedAt: z.string().optional().nullable(),
|
|
78
|
+
status: z.string().optional(),
|
|
79
|
+
topic: z.string().optional().nullable(),
|
|
80
|
+
userId: z.string().optional(),
|
|
81
|
+
})
|
|
82
|
+
.transform((data) => ({
|
|
83
|
+
category: data['category'],
|
|
84
|
+
completed_at: data['completedAt'],
|
|
85
|
+
id: data['id'],
|
|
86
|
+
next_step: data['nextStep'],
|
|
87
|
+
notification_id: data['notificationId'],
|
|
88
|
+
started_at: data['startedAt'],
|
|
89
|
+
status: data['status'],
|
|
90
|
+
topic: data['topic'],
|
|
91
|
+
user_id: data['userId'],
|
|
92
|
+
}));
|
|
93
|
+
});
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
import { Environment } from '../../http/environment.js';
|
|
4
|
+
import { ThrowableError } from '../../http/errors/throwable-error.js';
|
|
5
|
+
import { SerializationStyle } from '../../http/serialization/base-serializer.js';
|
|
6
|
+
import { RequestBuilder } from '../../http/transport/request-builder.js';
|
|
7
|
+
import { ContentType, HttpResponse, RequestConfig } from '../../http/types.js';
|
|
8
|
+
import { BaseService } from '../base-service.js';
|
|
9
|
+
import { DeliveryPlanCollection, deliveryPlanCollectionResponse } from './models/delivery-plan-collection.js';
|
|
10
|
+
|
|
11
|
+
export class NotificationsService extends BaseService {
|
|
12
|
+
/**
|
|
13
|
+
* Get the delivery plan for a notification.
|
|
14
|
+
* @param {string} notificationId -
|
|
15
|
+
* @param {RequestConfig} requestConfig - (Optional) The request configuration for retry and validation.
|
|
16
|
+
* @returns {Promise<HttpResponse<DeliveryPlanCollection>>} OK
|
|
17
|
+
*/
|
|
18
|
+
async getDeliveryplan(
|
|
19
|
+
notificationId: string,
|
|
20
|
+
requestConfig?: RequestConfig,
|
|
21
|
+
): Promise<HttpResponse<DeliveryPlanCollection>> {
|
|
22
|
+
const request = new RequestBuilder()
|
|
23
|
+
.setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT)
|
|
24
|
+
.setConfig(this.config)
|
|
25
|
+
.setMethod('GET')
|
|
26
|
+
.setPath('/notifications/{notification_id}/deliveryplan')
|
|
27
|
+
.setRequestSchema(z.any())
|
|
28
|
+
.addAccessTokenAuth(this.config.token, 'Bearer')
|
|
29
|
+
.setRequestContentType(ContentType.Json)
|
|
30
|
+
.addResponse({
|
|
31
|
+
schema: deliveryPlanCollectionResponse,
|
|
32
|
+
contentType: ContentType.Json,
|
|
33
|
+
status: 200,
|
|
34
|
+
})
|
|
35
|
+
.setRetryAttempts(this.config, requestConfig)
|
|
36
|
+
.setRetryDelayMs(this.config, requestConfig)
|
|
37
|
+
.setResponseValidation(this.config, requestConfig)
|
|
38
|
+
.addPathParam({
|
|
39
|
+
key: 'notification_id',
|
|
40
|
+
value: notificationId,
|
|
41
|
+
})
|
|
42
|
+
.build();
|
|
43
|
+
return this.client.call<DeliveryPlanCollection>(request);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
import { Links, links, linksRequest, linksResponse } from '../../common/links.js';
|
|
4
|
+
import { User, user, userRequest, userResponse } from './user.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The shape of the model inside the application code - what the users use
|
|
8
|
+
*/
|
|
9
|
+
export const userCollection = z.lazy(() => {
|
|
10
|
+
return z.object({
|
|
11
|
+
data: z.array(user).optional(),
|
|
12
|
+
links: links.optional(),
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @typedef {UserCollection} userCollection
|
|
19
|
+
* @property {User[]}
|
|
20
|
+
* @property {Links}
|
|
21
|
+
*/
|
|
22
|
+
export type UserCollection = z.infer<typeof userCollection>;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The shape of the model mapping from the api schema into the application shape.
|
|
26
|
+
* Is equal to application shape if all property names match the api schema
|
|
27
|
+
*/
|
|
28
|
+
export const userCollectionResponse = z.lazy(() => {
|
|
29
|
+
return z
|
|
30
|
+
.object({
|
|
31
|
+
data: z.array(userResponse).optional(),
|
|
32
|
+
links: linksResponse.optional(),
|
|
33
|
+
})
|
|
34
|
+
.transform((data) => ({
|
|
35
|
+
data: data['data'],
|
|
36
|
+
links: data['links'],
|
|
37
|
+
}));
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* The shape of the model mapping from the application shape into the api schema.
|
|
42
|
+
* Is equal to application shape if all property names match the api schema
|
|
43
|
+
*/
|
|
44
|
+
export const userCollectionRequest = z.lazy(() => {
|
|
45
|
+
return z
|
|
46
|
+
.object({
|
|
47
|
+
data: z.array(userRequest).optional(),
|
|
48
|
+
links: linksRequest.optional(),
|
|
49
|
+
})
|
|
50
|
+
.transform((data) => ({
|
|
51
|
+
data: data['data'],
|
|
52
|
+
links: data['links'],
|
|
53
|
+
}));
|
|
54
|
+
});
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The shape of the model inside the application code - what the users use
|
|
5
|
+
*/
|
|
6
|
+
export const user = z.lazy(() => {
|
|
7
|
+
return z.object({
|
|
8
|
+
createdAt: z.string().optional().nullable(),
|
|
9
|
+
customAttributes: z.any().optional().nullable(),
|
|
10
|
+
email: z.string().optional().nullable(),
|
|
11
|
+
externalId: z.string().optional().nullable(),
|
|
12
|
+
firstName: z.string().optional().nullable(),
|
|
13
|
+
id: z.string().optional(),
|
|
14
|
+
lastName: z.string().optional().nullable(),
|
|
15
|
+
lastNotifiedAt: z.string().optional().nullable(),
|
|
16
|
+
lastSeenAt: z.string().optional().nullable(),
|
|
17
|
+
updatedAt: z.string().optional().nullable(),
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
*
|
|
23
|
+
* @typedef {User} user
|
|
24
|
+
* @property {string}
|
|
25
|
+
* @property {any}
|
|
26
|
+
* @property {string}
|
|
27
|
+
* @property {string}
|
|
28
|
+
* @property {string}
|
|
29
|
+
* @property {string}
|
|
30
|
+
* @property {string}
|
|
31
|
+
* @property {string}
|
|
32
|
+
* @property {string}
|
|
33
|
+
* @property {string}
|
|
34
|
+
*/
|
|
35
|
+
export type User = z.infer<typeof user>;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* The shape of the model mapping from the api schema into the application shape.
|
|
39
|
+
* Is equal to application shape if all property names match the api schema
|
|
40
|
+
*/
|
|
41
|
+
export const userResponse = z.lazy(() => {
|
|
42
|
+
return z
|
|
43
|
+
.object({
|
|
44
|
+
created_at: z.string().optional().nullable(),
|
|
45
|
+
custom_attributes: z.any().optional().nullable(),
|
|
46
|
+
email: z.string().optional().nullable(),
|
|
47
|
+
external_id: z.string().optional().nullable(),
|
|
48
|
+
first_name: z.string().optional().nullable(),
|
|
49
|
+
id: z.string().optional(),
|
|
50
|
+
last_name: z.string().optional().nullable(),
|
|
51
|
+
last_notified_at: z.string().optional().nullable(),
|
|
52
|
+
last_seen_at: z.string().optional().nullable(),
|
|
53
|
+
updated_at: z.string().optional().nullable(),
|
|
54
|
+
})
|
|
55
|
+
.transform((data) => ({
|
|
56
|
+
createdAt: data['created_at'],
|
|
57
|
+
customAttributes: data['custom_attributes'],
|
|
58
|
+
email: data['email'],
|
|
59
|
+
externalId: data['external_id'],
|
|
60
|
+
firstName: data['first_name'],
|
|
61
|
+
id: data['id'],
|
|
62
|
+
lastName: data['last_name'],
|
|
63
|
+
lastNotifiedAt: data['last_notified_at'],
|
|
64
|
+
lastSeenAt: data['last_seen_at'],
|
|
65
|
+
updatedAt: data['updated_at'],
|
|
66
|
+
}));
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* The shape of the model mapping from the application shape into the api schema.
|
|
71
|
+
* Is equal to application shape if all property names match the api schema
|
|
72
|
+
*/
|
|
73
|
+
export const userRequest = z.lazy(() => {
|
|
74
|
+
return z
|
|
75
|
+
.object({
|
|
76
|
+
createdAt: z.string().optional().nullable(),
|
|
77
|
+
customAttributes: z.any().optional().nullable(),
|
|
78
|
+
email: z.string().optional().nullable(),
|
|
79
|
+
externalId: z.string().optional().nullable(),
|
|
80
|
+
firstName: z.string().optional().nullable(),
|
|
81
|
+
id: z.string().optional(),
|
|
82
|
+
lastName: z.string().optional().nullable(),
|
|
83
|
+
lastNotifiedAt: z.string().optional().nullable(),
|
|
84
|
+
lastSeenAt: z.string().optional().nullable(),
|
|
85
|
+
updatedAt: z.string().optional().nullable(),
|
|
86
|
+
})
|
|
87
|
+
.transform((data) => ({
|
|
88
|
+
created_at: data['createdAt'],
|
|
89
|
+
custom_attributes: data['customAttributes'],
|
|
90
|
+
email: data['email'],
|
|
91
|
+
external_id: data['externalId'],
|
|
92
|
+
first_name: data['firstName'],
|
|
93
|
+
id: data['id'],
|
|
94
|
+
last_name: data['lastName'],
|
|
95
|
+
last_notified_at: data['lastNotifiedAt'],
|
|
96
|
+
last_seen_at: data['lastSeenAt'],
|
|
97
|
+
updated_at: data['updatedAt'],
|
|
98
|
+
}));
|
|
99
|
+
});
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
import { Environment } from '../../http/environment.js';
|
|
4
|
+
import { ThrowableError } from '../../http/errors/throwable-error.js';
|
|
5
|
+
import { SerializationStyle } from '../../http/serialization/base-serializer.js';
|
|
6
|
+
import { RequestBuilder } from '../../http/transport/request-builder.js';
|
|
7
|
+
import { ContentType, HttpResponse, RequestConfig } from '../../http/types.js';
|
|
8
|
+
import { BaseService } from '../base-service.js';
|
|
9
|
+
import { User, userRequest, userResponse } from './models/user.js';
|
|
10
|
+
import { UserCollection, userCollectionResponse } from './models/user-collection.js';
|
|
11
|
+
import { ListUsersParams } from './request-params.js';
|
|
12
|
+
|
|
13
|
+
export class UsersService extends BaseService {
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* @param {number} [params.limit] -
|
|
17
|
+
* @param {string} [params.startingAfter] -
|
|
18
|
+
* @param {string} [params.endingBefore] -
|
|
19
|
+
* @param {string} [params.query] -
|
|
20
|
+
* @param {RequestConfig} requestConfig - (Optional) The request configuration for retry and validation.
|
|
21
|
+
* @returns {Promise<HttpResponse<UserCollection>>} OK
|
|
22
|
+
*/
|
|
23
|
+
async listUsers(params?: ListUsersParams, requestConfig?: RequestConfig): Promise<HttpResponse<UserCollection>> {
|
|
24
|
+
const request = new RequestBuilder()
|
|
25
|
+
.setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT)
|
|
26
|
+
.setConfig(this.config)
|
|
27
|
+
.setMethod('GET')
|
|
28
|
+
.setPath('/users')
|
|
29
|
+
.setRequestSchema(z.any())
|
|
30
|
+
.addAccessTokenAuth(this.config.token, 'Bearer')
|
|
31
|
+
.setRequestContentType(ContentType.Json)
|
|
32
|
+
.addResponse({
|
|
33
|
+
schema: userCollectionResponse,
|
|
34
|
+
contentType: ContentType.Json,
|
|
35
|
+
status: 200,
|
|
36
|
+
})
|
|
37
|
+
.setRetryAttempts(this.config, requestConfig)
|
|
38
|
+
.setRetryDelayMs(this.config, requestConfig)
|
|
39
|
+
.setResponseValidation(this.config, requestConfig)
|
|
40
|
+
.addQueryParam({
|
|
41
|
+
key: 'limit',
|
|
42
|
+
value: params?.limit,
|
|
43
|
+
})
|
|
44
|
+
.addQueryParam({
|
|
45
|
+
key: 'starting_after',
|
|
46
|
+
value: params?.startingAfter,
|
|
47
|
+
})
|
|
48
|
+
.addQueryParam({
|
|
49
|
+
key: 'ending_before',
|
|
50
|
+
value: params?.endingBefore,
|
|
51
|
+
})
|
|
52
|
+
.addQueryParam({
|
|
53
|
+
key: 'query',
|
|
54
|
+
value: params?.query,
|
|
55
|
+
})
|
|
56
|
+
.build();
|
|
57
|
+
return this.client.call<UserCollection>(request);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Creates a user with the provided details. The user will be associated with the project specified in the request context.
|
|
62
|
+
* @param {RequestConfig} requestConfig - (Optional) The request configuration for retry and validation.
|
|
63
|
+
* @returns {Promise<HttpResponse<User>>} Created
|
|
64
|
+
*/
|
|
65
|
+
async createUser(body: User, requestConfig?: RequestConfig): Promise<HttpResponse<User>> {
|
|
66
|
+
const request = new RequestBuilder()
|
|
67
|
+
.setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT)
|
|
68
|
+
.setConfig(this.config)
|
|
69
|
+
.setMethod('POST')
|
|
70
|
+
.setPath('/users')
|
|
71
|
+
.setRequestSchema(userRequest)
|
|
72
|
+
.addAccessTokenAuth(this.config.token, 'Bearer')
|
|
73
|
+
.setRequestContentType(ContentType.Json)
|
|
74
|
+
.addResponse({
|
|
75
|
+
schema: userResponse,
|
|
76
|
+
contentType: ContentType.Json,
|
|
77
|
+
status: 201,
|
|
78
|
+
})
|
|
79
|
+
.setRetryAttempts(this.config, requestConfig)
|
|
80
|
+
.setRetryDelayMs(this.config, requestConfig)
|
|
81
|
+
.setResponseValidation(this.config, requestConfig)
|
|
82
|
+
.addHeaderParam({ key: 'Content-Type', value: 'application/json' })
|
|
83
|
+
.addBody(body)
|
|
84
|
+
.build();
|
|
85
|
+
return this.client.call<User>(request);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
*
|
|
90
|
+
* @param {string} userId -
|
|
91
|
+
* @param {RequestConfig} requestConfig - (Optional) The request configuration for retry and validation.
|
|
92
|
+
* @returns {Promise<HttpResponse<any>>} No Content
|
|
93
|
+
*/
|
|
94
|
+
async deleteUser(userId: string, requestConfig?: RequestConfig): Promise<HttpResponse<void>> {
|
|
95
|
+
const request = new RequestBuilder()
|
|
96
|
+
.setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT)
|
|
97
|
+
.setConfig(this.config)
|
|
98
|
+
.setMethod('DELETE')
|
|
99
|
+
.setPath('/users/{user_id}')
|
|
100
|
+
.setRequestSchema(z.any())
|
|
101
|
+
.addAccessTokenAuth(this.config.token, 'Bearer')
|
|
102
|
+
.setRequestContentType(ContentType.Json)
|
|
103
|
+
.addResponse({
|
|
104
|
+
schema: z.undefined(),
|
|
105
|
+
contentType: ContentType.NoContent,
|
|
106
|
+
status: 204,
|
|
107
|
+
})
|
|
108
|
+
.setRetryAttempts(this.config, requestConfig)
|
|
109
|
+
.setRetryDelayMs(this.config, requestConfig)
|
|
110
|
+
.setResponseValidation(this.config, requestConfig)
|
|
111
|
+
.addPathParam({
|
|
112
|
+
key: 'user_id',
|
|
113
|
+
value: userId,
|
|
114
|
+
})
|
|
115
|
+
.build();
|
|
116
|
+
return this.client.call<void>(request);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './project-client/index.js';
|