@teardown/schemas 0.1.31 → 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.31",
3
+ "version": "0.1.32",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -12,6 +12,78 @@
12
12
  "main": "./src/index.ts",
13
13
  "module": "./src/index.ts",
14
14
  "types": "./src/index.ts",
15
+ "exports": {
16
+ ".": {
17
+ "types": "./src/index.ts",
18
+ "import": "./src/index.ts",
19
+ "default": "./src/index.ts"
20
+ },
21
+ "./common": {
22
+ "types": "./src/common/index.ts",
23
+ "import": "./src/common/index.ts",
24
+ "default": "./src/common/index.ts"
25
+ },
26
+ "./devices": {
27
+ "types": "./src/modules/devices/index.ts",
28
+ "import": "./src/modules/devices/index.ts",
29
+ "default": "./src/modules/devices/index.ts"
30
+ },
31
+ "./environment": {
32
+ "types": "./src/modules/environment/index.ts",
33
+ "import": "./src/modules/environment/index.ts",
34
+ "default": "./src/modules/environment/index.ts"
35
+ },
36
+ "./identify": {
37
+ "types": "./src/modules/identify/index.ts",
38
+ "import": "./src/modules/identify/index.ts",
39
+ "default": "./src/modules/identify/index.ts"
40
+ },
41
+ "./me": {
42
+ "types": "./src/modules/me/index.ts",
43
+ "import": "./src/modules/me/index.ts",
44
+ "default": "./src/modules/me/index.ts"
45
+ },
46
+ "./orgs": {
47
+ "types": "./src/modules/orgs/index.ts",
48
+ "import": "./src/modules/orgs/index.ts",
49
+ "default": "./src/modules/orgs/index.ts"
50
+ },
51
+ "./personas": {
52
+ "types": "./src/modules/personas/index.ts",
53
+ "import": "./src/modules/personas/index.ts",
54
+ "default": "./src/modules/personas/index.ts"
55
+ },
56
+ "./projects": {
57
+ "types": "./src/modules/projects/index.ts",
58
+ "import": "./src/modules/projects/index.ts",
59
+ "default": "./src/modules/projects/index.ts"
60
+ },
61
+ "./sessions": {
62
+ "types": "./src/modules/sessions/index.ts",
63
+ "import": "./src/modules/sessions/index.ts",
64
+ "default": "./src/modules/sessions/index.ts"
65
+ },
66
+ "./versions": {
67
+ "types": "./src/modules/versions/index.ts",
68
+ "import": "./src/modules/versions/index.ts",
69
+ "default": "./src/modules/versions/index.ts"
70
+ },
71
+ "./builds": {
72
+ "types": "./src/modules/builds/index.ts",
73
+ "import": "./src/modules/builds/index.ts",
74
+ "default": "./src/modules/builds/index.ts"
75
+ },
76
+ "./analytics": {
77
+ "types": "./src/modules/analytics/index.ts",
78
+ "import": "./src/modules/analytics/index.ts",
79
+ "default": "./src/modules/analytics/index.ts"
80
+ },
81
+ "./events": {
82
+ "types": "./src/modules/events/index.ts",
83
+ "import": "./src/modules/events/index.ts",
84
+ "default": "./src/modules/events/index.ts"
85
+ }
86
+ },
15
87
  "scripts": {
16
88
  "dev": "bun run typecheck --watch",
17
89
  "typecheck": "tsc --noEmit --project ./tsconfig.json",
@@ -21,7 +93,7 @@
21
93
  },
22
94
  "dependencies": {
23
95
  "@sinclair/typebox": "^0.34.41",
24
- "@teardown/types": "0.1.31"
96
+ "@teardown/types": "0.1.32"
25
97
  },
26
98
  "devDependencies": {
27
99
  "@biomejs/biome": "2.3.7",
@@ -1,5 +1,6 @@
1
1
  import { type Static, Type } from "@sinclair/typebox";
2
- import { DevicePlatformEnum } from "@teardown/types";
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(DevicePlatformEnum, { error: "platform is required" });
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 enum NotificationPlatformEnum {
72
- APNS = "APNS", // Apple Push Notification Service
73
- FCM = "FCM", // Firebase Cloud Messaging
74
- EXPO = "EXPO", // Expo Push Notifications
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(NotificationPlatformEnum, { error: "platform is required" }),
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
- export 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
- }
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(IdentifyVersionStatusEnum.UP_TO_DATE),
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(IdentifyVersionStatusEnum.UPDATE_REQUIRED),
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(IdentifyVersionStatusEnum.UPDATE_AVAILABLE),
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(IdentifyVersionStatusEnum.UPDATE_RECOMMENDED),
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(IdentifyVersionStatusEnum, { error: "status is required" }),
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>;