magicbell-js 0.0.3 → 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/package.json +2 -1
- package/src/project-client/http/client.ts +71 -0
- package/src/project-client/http/environment.ts +3 -0
- package/src/project-client/http/error.ts +14 -0
- package/src/project-client/http/errors/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,64 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
StripeConfigPayload,
|
|
5
|
+
stripeConfigPayload,
|
|
6
|
+
stripeConfigPayloadRequest,
|
|
7
|
+
stripeConfigPayloadResponse,
|
|
8
|
+
} from './stripe-config-payload.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The shape of the model inside the application code - what the users use
|
|
12
|
+
*/
|
|
13
|
+
export const stripeConfig = z.lazy(() => {
|
|
14
|
+
return z.object({
|
|
15
|
+
config: stripeConfigPayload,
|
|
16
|
+
id: z.string(),
|
|
17
|
+
name: z.string(),
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
*
|
|
23
|
+
* @typedef {StripeConfig} stripeConfig
|
|
24
|
+
* @property {StripeConfigPayload}
|
|
25
|
+
* @property {string}
|
|
26
|
+
* @property {string}
|
|
27
|
+
*/
|
|
28
|
+
export type StripeConfig = z.infer<typeof stripeConfig>;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* The shape of the model mapping from the api schema into the application shape.
|
|
32
|
+
* Is equal to application shape if all property names match the api schema
|
|
33
|
+
*/
|
|
34
|
+
export const stripeConfigResponse = z.lazy(() => {
|
|
35
|
+
return z
|
|
36
|
+
.object({
|
|
37
|
+
config: stripeConfigPayloadResponse,
|
|
38
|
+
id: z.string(),
|
|
39
|
+
name: z.string(),
|
|
40
|
+
})
|
|
41
|
+
.transform((data) => ({
|
|
42
|
+
config: data['config'],
|
|
43
|
+
id: data['id'],
|
|
44
|
+
name: data['name'],
|
|
45
|
+
}));
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The shape of the model mapping from the application shape into the api schema.
|
|
50
|
+
* Is equal to application shape if all property names match the api schema
|
|
51
|
+
*/
|
|
52
|
+
export const stripeConfigRequest = z.lazy(() => {
|
|
53
|
+
return z
|
|
54
|
+
.object({
|
|
55
|
+
config: stripeConfigPayloadRequest,
|
|
56
|
+
id: z.string(),
|
|
57
|
+
name: z.string(),
|
|
58
|
+
})
|
|
59
|
+
.transform((data) => ({
|
|
60
|
+
config: data['config'],
|
|
61
|
+
id: data['id'],
|
|
62
|
+
name: data['name'],
|
|
63
|
+
}));
|
|
64
|
+
});
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
import { Links, links, linksRequest, linksResponse } from '../../common/links.js';
|
|
4
|
+
import {
|
|
5
|
+
TemplatesConfig,
|
|
6
|
+
templatesConfig,
|
|
7
|
+
templatesConfigRequest,
|
|
8
|
+
templatesConfigResponse,
|
|
9
|
+
} from './templates-config.js';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The shape of the model inside the application code - what the users use
|
|
13
|
+
*/
|
|
14
|
+
export const templatesConfigCollection = z.lazy(() => {
|
|
15
|
+
return z.object({
|
|
16
|
+
data: z.array(templatesConfig).optional(),
|
|
17
|
+
links: links.optional(),
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
*
|
|
23
|
+
* @typedef {TemplatesConfigCollection} templatesConfigCollection
|
|
24
|
+
* @property {TemplatesConfig[]}
|
|
25
|
+
* @property {Links}
|
|
26
|
+
*/
|
|
27
|
+
export type TemplatesConfigCollection = z.infer<typeof templatesConfigCollection>;
|
|
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 templatesConfigCollectionResponse = z.lazy(() => {
|
|
34
|
+
return z
|
|
35
|
+
.object({
|
|
36
|
+
data: z.array(templatesConfigResponse).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 templatesConfigCollectionRequest = z.lazy(() => {
|
|
50
|
+
return z
|
|
51
|
+
.object({
|
|
52
|
+
data: z.array(templatesConfigRequest).optional(),
|
|
53
|
+
links: linksRequest.optional(),
|
|
54
|
+
})
|
|
55
|
+
.transform((data) => ({
|
|
56
|
+
data: data['data'],
|
|
57
|
+
links: data['links'],
|
|
58
|
+
}));
|
|
59
|
+
});
|
|
@@ -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 templatesConfig = z.lazy(() => {
|
|
7
|
+
return z.object({
|
|
8
|
+
config: z.any(),
|
|
9
|
+
id: z.string(),
|
|
10
|
+
name: z.string(),
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* @typedef {TemplatesConfig} templatesConfig
|
|
17
|
+
* @property {any}
|
|
18
|
+
* @property {string}
|
|
19
|
+
* @property {string}
|
|
20
|
+
*/
|
|
21
|
+
export type TemplatesConfig = z.infer<typeof templatesConfig>;
|
|
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 templatesConfigResponse = z.lazy(() => {
|
|
28
|
+
return z
|
|
29
|
+
.object({
|
|
30
|
+
config: z.any(),
|
|
31
|
+
id: z.string(),
|
|
32
|
+
name: z.string(),
|
|
33
|
+
})
|
|
34
|
+
.transform((data) => ({
|
|
35
|
+
config: data['config'],
|
|
36
|
+
id: data['id'],
|
|
37
|
+
name: data['name'],
|
|
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 templatesConfigRequest = z.lazy(() => {
|
|
46
|
+
return z
|
|
47
|
+
.object({
|
|
48
|
+
config: z.any(),
|
|
49
|
+
id: z.string(),
|
|
50
|
+
name: z.string(),
|
|
51
|
+
})
|
|
52
|
+
.transform((data) => ({
|
|
53
|
+
config: data['config'],
|
|
54
|
+
id: data['id'],
|
|
55
|
+
name: data['name'],
|
|
56
|
+
}));
|
|
57
|
+
});
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
import { Banner, banner, bannerRequest, bannerResponse } from './banner.js';
|
|
4
|
+
import { Dialog, dialog, dialogRequest, dialogResponse } from './dialog.js';
|
|
5
|
+
import { Footer, footer, footerRequest, footerResponse } from './footer.js';
|
|
6
|
+
import { Header, header, headerRequest, headerResponse } from './header.js';
|
|
7
|
+
import { Icon, icon, iconRequest, iconResponse } from './icon.js';
|
|
8
|
+
import { Notification, notification, notificationRequest, notificationResponse } from './notification.js';
|
|
9
|
+
import { UnseenBadge, unseenBadge, unseenBadgeRequest, unseenBadgeResponse } from './unseen-badge.js';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The shape of the model inside the application code - what the users use
|
|
13
|
+
*/
|
|
14
|
+
export const theme = z.lazy(() => {
|
|
15
|
+
return z.object({
|
|
16
|
+
banner: banner.optional(),
|
|
17
|
+
dialog: dialog.optional(),
|
|
18
|
+
footer: footer.optional(),
|
|
19
|
+
header: header.optional(),
|
|
20
|
+
icon: icon.optional(),
|
|
21
|
+
notification: notification.optional(),
|
|
22
|
+
unseenBadge: unseenBadge.optional(),
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
* @typedef {Theme} theme
|
|
29
|
+
* @property {Banner}
|
|
30
|
+
* @property {Dialog}
|
|
31
|
+
* @property {Footer}
|
|
32
|
+
* @property {Header}
|
|
33
|
+
* @property {Icon}
|
|
34
|
+
* @property {Notification}
|
|
35
|
+
* @property {UnseenBadge}
|
|
36
|
+
*/
|
|
37
|
+
export type Theme = z.infer<typeof theme>;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The shape of the model mapping from the api schema into the application shape.
|
|
41
|
+
* Is equal to application shape if all property names match the api schema
|
|
42
|
+
*/
|
|
43
|
+
export const themeResponse = z.lazy(() => {
|
|
44
|
+
return z
|
|
45
|
+
.object({
|
|
46
|
+
banner: bannerResponse.optional(),
|
|
47
|
+
dialog: dialogResponse.optional(),
|
|
48
|
+
footer: footerResponse.optional(),
|
|
49
|
+
header: headerResponse.optional(),
|
|
50
|
+
icon: iconResponse.optional(),
|
|
51
|
+
notification: notificationResponse.optional(),
|
|
52
|
+
unseenBadge: unseenBadgeResponse.optional(),
|
|
53
|
+
})
|
|
54
|
+
.transform((data) => ({
|
|
55
|
+
banner: data['banner'],
|
|
56
|
+
dialog: data['dialog'],
|
|
57
|
+
footer: data['footer'],
|
|
58
|
+
header: data['header'],
|
|
59
|
+
icon: data['icon'],
|
|
60
|
+
notification: data['notification'],
|
|
61
|
+
unseenBadge: data['unseenBadge'],
|
|
62
|
+
}));
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* The shape of the model mapping from the application shape into the api schema.
|
|
67
|
+
* Is equal to application shape if all property names match the api schema
|
|
68
|
+
*/
|
|
69
|
+
export const themeRequest = z.lazy(() => {
|
|
70
|
+
return z
|
|
71
|
+
.object({
|
|
72
|
+
banner: bannerRequest.optional(),
|
|
73
|
+
dialog: dialogRequest.optional(),
|
|
74
|
+
footer: footerRequest.optional(),
|
|
75
|
+
header: headerRequest.optional(),
|
|
76
|
+
icon: iconRequest.optional(),
|
|
77
|
+
notification: notificationRequest.optional(),
|
|
78
|
+
unseenBadge: unseenBadgeRequest.optional(),
|
|
79
|
+
})
|
|
80
|
+
.transform((data) => ({
|
|
81
|
+
banner: data['banner'],
|
|
82
|
+
dialog: data['dialog'],
|
|
83
|
+
footer: data['footer'],
|
|
84
|
+
header: data['header'],
|
|
85
|
+
icon: data['icon'],
|
|
86
|
+
notification: data['notification'],
|
|
87
|
+
unseenBadge: data['unseenBadge'],
|
|
88
|
+
}));
|
|
89
|
+
});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
import { Links, links, linksRequest, linksResponse } from '../../common/links.js';
|
|
4
|
+
import { TwilioConfig, twilioConfig, twilioConfigRequest, twilioConfigResponse } from './twilio-config.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The shape of the model inside the application code - what the users use
|
|
8
|
+
*/
|
|
9
|
+
export const twilioConfigCollection = z.lazy(() => {
|
|
10
|
+
return z.object({
|
|
11
|
+
data: z.array(twilioConfig).optional(),
|
|
12
|
+
links: links.optional(),
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @typedef {TwilioConfigCollection} twilioConfigCollection
|
|
19
|
+
* @property {TwilioConfig[]}
|
|
20
|
+
* @property {Links}
|
|
21
|
+
*/
|
|
22
|
+
export type TwilioConfigCollection = z.infer<typeof twilioConfigCollection>;
|
|
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 twilioConfigCollectionResponse = z.lazy(() => {
|
|
29
|
+
return z
|
|
30
|
+
.object({
|
|
31
|
+
data: z.array(twilioConfigResponse).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 twilioConfigCollectionRequest = z.lazy(() => {
|
|
45
|
+
return z
|
|
46
|
+
.object({
|
|
47
|
+
data: z.array(twilioConfigRequest).optional(),
|
|
48
|
+
links: linksRequest.optional(),
|
|
49
|
+
})
|
|
50
|
+
.transform((data) => ({
|
|
51
|
+
data: data['data'],
|
|
52
|
+
links: data['links'],
|
|
53
|
+
}));
|
|
54
|
+
});
|
|
@@ -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 twilioConfigPayload = z.lazy(() => {
|
|
7
|
+
return z.object({
|
|
8
|
+
accountSid: z.string().min(1).max(100),
|
|
9
|
+
apiKey: z.string().min(1).max(100),
|
|
10
|
+
apiSecret: z.string().min(1).max(100),
|
|
11
|
+
from: z
|
|
12
|
+
.string()
|
|
13
|
+
.min(1)
|
|
14
|
+
.max(100)
|
|
15
|
+
.regex(/^\+[0-9]{1,14}$/),
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @typedef {TwilioConfigPayload} twilioConfigPayload
|
|
22
|
+
* @property {string} - The SID for your Twilio account
|
|
23
|
+
* @property {string} - A US1 API key for Twilio- - https://www.twilio.com/docs/iam/api-keys
|
|
24
|
+
* @property {string} - The API Secret for Twilio
|
|
25
|
+
* @property {string} - The phone number to send from, in E.164 format
|
|
26
|
+
*/
|
|
27
|
+
export type TwilioConfigPayload = z.infer<typeof twilioConfigPayload>;
|
|
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 twilioConfigPayloadResponse = z.lazy(() => {
|
|
34
|
+
return z
|
|
35
|
+
.object({
|
|
36
|
+
account_sid: z.string().min(1).max(100),
|
|
37
|
+
api_key: z.string().min(1).max(100),
|
|
38
|
+
api_secret: z.string().min(1).max(100),
|
|
39
|
+
from: z
|
|
40
|
+
.string()
|
|
41
|
+
.min(1)
|
|
42
|
+
.max(100)
|
|
43
|
+
.regex(/^\+[0-9]{1,14}$/),
|
|
44
|
+
})
|
|
45
|
+
.transform((data) => ({
|
|
46
|
+
accountSid: data['account_sid'],
|
|
47
|
+
apiKey: data['api_key'],
|
|
48
|
+
apiSecret: data['api_secret'],
|
|
49
|
+
from: data['from'],
|
|
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 twilioConfigPayloadRequest = z.lazy(() => {
|
|
58
|
+
return z
|
|
59
|
+
.object({
|
|
60
|
+
accountSid: z.string().min(1).max(100),
|
|
61
|
+
apiKey: z.string().min(1).max(100),
|
|
62
|
+
apiSecret: z.string().min(1).max(100),
|
|
63
|
+
from: z
|
|
64
|
+
.string()
|
|
65
|
+
.min(1)
|
|
66
|
+
.max(100)
|
|
67
|
+
.regex(/^\+[0-9]{1,14}$/),
|
|
68
|
+
})
|
|
69
|
+
.transform((data) => ({
|
|
70
|
+
account_sid: data['accountSid'],
|
|
71
|
+
api_key: data['apiKey'],
|
|
72
|
+
api_secret: data['apiSecret'],
|
|
73
|
+
from: data['from'],
|
|
74
|
+
}));
|
|
75
|
+
});
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
TwilioConfigPayload,
|
|
5
|
+
twilioConfigPayload,
|
|
6
|
+
twilioConfigPayloadRequest,
|
|
7
|
+
twilioConfigPayloadResponse,
|
|
8
|
+
} from './twilio-config-payload.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The shape of the model inside the application code - what the users use
|
|
12
|
+
*/
|
|
13
|
+
export const twilioConfig = z.lazy(() => {
|
|
14
|
+
return z.object({
|
|
15
|
+
config: twilioConfigPayload,
|
|
16
|
+
id: z.string(),
|
|
17
|
+
name: z.string(),
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
*
|
|
23
|
+
* @typedef {TwilioConfig} twilioConfig
|
|
24
|
+
* @property {TwilioConfigPayload}
|
|
25
|
+
* @property {string}
|
|
26
|
+
* @property {string}
|
|
27
|
+
*/
|
|
28
|
+
export type TwilioConfig = z.infer<typeof twilioConfig>;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* The shape of the model mapping from the api schema into the application shape.
|
|
32
|
+
* Is equal to application shape if all property names match the api schema
|
|
33
|
+
*/
|
|
34
|
+
export const twilioConfigResponse = z.lazy(() => {
|
|
35
|
+
return z
|
|
36
|
+
.object({
|
|
37
|
+
config: twilioConfigPayloadResponse,
|
|
38
|
+
id: z.string(),
|
|
39
|
+
name: z.string(),
|
|
40
|
+
})
|
|
41
|
+
.transform((data) => ({
|
|
42
|
+
config: data['config'],
|
|
43
|
+
id: data['id'],
|
|
44
|
+
name: data['name'],
|
|
45
|
+
}));
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The shape of the model mapping from the application shape into the api schema.
|
|
50
|
+
* Is equal to application shape if all property names match the api schema
|
|
51
|
+
*/
|
|
52
|
+
export const twilioConfigRequest = z.lazy(() => {
|
|
53
|
+
return z
|
|
54
|
+
.object({
|
|
55
|
+
config: twilioConfigPayloadRequest,
|
|
56
|
+
id: z.string(),
|
|
57
|
+
name: z.string(),
|
|
58
|
+
})
|
|
59
|
+
.transform((data) => ({
|
|
60
|
+
config: data['config'],
|
|
61
|
+
id: data['id'],
|
|
62
|
+
name: data['name'],
|
|
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 unreadHover = z.lazy(() => {
|
|
7
|
+
return z.object({
|
|
8
|
+
backgroundColor: z.string(),
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @typedef {UnreadHover} unreadHover
|
|
15
|
+
* @property {string}
|
|
16
|
+
*/
|
|
17
|
+
export type UnreadHover = z.infer<typeof unreadHover>;
|
|
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 unreadHoverResponse = z.lazy(() => {
|
|
24
|
+
return z
|
|
25
|
+
.object({
|
|
26
|
+
backgroundColor: z.string(),
|
|
27
|
+
})
|
|
28
|
+
.transform((data) => ({
|
|
29
|
+
backgroundColor: data['backgroundColor'],
|
|
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 unreadHoverRequest = z.lazy(() => {
|
|
38
|
+
return z
|
|
39
|
+
.object({
|
|
40
|
+
backgroundColor: z.string(),
|
|
41
|
+
})
|
|
42
|
+
.transform((data) => ({
|
|
43
|
+
backgroundColor: data['backgroundColor'],
|
|
44
|
+
}));
|
|
45
|
+
});
|
|
@@ -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 unreadState = z.lazy(() => {
|
|
7
|
+
return z.object({
|
|
8
|
+
color: z.string(),
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @typedef {UnreadState} unreadState
|
|
15
|
+
* @property {string}
|
|
16
|
+
*/
|
|
17
|
+
export type UnreadState = z.infer<typeof unreadState>;
|
|
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 unreadStateResponse = z.lazy(() => {
|
|
24
|
+
return z
|
|
25
|
+
.object({
|
|
26
|
+
color: z.string(),
|
|
27
|
+
})
|
|
28
|
+
.transform((data) => ({
|
|
29
|
+
color: data['color'],
|
|
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 unreadStateRequest = z.lazy(() => {
|
|
38
|
+
return z
|
|
39
|
+
.object({
|
|
40
|
+
color: z.string(),
|
|
41
|
+
})
|
|
42
|
+
.transform((data) => ({
|
|
43
|
+
color: data['color'],
|
|
44
|
+
}));
|
|
45
|
+
});
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
import { UnreadHover, unreadHover, unreadHoverRequest, unreadHoverResponse } from './unread-hover.js';
|
|
4
|
+
import { UnreadState, unreadState, unreadStateRequest, unreadStateResponse } from './unread-state.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The shape of the model inside the application code - what the users use
|
|
8
|
+
*/
|
|
9
|
+
export const unread = z.lazy(() => {
|
|
10
|
+
return z.object({
|
|
11
|
+
backgroundColor: z.string(),
|
|
12
|
+
hover: unreadHover.optional(),
|
|
13
|
+
state: unreadState.optional(),
|
|
14
|
+
textColor: z.string(),
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* @typedef {Unread} unread
|
|
21
|
+
* @property {string}
|
|
22
|
+
* @property {UnreadHover}
|
|
23
|
+
* @property {UnreadState}
|
|
24
|
+
* @property {string}
|
|
25
|
+
*/
|
|
26
|
+
export type Unread = z.infer<typeof unread>;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The shape of the model mapping from the api schema into the application shape.
|
|
30
|
+
* Is equal to application shape if all property names match the api schema
|
|
31
|
+
*/
|
|
32
|
+
export const unreadResponse = z.lazy(() => {
|
|
33
|
+
return z
|
|
34
|
+
.object({
|
|
35
|
+
backgroundColor: z.string(),
|
|
36
|
+
hover: unreadHoverResponse.optional(),
|
|
37
|
+
state: unreadStateResponse.optional(),
|
|
38
|
+
textColor: z.string(),
|
|
39
|
+
})
|
|
40
|
+
.transform((data) => ({
|
|
41
|
+
backgroundColor: data['backgroundColor'],
|
|
42
|
+
hover: data['hover'],
|
|
43
|
+
state: data['state'],
|
|
44
|
+
textColor: data['textColor'],
|
|
45
|
+
}));
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The shape of the model mapping from the application shape into the api schema.
|
|
50
|
+
* Is equal to application shape if all property names match the api schema
|
|
51
|
+
*/
|
|
52
|
+
export const unreadRequest = z.lazy(() => {
|
|
53
|
+
return z
|
|
54
|
+
.object({
|
|
55
|
+
backgroundColor: z.string(),
|
|
56
|
+
hover: unreadHoverRequest.optional(),
|
|
57
|
+
state: unreadStateRequest.optional(),
|
|
58
|
+
textColor: z.string(),
|
|
59
|
+
})
|
|
60
|
+
.transform((data) => ({
|
|
61
|
+
backgroundColor: data['backgroundColor'],
|
|
62
|
+
hover: data['hover'],
|
|
63
|
+
state: data['state'],
|
|
64
|
+
textColor: data['textColor'],
|
|
65
|
+
}));
|
|
66
|
+
});
|
|
@@ -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 unseenBadge = z.lazy(() => {
|
|
7
|
+
return z.object({
|
|
8
|
+
backgroundColor: z.string(),
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @typedef {UnseenBadge} unseenBadge
|
|
15
|
+
* @property {string}
|
|
16
|
+
*/
|
|
17
|
+
export type UnseenBadge = z.infer<typeof unseenBadge>;
|
|
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 unseenBadgeResponse = z.lazy(() => {
|
|
24
|
+
return z
|
|
25
|
+
.object({
|
|
26
|
+
backgroundColor: z.string(),
|
|
27
|
+
})
|
|
28
|
+
.transform((data) => ({
|
|
29
|
+
backgroundColor: data['backgroundColor'],
|
|
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 unseenBadgeRequest = z.lazy(() => {
|
|
38
|
+
return z
|
|
39
|
+
.object({
|
|
40
|
+
backgroundColor: z.string(),
|
|
41
|
+
})
|
|
42
|
+
.transform((data) => ({
|
|
43
|
+
backgroundColor: data['backgroundColor'],
|
|
44
|
+
}));
|
|
45
|
+
});
|