@teardown/schemas 2.0.29 → 2.0.30
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": "2.0.
|
|
3
|
+
"version": "2.0.30",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -98,11 +98,11 @@
|
|
|
98
98
|
},
|
|
99
99
|
"dependencies": {
|
|
100
100
|
"@sinclair/typebox": "^0.34.41",
|
|
101
|
-
"@teardown/types": "2.0.
|
|
101
|
+
"@teardown/types": "2.0.30"
|
|
102
102
|
},
|
|
103
103
|
"devDependencies": {
|
|
104
104
|
"@biomejs/biome": "2.3.10",
|
|
105
|
-
"@teardown/tsconfig": "2.0.
|
|
105
|
+
"@teardown/tsconfig": "2.0.30",
|
|
106
106
|
"typescript": "5.9.3"
|
|
107
107
|
},
|
|
108
108
|
"peerDependencies": {
|
|
@@ -195,6 +195,7 @@ export const UpdateInfoSchema = Type.Object({
|
|
|
195
195
|
build: Type.String({ error: "build is required" }),
|
|
196
196
|
update_id: Type.String({ error: "update_id is required" }),
|
|
197
197
|
effective_date: Type.Date({ error: "effective_date is required" }),
|
|
198
|
+
release_notes: Type.Union([Type.String(), Type.Null()]),
|
|
198
199
|
});
|
|
199
200
|
export type UpdateInfo = Static<typeof UpdateInfoSchema>;
|
|
200
201
|
|
|
@@ -227,7 +228,7 @@ export const VersionInfoSchema = Type.Object({
|
|
|
227
228
|
* The status of the version
|
|
228
229
|
*/
|
|
229
230
|
status: Type.Enum(IdentifyVersionStatusEnum, { error: "status is required" }),
|
|
230
|
-
update: Type.Union([
|
|
231
|
+
update: Type.Union([UpdateInfoSchema, Type.Null()]),
|
|
231
232
|
});
|
|
232
233
|
export type VersionInfo = Static<typeof VersionInfoSchema>;
|
|
233
234
|
|
|
@@ -64,6 +64,7 @@ export const ProjectSchema = Type.Object({
|
|
|
64
64
|
type: Type.Enum(ProjectTypeEnum),
|
|
65
65
|
status: Type.Enum(ProjectStatusEnum),
|
|
66
66
|
push_notifications_enabled: Type.Boolean(),
|
|
67
|
+
first_session_at: Type.Union([Type.String(), Type.Null()]),
|
|
67
68
|
created_at: Type.String(),
|
|
68
69
|
updated_at: Type.String(),
|
|
69
70
|
});
|
|
@@ -165,6 +166,14 @@ export const ProjectErrorSchema = Type.Union([
|
|
|
165
166
|
code: Type.Literal("PROJECT_LIMIT_REACHED"),
|
|
166
167
|
message: Type.String(),
|
|
167
168
|
}),
|
|
169
|
+
Type.Object({
|
|
170
|
+
code: Type.Literal("CHECK_SESSIONS_FAILED"),
|
|
171
|
+
message: Type.String(),
|
|
172
|
+
}),
|
|
173
|
+
Type.Object({
|
|
174
|
+
code: Type.Literal("RATE_LIMITED"),
|
|
175
|
+
message: Type.String(),
|
|
176
|
+
}),
|
|
168
177
|
]);
|
|
169
178
|
export type ProjectError = Static<typeof ProjectErrorSchema>;
|
|
170
179
|
|
|
@@ -180,6 +189,67 @@ export type ProjectErrorResponse = Static<typeof ProjectErrorResponseSchema>;
|
|
|
180
189
|
export const ProjectRequestResponseSchema = Type.Union([ProjectResponseSchema, ProjectErrorResponseSchema]);
|
|
181
190
|
export type ProjectRequestResponse = Static<typeof ProjectRequestResponseSchema>;
|
|
182
191
|
|
|
192
|
+
/**
|
|
193
|
+
* Check sessions response schema
|
|
194
|
+
* Returns whether project has received sessions and updates first_session_at
|
|
195
|
+
*/
|
|
196
|
+
export const CheckSessionsResponseSchema = Type.Object({
|
|
197
|
+
success: Type.Literal(true),
|
|
198
|
+
data: Type.Object({
|
|
199
|
+
has_sessions: Type.Boolean(),
|
|
200
|
+
first_session_at: Type.Union([Type.String(), Type.Null()]),
|
|
201
|
+
project: ProjectSchema,
|
|
202
|
+
}),
|
|
203
|
+
});
|
|
204
|
+
export type CheckSessionsResponse = Static<typeof CheckSessionsResponseSchema>;
|
|
205
|
+
|
|
206
|
+
export const CheckSessionsRequestResponseSchema = Type.Union([CheckSessionsResponseSchema, ProjectErrorResponseSchema]);
|
|
207
|
+
export type CheckSessionsRequestResponse = Static<typeof CheckSessionsRequestResponseSchema>;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Nuke project data response schema
|
|
211
|
+
*/
|
|
212
|
+
export const NukeDataResultSchema = Type.Object({
|
|
213
|
+
sessionsDeleted: Type.Number(),
|
|
214
|
+
devicesDeleted: Type.Number(),
|
|
215
|
+
usersDeleted: Type.Number(),
|
|
216
|
+
eventsDeleted: Type.Number(),
|
|
217
|
+
versionsDeleted: Type.Number(),
|
|
218
|
+
buildsDeleted: Type.Number(),
|
|
219
|
+
});
|
|
220
|
+
export type NukeDataResult = Static<typeof NukeDataResultSchema>;
|
|
221
|
+
|
|
222
|
+
export const NukeDataResponseSchema = Type.Object({
|
|
223
|
+
success: Type.Literal(true),
|
|
224
|
+
data: NukeDataResultSchema,
|
|
225
|
+
});
|
|
226
|
+
export type NukeDataResponse = Static<typeof NukeDataResponseSchema>;
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Nuke data error schema
|
|
230
|
+
*/
|
|
231
|
+
export const NukeDataErrorSchema = Type.Union([
|
|
232
|
+
Type.Object({
|
|
233
|
+
code: Type.Literal("UNAUTHORIZED"),
|
|
234
|
+
message: Type.String(),
|
|
235
|
+
}),
|
|
236
|
+
Type.Object({
|
|
237
|
+
code: Type.Literal("NUKE_FAILED"),
|
|
238
|
+
message: Type.String(),
|
|
239
|
+
}),
|
|
240
|
+
Type.Object({
|
|
241
|
+
code: Type.Literal("PROJECT_NOT_FOUND"),
|
|
242
|
+
message: Type.String(),
|
|
243
|
+
}),
|
|
244
|
+
]);
|
|
245
|
+
export type NukeDataError = Static<typeof NukeDataErrorSchema>;
|
|
246
|
+
|
|
247
|
+
export const NukeDataErrorResponseSchema = Type.Object({
|
|
248
|
+
success: Type.Literal(false),
|
|
249
|
+
error: NukeDataErrorSchema,
|
|
250
|
+
});
|
|
251
|
+
export type NukeDataErrorResponse = Static<typeof NukeDataErrorResponseSchema>;
|
|
252
|
+
|
|
183
253
|
export type _CheckProjectRow = AssertTrue<AssertSchemaCompatibleWithRow<Project, "projects">>;
|
|
184
254
|
export type _CheckCreateProject = AssertTrue<AssertSchemaCompatibleWithInsert<CreateProject, "projects">>;
|
|
185
255
|
export type _CheckUpdateProject = AssertTrue<AssertSchemaCompatibleWithUpdate<UpdateProject, "projects">>;
|