magicbell-js 0.0.2 → 0.0.4
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/dist/commonjs/project-client/http/environment.d.ts +1 -1
- package/dist/commonjs/project-client/http/environment.d.ts.map +1 -1
- package/dist/commonjs/project-client/http/environment.js +1 -1
- package/dist/commonjs/project-client/http/environment.js.map +1 -1
- package/dist/commonjs/user-client/http/environment.d.ts +1 -1
- package/dist/commonjs/user-client/http/environment.d.ts.map +1 -1
- package/dist/commonjs/user-client/http/environment.js +1 -1
- package/dist/commonjs/user-client/http/environment.js.map +1 -1
- package/dist/esm/project-client/http/environment.d.ts +1 -1
- package/dist/esm/project-client/http/environment.d.ts.map +1 -1
- package/dist/esm/project-client/http/environment.js +1 -1
- package/dist/esm/project-client/http/environment.js.map +1 -1
- package/dist/esm/user-client/http/environment.d.ts +1 -1
- package/dist/esm/user-client/http/environment.d.ts.map +1 -1
- package/dist/esm/user-client/http/environment.js +1 -1
- package/dist/esm/user-client/http/environment.js.map +1 -1
- package/package.json +3 -2
- 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/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 +78 -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 +50 -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 +115 -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 +1017 -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 +84 -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 +1965 -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 +233 -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/create-user-token-request.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 +6 -0
- package/src/project-client/services/jwt/request-params.ts +11 -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 +44 -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 +117 -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/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 +78 -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 +50 -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 +1020 -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 +278 -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 +189 -0
- package/src/user-client/services/notifications/request-params.ts +7 -0
- package/src/user-client.ts +1 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
import { Links, links, linksRequest, linksResponse } from '../../common/links.js';
|
|
4
|
+
import {
|
|
5
|
+
InboxTokenResponse,
|
|
6
|
+
inboxTokenResponse,
|
|
7
|
+
inboxTokenResponseRequest,
|
|
8
|
+
inboxTokenResponseResponse,
|
|
9
|
+
} from './inbox-token-response.js';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The shape of the model inside the application code - what the users use
|
|
13
|
+
*/
|
|
14
|
+
export const inboxTokenResponseCollection = z.lazy(() => {
|
|
15
|
+
return z.object({
|
|
16
|
+
data: z.array(inboxTokenResponse).optional(),
|
|
17
|
+
links: links.optional(),
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
*
|
|
23
|
+
* @typedef {InboxTokenResponseCollection} inboxTokenResponseCollection
|
|
24
|
+
* @property {InboxTokenResponse[]}
|
|
25
|
+
* @property {Links}
|
|
26
|
+
*/
|
|
27
|
+
export type InboxTokenResponseCollection = z.infer<typeof inboxTokenResponseCollection>;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The shape of the model mapping from the api schema into the application shape.
|
|
31
|
+
* Is equal to application shape if all property names match the api schema
|
|
32
|
+
*/
|
|
33
|
+
export const inboxTokenResponseCollectionResponse = z.lazy(() => {
|
|
34
|
+
return z
|
|
35
|
+
.object({
|
|
36
|
+
data: z.array(inboxTokenResponseResponse).optional(),
|
|
37
|
+
links: linksResponse.optional(),
|
|
38
|
+
})
|
|
39
|
+
.transform((data) => ({
|
|
40
|
+
data: data['data'],
|
|
41
|
+
links: data['links'],
|
|
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 inboxTokenResponseCollectionRequest = z.lazy(() => {
|
|
50
|
+
return z
|
|
51
|
+
.object({
|
|
52
|
+
data: z.array(inboxTokenResponseRequest).optional(),
|
|
53
|
+
links: linksRequest.optional(),
|
|
54
|
+
})
|
|
55
|
+
.transform((data) => ({
|
|
56
|
+
data: data['data'],
|
|
57
|
+
links: data['links'],
|
|
58
|
+
}));
|
|
59
|
+
});
|
|
@@ -0,0 +1,75 @@
|
|
|
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 inboxTokenResponse = z.lazy(() => {
|
|
7
|
+
return z.object({
|
|
8
|
+
connectionId: z.string().optional().nullable(),
|
|
9
|
+
createdAt: z.string(),
|
|
10
|
+
discardedAt: z.string().optional().nullable(),
|
|
11
|
+
id: z.string(),
|
|
12
|
+
token: z.string().min(64),
|
|
13
|
+
updatedAt: z.string().optional().nullable(),
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
* @typedef {InboxTokenResponse} inboxTokenResponse
|
|
20
|
+
* @property {string}
|
|
21
|
+
* @property {string}
|
|
22
|
+
* @property {string}
|
|
23
|
+
* @property {string}
|
|
24
|
+
* @property {string}
|
|
25
|
+
* @property {string}
|
|
26
|
+
*/
|
|
27
|
+
export type InboxTokenResponse = z.infer<typeof inboxTokenResponse>;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The shape of the model mapping from the api schema into the application shape.
|
|
31
|
+
* Is equal to application shape if all property names match the api schema
|
|
32
|
+
*/
|
|
33
|
+
export const inboxTokenResponseResponse = z.lazy(() => {
|
|
34
|
+
return z
|
|
35
|
+
.object({
|
|
36
|
+
connection_id: z.string().optional().nullable(),
|
|
37
|
+
created_at: z.string(),
|
|
38
|
+
discarded_at: z.string().optional().nullable(),
|
|
39
|
+
id: z.string(),
|
|
40
|
+
token: z.string().min(64),
|
|
41
|
+
updated_at: z.string().optional().nullable(),
|
|
42
|
+
})
|
|
43
|
+
.transform((data) => ({
|
|
44
|
+
connectionId: data['connection_id'],
|
|
45
|
+
createdAt: data['created_at'],
|
|
46
|
+
discardedAt: data['discarded_at'],
|
|
47
|
+
id: data['id'],
|
|
48
|
+
token: data['token'],
|
|
49
|
+
updatedAt: data['updated_at'],
|
|
50
|
+
}));
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* The shape of the model mapping from the application shape into the api schema.
|
|
55
|
+
* Is equal to application shape if all property names match the api schema
|
|
56
|
+
*/
|
|
57
|
+
export const inboxTokenResponseRequest = z.lazy(() => {
|
|
58
|
+
return z
|
|
59
|
+
.object({
|
|
60
|
+
connectionId: z.string().optional().nullable(),
|
|
61
|
+
createdAt: z.string(),
|
|
62
|
+
discardedAt: z.string().optional().nullable(),
|
|
63
|
+
id: z.string(),
|
|
64
|
+
token: z.string().min(64),
|
|
65
|
+
updatedAt: z.string().optional().nullable(),
|
|
66
|
+
})
|
|
67
|
+
.transform((data) => ({
|
|
68
|
+
connection_id: data['connectionId'],
|
|
69
|
+
created_at: data['createdAt'],
|
|
70
|
+
discarded_at: data['discardedAt'],
|
|
71
|
+
id: data['id'],
|
|
72
|
+
token: data['token'],
|
|
73
|
+
updated_at: data['updatedAt'],
|
|
74
|
+
}));
|
|
75
|
+
});
|
|
@@ -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 inboxToken = z.lazy(() => {
|
|
7
|
+
return z.object({
|
|
8
|
+
connectionId: z.string().optional().nullable(),
|
|
9
|
+
token: z.string().min(64),
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @typedef {InboxToken} inboxToken
|
|
16
|
+
* @property {string}
|
|
17
|
+
* @property {string}
|
|
18
|
+
*/
|
|
19
|
+
export type InboxToken = z.infer<typeof inboxToken>;
|
|
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 inboxTokenResponse1 = z.lazy(() => {
|
|
26
|
+
return z
|
|
27
|
+
.object({
|
|
28
|
+
connection_id: z.string().optional().nullable(),
|
|
29
|
+
token: z.string().min(64),
|
|
30
|
+
})
|
|
31
|
+
.transform((data) => ({
|
|
32
|
+
connectionId: data['connection_id'],
|
|
33
|
+
token: data['token'],
|
|
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 inboxTokenRequest = z.lazy(() => {
|
|
42
|
+
return z
|
|
43
|
+
.object({
|
|
44
|
+
connectionId: z.string().optional().nullable(),
|
|
45
|
+
token: z.string().min(64),
|
|
46
|
+
})
|
|
47
|
+
.transform((data) => ({
|
|
48
|
+
connection_id: data['connectionId'],
|
|
49
|
+
token: data['token'],
|
|
50
|
+
}));
|
|
51
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export type { ApnsToken } from './apns-token.js';
|
|
2
|
+
export type { ApnsTokenCollection } from './apns-token-collection.js';
|
|
3
|
+
export { ApnsTokenInstallationId } from './apns-token-installation-id.js';
|
|
4
|
+
export type { ApnsTokenPayload } from './apns-token-payload.js';
|
|
5
|
+
export { ApnsTokenPayloadInstallationId } from './apns-token-payload-installation-id.js';
|
|
6
|
+
export type { DiscardResult } from './discard-result.js';
|
|
7
|
+
export type { ExpoToken } from './expo-token.js';
|
|
8
|
+
export type { ExpoTokenCollection } from './expo-token-collection.js';
|
|
9
|
+
export type { ExpoTokenPayload } from './expo-token-payload.js';
|
|
10
|
+
export type { FcmToken } from './fcm-token.js';
|
|
11
|
+
export type { FcmTokenCollection } from './fcm-token-collection.js';
|
|
12
|
+
export { FcmTokenInstallationId } from './fcm-token-installation-id.js';
|
|
13
|
+
export type { FcmTokenPayload } from './fcm-token-payload.js';
|
|
14
|
+
export { FcmTokenPayloadInstallationId } from './fcm-token-payload-installation-id.js';
|
|
15
|
+
export type { InboxToken } from './inbox-token.js';
|
|
16
|
+
export type { InboxTokenResponse } from './inbox-token-response.js';
|
|
17
|
+
export type { InboxTokenResponseCollection } from './inbox-token-response-collection.js';
|
|
18
|
+
export type { SlackToken } from './slack-token.js';
|
|
19
|
+
export type { SlackTokenCollection } from './slack-token-collection.js';
|
|
20
|
+
export type { SlackTokenOauth } from './slack-token-oauth.js';
|
|
21
|
+
export type { SlackTokenPayload } from './slack-token-payload.js';
|
|
22
|
+
export type { SlackTokenPayloadOauth } from './slack-token-payload-oauth.js';
|
|
23
|
+
export type { SlackTokenPayloadWebhook } from './slack-token-payload-webhook.js';
|
|
24
|
+
export type { SlackTokenWebhook } from './slack-token-webhook.js';
|
|
25
|
+
export type { TeamsToken } from './teams-token.js';
|
|
26
|
+
export type { TeamsTokenCollection } from './teams-token-collection.js';
|
|
27
|
+
export type { TeamsTokenPayload } from './teams-token-payload.js';
|
|
28
|
+
export type { TeamsTokenPayloadWebhook } from './teams-token-payload-webhook.js';
|
|
29
|
+
export type { TeamsTokenWebhook } from './teams-token-webhook.js';
|
|
30
|
+
export type { WebPushToken } from './web-push-token.js';
|
|
31
|
+
export type { WebPushTokenCollection } from './web-push-token-collection.js';
|
|
32
|
+
export type { WebPushTokenKeys } from './web-push-token-keys.js';
|
|
33
|
+
export type { WebPushTokenPayloadKeys } from './web-push-token-payload-keys.js';
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
import { Links, links, linksRequest, linksResponse } from '../../common/links.js';
|
|
4
|
+
import { SlackToken, slackToken, slackTokenRequest, slackTokenResponse } from './slack-token.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The shape of the model inside the application code - what the users use
|
|
8
|
+
*/
|
|
9
|
+
export const slackTokenCollection = z.lazy(() => {
|
|
10
|
+
return z.object({
|
|
11
|
+
data: z.array(slackToken).optional(),
|
|
12
|
+
links: links.optional(),
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @typedef {SlackTokenCollection} slackTokenCollection
|
|
19
|
+
* @property {SlackToken[]}
|
|
20
|
+
* @property {Links}
|
|
21
|
+
*/
|
|
22
|
+
export type SlackTokenCollection = z.infer<typeof slackTokenCollection>;
|
|
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 slackTokenCollectionResponse = z.lazy(() => {
|
|
29
|
+
return z
|
|
30
|
+
.object({
|
|
31
|
+
data: z.array(slackTokenResponse).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 slackTokenCollectionRequest = z.lazy(() => {
|
|
45
|
+
return z
|
|
46
|
+
.object({
|
|
47
|
+
data: z.array(slackTokenRequest).optional(),
|
|
48
|
+
links: linksRequest.optional(),
|
|
49
|
+
})
|
|
50
|
+
.transform((data) => ({
|
|
51
|
+
data: data['data'],
|
|
52
|
+
links: data['links'],
|
|
53
|
+
}));
|
|
54
|
+
});
|
|
@@ -0,0 +1,57 @@
|
|
|
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 slackTokenOauth = z.lazy(() => {
|
|
7
|
+
return z.object({
|
|
8
|
+
channelId: z.string(),
|
|
9
|
+
installationId: z.string(),
|
|
10
|
+
scope: z.string().optional(),
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* @typedef {SlackTokenOauth} slackTokenOauth
|
|
17
|
+
* @property {string}
|
|
18
|
+
* @property {string}
|
|
19
|
+
* @property {string}
|
|
20
|
+
*/
|
|
21
|
+
export type SlackTokenOauth = z.infer<typeof slackTokenOauth>;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The shape of the model mapping from the api schema into the application shape.
|
|
25
|
+
* Is equal to application shape if all property names match the api schema
|
|
26
|
+
*/
|
|
27
|
+
export const slackTokenOauthResponse = z.lazy(() => {
|
|
28
|
+
return z
|
|
29
|
+
.object({
|
|
30
|
+
channel_id: z.string(),
|
|
31
|
+
installation_id: z.string(),
|
|
32
|
+
scope: z.string().optional(),
|
|
33
|
+
})
|
|
34
|
+
.transform((data) => ({
|
|
35
|
+
channelId: data['channel_id'],
|
|
36
|
+
installationId: data['installation_id'],
|
|
37
|
+
scope: data['scope'],
|
|
38
|
+
}));
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* The shape of the model mapping from the application shape into the api schema.
|
|
43
|
+
* Is equal to application shape if all property names match the api schema
|
|
44
|
+
*/
|
|
45
|
+
export const slackTokenOauthRequest = z.lazy(() => {
|
|
46
|
+
return z
|
|
47
|
+
.object({
|
|
48
|
+
channelId: z.string(),
|
|
49
|
+
installationId: z.string(),
|
|
50
|
+
scope: z.string().optional(),
|
|
51
|
+
})
|
|
52
|
+
.transform((data) => ({
|
|
53
|
+
channel_id: data['channelId'],
|
|
54
|
+
installation_id: data['installationId'],
|
|
55
|
+
scope: data['scope'],
|
|
56
|
+
}));
|
|
57
|
+
});
|
|
@@ -0,0 +1,57 @@
|
|
|
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 slackTokenPayloadOauth = z.lazy(() => {
|
|
7
|
+
return z.object({
|
|
8
|
+
channelId: z.string(),
|
|
9
|
+
installationId: z.string(),
|
|
10
|
+
scope: z.string().optional(),
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* @typedef {SlackTokenPayloadOauth} slackTokenPayloadOauth
|
|
17
|
+
* @property {string}
|
|
18
|
+
* @property {string}
|
|
19
|
+
* @property {string}
|
|
20
|
+
*/
|
|
21
|
+
export type SlackTokenPayloadOauth = z.infer<typeof slackTokenPayloadOauth>;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The shape of the model mapping from the api schema into the application shape.
|
|
25
|
+
* Is equal to application shape if all property names match the api schema
|
|
26
|
+
*/
|
|
27
|
+
export const slackTokenPayloadOauthResponse = z.lazy(() => {
|
|
28
|
+
return z
|
|
29
|
+
.object({
|
|
30
|
+
channel_id: z.string(),
|
|
31
|
+
installation_id: z.string(),
|
|
32
|
+
scope: z.string().optional(),
|
|
33
|
+
})
|
|
34
|
+
.transform((data) => ({
|
|
35
|
+
channelId: data['channel_id'],
|
|
36
|
+
installationId: data['installation_id'],
|
|
37
|
+
scope: data['scope'],
|
|
38
|
+
}));
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* The shape of the model mapping from the application shape into the api schema.
|
|
43
|
+
* Is equal to application shape if all property names match the api schema
|
|
44
|
+
*/
|
|
45
|
+
export const slackTokenPayloadOauthRequest = z.lazy(() => {
|
|
46
|
+
return z
|
|
47
|
+
.object({
|
|
48
|
+
channelId: z.string(),
|
|
49
|
+
installationId: z.string(),
|
|
50
|
+
scope: z.string().optional(),
|
|
51
|
+
})
|
|
52
|
+
.transform((data) => ({
|
|
53
|
+
channel_id: data['channelId'],
|
|
54
|
+
installation_id: data['installationId'],
|
|
55
|
+
scope: data['scope'],
|
|
56
|
+
}));
|
|
57
|
+
});
|
|
@@ -0,0 +1,45 @@
|
|
|
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 slackTokenPayloadWebhook = z.lazy(() => {
|
|
7
|
+
return z.object({
|
|
8
|
+
url: z.string().min(1),
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Obtained directly from the incoming_webhook object in the installation response from the Slack API.
|
|
14
|
+
* @typedef {SlackTokenPayloadWebhook} slackTokenPayloadWebhook - Obtained directly from the incoming_webhook object in the installation response from the Slack API. - Obtained directly from the incoming_webhook object in the installation response from the Slack API.
|
|
15
|
+
* @property {string}
|
|
16
|
+
*/
|
|
17
|
+
export type SlackTokenPayloadWebhook = z.infer<typeof slackTokenPayloadWebhook>;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The shape of the model mapping from the api schema into the application shape.
|
|
21
|
+
* Is equal to application shape if all property names match the api schema
|
|
22
|
+
*/
|
|
23
|
+
export const slackTokenPayloadWebhookResponse = z.lazy(() => {
|
|
24
|
+
return z
|
|
25
|
+
.object({
|
|
26
|
+
url: z.string().min(1),
|
|
27
|
+
})
|
|
28
|
+
.transform((data) => ({
|
|
29
|
+
url: data['url'],
|
|
30
|
+
}));
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The shape of the model mapping from the application shape into the api schema.
|
|
35
|
+
* Is equal to application shape if all property names match the api schema
|
|
36
|
+
*/
|
|
37
|
+
export const slackTokenPayloadWebhookRequest = z.lazy(() => {
|
|
38
|
+
return z
|
|
39
|
+
.object({
|
|
40
|
+
url: z.string().min(1),
|
|
41
|
+
})
|
|
42
|
+
.transform((data) => ({
|
|
43
|
+
url: data['url'],
|
|
44
|
+
}));
|
|
45
|
+
});
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
SlackTokenPayloadOauth,
|
|
5
|
+
slackTokenPayloadOauth,
|
|
6
|
+
slackTokenPayloadOauthRequest,
|
|
7
|
+
slackTokenPayloadOauthResponse,
|
|
8
|
+
} from './slack-token-payload-oauth.js';
|
|
9
|
+
import {
|
|
10
|
+
SlackTokenPayloadWebhook,
|
|
11
|
+
slackTokenPayloadWebhook,
|
|
12
|
+
slackTokenPayloadWebhookRequest,
|
|
13
|
+
slackTokenPayloadWebhookResponse,
|
|
14
|
+
} from './slack-token-payload-webhook.js';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The shape of the model inside the application code - what the users use
|
|
18
|
+
*/
|
|
19
|
+
export const slackTokenPayload = z.lazy(() => {
|
|
20
|
+
return z.object({
|
|
21
|
+
oauth: slackTokenPayloadOauth.optional(),
|
|
22
|
+
webhook: slackTokenPayloadWebhook.optional(),
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
* @typedef {SlackTokenPayload} slackTokenPayload
|
|
29
|
+
* @property {SlackTokenPayloadOauth}
|
|
30
|
+
* @property {SlackTokenPayloadWebhook} - Obtained directly from the incoming_webhook object in the installation response from the Slack API.
|
|
31
|
+
*/
|
|
32
|
+
export type SlackTokenPayload = z.infer<typeof slackTokenPayload>;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* The shape of the model mapping from the api schema into the application shape.
|
|
36
|
+
* Is equal to application shape if all property names match the api schema
|
|
37
|
+
*/
|
|
38
|
+
export const slackTokenPayloadResponse = z.lazy(() => {
|
|
39
|
+
return z
|
|
40
|
+
.object({
|
|
41
|
+
oauth: slackTokenPayloadOauthResponse.optional(),
|
|
42
|
+
webhook: slackTokenPayloadWebhookResponse.optional(),
|
|
43
|
+
})
|
|
44
|
+
.transform((data) => ({
|
|
45
|
+
oauth: data['oauth'],
|
|
46
|
+
webhook: data['webhook'],
|
|
47
|
+
}));
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* The shape of the model mapping from the application shape into the api schema.
|
|
52
|
+
* Is equal to application shape if all property names match the api schema
|
|
53
|
+
*/
|
|
54
|
+
export const slackTokenPayloadRequest = z.lazy(() => {
|
|
55
|
+
return z
|
|
56
|
+
.object({
|
|
57
|
+
oauth: slackTokenPayloadOauthRequest.optional(),
|
|
58
|
+
webhook: slackTokenPayloadWebhookRequest.optional(),
|
|
59
|
+
})
|
|
60
|
+
.transform((data) => ({
|
|
61
|
+
oauth: data['oauth'],
|
|
62
|
+
webhook: data['webhook'],
|
|
63
|
+
}));
|
|
64
|
+
});
|
|
@@ -0,0 +1,45 @@
|
|
|
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 slackTokenWebhook = z.lazy(() => {
|
|
7
|
+
return z.object({
|
|
8
|
+
url: z.string().min(1),
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Obtained directly from the incoming_webhook object in the installation response from the Slack API.
|
|
14
|
+
* @typedef {SlackTokenWebhook} slackTokenWebhook - Obtained directly from the incoming_webhook object in the installation response from the Slack API. - Obtained directly from the incoming_webhook object in the installation response from the Slack API.
|
|
15
|
+
* @property {string}
|
|
16
|
+
*/
|
|
17
|
+
export type SlackTokenWebhook = z.infer<typeof slackTokenWebhook>;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The shape of the model mapping from the api schema into the application shape.
|
|
21
|
+
* Is equal to application shape if all property names match the api schema
|
|
22
|
+
*/
|
|
23
|
+
export const slackTokenWebhookResponse = z.lazy(() => {
|
|
24
|
+
return z
|
|
25
|
+
.object({
|
|
26
|
+
url: z.string().min(1),
|
|
27
|
+
})
|
|
28
|
+
.transform((data) => ({
|
|
29
|
+
url: data['url'],
|
|
30
|
+
}));
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The shape of the model mapping from the application shape into the api schema.
|
|
35
|
+
* Is equal to application shape if all property names match the api schema
|
|
36
|
+
*/
|
|
37
|
+
export const slackTokenWebhookRequest = z.lazy(() => {
|
|
38
|
+
return z
|
|
39
|
+
.object({
|
|
40
|
+
url: z.string().min(1),
|
|
41
|
+
})
|
|
42
|
+
.transform((data) => ({
|
|
43
|
+
url: data['url'],
|
|
44
|
+
}));
|
|
45
|
+
});
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
SlackTokenOauth,
|
|
5
|
+
slackTokenOauth,
|
|
6
|
+
slackTokenOauthRequest,
|
|
7
|
+
slackTokenOauthResponse,
|
|
8
|
+
} from './slack-token-oauth.js';
|
|
9
|
+
import {
|
|
10
|
+
SlackTokenWebhook,
|
|
11
|
+
slackTokenWebhook,
|
|
12
|
+
slackTokenWebhookRequest,
|
|
13
|
+
slackTokenWebhookResponse,
|
|
14
|
+
} from './slack-token-webhook.js';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The shape of the model inside the application code - what the users use
|
|
18
|
+
*/
|
|
19
|
+
export const slackToken = z.lazy(() => {
|
|
20
|
+
return z.object({
|
|
21
|
+
createdAt: z.string(),
|
|
22
|
+
discardedAt: z.string().optional().nullable(),
|
|
23
|
+
id: z.string(),
|
|
24
|
+
oauth: slackTokenOauth.optional(),
|
|
25
|
+
updatedAt: z.string().optional().nullable(),
|
|
26
|
+
webhook: slackTokenWebhook.optional(),
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @typedef {SlackToken} slackToken
|
|
33
|
+
* @property {string}
|
|
34
|
+
* @property {string}
|
|
35
|
+
* @property {string}
|
|
36
|
+
* @property {SlackTokenOauth}
|
|
37
|
+
* @property {string}
|
|
38
|
+
* @property {SlackTokenWebhook} - Obtained directly from the incoming_webhook object in the installation response from the Slack API.
|
|
39
|
+
*/
|
|
40
|
+
export type SlackToken = z.infer<typeof slackToken>;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* The shape of the model mapping from the api schema into the application shape.
|
|
44
|
+
* Is equal to application shape if all property names match the api schema
|
|
45
|
+
*/
|
|
46
|
+
export const slackTokenResponse = z.lazy(() => {
|
|
47
|
+
return z
|
|
48
|
+
.object({
|
|
49
|
+
created_at: z.string(),
|
|
50
|
+
discarded_at: z.string().optional().nullable(),
|
|
51
|
+
id: z.string(),
|
|
52
|
+
oauth: slackTokenOauthResponse.optional(),
|
|
53
|
+
updated_at: z.string().optional().nullable(),
|
|
54
|
+
webhook: slackTokenWebhookResponse.optional(),
|
|
55
|
+
})
|
|
56
|
+
.transform((data) => ({
|
|
57
|
+
createdAt: data['created_at'],
|
|
58
|
+
discardedAt: data['discarded_at'],
|
|
59
|
+
id: data['id'],
|
|
60
|
+
oauth: data['oauth'],
|
|
61
|
+
updatedAt: data['updated_at'],
|
|
62
|
+
webhook: data['webhook'],
|
|
63
|
+
}));
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* The shape of the model mapping from the application shape into the api schema.
|
|
68
|
+
* Is equal to application shape if all property names match the api schema
|
|
69
|
+
*/
|
|
70
|
+
export const slackTokenRequest = z.lazy(() => {
|
|
71
|
+
return z
|
|
72
|
+
.object({
|
|
73
|
+
createdAt: z.string(),
|
|
74
|
+
discardedAt: z.string().optional().nullable(),
|
|
75
|
+
id: z.string(),
|
|
76
|
+
oauth: slackTokenOauthRequest.optional(),
|
|
77
|
+
updatedAt: z.string().optional().nullable(),
|
|
78
|
+
webhook: slackTokenWebhookRequest.optional(),
|
|
79
|
+
})
|
|
80
|
+
.transform((data) => ({
|
|
81
|
+
created_at: data['createdAt'],
|
|
82
|
+
discarded_at: data['discardedAt'],
|
|
83
|
+
id: data['id'],
|
|
84
|
+
oauth: data['oauth'],
|
|
85
|
+
updated_at: data['updatedAt'],
|
|
86
|
+
webhook: data['webhook'],
|
|
87
|
+
}));
|
|
88
|
+
});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
import { Links, links, linksRequest, linksResponse } from '../../common/links.js';
|
|
4
|
+
import { TeamsToken, teamsToken, teamsTokenRequest, teamsTokenResponse } from './teams-token.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The shape of the model inside the application code - what the users use
|
|
8
|
+
*/
|
|
9
|
+
export const teamsTokenCollection = z.lazy(() => {
|
|
10
|
+
return z.object({
|
|
11
|
+
data: z.array(teamsToken).optional(),
|
|
12
|
+
links: links.optional(),
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @typedef {TeamsTokenCollection} teamsTokenCollection
|
|
19
|
+
* @property {TeamsToken[]}
|
|
20
|
+
* @property {Links}
|
|
21
|
+
*/
|
|
22
|
+
export type TeamsTokenCollection = z.infer<typeof teamsTokenCollection>;
|
|
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 teamsTokenCollectionResponse = z.lazy(() => {
|
|
29
|
+
return z
|
|
30
|
+
.object({
|
|
31
|
+
data: z.array(teamsTokenResponse).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 teamsTokenCollectionRequest = z.lazy(() => {
|
|
45
|
+
return z
|
|
46
|
+
.object({
|
|
47
|
+
data: z.array(teamsTokenRequest).optional(),
|
|
48
|
+
links: linksRequest.optional(),
|
|
49
|
+
})
|
|
50
|
+
.transform((data) => ({
|
|
51
|
+
data: data['data'],
|
|
52
|
+
links: data['links'],
|
|
53
|
+
}));
|
|
54
|
+
});
|