magicbell-js 0.0.4 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/README.md +2 -3
  2. package/dist/commonjs/project-client/http/errors/throwable-error.d.ts +7 -0
  3. package/dist/commonjs/project-client/http/errors/throwable-error.d.ts.map +1 -0
  4. package/dist/commonjs/project-client/http/errors/throwable-error.js +25 -0
  5. package/dist/commonjs/project-client/http/errors/throwable-error.js.map +1 -0
  6. package/dist/commonjs/project-client/http/handlers/hook-handler.d.ts.map +1 -1
  7. package/dist/commonjs/project-client/http/handlers/hook-handler.js +2 -2
  8. package/dist/commonjs/project-client/http/handlers/hook-handler.js.map +1 -1
  9. package/dist/commonjs/project-client/http/transport/types.d.ts +2 -1
  10. package/dist/commonjs/project-client/http/transport/types.d.ts.map +1 -1
  11. package/dist/commonjs/project-client/services/broadcasts/broadcasts-service.d.ts.map +1 -1
  12. package/dist/commonjs/project-client/services/broadcasts/broadcasts-service.js.map +1 -1
  13. package/dist/commonjs/project-client/services/channels/channels-service.d.ts.map +1 -1
  14. package/dist/commonjs/project-client/services/channels/channels-service.js.map +1 -1
  15. package/dist/commonjs/project-client/services/events/events-service.d.ts.map +1 -1
  16. package/dist/commonjs/project-client/services/events/events-service.js.map +1 -1
  17. package/dist/commonjs/project-client/services/integrations/integrations-service.d.ts.map +1 -1
  18. package/dist/commonjs/project-client/services/integrations/integrations-service.js.map +1 -1
  19. package/dist/commonjs/project-client/services/jwt/jwt-service.d.ts +1 -25
  20. package/dist/commonjs/project-client/services/jwt/jwt-service.d.ts.map +1 -1
  21. package/dist/commonjs/project-client/services/jwt/jwt-service.js +0 -103
  22. package/dist/commonjs/project-client/services/jwt/jwt-service.js.map +1 -1
  23. package/dist/commonjs/project-client/services/jwt/models/index.d.ts +0 -1
  24. package/dist/commonjs/project-client/services/jwt/models/index.d.ts.map +1 -1
  25. package/dist/commonjs/project-client/services/jwt/request-params.d.ts +0 -5
  26. package/dist/commonjs/project-client/services/jwt/request-params.d.ts.map +1 -1
  27. package/dist/commonjs/project-client/services/notifications/notifications-service.d.ts.map +1 -1
  28. package/dist/commonjs/project-client/services/notifications/notifications-service.js.map +1 -1
  29. package/dist/commonjs/project-client/services/users/users-service.d.ts.map +1 -1
  30. package/dist/commonjs/project-client/services/users/users-service.js.map +1 -1
  31. package/dist/commonjs/user-client/http/errors/throwable-error.d.ts +7 -0
  32. package/dist/commonjs/user-client/http/errors/throwable-error.d.ts.map +1 -0
  33. package/dist/commonjs/user-client/http/errors/throwable-error.js +25 -0
  34. package/dist/commonjs/user-client/http/errors/throwable-error.js.map +1 -0
  35. package/dist/commonjs/user-client/http/handlers/hook-handler.d.ts.map +1 -1
  36. package/dist/commonjs/user-client/http/handlers/hook-handler.js +2 -2
  37. package/dist/commonjs/user-client/http/handlers/hook-handler.js.map +1 -1
  38. package/dist/commonjs/user-client/http/transport/types.d.ts +2 -1
  39. package/dist/commonjs/user-client/http/transport/types.d.ts.map +1 -1
  40. package/dist/commonjs/user-client/services/channels/channels-service.d.ts.map +1 -1
  41. package/dist/commonjs/user-client/services/channels/channels-service.js.map +1 -1
  42. package/dist/commonjs/user-client/services/integrations/integrations-service.d.ts.map +1 -1
  43. package/dist/commonjs/user-client/services/integrations/integrations-service.js.map +1 -1
  44. package/dist/commonjs/user-client/services/notifications/notifications-service.d.ts +26 -1
  45. package/dist/commonjs/user-client/services/notifications/notifications-service.d.ts.map +1 -1
  46. package/dist/commonjs/user-client/services/notifications/notifications-service.js +106 -0
  47. package/dist/commonjs/user-client/services/notifications/notifications-service.js.map +1 -1
  48. package/dist/commonjs/user-client/services/notifications/request-params.d.ts +9 -0
  49. package/dist/commonjs/user-client/services/notifications/request-params.d.ts.map +1 -1
  50. package/dist/esm/project-client/http/errors/throwable-error.d.ts +7 -0
  51. package/dist/esm/project-client/http/errors/throwable-error.d.ts.map +1 -0
  52. package/dist/esm/project-client/http/errors/throwable-error.js +21 -0
  53. package/dist/esm/project-client/http/errors/throwable-error.js.map +1 -0
  54. package/dist/esm/project-client/http/handlers/hook-handler.d.ts.map +1 -1
  55. package/dist/esm/project-client/http/handlers/hook-handler.js +2 -2
  56. package/dist/esm/project-client/http/handlers/hook-handler.js.map +1 -1
  57. package/dist/esm/project-client/http/transport/types.d.ts +2 -1
  58. package/dist/esm/project-client/http/transport/types.d.ts.map +1 -1
  59. package/dist/esm/project-client/services/broadcasts/broadcasts-service.d.ts.map +1 -1
  60. package/dist/esm/project-client/services/broadcasts/broadcasts-service.js.map +1 -1
  61. package/dist/esm/project-client/services/channels/channels-service.d.ts.map +1 -1
  62. package/dist/esm/project-client/services/channels/channels-service.js.map +1 -1
  63. package/dist/esm/project-client/services/events/events-service.d.ts.map +1 -1
  64. package/dist/esm/project-client/services/events/events-service.js.map +1 -1
  65. package/dist/esm/project-client/services/integrations/integrations-service.d.ts.map +1 -1
  66. package/dist/esm/project-client/services/integrations/integrations-service.js.map +1 -1
  67. package/dist/esm/project-client/services/jwt/jwt-service.d.ts +1 -25
  68. package/dist/esm/project-client/services/jwt/jwt-service.d.ts.map +1 -1
  69. package/dist/esm/project-client/services/jwt/jwt-service.js +0 -103
  70. package/dist/esm/project-client/services/jwt/jwt-service.js.map +1 -1
  71. package/dist/esm/project-client/services/jwt/models/index.d.ts +0 -1
  72. package/dist/esm/project-client/services/jwt/models/index.d.ts.map +1 -1
  73. package/dist/esm/project-client/services/jwt/request-params.d.ts +0 -5
  74. package/dist/esm/project-client/services/jwt/request-params.d.ts.map +1 -1
  75. package/dist/esm/project-client/services/notifications/notifications-service.d.ts.map +1 -1
  76. package/dist/esm/project-client/services/notifications/notifications-service.js.map +1 -1
  77. package/dist/esm/project-client/services/users/users-service.d.ts.map +1 -1
  78. package/dist/esm/project-client/services/users/users-service.js.map +1 -1
  79. package/dist/esm/user-client/http/errors/throwable-error.d.ts +7 -0
  80. package/dist/esm/user-client/http/errors/throwable-error.d.ts.map +1 -0
  81. package/dist/esm/user-client/http/errors/throwable-error.js +21 -0
  82. package/dist/esm/user-client/http/errors/throwable-error.js.map +1 -0
  83. package/dist/esm/user-client/http/handlers/hook-handler.d.ts.map +1 -1
  84. package/dist/esm/user-client/http/handlers/hook-handler.js +2 -2
  85. package/dist/esm/user-client/http/handlers/hook-handler.js.map +1 -1
  86. package/dist/esm/user-client/http/transport/types.d.ts +2 -1
  87. package/dist/esm/user-client/http/transport/types.d.ts.map +1 -1
  88. package/dist/esm/user-client/services/channels/channels-service.d.ts.map +1 -1
  89. package/dist/esm/user-client/services/channels/channels-service.js.map +1 -1
  90. package/dist/esm/user-client/services/integrations/integrations-service.d.ts.map +1 -1
  91. package/dist/esm/user-client/services/integrations/integrations-service.js.map +1 -1
  92. package/dist/esm/user-client/services/notifications/notifications-service.d.ts +26 -1
  93. package/dist/esm/user-client/services/notifications/notifications-service.d.ts.map +1 -1
  94. package/dist/esm/user-client/services/notifications/notifications-service.js +106 -0
  95. package/dist/esm/user-client/services/notifications/notifications-service.js.map +1 -1
  96. package/dist/esm/user-client/services/notifications/request-params.d.ts +9 -0
  97. package/dist/esm/user-client/services/notifications/request-params.d.ts.map +1 -1
  98. package/package.json +2 -1
  99. package/src/project-client/http/errors/throwable-error.ts +9 -0
  100. package/src/project-client/http/handlers/hook-handler.ts +5 -3
  101. package/src/project-client/http/transport/types.ts +2 -1
  102. package/src/project-client/services/broadcasts/broadcasts-service.ts +1 -0
  103. package/src/project-client/services/channels/channels-service.ts +1 -0
  104. package/src/project-client/services/events/events-service.ts +1 -0
  105. package/src/project-client/services/integrations/integrations-service.ts +1 -0
  106. package/src/project-client/services/jwt/jwt-service.ts +2 -114
  107. package/src/project-client/services/jwt/models/index.ts +0 -1
  108. package/src/project-client/services/jwt/request-params.ts +0 -6
  109. package/src/project-client/services/notifications/notifications-service.ts +1 -0
  110. package/src/project-client/services/users/users-service.ts +1 -0
  111. package/src/user-client/http/errors/throwable-error.ts +9 -0
  112. package/src/user-client/http/handlers/hook-handler.ts +5 -3
  113. package/src/user-client/http/transport/types.ts +2 -1
  114. package/src/user-client/services/channels/channels-service.ts +1 -0
  115. package/src/user-client/services/integrations/integrations-service.ts +1 -0
  116. package/src/user-client/services/notifications/notifications-service.ts +117 -1
  117. package/src/user-client/services/notifications/request-params.ts +11 -0
  118. package/dist/commonjs/project-client/services/jwt/models/create-user-token-request.d.ts +0 -90
  119. package/dist/commonjs/project-client/services/jwt/models/create-user-token-request.d.ts.map +0 -1
  120. package/dist/commonjs/project-client/services/jwt/models/create-user-token-request.js +0 -54
  121. package/dist/commonjs/project-client/services/jwt/models/create-user-token-request.js.map +0 -1
  122. package/dist/esm/project-client/services/jwt/models/create-user-token-request.d.ts +0 -90
  123. package/dist/esm/project-client/services/jwt/models/create-user-token-request.d.ts.map +0 -1
  124. package/dist/esm/project-client/services/jwt/models/create-user-token-request.js +0 -51
  125. package/dist/esm/project-client/services/jwt/models/create-user-token-request.js.map +0 -1
  126. package/src/project-client/services/jwt/models/create-user-token-request.ts +0 -63
@@ -1,12 +1,14 @@
1
1
  import { z } from 'zod';
2
2
 
3
3
  import { Environment } from '../../http/environment.js';
4
+ import { ThrowableError } from '../../http/errors/throwable-error.js';
4
5
  import { SerializationStyle } from '../../http/serialization/base-serializer.js';
5
6
  import { RequestBuilder } from '../../http/transport/request-builder.js';
6
7
  import { ContentType, HttpResponse, RequestConfig } from '../../http/types.js';
7
8
  import { BaseService } from '../base-service.js';
9
+ import { Notification, notificationResponse } from './models/notification.js';
8
10
  import { NotificationCollection, notificationCollectionResponse } from './models/notification-collection.js';
9
- import { ListNotificationsParams } from './request-params.js';
11
+ import { ArchiveNotificationsParams, ListNotificationsParams, MarkNotificationsReadParams } from './request-params.js';
10
12
 
11
13
  export class NotificationsService extends BaseService {
12
14
  /**
@@ -15,6 +17,7 @@ export class NotificationsService extends BaseService {
15
17
  * @param {string} [params.startingAfter] -
16
18
  * @param {string} [params.endingBefore] -
17
19
  * @param {string} [params.status] -
20
+ * @param {string} [params.category] -
18
21
  * @param {string} [params.topic] -
19
22
  * @param {RequestConfig} requestConfig - (Optional) The request configuration for retry and validation.
20
23
  * @returns {Promise<HttpResponse<NotificationCollection>>} OK
@@ -55,6 +58,10 @@ export class NotificationsService extends BaseService {
55
58
  key: 'status',
56
59
  value: params?.status,
57
60
  })
61
+ .addQueryParam({
62
+ key: 'category',
63
+ value: params?.category,
64
+ })
58
65
  .addQueryParam({
59
66
  key: 'topic',
60
67
  value: params?.topic,
@@ -63,6 +70,115 @@ export class NotificationsService extends BaseService {
63
70
  return this.client.call<NotificationCollection>(request);
64
71
  }
65
72
 
73
+ /**
74
+ * Archives all notifications.
75
+ * @param {string} [params.category] -
76
+ * @param {string} [params.topic] -
77
+ * @param {RequestConfig} requestConfig - (Optional) The request configuration for retry and validation.
78
+ * @returns {Promise<HttpResponse<any>>} No Content
79
+ */
80
+ async archiveNotifications(
81
+ params?: ArchiveNotificationsParams,
82
+ requestConfig?: RequestConfig,
83
+ ): Promise<HttpResponse<void>> {
84
+ const request = new RequestBuilder()
85
+ .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT)
86
+ .setConfig(this.config)
87
+ .setMethod('POST')
88
+ .setPath('/notifications/archive')
89
+ .setRequestSchema(z.any())
90
+ .addAccessTokenAuth(this.config.token, 'Bearer')
91
+ .setRequestContentType(ContentType.Json)
92
+ .addResponse({
93
+ schema: z.undefined(),
94
+ contentType: ContentType.NoContent,
95
+ status: 204,
96
+ })
97
+ .setRetryAttempts(this.config, requestConfig)
98
+ .setRetryDelayMs(this.config, requestConfig)
99
+ .setResponseValidation(this.config, requestConfig)
100
+ .addQueryParam({
101
+ key: 'category',
102
+ value: params?.category,
103
+ })
104
+ .addQueryParam({
105
+ key: 'topic',
106
+ value: params?.topic,
107
+ })
108
+ .build();
109
+ return this.client.call<void>(request);
110
+ }
111
+
112
+ /**
113
+ * Marks all notifications as read.
114
+ * @param {string} [params.category] -
115
+ * @param {string} [params.topic] -
116
+ * @param {RequestConfig} requestConfig - (Optional) The request configuration for retry and validation.
117
+ * @returns {Promise<HttpResponse<any>>} No Content
118
+ */
119
+ async markNotificationsRead(
120
+ params?: MarkNotificationsReadParams,
121
+ requestConfig?: RequestConfig,
122
+ ): Promise<HttpResponse<void>> {
123
+ const request = new RequestBuilder()
124
+ .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT)
125
+ .setConfig(this.config)
126
+ .setMethod('POST')
127
+ .setPath('/notifications/read')
128
+ .setRequestSchema(z.any())
129
+ .addAccessTokenAuth(this.config.token, 'Bearer')
130
+ .setRequestContentType(ContentType.Json)
131
+ .addResponse({
132
+ schema: z.undefined(),
133
+ contentType: ContentType.NoContent,
134
+ status: 204,
135
+ })
136
+ .setRetryAttempts(this.config, requestConfig)
137
+ .setRetryDelayMs(this.config, requestConfig)
138
+ .setResponseValidation(this.config, requestConfig)
139
+ .addQueryParam({
140
+ key: 'category',
141
+ value: params?.category,
142
+ })
143
+ .addQueryParam({
144
+ key: 'topic',
145
+ value: params?.topic,
146
+ })
147
+ .build();
148
+ return this.client.call<void>(request);
149
+ }
150
+
151
+ /**
152
+ * Gets a notification by ID.
153
+ * @param {string} notificationId -
154
+ * @param {RequestConfig} requestConfig - (Optional) The request configuration for retry and validation.
155
+ * @returns {Promise<HttpResponse<Notification>>} OK
156
+ */
157
+ async getNotification(notificationId: string, requestConfig?: RequestConfig): Promise<HttpResponse<Notification>> {
158
+ const request = new RequestBuilder()
159
+ .setBaseUrl(requestConfig?.baseUrl || this.config.baseUrl || this.config.environment || Environment.DEFAULT)
160
+ .setConfig(this.config)
161
+ .setMethod('GET')
162
+ .setPath('/notifications/{notification_id}')
163
+ .setRequestSchema(z.any())
164
+ .addAccessTokenAuth(this.config.token, 'Bearer')
165
+ .setRequestContentType(ContentType.Json)
166
+ .addResponse({
167
+ schema: notificationResponse,
168
+ contentType: ContentType.Json,
169
+ status: 200,
170
+ })
171
+ .setRetryAttempts(this.config, requestConfig)
172
+ .setRetryDelayMs(this.config, requestConfig)
173
+ .setResponseValidation(this.config, requestConfig)
174
+ .addPathParam({
175
+ key: 'notification_id',
176
+ value: notificationId,
177
+ })
178
+ .build();
179
+ return this.client.call<Notification>(request);
180
+ }
181
+
66
182
  /**
67
183
  * Archives a notification.
68
184
  * @param {string} notificationId -
@@ -3,5 +3,16 @@ export interface ListNotificationsParams {
3
3
  startingAfter?: string;
4
4
  endingBefore?: string;
5
5
  status?: string;
6
+ category?: string;
7
+ topic?: string;
8
+ }
9
+
10
+ export interface ArchiveNotificationsParams {
11
+ category?: string;
12
+ topic?: string;
13
+ }
14
+
15
+ export interface MarkNotificationsReadParams {
16
+ category?: string;
6
17
  topic?: string;
7
18
  }
@@ -1,90 +0,0 @@
1
- import { z } from 'zod';
2
- /**
3
- * The shape of the model inside the application code - what the users use
4
- */
5
- export declare const createUserTokenRequest: z.ZodLazy<z.ZodObject<{
6
- email: z.ZodNullable<z.ZodOptional<z.ZodString>>;
7
- expiry: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
8
- externalId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
9
- name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
10
- }, "strip", z.ZodTypeAny, {
11
- email?: string | null | undefined;
12
- name?: string | null | undefined;
13
- expiry?: number | null | undefined;
14
- externalId?: string | null | undefined;
15
- }, {
16
- email?: string | null | undefined;
17
- name?: string | null | undefined;
18
- expiry?: number | null | undefined;
19
- externalId?: string | null | undefined;
20
- }>>;
21
- /**
22
- *
23
- * @typedef {CreateUserTokenRequest} createUserTokenRequest
24
- * @property {string} - The user's email.
25
- * @property {number} - The duration for which the token is valid (in seconds)
26
- * @property {string} - A unique string that MagicBell can utilize to identify the user uniquely. We recommend setting this attribute to the ID of the user in your database. Provide the external id if the user's email is unavailable.
27
- * @property {string} - The name of the token.
28
- */
29
- export type CreateUserTokenRequest = z.infer<typeof createUserTokenRequest>;
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 declare const createUserTokenRequestResponse: z.ZodLazy<z.ZodEffects<z.ZodObject<{
35
- email: z.ZodNullable<z.ZodOptional<z.ZodString>>;
36
- expiry: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
37
- external_id: z.ZodNullable<z.ZodOptional<z.ZodString>>;
38
- name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
39
- }, "strip", z.ZodTypeAny, {
40
- email?: string | null | undefined;
41
- name?: string | null | undefined;
42
- expiry?: number | null | undefined;
43
- external_id?: string | null | undefined;
44
- }, {
45
- email?: string | null | undefined;
46
- name?: string | null | undefined;
47
- expiry?: number | null | undefined;
48
- external_id?: string | null | undefined;
49
- }>, {
50
- email: string | null | undefined;
51
- expiry: number | null | undefined;
52
- externalId: string | null | undefined;
53
- name: string | null | undefined;
54
- }, {
55
- email?: string | null | undefined;
56
- name?: string | null | undefined;
57
- expiry?: number | null | undefined;
58
- external_id?: string | null | undefined;
59
- }>>;
60
- /**
61
- * The shape of the model mapping from the application shape into the api schema.
62
- * Is equal to application shape if all property names match the api schema
63
- */
64
- export declare const createUserTokenRequestRequest: z.ZodLazy<z.ZodEffects<z.ZodObject<{
65
- email: z.ZodNullable<z.ZodOptional<z.ZodString>>;
66
- expiry: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
67
- externalId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
68
- name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
69
- }, "strip", z.ZodTypeAny, {
70
- email?: string | null | undefined;
71
- name?: string | null | undefined;
72
- expiry?: number | null | undefined;
73
- externalId?: string | null | undefined;
74
- }, {
75
- email?: string | null | undefined;
76
- name?: string | null | undefined;
77
- expiry?: number | null | undefined;
78
- externalId?: string | null | undefined;
79
- }>, {
80
- email: string | null | undefined;
81
- expiry: number | null | undefined;
82
- external_id: string | null | undefined;
83
- name: string | null | undefined;
84
- }, {
85
- email?: string | null | undefined;
86
- name?: string | null | undefined;
87
- expiry?: number | null | undefined;
88
- externalId?: string | null | undefined;
89
- }>>;
90
- //# sourceMappingURL=create-user-token-request.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-user-token-request.d.ts","sourceRoot":"","sources":["../../../../../../src/project-client/services/jwt/models/create-user-token-request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;GAOjC,CAAC;AAEH;;;;;;;GAOG;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE5E;;;GAGG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;GAczC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;GAcxC,CAAC"}
@@ -1,54 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createUserTokenRequestRequest = exports.createUserTokenRequestResponse = exports.createUserTokenRequest = void 0;
4
- const zod_1 = require("zod");
5
- /**
6
- * The shape of the model inside the application code - what the users use
7
- */
8
- exports.createUserTokenRequest = zod_1.z.lazy(() => {
9
- return zod_1.z.object({
10
- email: zod_1.z.string().max(255).optional().nullable(),
11
- expiry: zod_1.z.number().gte(1).optional().nullable(),
12
- externalId: zod_1.z.string().max(255).optional().nullable(),
13
- name: zod_1.z.string().max(255).optional().nullable(),
14
- });
15
- });
16
- /**
17
- * The shape of the model mapping from the api schema into the application shape.
18
- * Is equal to application shape if all property names match the api schema
19
- */
20
- exports.createUserTokenRequestResponse = zod_1.z.lazy(() => {
21
- return zod_1.z
22
- .object({
23
- email: zod_1.z.string().max(255).optional().nullable(),
24
- expiry: zod_1.z.number().gte(1).optional().nullable(),
25
- external_id: zod_1.z.string().max(255).optional().nullable(),
26
- name: zod_1.z.string().max(255).optional().nullable(),
27
- })
28
- .transform((data) => ({
29
- email: data['email'],
30
- expiry: data['expiry'],
31
- externalId: data['external_id'],
32
- name: data['name'],
33
- }));
34
- });
35
- /**
36
- * The shape of the model mapping from the application shape into the api schema.
37
- * Is equal to application shape if all property names match the api schema
38
- */
39
- exports.createUserTokenRequestRequest = zod_1.z.lazy(() => {
40
- return zod_1.z
41
- .object({
42
- email: zod_1.z.string().max(255).optional().nullable(),
43
- expiry: zod_1.z.number().gte(1).optional().nullable(),
44
- externalId: zod_1.z.string().max(255).optional().nullable(),
45
- name: zod_1.z.string().max(255).optional().nullable(),
46
- })
47
- .transform((data) => ({
48
- email: data['email'],
49
- expiry: data['expiry'],
50
- external_id: data['externalId'],
51
- name: data['name'],
52
- }));
53
- });
54
- //# sourceMappingURL=create-user-token-request.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-user-token-request.js","sourceRoot":"","sources":["../../../../../../src/project-client/services/jwt/models/create-user-token-request.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB;;GAEG;AACU,QAAA,sBAAsB,GAAG,OAAC,CAAC,IAAI,CAAC,GAAG,EAAE;IAChD,OAAO,OAAC,CAAC,MAAM,CAAC;QACd,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;QAChD,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;QAC/C,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;QACrD,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;KAChD,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAYH;;;GAGG;A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AAQ,EAAE,CAAC,QAAQ,EAAE;QACrD,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;KAChD,CAAC;SACD,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACpB,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC;QACpB,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC;QACtB,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC;QAC/B,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC;KACnB,CAAC,CAAC,CAAC;AACR,CAAC,CAAC,CAAC"}
@@ -1,90 +0,0 @@
1
- import { z } from 'zod';
2
- /**
3
- * The shape of the model inside the application code - what the users use
4
- */
5
- export declare const createUserTokenRequest: z.ZodLazy<z.ZodObject<{
6
- email: z.ZodNullable<z.ZodOptional<z.ZodString>>;
7
- expiry: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
8
- externalId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
9
- name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
10
- }, "strip", z.ZodTypeAny, {
11
- email?: string | null | undefined;
12
- name?: string | null | undefined;
13
- expiry?: number | null | undefined;
14
- externalId?: string | null | undefined;
15
- }, {
16
- email?: string | null | undefined;
17
- name?: string | null | undefined;
18
- expiry?: number | null | undefined;
19
- externalId?: string | null | undefined;
20
- }>>;
21
- /**
22
- *
23
- * @typedef {CreateUserTokenRequest} createUserTokenRequest
24
- * @property {string} - The user's email.
25
- * @property {number} - The duration for which the token is valid (in seconds)
26
- * @property {string} - A unique string that MagicBell can utilize to identify the user uniquely. We recommend setting this attribute to the ID of the user in your database. Provide the external id if the user's email is unavailable.
27
- * @property {string} - The name of the token.
28
- */
29
- export type CreateUserTokenRequest = z.infer<typeof createUserTokenRequest>;
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 declare const createUserTokenRequestResponse: z.ZodLazy<z.ZodEffects<z.ZodObject<{
35
- email: z.ZodNullable<z.ZodOptional<z.ZodString>>;
36
- expiry: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
37
- external_id: z.ZodNullable<z.ZodOptional<z.ZodString>>;
38
- name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
39
- }, "strip", z.ZodTypeAny, {
40
- email?: string | null | undefined;
41
- name?: string | null | undefined;
42
- expiry?: number | null | undefined;
43
- external_id?: string | null | undefined;
44
- }, {
45
- email?: string | null | undefined;
46
- name?: string | null | undefined;
47
- expiry?: number | null | undefined;
48
- external_id?: string | null | undefined;
49
- }>, {
50
- email: string | null | undefined;
51
- expiry: number | null | undefined;
52
- externalId: string | null | undefined;
53
- name: string | null | undefined;
54
- }, {
55
- email?: string | null | undefined;
56
- name?: string | null | undefined;
57
- expiry?: number | null | undefined;
58
- external_id?: string | null | undefined;
59
- }>>;
60
- /**
61
- * The shape of the model mapping from the application shape into the api schema.
62
- * Is equal to application shape if all property names match the api schema
63
- */
64
- export declare const createUserTokenRequestRequest: z.ZodLazy<z.ZodEffects<z.ZodObject<{
65
- email: z.ZodNullable<z.ZodOptional<z.ZodString>>;
66
- expiry: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
67
- externalId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
68
- name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
69
- }, "strip", z.ZodTypeAny, {
70
- email?: string | null | undefined;
71
- name?: string | null | undefined;
72
- expiry?: number | null | undefined;
73
- externalId?: string | null | undefined;
74
- }, {
75
- email?: string | null | undefined;
76
- name?: string | null | undefined;
77
- expiry?: number | null | undefined;
78
- externalId?: string | null | undefined;
79
- }>, {
80
- email: string | null | undefined;
81
- expiry: number | null | undefined;
82
- external_id: string | null | undefined;
83
- name: string | null | undefined;
84
- }, {
85
- email?: string | null | undefined;
86
- name?: string | null | undefined;
87
- expiry?: number | null | undefined;
88
- externalId?: string | null | undefined;
89
- }>>;
90
- //# sourceMappingURL=create-user-token-request.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-user-token-request.d.ts","sourceRoot":"","sources":["../../../../../../src/project-client/services/jwt/models/create-user-token-request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;GAOjC,CAAC;AAEH;;;;;;;GAOG;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE5E;;;GAGG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;GAczC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;GAcxC,CAAC"}
@@ -1,51 +0,0 @@
1
- import { z } from 'zod';
2
- /**
3
- * The shape of the model inside the application code - what the users use
4
- */
5
- export const createUserTokenRequest = z.lazy(() => {
6
- return z.object({
7
- email: z.string().max(255).optional().nullable(),
8
- expiry: z.number().gte(1).optional().nullable(),
9
- externalId: z.string().max(255).optional().nullable(),
10
- name: z.string().max(255).optional().nullable(),
11
- });
12
- });
13
- /**
14
- * The shape of the model mapping from the api schema into the application shape.
15
- * Is equal to application shape if all property names match the api schema
16
- */
17
- export const createUserTokenRequestResponse = z.lazy(() => {
18
- return z
19
- .object({
20
- email: z.string().max(255).optional().nullable(),
21
- expiry: z.number().gte(1).optional().nullable(),
22
- external_id: z.string().max(255).optional().nullable(),
23
- name: z.string().max(255).optional().nullable(),
24
- })
25
- .transform((data) => ({
26
- email: data['email'],
27
- expiry: data['expiry'],
28
- externalId: data['external_id'],
29
- name: data['name'],
30
- }));
31
- });
32
- /**
33
- * The shape of the model mapping from the application shape into the api schema.
34
- * Is equal to application shape if all property names match the api schema
35
- */
36
- export const createUserTokenRequestRequest = z.lazy(() => {
37
- return z
38
- .object({
39
- email: z.string().max(255).optional().nullable(),
40
- expiry: z.number().gte(1).optional().nullable(),
41
- externalId: z.string().max(255).optional().nullable(),
42
- name: z.string().max(255).optional().nullable(),
43
- })
44
- .transform((data) => ({
45
- email: data['email'],
46
- expiry: data['expiry'],
47
- external_id: data['externalId'],
48
- name: data['name'],
49
- }));
50
- });
51
- //# sourceMappingURL=create-user-token-request.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-user-token-request.js","sourceRoot":"","sources":["../../../../../../src/project-client/services/jwt/models/create-user-token-request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;IAChD,OAAO,CAAC,CAAC,MAAM,CAAC;QACd,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;QAChD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;QAC/C,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;QACrD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;KAChD,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAYH;;;GAGG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;IACxD,OAAO,CAAC;SACL,MAAM,CAAC;QACN,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAA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CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACpB,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC;QACpB,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC;QACtB,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC;QAC/B,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC;KACnB,CAAC,CAAC,CAAC;AACR,CAAC,CAAC,CAAC"}
@@ -1,63 +0,0 @@
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 createUserTokenRequest = z.lazy(() => {
7
- return z.object({
8
- email: z.string().max(255).optional().nullable(),
9
- expiry: z.number().gte(1).optional().nullable(),
10
- externalId: z.string().max(255).optional().nullable(),
11
- name: z.string().max(255).optional().nullable(),
12
- });
13
- });
14
-
15
- /**
16
- *
17
- * @typedef {CreateUserTokenRequest} createUserTokenRequest
18
- * @property {string} - The user's email.
19
- * @property {number} - The duration for which the token is valid (in seconds)
20
- * @property {string} - A unique string that MagicBell can utilize to identify the user uniquely. We recommend setting this attribute to the ID of the user in your database. Provide the external id if the user's email is unavailable.
21
- * @property {string} - The name of the token.
22
- */
23
- export type CreateUserTokenRequest = z.infer<typeof createUserTokenRequest>;
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 createUserTokenRequestResponse = z.lazy(() => {
30
- return z
31
- .object({
32
- email: z.string().max(255).optional().nullable(),
33
- expiry: z.number().gte(1).optional().nullable(),
34
- external_id: z.string().max(255).optional().nullable(),
35
- name: z.string().max(255).optional().nullable(),
36
- })
37
- .transform((data) => ({
38
- email: data['email'],
39
- expiry: data['expiry'],
40
- externalId: data['external_id'],
41
- name: data['name'],
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 createUserTokenRequestRequest = z.lazy(() => {
50
- return z
51
- .object({
52
- email: z.string().max(255).optional().nullable(),
53
- expiry: z.number().gte(1).optional().nullable(),
54
- externalId: z.string().max(255).optional().nullable(),
55
- name: z.string().max(255).optional().nullable(),
56
- })
57
- .transform((data) => ({
58
- email: data['email'],
59
- expiry: data['expiry'],
60
- external_id: data['externalId'],
61
- name: data['name'],
62
- }));
63
- });