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,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 enterprise = z.lazy(() => {
|
|
7
|
+
return z.object({
|
|
8
|
+
id: z.string(),
|
|
9
|
+
name: z.string(),
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @typedef {Enterprise} enterprise
|
|
16
|
+
* @property {string}
|
|
17
|
+
* @property {string}
|
|
18
|
+
*/
|
|
19
|
+
export type Enterprise = z.infer<typeof enterprise>;
|
|
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 enterpriseResponse = z.lazy(() => {
|
|
26
|
+
return z
|
|
27
|
+
.object({
|
|
28
|
+
id: z.string(),
|
|
29
|
+
name: z.string(),
|
|
30
|
+
})
|
|
31
|
+
.transform((data) => ({
|
|
32
|
+
id: data['id'],
|
|
33
|
+
name: data['name'],
|
|
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 enterpriseRequest = z.lazy(() => {
|
|
42
|
+
return z
|
|
43
|
+
.object({
|
|
44
|
+
id: z.string(),
|
|
45
|
+
name: z.string(),
|
|
46
|
+
})
|
|
47
|
+
.transform((data) => ({
|
|
48
|
+
id: data['id'],
|
|
49
|
+
name: data['name'],
|
|
50
|
+
}));
|
|
51
|
+
});
|
|
@@ -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 footer = z.lazy(() => {
|
|
7
|
+
return z.object({
|
|
8
|
+
backgroundColor: z.string(),
|
|
9
|
+
borderRadius: z.string(),
|
|
10
|
+
fontSize: z.string(),
|
|
11
|
+
textColor: z.string(),
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @typedef {Footer} footer
|
|
18
|
+
* @property {string}
|
|
19
|
+
* @property {string}
|
|
20
|
+
* @property {string}
|
|
21
|
+
* @property {string}
|
|
22
|
+
*/
|
|
23
|
+
export type Footer = z.infer<typeof footer>;
|
|
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 footerResponse = z.lazy(() => {
|
|
30
|
+
return z
|
|
31
|
+
.object({
|
|
32
|
+
backgroundColor: z.string(),
|
|
33
|
+
borderRadius: z.string(),
|
|
34
|
+
fontSize: z.string(),
|
|
35
|
+
textColor: z.string(),
|
|
36
|
+
})
|
|
37
|
+
.transform((data) => ({
|
|
38
|
+
backgroundColor: data['backgroundColor'],
|
|
39
|
+
borderRadius: data['borderRadius'],
|
|
40
|
+
fontSize: data['fontSize'],
|
|
41
|
+
textColor: data['textColor'],
|
|
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 footerRequest = z.lazy(() => {
|
|
50
|
+
return z
|
|
51
|
+
.object({
|
|
52
|
+
backgroundColor: z.string(),
|
|
53
|
+
borderRadius: z.string(),
|
|
54
|
+
fontSize: z.string(),
|
|
55
|
+
textColor: z.string(),
|
|
56
|
+
})
|
|
57
|
+
.transform((data) => ({
|
|
58
|
+
backgroundColor: data['backgroundColor'],
|
|
59
|
+
borderRadius: data['borderRadius'],
|
|
60
|
+
fontSize: data['fontSize'],
|
|
61
|
+
textColor: data['textColor'],
|
|
62
|
+
}));
|
|
63
|
+
});
|
|
@@ -0,0 +1,69 @@
|
|
|
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 header = z.lazy(() => {
|
|
7
|
+
return z.object({
|
|
8
|
+
backgroundColor: z.string(),
|
|
9
|
+
borderRadius: z.string(),
|
|
10
|
+
fontFamily: z.string(),
|
|
11
|
+
fontSize: z.string(),
|
|
12
|
+
textColor: z.string(),
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @typedef {Header} header
|
|
19
|
+
* @property {string}
|
|
20
|
+
* @property {string}
|
|
21
|
+
* @property {string}
|
|
22
|
+
* @property {string}
|
|
23
|
+
* @property {string}
|
|
24
|
+
*/
|
|
25
|
+
export type Header = z.infer<typeof header>;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* The shape of the model mapping from the api schema into the application shape.
|
|
29
|
+
* Is equal to application shape if all property names match the api schema
|
|
30
|
+
*/
|
|
31
|
+
export const headerResponse = z.lazy(() => {
|
|
32
|
+
return z
|
|
33
|
+
.object({
|
|
34
|
+
backgroundColor: z.string(),
|
|
35
|
+
borderRadius: z.string(),
|
|
36
|
+
fontFamily: z.string(),
|
|
37
|
+
fontSize: z.string(),
|
|
38
|
+
textColor: z.string(),
|
|
39
|
+
})
|
|
40
|
+
.transform((data) => ({
|
|
41
|
+
backgroundColor: data['backgroundColor'],
|
|
42
|
+
borderRadius: data['borderRadius'],
|
|
43
|
+
fontFamily: data['fontFamily'],
|
|
44
|
+
fontSize: data['fontSize'],
|
|
45
|
+
textColor: data['textColor'],
|
|
46
|
+
}));
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* The shape of the model mapping from the application shape into the api schema.
|
|
51
|
+
* Is equal to application shape if all property names match the api schema
|
|
52
|
+
*/
|
|
53
|
+
export const headerRequest = z.lazy(() => {
|
|
54
|
+
return z
|
|
55
|
+
.object({
|
|
56
|
+
backgroundColor: z.string(),
|
|
57
|
+
borderRadius: z.string(),
|
|
58
|
+
fontFamily: z.string(),
|
|
59
|
+
fontSize: z.string(),
|
|
60
|
+
textColor: z.string(),
|
|
61
|
+
})
|
|
62
|
+
.transform((data) => ({
|
|
63
|
+
backgroundColor: data['backgroundColor'],
|
|
64
|
+
borderRadius: data['borderRadius'],
|
|
65
|
+
fontFamily: data['fontFamily'],
|
|
66
|
+
fontSize: data['fontSize'],
|
|
67
|
+
textColor: data['textColor'],
|
|
68
|
+
}));
|
|
69
|
+
});
|
|
@@ -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 icon = z.lazy(() => {
|
|
7
|
+
return z.object({
|
|
8
|
+
borderColor: z.string(),
|
|
9
|
+
width: z.string(),
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @typedef {Icon} icon
|
|
16
|
+
* @property {string}
|
|
17
|
+
* @property {string}
|
|
18
|
+
*/
|
|
19
|
+
export type Icon = z.infer<typeof icon>;
|
|
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 iconResponse = z.lazy(() => {
|
|
26
|
+
return z
|
|
27
|
+
.object({
|
|
28
|
+
borderColor: z.string(),
|
|
29
|
+
width: z.string(),
|
|
30
|
+
})
|
|
31
|
+
.transform((data) => ({
|
|
32
|
+
borderColor: data['borderColor'],
|
|
33
|
+
width: data['width'],
|
|
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 iconRequest = z.lazy(() => {
|
|
42
|
+
return z
|
|
43
|
+
.object({
|
|
44
|
+
borderColor: z.string(),
|
|
45
|
+
width: z.string(),
|
|
46
|
+
})
|
|
47
|
+
.transform((data) => ({
|
|
48
|
+
borderColor: data['borderColor'],
|
|
49
|
+
width: data['width'],
|
|
50
|
+
}));
|
|
51
|
+
});
|
|
@@ -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 images = z.lazy(() => {
|
|
7
|
+
return z.object({
|
|
8
|
+
emptyInboxUrl: z.string(),
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @typedef {Images} images
|
|
15
|
+
* @property {string}
|
|
16
|
+
*/
|
|
17
|
+
export type Images = z.infer<typeof images>;
|
|
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 imagesResponse = z.lazy(() => {
|
|
24
|
+
return z
|
|
25
|
+
.object({
|
|
26
|
+
emptyInboxUrl: z.string(),
|
|
27
|
+
})
|
|
28
|
+
.transform((data) => ({
|
|
29
|
+
emptyInboxUrl: data['emptyInboxUrl'],
|
|
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 imagesRequest = z.lazy(() => {
|
|
38
|
+
return z
|
|
39
|
+
.object({
|
|
40
|
+
emptyInboxUrl: z.string(),
|
|
41
|
+
})
|
|
42
|
+
.transform((data) => ({
|
|
43
|
+
emptyInboxUrl: data['emptyInboxUrl'],
|
|
44
|
+
}));
|
|
45
|
+
});
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
import { Images, images, imagesRequest, imagesResponse } from './images.js';
|
|
4
|
+
import { Theme, theme, themeRequest, themeResponse } from './theme.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The shape of the model inside the application code - what the users use
|
|
8
|
+
*/
|
|
9
|
+
export const inboxConfigPayload = z.lazy(() => {
|
|
10
|
+
return z.object({
|
|
11
|
+
images: images.nullable(),
|
|
12
|
+
locale: z.string().min(2).nullable(),
|
|
13
|
+
theme: theme.nullable(),
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
* @typedef {InboxConfigPayload} inboxConfigPayload
|
|
20
|
+
* @property {Images}
|
|
21
|
+
* @property {string}
|
|
22
|
+
* @property {Theme}
|
|
23
|
+
*/
|
|
24
|
+
export type InboxConfigPayload = z.infer<typeof inboxConfigPayload>;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The shape of the model mapping from the api schema into the application shape.
|
|
28
|
+
* Is equal to application shape if all property names match the api schema
|
|
29
|
+
*/
|
|
30
|
+
export const inboxConfigPayloadResponse = z.lazy(() => {
|
|
31
|
+
return z
|
|
32
|
+
.object({
|
|
33
|
+
images: imagesResponse.nullable(),
|
|
34
|
+
locale: z.string().min(2).nullable(),
|
|
35
|
+
theme: themeResponse.nullable(),
|
|
36
|
+
})
|
|
37
|
+
.transform((data) => ({
|
|
38
|
+
images: data['images'],
|
|
39
|
+
locale: data['locale'],
|
|
40
|
+
theme: data['theme'],
|
|
41
|
+
}));
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* The shape of the model mapping from the application shape into the api schema.
|
|
46
|
+
* Is equal to application shape if all property names match the api schema
|
|
47
|
+
*/
|
|
48
|
+
export const inboxConfigPayloadRequest = z.lazy(() => {
|
|
49
|
+
return z
|
|
50
|
+
.object({
|
|
51
|
+
images: imagesRequest.nullable(),
|
|
52
|
+
locale: z.string().min(2).nullable(),
|
|
53
|
+
theme: themeRequest.nullable(),
|
|
54
|
+
})
|
|
55
|
+
.transform((data) => ({
|
|
56
|
+
images: data['images'],
|
|
57
|
+
locale: data['locale'],
|
|
58
|
+
theme: data['theme'],
|
|
59
|
+
}));
|
|
60
|
+
});
|
|
@@ -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 incomingWebhook = z.lazy(() => {
|
|
7
|
+
return z.object({
|
|
8
|
+
channel: z.string(),
|
|
9
|
+
configurationUrl: z.string(),
|
|
10
|
+
url: z.string(),
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* @typedef {IncomingWebhook} incomingWebhook
|
|
17
|
+
* @property {string}
|
|
18
|
+
* @property {string}
|
|
19
|
+
* @property {string}
|
|
20
|
+
*/
|
|
21
|
+
export type IncomingWebhook = z.infer<typeof incomingWebhook>;
|
|
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 incomingWebhookResponse = z.lazy(() => {
|
|
28
|
+
return z
|
|
29
|
+
.object({
|
|
30
|
+
channel: z.string(),
|
|
31
|
+
configuration_url: z.string(),
|
|
32
|
+
url: z.string(),
|
|
33
|
+
})
|
|
34
|
+
.transform((data) => ({
|
|
35
|
+
channel: data['channel'],
|
|
36
|
+
configurationUrl: data['configuration_url'],
|
|
37
|
+
url: data['url'],
|
|
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 incomingWebhookRequest = z.lazy(() => {
|
|
46
|
+
return z
|
|
47
|
+
.object({
|
|
48
|
+
channel: z.string(),
|
|
49
|
+
configurationUrl: z.string(),
|
|
50
|
+
url: z.string(),
|
|
51
|
+
})
|
|
52
|
+
.transform((data) => ({
|
|
53
|
+
channel: data['channel'],
|
|
54
|
+
configuration_url: data['configurationUrl'],
|
|
55
|
+
url: data['url'],
|
|
56
|
+
}));
|
|
57
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export type { AuthedUser } from './authed-user.js';
|
|
2
|
+
export type { Banner } from './banner.js';
|
|
3
|
+
export type { Default_ } from './default_.js';
|
|
4
|
+
export type { DefaultHover } from './default-hover.js';
|
|
5
|
+
export type { DefaultState } from './default-state.js';
|
|
6
|
+
export type { Dialog } from './dialog.js';
|
|
7
|
+
export type { Enterprise } from './enterprise.js';
|
|
8
|
+
export type { Footer } from './footer.js';
|
|
9
|
+
export type { Header } from './header.js';
|
|
10
|
+
export type { Icon } from './icon.js';
|
|
11
|
+
export type { Images } from './images.js';
|
|
12
|
+
export type { InboxConfigPayload } from './inbox-config-payload.js';
|
|
13
|
+
export type { IncomingWebhook } from './incoming-webhook.js';
|
|
14
|
+
export type { SlackFinishInstallResponse } from './slack-finish-install-response.js';
|
|
15
|
+
export type { SlackInstallation } from './slack-installation.js';
|
|
16
|
+
export type { SlackStartInstall } from './slack-start-install.js';
|
|
17
|
+
export type { SlackStartInstallResponseContent } from './slack-start-install-response-content.js';
|
|
18
|
+
export type { Team } from './team.js';
|
|
19
|
+
export type { TemplatesInstallation } from './templates-installation.js';
|
|
20
|
+
export type { Theme } from './theme.js';
|
|
21
|
+
export type { ThemeNotification } from './theme-notification.js';
|
|
22
|
+
export type { Unread } from './unread.js';
|
|
23
|
+
export type { UnreadHover } from './unread-hover.js';
|
|
24
|
+
export type { UnreadState } from './unread-state.js';
|
|
25
|
+
export type { Unseen } from './unseen.js';
|
|
26
|
+
export type { UnseenBadge } from './unseen-badge.js';
|
|
27
|
+
export type { UnseenHover } from './unseen-hover.js';
|
|
28
|
+
export type { UnseenState } from './unseen-state.js';
|
|
29
|
+
export type { WebPushStartInstallationResponse } from './web-push-start-installation-response.js';
|
|
@@ -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 slackFinishInstallResponse = z.lazy(() => {
|
|
7
|
+
return z.object({
|
|
8
|
+
appId: z.string(),
|
|
9
|
+
code: z.string(),
|
|
10
|
+
redirectUrl: z.string().optional(),
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* @typedef {SlackFinishInstallResponse} slackFinishInstallResponse
|
|
17
|
+
* @property {string} - The app ID of the Slack app that was originally configured at the project-level.
|
|
18
|
+
* @property {string} - The code that was returned from the OAuth flow, and found in the query string of the redirect URL.
|
|
19
|
+
* @property {string}
|
|
20
|
+
*/
|
|
21
|
+
export type SlackFinishInstallResponse = z.infer<typeof slackFinishInstallResponse>;
|
|
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 slackFinishInstallResponseResponse = z.lazy(() => {
|
|
28
|
+
return z
|
|
29
|
+
.object({
|
|
30
|
+
app_id: z.string(),
|
|
31
|
+
code: z.string(),
|
|
32
|
+
redirect_url: z.string().optional(),
|
|
33
|
+
})
|
|
34
|
+
.transform((data) => ({
|
|
35
|
+
appId: data['app_id'],
|
|
36
|
+
code: data['code'],
|
|
37
|
+
redirectUrl: data['redirect_url'],
|
|
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 slackFinishInstallResponseRequest = z.lazy(() => {
|
|
46
|
+
return z
|
|
47
|
+
.object({
|
|
48
|
+
appId: z.string(),
|
|
49
|
+
code: z.string(),
|
|
50
|
+
redirectUrl: z.string().optional(),
|
|
51
|
+
})
|
|
52
|
+
.transform((data) => ({
|
|
53
|
+
app_id: data['appId'],
|
|
54
|
+
code: data['code'],
|
|
55
|
+
redirect_url: data['redirectUrl'],
|
|
56
|
+
}));
|
|
57
|
+
});
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
import { AuthedUser, authedUser, authedUserRequest, authedUserResponse } from './authed-user.js';
|
|
4
|
+
import { Enterprise, enterprise, enterpriseRequest, enterpriseResponse } from './enterprise.js';
|
|
5
|
+
import {
|
|
6
|
+
IncomingWebhook,
|
|
7
|
+
incomingWebhook,
|
|
8
|
+
incomingWebhookRequest,
|
|
9
|
+
incomingWebhookResponse,
|
|
10
|
+
} from './incoming-webhook.js';
|
|
11
|
+
import { Team, team, teamRequest, teamResponse } from './team.js';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The shape of the model inside the application code - what the users use
|
|
15
|
+
*/
|
|
16
|
+
export const slackInstallation = z.lazy(() => {
|
|
17
|
+
return z.object({
|
|
18
|
+
accessToken: z.string(),
|
|
19
|
+
appId: z.string(),
|
|
20
|
+
authedUser: authedUser,
|
|
21
|
+
botUserId: z.string().optional(),
|
|
22
|
+
enterprise: enterprise.optional(),
|
|
23
|
+
expiresIn: z.number().optional(),
|
|
24
|
+
id: z
|
|
25
|
+
.string()
|
|
26
|
+
.regex(/^[A-Z0-9]+-.*$/)
|
|
27
|
+
.optional(),
|
|
28
|
+
incomingWebhook: incomingWebhook.optional(),
|
|
29
|
+
isEnterpriseInstall: z.boolean().optional(),
|
|
30
|
+
refreshToken: z.string().optional(),
|
|
31
|
+
scope: z.string().optional(),
|
|
32
|
+
team: team,
|
|
33
|
+
tokenType: z.string().optional(),
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
*
|
|
39
|
+
* @typedef {SlackInstallation} slackInstallation
|
|
40
|
+
* @property {string}
|
|
41
|
+
* @property {string}
|
|
42
|
+
* @property {AuthedUser}
|
|
43
|
+
* @property {string}
|
|
44
|
+
* @property {Enterprise}
|
|
45
|
+
* @property {number}
|
|
46
|
+
* @property {string}
|
|
47
|
+
* @property {IncomingWebhook}
|
|
48
|
+
* @property {boolean}
|
|
49
|
+
* @property {string}
|
|
50
|
+
* @property {string}
|
|
51
|
+
* @property {Team}
|
|
52
|
+
* @property {string}
|
|
53
|
+
*/
|
|
54
|
+
export type SlackInstallation = z.infer<typeof slackInstallation>;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* The shape of the model mapping from the api schema into the application shape.
|
|
58
|
+
* Is equal to application shape if all property names match the api schema
|
|
59
|
+
*/
|
|
60
|
+
export const slackInstallationResponse = z.lazy(() => {
|
|
61
|
+
return z
|
|
62
|
+
.object({
|
|
63
|
+
access_token: z.string(),
|
|
64
|
+
app_id: z.string(),
|
|
65
|
+
authed_user: authedUserResponse,
|
|
66
|
+
bot_user_id: z.string().optional(),
|
|
67
|
+
enterprise: enterpriseResponse.optional(),
|
|
68
|
+
expires_in: z.number().optional(),
|
|
69
|
+
id: z
|
|
70
|
+
.string()
|
|
71
|
+
.regex(/^[A-Z0-9]+-.*$/)
|
|
72
|
+
.optional(),
|
|
73
|
+
incoming_webhook: incomingWebhookResponse.optional(),
|
|
74
|
+
is_enterprise_install: z.boolean().optional(),
|
|
75
|
+
refresh_token: z.string().optional(),
|
|
76
|
+
scope: z.string().optional(),
|
|
77
|
+
team: teamResponse,
|
|
78
|
+
token_type: z.string().optional(),
|
|
79
|
+
})
|
|
80
|
+
.transform((data) => ({
|
|
81
|
+
accessToken: data['access_token'],
|
|
82
|
+
appId: data['app_id'],
|
|
83
|
+
authedUser: data['authed_user'],
|
|
84
|
+
botUserId: data['bot_user_id'],
|
|
85
|
+
enterprise: data['enterprise'],
|
|
86
|
+
expiresIn: data['expires_in'],
|
|
87
|
+
id: data['id'],
|
|
88
|
+
incomingWebhook: data['incoming_webhook'],
|
|
89
|
+
isEnterpriseInstall: data['is_enterprise_install'],
|
|
90
|
+
refreshToken: data['refresh_token'],
|
|
91
|
+
scope: data['scope'],
|
|
92
|
+
team: data['team'],
|
|
93
|
+
tokenType: data['token_type'],
|
|
94
|
+
}));
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* The shape of the model mapping from the application shape into the api schema.
|
|
99
|
+
* Is equal to application shape if all property names match the api schema
|
|
100
|
+
*/
|
|
101
|
+
export const slackInstallationRequest = z.lazy(() => {
|
|
102
|
+
return z
|
|
103
|
+
.object({
|
|
104
|
+
accessToken: z.string(),
|
|
105
|
+
appId: z.string(),
|
|
106
|
+
authedUser: authedUserRequest,
|
|
107
|
+
botUserId: z.string().optional(),
|
|
108
|
+
enterprise: enterpriseRequest.optional(),
|
|
109
|
+
expiresIn: z.number().optional(),
|
|
110
|
+
id: z
|
|
111
|
+
.string()
|
|
112
|
+
.regex(/^[A-Z0-9]+-.*$/)
|
|
113
|
+
.optional(),
|
|
114
|
+
incomingWebhook: incomingWebhookRequest.optional(),
|
|
115
|
+
isEnterpriseInstall: z.boolean().optional(),
|
|
116
|
+
refreshToken: z.string().optional(),
|
|
117
|
+
scope: z.string().optional(),
|
|
118
|
+
team: teamRequest,
|
|
119
|
+
tokenType: z.string().optional(),
|
|
120
|
+
})
|
|
121
|
+
.transform((data) => ({
|
|
122
|
+
access_token: data['accessToken'],
|
|
123
|
+
app_id: data['appId'],
|
|
124
|
+
authed_user: data['authedUser'],
|
|
125
|
+
bot_user_id: data['botUserId'],
|
|
126
|
+
enterprise: data['enterprise'],
|
|
127
|
+
expires_in: data['expiresIn'],
|
|
128
|
+
id: data['id'],
|
|
129
|
+
incoming_webhook: data['incomingWebhook'],
|
|
130
|
+
is_enterprise_install: data['isEnterpriseInstall'],
|
|
131
|
+
refresh_token: data['refreshToken'],
|
|
132
|
+
scope: data['scope'],
|
|
133
|
+
team: data['team'],
|
|
134
|
+
token_type: data['tokenType'],
|
|
135
|
+
}));
|
|
136
|
+
});
|
|
@@ -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 slackStartInstallResponseContent = z.lazy(() => {
|
|
7
|
+
return z.object({
|
|
8
|
+
appId: z.string().optional(),
|
|
9
|
+
authUrl: z.string().optional(),
|
|
10
|
+
scopes: z.array(z.string()).optional(),
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* @typedef {SlackStartInstallResponseContent} slackStartInstallResponseContent
|
|
17
|
+
* @property {string}
|
|
18
|
+
* @property {string}
|
|
19
|
+
* @property {string[]}
|
|
20
|
+
*/
|
|
21
|
+
export type SlackStartInstallResponseContent = z.infer<typeof slackStartInstallResponseContent>;
|
|
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 slackStartInstallResponseContentResponse = z.lazy(() => {
|
|
28
|
+
return z
|
|
29
|
+
.object({
|
|
30
|
+
app_id: z.string().optional(),
|
|
31
|
+
auth_url: z.string().optional(),
|
|
32
|
+
scopes: z.array(z.string()).optional(),
|
|
33
|
+
})
|
|
34
|
+
.transform((data) => ({
|
|
35
|
+
appId: data['app_id'],
|
|
36
|
+
authUrl: data['auth_url'],
|
|
37
|
+
scopes: data['scopes'],
|
|
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 slackStartInstallResponseContentRequest = z.lazy(() => {
|
|
46
|
+
return z
|
|
47
|
+
.object({
|
|
48
|
+
appId: z.string().optional(),
|
|
49
|
+
authUrl: z.string().optional(),
|
|
50
|
+
scopes: z.array(z.string()).optional(),
|
|
51
|
+
})
|
|
52
|
+
.transform((data) => ({
|
|
53
|
+
app_id: data['appId'],
|
|
54
|
+
auth_url: data['authUrl'],
|
|
55
|
+
scopes: data['scopes'],
|
|
56
|
+
}));
|
|
57
|
+
});
|