@teardown/schemas 0.1.30 → 0.1.32
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.
|
|
3
|
+
"version": "0.1.32",
|
|
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.
|
|
96
|
+
"@teardown/types": "0.1.32"
|
|
97
97
|
},
|
|
98
98
|
"devDependencies": {
|
|
99
99
|
"@biomejs/biome": "2.3.7",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type Static, Type } from "@sinclair/typebox";
|
|
2
|
-
import {
|
|
2
|
+
import { DevicePlatform } from "@teardown/types";
|
|
3
|
+
import type { DevicePlatformEnum } from "@teardown/types";
|
|
3
4
|
import type { AssertSchemaCompatibleWithRow, AssertTrue } from "../../common";
|
|
4
5
|
|
|
5
6
|
/**
|
|
@@ -9,7 +10,7 @@ import type { AssertSchemaCompatibleWithRow, AssertTrue } from "../../common";
|
|
|
9
10
|
/**
|
|
10
11
|
* Device platform
|
|
11
12
|
*/
|
|
12
|
-
export const DevicePlatformSchema = Type.Enum(
|
|
13
|
+
export const DevicePlatformSchema = Type.Enum(DevicePlatform, { error: "platform is required" });
|
|
13
14
|
export type DevicePlatform = Static<typeof DevicePlatformSchema>;
|
|
14
15
|
|
|
15
16
|
/**
|
|
@@ -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 { DevicePlatformEnum };
|
|
5
|
+
export type { DevicePlatformEnum };
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Application info schema
|
|
@@ -68,11 +68,12 @@ export const DeviceUpdateInfoSchema = Type.Object({
|
|
|
68
68
|
});
|
|
69
69
|
export type DeviceUpdateInfo = Static<typeof DeviceUpdateInfoSchema>;
|
|
70
70
|
|
|
71
|
-
export
|
|
72
|
-
APNS
|
|
73
|
-
FCM
|
|
74
|
-
EXPO
|
|
75
|
-
}
|
|
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];
|
|
76
77
|
|
|
77
78
|
/**
|
|
78
79
|
* Push notification info schema
|
|
@@ -81,7 +82,7 @@ export const PushNotificationInfoSchema = Type.Object({
|
|
|
81
82
|
enabled: Type.Boolean({ error: "enabled is required" }),
|
|
82
83
|
granted: Type.Boolean({ error: "granted is required" }),
|
|
83
84
|
token: Type.Union([Type.String({ error: "token is required" }), Type.Null()]),
|
|
84
|
-
platform: Type.Enum(
|
|
85
|
+
platform: Type.Enum(NotificationPlatform, { error: "platform is required" }),
|
|
85
86
|
});
|
|
86
87
|
export type PushNotificationInfo = Static<typeof PushNotificationInfoSchema>;
|
|
87
88
|
|
|
@@ -142,28 +143,20 @@ export const IdentifyRequestSchema = Type.Object({
|
|
|
142
143
|
});
|
|
143
144
|
export type IdentifyRequest = Static<typeof IdentifyRequestSchema>;
|
|
144
145
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
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
|
-
}
|
|
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];
|
|
167
160
|
|
|
168
161
|
export const UpdateInfoSchema = Type.Object({
|
|
169
162
|
version: Type.String({ error: "version is required" }),
|
|
@@ -174,25 +167,25 @@ export const UpdateInfoSchema = Type.Object({
|
|
|
174
167
|
export type UpdateInfo = Static<typeof UpdateInfoSchema>;
|
|
175
168
|
|
|
176
169
|
export const UpToDateInfoSchema = Type.Object({
|
|
177
|
-
status: Type.Literal(
|
|
170
|
+
status: Type.Literal(IdentifyVersionStatus.UP_TO_DATE),
|
|
178
171
|
update: Type.Null(),
|
|
179
172
|
});
|
|
180
173
|
export type UpToDateInfo = Static<typeof UpToDateInfoSchema>;
|
|
181
174
|
|
|
182
175
|
export const UpdateRequiredInfoSchema = Type.Object({
|
|
183
|
-
status: Type.Literal(
|
|
176
|
+
status: Type.Literal(IdentifyVersionStatus.UPDATE_REQUIRED),
|
|
184
177
|
update: UpdateInfoSchema,
|
|
185
178
|
});
|
|
186
179
|
export type UpdateRequiredInfo = Static<typeof UpdateRequiredInfoSchema>;
|
|
187
180
|
|
|
188
181
|
export const UpdateAvailableInfoSchema = Type.Object({
|
|
189
|
-
status: Type.Literal(
|
|
182
|
+
status: Type.Literal(IdentifyVersionStatus.UPDATE_AVAILABLE),
|
|
190
183
|
update: UpdateInfoSchema,
|
|
191
184
|
});
|
|
192
185
|
export type UpdateAvailableInfo = Static<typeof UpdateAvailableInfoSchema>;
|
|
193
186
|
|
|
194
187
|
export const UpdateRecommendedInfoSchema = Type.Object({
|
|
195
|
-
status: Type.Literal(
|
|
188
|
+
status: Type.Literal(IdentifyVersionStatus.UPDATE_RECOMMENDED),
|
|
196
189
|
update: UpdateInfoSchema,
|
|
197
190
|
});
|
|
198
191
|
export type UpdateRecommendedInfo = Static<typeof UpdateRecommendedInfoSchema>;
|
|
@@ -201,7 +194,7 @@ export const VersionInfoSchema = Type.Object({
|
|
|
201
194
|
/**
|
|
202
195
|
* The status of the version
|
|
203
196
|
*/
|
|
204
|
-
status: Type.Enum(
|
|
197
|
+
status: Type.Enum(IdentifyVersionStatus, { error: "status is required" }),
|
|
205
198
|
update: Type.Union([UpdateAvailableInfoSchema, UpdateRecommendedInfoSchema, Type.Null()]),
|
|
206
199
|
});
|
|
207
200
|
export type VersionInfo = Static<typeof VersionInfoSchema>;
|