@teardown/ingest-api 0.0.20 → 0.0.21-alpha.11
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/dist/client/client.d.ts +233 -3
- package/dist/client/types.d.ts +18 -34
- package/dist/schemas/index.d.ts +1 -1
- package/dist/schemas/index.js +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.js +2 -1
- package/dist/vendored/schemas/identify.d.ts +303 -0
- package/dist/vendored/schemas/identify.js +260 -0
- package/dist/vendored/types/generated-consts.d.ts +47 -0
- package/dist/vendored/types/generated-consts.js +54 -0
- package/package.json +19 -15
- package/dist/schemas/identify.schema.d.ts +0 -203
- package/dist/schemas/identify.schema.js +0 -131
- package/dist/types/app.d.ts +0 -9
- package/dist/types/app.js +0 -1
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
/**
|
|
3
|
-
* OS types
|
|
4
|
-
*/
|
|
5
|
-
export var OSType;
|
|
6
|
-
(function (OSType) {
|
|
7
|
-
OSType["IOS"] = "IOS";
|
|
8
|
-
OSType["ANDROID"] = "ANDROID";
|
|
9
|
-
OSType["WEB"] = "WEB";
|
|
10
|
-
OSType["WINDOWS"] = "WINDOWS";
|
|
11
|
-
OSType["MACOS"] = "MACOS";
|
|
12
|
-
OSType["LINUX"] = "LINUX";
|
|
13
|
-
})(OSType || (OSType = {}));
|
|
14
|
-
/**
|
|
15
|
-
* Application info schema
|
|
16
|
-
*/
|
|
17
|
-
export const ApplicationInfoSchema = z.object({
|
|
18
|
-
version: z.string(),
|
|
19
|
-
build_number: z.string(),
|
|
20
|
-
});
|
|
21
|
-
/**
|
|
22
|
-
* OS info schema
|
|
23
|
-
*/
|
|
24
|
-
export const OSInfoSchema = z.object({
|
|
25
|
-
/**
|
|
26
|
-
* OS type
|
|
27
|
-
*/
|
|
28
|
-
type: z.enum(OSType),
|
|
29
|
-
name: z.string(),
|
|
30
|
-
version: z.string(),
|
|
31
|
-
});
|
|
32
|
-
/**
|
|
33
|
-
* Hardware info schema
|
|
34
|
-
*/
|
|
35
|
-
export const HardwareInfoSchema = z.object({
|
|
36
|
-
device_name: z.string(),
|
|
37
|
-
device_type: z.string(),
|
|
38
|
-
device_brand: z.string(),
|
|
39
|
-
});
|
|
40
|
-
export const EmergencyLaunchSchema = z.union([
|
|
41
|
-
z.object({
|
|
42
|
-
is_emergency_launch: z.literal(true),
|
|
43
|
-
reason: z.string(),
|
|
44
|
-
}),
|
|
45
|
-
z.object({
|
|
46
|
-
is_emergency_launch: z.literal(false),
|
|
47
|
-
reason: z.never().optional(),
|
|
48
|
-
}),
|
|
49
|
-
]);
|
|
50
|
-
/**
|
|
51
|
-
* Update info schema
|
|
52
|
-
*/
|
|
53
|
-
export const UpdateInfoSchema = z.object({
|
|
54
|
-
is_enabled: z.boolean(),
|
|
55
|
-
update_id: z.string(),
|
|
56
|
-
update_channel: z.string(),
|
|
57
|
-
runtime_version: z.string(),
|
|
58
|
-
emergency_launch: EmergencyLaunchSchema,
|
|
59
|
-
is_embedded_launch: z.boolean(),
|
|
60
|
-
created_at: z.coerce.date(),
|
|
61
|
-
});
|
|
62
|
-
/**
|
|
63
|
-
* Push notification info schema
|
|
64
|
-
*/
|
|
65
|
-
export const PushNotificationInfoSchema = z.object({
|
|
66
|
-
token: z.string(),
|
|
67
|
-
platform: z.enum(["APNS", "FCM", "EXPO"]),
|
|
68
|
-
});
|
|
69
|
-
/**
|
|
70
|
-
* Device info schema
|
|
71
|
-
*/
|
|
72
|
-
export const DeviceInfoSchema = z.object({
|
|
73
|
-
/**
|
|
74
|
-
* Application info, required
|
|
75
|
-
*/
|
|
76
|
-
application: ApplicationInfoSchema,
|
|
77
|
-
/**
|
|
78
|
-
* Update info (optional) - not all builds will have an update
|
|
79
|
-
*/
|
|
80
|
-
update: UpdateInfoSchema.nullable(),
|
|
81
|
-
/**
|
|
82
|
-
* Hardware info, required
|
|
83
|
-
*/
|
|
84
|
-
hardware: HardwareInfoSchema,
|
|
85
|
-
/**
|
|
86
|
-
* OS info, required
|
|
87
|
-
*/
|
|
88
|
-
os: OSInfoSchema,
|
|
89
|
-
/**
|
|
90
|
-
* Push notification info, optional
|
|
91
|
-
*/
|
|
92
|
-
push_notification: PushNotificationInfoSchema.optional(),
|
|
93
|
-
});
|
|
94
|
-
/**
|
|
95
|
-
* Persona info schema (optional fields)
|
|
96
|
-
* Matches personas table structure
|
|
97
|
-
*/
|
|
98
|
-
export const PersonaInfoSchema = z.object({
|
|
99
|
-
user_id: z.string().optional(),
|
|
100
|
-
email: z
|
|
101
|
-
.string()
|
|
102
|
-
.refine((val) => !val || /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(val), {
|
|
103
|
-
message: "Invalid email format",
|
|
104
|
-
})
|
|
105
|
-
.optional(),
|
|
106
|
-
name: z.string().optional(),
|
|
107
|
-
});
|
|
108
|
-
/**
|
|
109
|
-
* Identify request schema
|
|
110
|
-
* Ties a device to a persona with optional persona data
|
|
111
|
-
*/
|
|
112
|
-
export const IdentifyRequestSchema = z.object({
|
|
113
|
-
device: DeviceInfoSchema,
|
|
114
|
-
persona: PersonaInfoSchema.optional(),
|
|
115
|
-
});
|
|
116
|
-
/**
|
|
117
|
-
* Identify response schema
|
|
118
|
-
*/
|
|
119
|
-
export const IdentifyResponseSchema = z.object({
|
|
120
|
-
success: z.literal(true),
|
|
121
|
-
session_id: z.string(),
|
|
122
|
-
device_id: z.string(),
|
|
123
|
-
persona_id: z.string(),
|
|
124
|
-
});
|
|
125
|
-
export const IdentifyErrorResponseSchema = z.object({
|
|
126
|
-
success: z.literal(false),
|
|
127
|
-
error: z.object({
|
|
128
|
-
code: z.string(),
|
|
129
|
-
message: z.string(),
|
|
130
|
-
}),
|
|
131
|
-
});
|
package/dist/types/app.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Elysia } from "elysia";
|
|
2
|
-
/**
|
|
3
|
-
* Type placeholder for IngestApp
|
|
4
|
-
* This should match the type from @teardown/ingest but is defined here
|
|
5
|
-
* to avoid runtime dependency on the private package
|
|
6
|
-
*
|
|
7
|
-
* When developing locally, you can override this with the actual type from @teardown/ingest
|
|
8
|
-
*/
|
|
9
|
-
export type IngestApp = Elysia<any>;
|
package/dist/types/app.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|