@teardown/schemas 0.1.32 → 0.1.33

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teardown/schemas",
3
- "version": "0.1.32",
3
+ "version": "0.1.33",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -93,7 +93,7 @@
93
93
  },
94
94
  "dependencies": {
95
95
  "@sinclair/typebox": "^0.34.41",
96
- "@teardown/types": "0.1.32"
96
+ "@teardown/types": "0.1.33"
97
97
  },
98
98
  "devDependencies": {
99
99
  "@biomejs/biome": "2.3.7",
@@ -1,6 +1,5 @@
1
1
  import { type Static, Type } from "@sinclair/typebox";
2
- import { DevicePlatform } from "@teardown/types";
3
- import type { DevicePlatformEnum } from "@teardown/types";
2
+ import { DevicePlatformEnum } from "@teardown/types";
4
3
  import type { AssertSchemaCompatibleWithRow, AssertTrue } from "../../common";
5
4
 
6
5
  /**
@@ -10,7 +9,7 @@ import type { AssertSchemaCompatibleWithRow, AssertTrue } from "../../common";
10
9
  /**
11
10
  * Device platform
12
11
  */
13
- export const DevicePlatformSchema = Type.Enum(DevicePlatform, { error: "platform is required" });
12
+ export const DevicePlatformSchema = Type.Enum(DevicePlatformEnum, { error: "platform is required" });
14
13
  export type DevicePlatform = Static<typeof DevicePlatformSchema>;
15
14
 
16
15
  /**
@@ -2,7 +2,7 @@ import { type Static, Type } from "@sinclair/typebox";
2
2
  import { DevicePlatformEnum } from "@teardown/types";
3
3
  import { EmailSchema } from "../../common";
4
4
 
5
- export type { DevicePlatformEnum };
5
+ export { DevicePlatformEnum };
6
6
 
7
7
  /**
8
8
  * Application info schema
@@ -68,12 +68,11 @@ export const DeviceUpdateInfoSchema = Type.Object({
68
68
  });
69
69
  export type DeviceUpdateInfo = Static<typeof DeviceUpdateInfoSchema>;
70
70
 
71
- export const NotificationPlatform = {
72
- APNS: "APNS", // Apple Push Notification Service
73
- FCM: "FCM", // Firebase Cloud Messaging
74
- EXPO: "EXPO", // Expo Push Notifications
75
- } as const;
76
- export type NotificationPlatformEnum = (typeof NotificationPlatform)[keyof typeof NotificationPlatform];
71
+ export enum NotificationPlatformEnum {
72
+ APNS = "APNS", // Apple Push Notification Service
73
+ FCM = "FCM", // Firebase Cloud Messaging
74
+ EXPO = "EXPO", // Expo Push Notifications
75
+ }
77
76
 
78
77
  /**
79
78
  * Push notification info schema
@@ -82,7 +81,7 @@ export const PushNotificationInfoSchema = Type.Object({
82
81
  enabled: Type.Boolean({ error: "enabled is required" }),
83
82
  granted: Type.Boolean({ error: "granted is required" }),
84
83
  token: Type.Union([Type.String({ error: "token is required" }), Type.Null()]),
85
- platform: Type.Enum(NotificationPlatform, { error: "platform is required" }),
84
+ platform: Type.Enum(NotificationPlatformEnum, { error: "platform is required" }),
86
85
  });
87
86
  export type PushNotificationInfo = Static<typeof PushNotificationInfoSchema>;
88
87
 
@@ -143,20 +142,30 @@ export const IdentifyRequestSchema = Type.Object({
143
142
  });
144
143
  export type IdentifyRequest = Static<typeof IdentifyRequestSchema>;
145
144
 
146
- /** Version status values */
147
- export const IdentifyVersionStatus = {
148
- /** A new version is available */
149
- UPDATE_AVAILABLE: "UPDATE_AVAILABLE",
150
- /** An update is recommended */
151
- UPDATE_RECOMMENDED: "UPDATE_RECOMMENDED",
152
- /** An update is required */
153
- UPDATE_REQUIRED: "UPDATE_REQUIRED",
154
- /** The current version is valid & up to date */
155
- UP_TO_DATE: "UP_TO_DATE",
156
- /** The version or build has been disabled */
157
- DISABLED: "DISABLED",
158
- } as const;
159
- export type IdentifyVersionStatusEnum = (typeof IdentifyVersionStatus)[keyof typeof IdentifyVersionStatus];
145
+ enum IdentifyVersionStatusEnum {
146
+ /**
147
+ * A new version is available
148
+ */
149
+ UPDATE_AVAILABLE = "UPDATE_AVAILABLE",
150
+ /**
151
+ * An update is recommended
152
+ */
153
+ UPDATE_RECOMMENDED = "UPDATE_RECOMMENDED",
154
+ /**
155
+ * An update is required
156
+ */
157
+ UPDATE_REQUIRED = "UPDATE_REQUIRED",
158
+ /**
159
+ * The current version is valid & up to date
160
+ */
161
+ UP_TO_DATE = "UP_TO_DATE",
162
+ /**
163
+ * The version or build has been disabled
164
+ */
165
+ DISABLED = "DISABLED",
166
+ }
167
+
168
+ export { IdentifyVersionStatusEnum };
160
169
 
161
170
  export const UpdateInfoSchema = Type.Object({
162
171
  version: Type.String({ error: "version is required" }),
@@ -167,25 +176,25 @@ export const UpdateInfoSchema = Type.Object({
167
176
  export type UpdateInfo = Static<typeof UpdateInfoSchema>;
168
177
 
169
178
  export const UpToDateInfoSchema = Type.Object({
170
- status: Type.Literal(IdentifyVersionStatus.UP_TO_DATE),
179
+ status: Type.Literal(IdentifyVersionStatusEnum.UP_TO_DATE),
171
180
  update: Type.Null(),
172
181
  });
173
182
  export type UpToDateInfo = Static<typeof UpToDateInfoSchema>;
174
183
 
175
184
  export const UpdateRequiredInfoSchema = Type.Object({
176
- status: Type.Literal(IdentifyVersionStatus.UPDATE_REQUIRED),
185
+ status: Type.Literal(IdentifyVersionStatusEnum.UPDATE_REQUIRED),
177
186
  update: UpdateInfoSchema,
178
187
  });
179
188
  export type UpdateRequiredInfo = Static<typeof UpdateRequiredInfoSchema>;
180
189
 
181
190
  export const UpdateAvailableInfoSchema = Type.Object({
182
- status: Type.Literal(IdentifyVersionStatus.UPDATE_AVAILABLE),
191
+ status: Type.Literal(IdentifyVersionStatusEnum.UPDATE_AVAILABLE),
183
192
  update: UpdateInfoSchema,
184
193
  });
185
194
  export type UpdateAvailableInfo = Static<typeof UpdateAvailableInfoSchema>;
186
195
 
187
196
  export const UpdateRecommendedInfoSchema = Type.Object({
188
- status: Type.Literal(IdentifyVersionStatus.UPDATE_RECOMMENDED),
197
+ status: Type.Literal(IdentifyVersionStatusEnum.UPDATE_RECOMMENDED),
189
198
  update: UpdateInfoSchema,
190
199
  });
191
200
  export type UpdateRecommendedInfo = Static<typeof UpdateRecommendedInfoSchema>;
@@ -194,7 +203,7 @@ export const VersionInfoSchema = Type.Object({
194
203
  /**
195
204
  * The status of the version
196
205
  */
197
- status: Type.Enum(IdentifyVersionStatus, { error: "status is required" }),
206
+ status: Type.Enum(IdentifyVersionStatusEnum, { error: "status is required" }),
198
207
  update: Type.Union([UpdateAvailableInfoSchema, UpdateRecommendedInfoSchema, Type.Null()]),
199
208
  });
200
209
  export type VersionInfo = Static<typeof VersionInfoSchema>;