@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
package/dist/client/client.d.ts
CHANGED
|
@@ -1,9 +1,239 @@
|
|
|
1
1
|
import { edenFetch } from "@elysiajs/eden";
|
|
2
|
-
import type { IngestApp } from "
|
|
3
|
-
export type ClientConfig = NonNullable<Parameters<typeof edenFetch<IngestApp>>[1]>;
|
|
4
|
-
export declare const client: (server: string, config?: import("@elysiajs/eden/fetch").EdenFetch.Config) => import("@elysiajs/eden/fetch").EdenFetch.Fn<
|
|
2
|
+
import type { IngestApp } from "@teardown/ingest/types";
|
|
3
|
+
export type ClientConfig = NonNullable<Parameters<typeof edenFetch<typeof IngestApp>>[1]>;
|
|
4
|
+
export declare const client: (server: string, config?: import("@elysiajs/eden/fetch").EdenFetch.Config) => import("@elysiajs/eden/fetch").EdenFetch.Fn<{
|
|
5
|
+
"/health": {
|
|
6
|
+
get: {
|
|
7
|
+
body: unknown;
|
|
8
|
+
params: {};
|
|
9
|
+
query: unknown;
|
|
10
|
+
headers: unknown;
|
|
11
|
+
response: {
|
|
12
|
+
200: import("@teardown/errors").ErrorResponse | {
|
|
13
|
+
status: string;
|
|
14
|
+
timestamp: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
} & {
|
|
20
|
+
"": {
|
|
21
|
+
get: {
|
|
22
|
+
body: unknown;
|
|
23
|
+
params: {};
|
|
24
|
+
query: unknown;
|
|
25
|
+
headers: unknown;
|
|
26
|
+
response: {
|
|
27
|
+
200: import("@teardown/errors").ErrorResponse | {
|
|
28
|
+
message: string;
|
|
29
|
+
version: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
} & {
|
|
35
|
+
"/v1/identify": {
|
|
36
|
+
post: {
|
|
37
|
+
body: {
|
|
38
|
+
device: {
|
|
39
|
+
application: {
|
|
40
|
+
version: string;
|
|
41
|
+
build_number: string;
|
|
42
|
+
};
|
|
43
|
+
update: {
|
|
44
|
+
is_enabled: boolean;
|
|
45
|
+
update_id: string;
|
|
46
|
+
update_channel: string;
|
|
47
|
+
runtime_version: string;
|
|
48
|
+
emergency_launch: {
|
|
49
|
+
is_emergency_launch: true;
|
|
50
|
+
reason: string;
|
|
51
|
+
} | {
|
|
52
|
+
is_emergency_launch: false;
|
|
53
|
+
reason?: undefined;
|
|
54
|
+
};
|
|
55
|
+
is_embedded_launch: boolean;
|
|
56
|
+
created_at: Date;
|
|
57
|
+
} | null;
|
|
58
|
+
hardware: {
|
|
59
|
+
device_name: string;
|
|
60
|
+
device_type: string;
|
|
61
|
+
device_brand: string;
|
|
62
|
+
};
|
|
63
|
+
os: {
|
|
64
|
+
platform: import("@teardown/types").DevicePlatformEnum;
|
|
65
|
+
name: string;
|
|
66
|
+
version: string;
|
|
67
|
+
};
|
|
68
|
+
notifications: {
|
|
69
|
+
push: {
|
|
70
|
+
enabled: boolean;
|
|
71
|
+
granted: boolean;
|
|
72
|
+
token: string | null;
|
|
73
|
+
platform: import("@teardown/schemas").NotificationPlatform;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
timestamp?: Date | undefined;
|
|
77
|
+
};
|
|
78
|
+
persona?: {
|
|
79
|
+
user_id?: string | undefined;
|
|
80
|
+
email?: string | undefined;
|
|
81
|
+
name?: string | undefined;
|
|
82
|
+
} | undefined;
|
|
83
|
+
};
|
|
84
|
+
params: {};
|
|
85
|
+
query: unknown;
|
|
86
|
+
headers: {
|
|
87
|
+
"td-org-id": string;
|
|
88
|
+
"td-project-id": string;
|
|
89
|
+
"td-environment-slug": string;
|
|
90
|
+
"td-device-id": string;
|
|
91
|
+
authorization?: string | undefined;
|
|
92
|
+
"td-session-id"?: string | undefined;
|
|
93
|
+
};
|
|
94
|
+
response: {
|
|
95
|
+
200: {
|
|
96
|
+
success: true;
|
|
97
|
+
data: {
|
|
98
|
+
session_id: string;
|
|
99
|
+
device_id: string;
|
|
100
|
+
persona_id: string;
|
|
101
|
+
token: string;
|
|
102
|
+
version_info: {
|
|
103
|
+
status: import("@teardown/schemas").IdentifyVersionStatusEnum;
|
|
104
|
+
update?: {
|
|
105
|
+
status: import("@teardown/schemas").IdentifyVersionStatusEnum.UPDATE_AVAILABLE;
|
|
106
|
+
update: {
|
|
107
|
+
version: string;
|
|
108
|
+
build: string;
|
|
109
|
+
update_id: string;
|
|
110
|
+
effective_date: Date;
|
|
111
|
+
};
|
|
112
|
+
} | null | undefined;
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
400: {
|
|
117
|
+
success: false;
|
|
118
|
+
error: {
|
|
119
|
+
code: "MISSING_ORG_ID";
|
|
120
|
+
message: string;
|
|
121
|
+
} | {
|
|
122
|
+
code: "MISSING_PROJECT_ID";
|
|
123
|
+
message: string;
|
|
124
|
+
} | {
|
|
125
|
+
code: "MISSING_ENVIRONMENT_SLUG";
|
|
126
|
+
message: string;
|
|
127
|
+
} | {
|
|
128
|
+
code: "MISSING_DEVICE_ID";
|
|
129
|
+
message: string;
|
|
130
|
+
} | {
|
|
131
|
+
code: "IDENTIFY_FAILED";
|
|
132
|
+
message: string;
|
|
133
|
+
} | {
|
|
134
|
+
code: "NO_SESSION_ID_GENERATED";
|
|
135
|
+
message: string;
|
|
136
|
+
} | {
|
|
137
|
+
code: "NO_DEVICE_ID_GENERATED";
|
|
138
|
+
message: string;
|
|
139
|
+
} | {
|
|
140
|
+
code: "NO_PERSONA_ID_GENERATED";
|
|
141
|
+
message: string;
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
422: {
|
|
145
|
+
type: "validation";
|
|
146
|
+
on: string;
|
|
147
|
+
summary?: string;
|
|
148
|
+
message?: string;
|
|
149
|
+
found?: unknown;
|
|
150
|
+
property?: string;
|
|
151
|
+
expected?: string;
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
} & {
|
|
157
|
+
"/v1/events": {
|
|
158
|
+
post: {
|
|
159
|
+
body: {
|
|
160
|
+
events: {
|
|
161
|
+
event_name: string;
|
|
162
|
+
event_type: "action" | "screen_view" | "custom";
|
|
163
|
+
properties?: Record<string, unknown> | undefined;
|
|
164
|
+
timestamp?: Date | undefined;
|
|
165
|
+
session_id?: string | undefined;
|
|
166
|
+
device_id?: string | undefined;
|
|
167
|
+
}[];
|
|
168
|
+
session_id?: string | undefined;
|
|
169
|
+
device_id?: string | undefined;
|
|
170
|
+
};
|
|
171
|
+
params: {};
|
|
172
|
+
query: unknown;
|
|
173
|
+
headers: {
|
|
174
|
+
"td-org-id": string;
|
|
175
|
+
"td-project-id": string;
|
|
176
|
+
"td-environment-slug": string;
|
|
177
|
+
authorization?: string | undefined;
|
|
178
|
+
"td-device-id"?: string | undefined;
|
|
179
|
+
"td-session-id"?: string | undefined;
|
|
180
|
+
};
|
|
181
|
+
response: {
|
|
182
|
+
200: {
|
|
183
|
+
success: true;
|
|
184
|
+
data: {
|
|
185
|
+
event_ids: string[];
|
|
186
|
+
processed_count: number;
|
|
187
|
+
failed_count: number;
|
|
188
|
+
};
|
|
189
|
+
};
|
|
190
|
+
400: {
|
|
191
|
+
success: false;
|
|
192
|
+
error: {
|
|
193
|
+
code: "MISSING_ORG_ID";
|
|
194
|
+
message: string;
|
|
195
|
+
} | {
|
|
196
|
+
code: "MISSING_PROJECT_ID";
|
|
197
|
+
message: string;
|
|
198
|
+
} | {
|
|
199
|
+
code: "MISSING_ENVIRONMENT_SLUG";
|
|
200
|
+
message: string;
|
|
201
|
+
} | {
|
|
202
|
+
code: "MISSING_DEVICE_ID";
|
|
203
|
+
message: string;
|
|
204
|
+
} | {
|
|
205
|
+
code: "EVENTS_PROCESSING_FAILED";
|
|
206
|
+
message: string;
|
|
207
|
+
} | {
|
|
208
|
+
code: "INVALID_SESSION";
|
|
209
|
+
message: string;
|
|
210
|
+
} | {
|
|
211
|
+
code: "INVALID_DEVICE";
|
|
212
|
+
message: string;
|
|
213
|
+
} | {
|
|
214
|
+
code: "BATCH_SIZE_EXCEEDED";
|
|
215
|
+
message: string;
|
|
216
|
+
} | {
|
|
217
|
+
code: "VALIDATION_ERROR";
|
|
218
|
+
message: string;
|
|
219
|
+
};
|
|
220
|
+
};
|
|
221
|
+
422: {
|
|
222
|
+
type: "validation";
|
|
223
|
+
on: string;
|
|
224
|
+
summary?: string;
|
|
225
|
+
message?: string;
|
|
226
|
+
found?: unknown;
|
|
227
|
+
property?: string;
|
|
228
|
+
expected?: string;
|
|
229
|
+
};
|
|
230
|
+
};
|
|
231
|
+
};
|
|
232
|
+
};
|
|
233
|
+
}>;
|
|
5
234
|
export type Client = ReturnType<typeof client>;
|
|
6
235
|
export type RequestOptions = Omit<NonNullable<Parameters<Client>[1]>, "headers"> & {
|
|
7
236
|
headers?: Record<string, string>;
|
|
8
237
|
};
|
|
9
238
|
export type Endpoints = Parameters<Client>[0];
|
|
239
|
+
export type App = typeof IngestApp;
|
package/dist/client/types.d.ts
CHANGED
|
@@ -17,7 +17,23 @@ export type UnionToIntersect<U> = (U extends any ? (arg: U) => any : never) exte
|
|
|
17
17
|
export type IsAny<T> = 0 extends 1 & T ? true : false;
|
|
18
18
|
export type IsNever<T> = [T] extends [never] ? true : false;
|
|
19
19
|
export type IsUnknown<T> = IsAny<T> extends true ? false : unknown extends T ? true : false;
|
|
20
|
-
export type
|
|
20
|
+
export type IsExactlyUnknown<T> = [T] extends [unknown] ? ([unknown] extends [T] ? true : false) : false;
|
|
21
|
+
export type IsUndefined<T> = [T] extends [undefined] ? true : false;
|
|
22
|
+
export type IsMatchingEmptyObject<T> = [T] extends [{}] ? ([{}] extends [T] ? true : false) : false;
|
|
23
|
+
export type MaybeEmptyObject<TObj, TKey extends PropertyKey, TFallback = Record<string, unknown>> = IsUndefined<TObj> extends true ? {
|
|
24
|
+
[K in TKey]?: TFallback;
|
|
25
|
+
} : IsExactlyUnknown<TObj> extends true ? {
|
|
26
|
+
[K in TKey]?: TFallback;
|
|
27
|
+
} : IsMatchingEmptyObject<TObj> extends true ? {
|
|
28
|
+
[K in TKey]?: TObj;
|
|
29
|
+
} : undefined extends TObj ? {
|
|
30
|
+
[K in TKey]?: TObj;
|
|
31
|
+
} : null extends TObj ? {
|
|
32
|
+
[K in TKey]?: TObj;
|
|
33
|
+
} : {
|
|
34
|
+
[K in TKey]: TObj;
|
|
35
|
+
};
|
|
36
|
+
type AnyTypedRoute = {
|
|
21
37
|
body?: unknown;
|
|
22
38
|
headers?: unknown;
|
|
23
39
|
query?: unknown;
|
|
@@ -39,36 +55,4 @@ export type TreatyToPath<T, Path extends string = ""> = UnionToIntersect<T exten
|
|
|
39
55
|
} : TreatyToPath<T[K], `${Path}/${K & string}`>;
|
|
40
56
|
}[keyof T] : {}>;
|
|
41
57
|
export type Not<T> = T extends true ? false : true;
|
|
42
|
-
export
|
|
43
|
-
method?: Method;
|
|
44
|
-
} : {
|
|
45
|
-
method: Method;
|
|
46
|
-
}) & (IsNever<keyof Route["params"]> extends true ? {
|
|
47
|
-
params?: Record<never, string>;
|
|
48
|
-
} : {
|
|
49
|
-
params: Route["params"];
|
|
50
|
-
}) & (IsNever<keyof Route["query"]> extends true ? {
|
|
51
|
-
query?: Record<never, string>;
|
|
52
|
-
} : {
|
|
53
|
-
query: Route["query"];
|
|
54
|
-
}) & (undefined extends Route["headers"] ? {
|
|
55
|
-
headers?: Record<string, string>;
|
|
56
|
-
} : {
|
|
57
|
-
headers: Route["headers"];
|
|
58
|
-
}) & (IsUnknown<Route["body"]> extends false ? {
|
|
59
|
-
body: Route["body"];
|
|
60
|
-
} : {
|
|
61
|
-
body?: unknown;
|
|
62
|
-
})) => Promise<Prettify<{
|
|
63
|
-
data: Awaited<Route["response"][200]>;
|
|
64
|
-
error: null;
|
|
65
|
-
status: number;
|
|
66
|
-
headers: Record<string, unknown>;
|
|
67
|
-
retry(): Promise<void>;
|
|
68
|
-
} | {
|
|
69
|
-
data: null;
|
|
70
|
-
error: MapError<Route["response"]> extends infer Errors ? IsNever<Errors> extends true ? EdenFetchError<number, string> : Errors : EdenFetchError<number, string>;
|
|
71
|
-
status: number;
|
|
72
|
-
headers: Record<string, unknown>;
|
|
73
|
-
retry(): Promise<void>;
|
|
74
|
-
}>>;
|
|
58
|
+
export {};
|
package/dist/schemas/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "
|
|
1
|
+
export * from "../vendored/schemas/identify";
|
package/dist/schemas/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "
|
|
1
|
+
export * from "../vendored/schemas/identify";
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
import * as IdentifySchemas from "../vendored/schemas/identify";
|
|
2
|
+
export { IdentifySchemas };
|
package/dist/types/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import * as IdentifySchemas from "../vendored/schemas/identify";
|
|
2
|
+
export { IdentifySchemas };
|
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
import { DevicePlatformEnum } from "../types/generated-consts";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
export { DevicePlatformEnum };
|
|
4
|
+
/**
|
|
5
|
+
* Application info schema
|
|
6
|
+
*/
|
|
7
|
+
export declare const ApplicationInfoSchema: z.ZodObject<{
|
|
8
|
+
version: z.ZodString;
|
|
9
|
+
build_number: z.ZodString;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
export type ApplicationInfo = z.infer<typeof ApplicationInfoSchema>;
|
|
12
|
+
/**
|
|
13
|
+
* OS info schema
|
|
14
|
+
*/
|
|
15
|
+
export declare const OSInfoSchema: z.ZodObject<{
|
|
16
|
+
platform: z.ZodEnum<typeof DevicePlatformEnum>;
|
|
17
|
+
name: z.ZodString;
|
|
18
|
+
version: z.ZodString;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
export type OSInfo = z.infer<typeof OSInfoSchema>;
|
|
21
|
+
/**
|
|
22
|
+
* Hardware info schema
|
|
23
|
+
*/
|
|
24
|
+
export declare const HardwareInfoSchema: z.ZodObject<{
|
|
25
|
+
device_name: z.ZodString;
|
|
26
|
+
device_type: z.ZodString;
|
|
27
|
+
device_brand: z.ZodString;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
export type HardwareInfo = z.infer<typeof HardwareInfoSchema>;
|
|
30
|
+
export declare const EmergencyLaunchSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
31
|
+
is_emergency_launch: z.ZodLiteral<true>;
|
|
32
|
+
reason: z.ZodString;
|
|
33
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
34
|
+
is_emergency_launch: z.ZodLiteral<false>;
|
|
35
|
+
reason: z.ZodOptional<z.ZodNever>;
|
|
36
|
+
}, z.core.$strip>]>;
|
|
37
|
+
export type EmergencyLaunch = z.infer<typeof EmergencyLaunchSchema>;
|
|
38
|
+
/**
|
|
39
|
+
* Update info schema
|
|
40
|
+
*/
|
|
41
|
+
export declare const DeviceUpdateInfoSchema: z.ZodObject<{
|
|
42
|
+
is_enabled: z.ZodBoolean;
|
|
43
|
+
update_id: z.ZodString;
|
|
44
|
+
update_channel: z.ZodString;
|
|
45
|
+
runtime_version: z.ZodString;
|
|
46
|
+
emergency_launch: z.ZodUnion<readonly [z.ZodObject<{
|
|
47
|
+
is_emergency_launch: z.ZodLiteral<true>;
|
|
48
|
+
reason: z.ZodString;
|
|
49
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
50
|
+
is_emergency_launch: z.ZodLiteral<false>;
|
|
51
|
+
reason: z.ZodOptional<z.ZodNever>;
|
|
52
|
+
}, z.core.$strip>]>;
|
|
53
|
+
is_embedded_launch: z.ZodBoolean;
|
|
54
|
+
created_at: z.ZodCoercedDate<unknown>;
|
|
55
|
+
}, z.core.$strip>;
|
|
56
|
+
export type DeviceUpdateInfo = z.infer<typeof DeviceUpdateInfoSchema>;
|
|
57
|
+
export declare enum NotificationPlatform {
|
|
58
|
+
APNS = "APNS",// Apple Push Notification Service
|
|
59
|
+
FCM = "FCM",// Firebase Cloud Messaging
|
|
60
|
+
EXPO = "EXPO"
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Push notification info schema
|
|
64
|
+
*/
|
|
65
|
+
export declare const PushNotificationInfoSchema: z.ZodObject<{
|
|
66
|
+
enabled: z.ZodBoolean;
|
|
67
|
+
granted: z.ZodBoolean;
|
|
68
|
+
token: z.ZodNullable<z.ZodString>;
|
|
69
|
+
platform: z.ZodEnum<typeof NotificationPlatform>;
|
|
70
|
+
}, z.core.$strip>;
|
|
71
|
+
export type PushNotificationInfo = z.infer<typeof PushNotificationInfoSchema>;
|
|
72
|
+
export declare const NotificationsInfoSchema: z.ZodObject<{
|
|
73
|
+
push: z.ZodObject<{
|
|
74
|
+
enabled: z.ZodBoolean;
|
|
75
|
+
granted: z.ZodBoolean;
|
|
76
|
+
token: z.ZodNullable<z.ZodString>;
|
|
77
|
+
platform: z.ZodEnum<typeof NotificationPlatform>;
|
|
78
|
+
}, z.core.$strip>;
|
|
79
|
+
}, z.core.$strip>;
|
|
80
|
+
export type NotificationsInfo = z.infer<typeof NotificationsInfoSchema>;
|
|
81
|
+
/**
|
|
82
|
+
* Device info schema
|
|
83
|
+
*/
|
|
84
|
+
export declare const DeviceInfoSchema: z.ZodObject<{
|
|
85
|
+
timestamp: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
86
|
+
application: z.ZodObject<{
|
|
87
|
+
version: z.ZodString;
|
|
88
|
+
build_number: z.ZodString;
|
|
89
|
+
}, z.core.$strip>;
|
|
90
|
+
update: z.ZodNullable<z.ZodObject<{
|
|
91
|
+
is_enabled: z.ZodBoolean;
|
|
92
|
+
update_id: z.ZodString;
|
|
93
|
+
update_channel: z.ZodString;
|
|
94
|
+
runtime_version: z.ZodString;
|
|
95
|
+
emergency_launch: z.ZodUnion<readonly [z.ZodObject<{
|
|
96
|
+
is_emergency_launch: z.ZodLiteral<true>;
|
|
97
|
+
reason: z.ZodString;
|
|
98
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
99
|
+
is_emergency_launch: z.ZodLiteral<false>;
|
|
100
|
+
reason: z.ZodOptional<z.ZodNever>;
|
|
101
|
+
}, z.core.$strip>]>;
|
|
102
|
+
is_embedded_launch: z.ZodBoolean;
|
|
103
|
+
created_at: z.ZodCoercedDate<unknown>;
|
|
104
|
+
}, z.core.$strip>>;
|
|
105
|
+
hardware: z.ZodObject<{
|
|
106
|
+
device_name: z.ZodString;
|
|
107
|
+
device_type: z.ZodString;
|
|
108
|
+
device_brand: z.ZodString;
|
|
109
|
+
}, z.core.$strip>;
|
|
110
|
+
os: z.ZodObject<{
|
|
111
|
+
platform: z.ZodEnum<typeof DevicePlatformEnum>;
|
|
112
|
+
name: z.ZodString;
|
|
113
|
+
version: z.ZodString;
|
|
114
|
+
}, z.core.$strip>;
|
|
115
|
+
notifications: z.ZodObject<{
|
|
116
|
+
push: z.ZodObject<{
|
|
117
|
+
enabled: z.ZodBoolean;
|
|
118
|
+
granted: z.ZodBoolean;
|
|
119
|
+
token: z.ZodNullable<z.ZodString>;
|
|
120
|
+
platform: z.ZodEnum<typeof NotificationPlatform>;
|
|
121
|
+
}, z.core.$strip>;
|
|
122
|
+
}, z.core.$strip>;
|
|
123
|
+
}, z.core.$strip>;
|
|
124
|
+
export type DeviceInfo = z.infer<typeof DeviceInfoSchema>;
|
|
125
|
+
/**
|
|
126
|
+
* Persona info schema (optional fields)
|
|
127
|
+
* Matches personas table structure
|
|
128
|
+
*/
|
|
129
|
+
export declare const PersonaInfoSchema: z.ZodObject<{
|
|
130
|
+
user_id: z.ZodOptional<z.ZodString>;
|
|
131
|
+
email: z.ZodOptional<z.ZodString>;
|
|
132
|
+
name: z.ZodOptional<z.ZodString>;
|
|
133
|
+
}, z.core.$strip>;
|
|
134
|
+
export type PersonaInfo = z.infer<typeof PersonaInfoSchema>;
|
|
135
|
+
/**
|
|
136
|
+
* Identify request schema
|
|
137
|
+
* Ties a device to a persona with optional persona data
|
|
138
|
+
*/
|
|
139
|
+
export declare const IdentifyRequestSchema: z.ZodObject<{
|
|
140
|
+
device: z.ZodObject<{
|
|
141
|
+
timestamp: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
142
|
+
application: z.ZodObject<{
|
|
143
|
+
version: z.ZodString;
|
|
144
|
+
build_number: z.ZodString;
|
|
145
|
+
}, z.core.$strip>;
|
|
146
|
+
update: z.ZodNullable<z.ZodObject<{
|
|
147
|
+
is_enabled: z.ZodBoolean;
|
|
148
|
+
update_id: z.ZodString;
|
|
149
|
+
update_channel: z.ZodString;
|
|
150
|
+
runtime_version: z.ZodString;
|
|
151
|
+
emergency_launch: z.ZodUnion<readonly [z.ZodObject<{
|
|
152
|
+
is_emergency_launch: z.ZodLiteral<true>;
|
|
153
|
+
reason: z.ZodString;
|
|
154
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
155
|
+
is_emergency_launch: z.ZodLiteral<false>;
|
|
156
|
+
reason: z.ZodOptional<z.ZodNever>;
|
|
157
|
+
}, z.core.$strip>]>;
|
|
158
|
+
is_embedded_launch: z.ZodBoolean;
|
|
159
|
+
created_at: z.ZodCoercedDate<unknown>;
|
|
160
|
+
}, z.core.$strip>>;
|
|
161
|
+
hardware: z.ZodObject<{
|
|
162
|
+
device_name: z.ZodString;
|
|
163
|
+
device_type: z.ZodString;
|
|
164
|
+
device_brand: z.ZodString;
|
|
165
|
+
}, z.core.$strip>;
|
|
166
|
+
os: z.ZodObject<{
|
|
167
|
+
platform: z.ZodEnum<typeof DevicePlatformEnum>;
|
|
168
|
+
name: z.ZodString;
|
|
169
|
+
version: z.ZodString;
|
|
170
|
+
}, z.core.$strip>;
|
|
171
|
+
notifications: z.ZodObject<{
|
|
172
|
+
push: z.ZodObject<{
|
|
173
|
+
enabled: z.ZodBoolean;
|
|
174
|
+
granted: z.ZodBoolean;
|
|
175
|
+
token: z.ZodNullable<z.ZodString>;
|
|
176
|
+
platform: z.ZodEnum<typeof NotificationPlatform>;
|
|
177
|
+
}, z.core.$strip>;
|
|
178
|
+
}, z.core.$strip>;
|
|
179
|
+
}, z.core.$strip>;
|
|
180
|
+
persona: z.ZodOptional<z.ZodObject<{
|
|
181
|
+
user_id: z.ZodOptional<z.ZodString>;
|
|
182
|
+
email: z.ZodOptional<z.ZodString>;
|
|
183
|
+
name: z.ZodOptional<z.ZodString>;
|
|
184
|
+
}, z.core.$strip>>;
|
|
185
|
+
}, z.core.$strip>;
|
|
186
|
+
export type IdentifyRequest = z.infer<typeof IdentifyRequestSchema>;
|
|
187
|
+
export declare enum IdentifyVersionStatusEnum {
|
|
188
|
+
/**
|
|
189
|
+
* A new version is available
|
|
190
|
+
*/
|
|
191
|
+
UPDATE_AVAILABLE = "UPDATE_AVAILABLE",
|
|
192
|
+
/**
|
|
193
|
+
* An update is required
|
|
194
|
+
*/
|
|
195
|
+
UPDATE_REQUIRED = "UPDATE_REQUIRED",
|
|
196
|
+
/**
|
|
197
|
+
* The current version is valid & up to date
|
|
198
|
+
*/
|
|
199
|
+
UP_TO_DATE = "UP_TO_DATE"
|
|
200
|
+
}
|
|
201
|
+
export declare const UpdateInfoSchema: z.ZodObject<{
|
|
202
|
+
version: z.ZodString;
|
|
203
|
+
build: z.ZodString;
|
|
204
|
+
update_id: z.ZodString;
|
|
205
|
+
effective_date: z.ZodCoercedDate<unknown>;
|
|
206
|
+
}, z.core.$strip>;
|
|
207
|
+
export type UpdateAvailableInfo = z.infer<typeof UpdateAvailableInfoSchema>;
|
|
208
|
+
export declare const UpToDateInfoSchema: z.ZodObject<{
|
|
209
|
+
status: z.ZodLiteral<IdentifyVersionStatusEnum.UP_TO_DATE>;
|
|
210
|
+
update: z.ZodNull;
|
|
211
|
+
}, z.core.$strip>;
|
|
212
|
+
export type UpToDateInfo = z.infer<typeof UpToDateInfoSchema>;
|
|
213
|
+
export declare const UpdateRequiredInfoSchema: z.ZodObject<{
|
|
214
|
+
status: z.ZodLiteral<IdentifyVersionStatusEnum.UPDATE_REQUIRED>;
|
|
215
|
+
update: z.ZodObject<{
|
|
216
|
+
version: z.ZodString;
|
|
217
|
+
build: z.ZodString;
|
|
218
|
+
update_id: z.ZodString;
|
|
219
|
+
effective_date: z.ZodCoercedDate<unknown>;
|
|
220
|
+
}, z.core.$strip>;
|
|
221
|
+
}, z.core.$strip>;
|
|
222
|
+
export type UpdateRequiredInfo = z.infer<typeof UpdateRequiredInfoSchema>;
|
|
223
|
+
export declare const UpdateAvailableInfoSchema: z.ZodObject<{
|
|
224
|
+
status: z.ZodLiteral<IdentifyVersionStatusEnum.UPDATE_AVAILABLE>;
|
|
225
|
+
update: z.ZodObject<{
|
|
226
|
+
version: z.ZodString;
|
|
227
|
+
build: z.ZodString;
|
|
228
|
+
update_id: z.ZodString;
|
|
229
|
+
effective_date: z.ZodCoercedDate<unknown>;
|
|
230
|
+
}, z.core.$strip>;
|
|
231
|
+
}, z.core.$strip>;
|
|
232
|
+
export declare const VersionInfoSchema: z.ZodObject<{
|
|
233
|
+
status: z.ZodEnum<typeof IdentifyVersionStatusEnum>;
|
|
234
|
+
update: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
235
|
+
status: z.ZodLiteral<IdentifyVersionStatusEnum.UPDATE_AVAILABLE>;
|
|
236
|
+
update: z.ZodObject<{
|
|
237
|
+
version: z.ZodString;
|
|
238
|
+
build: z.ZodString;
|
|
239
|
+
update_id: z.ZodString;
|
|
240
|
+
effective_date: z.ZodCoercedDate<unknown>;
|
|
241
|
+
}, z.core.$strip>;
|
|
242
|
+
}, z.core.$strip>>>;
|
|
243
|
+
}, z.core.$strip>;
|
|
244
|
+
export type VersionInfo = z.infer<typeof VersionInfoSchema>;
|
|
245
|
+
/**
|
|
246
|
+
* Identify response schema
|
|
247
|
+
*/
|
|
248
|
+
export declare const IdentifyResponseSchema: z.ZodObject<{
|
|
249
|
+
success: z.ZodLiteral<true>;
|
|
250
|
+
data: z.ZodObject<{
|
|
251
|
+
session_id: z.ZodString;
|
|
252
|
+
device_id: z.ZodString;
|
|
253
|
+
persona_id: z.ZodString;
|
|
254
|
+
token: z.ZodString;
|
|
255
|
+
version_info: z.ZodObject<{
|
|
256
|
+
status: z.ZodEnum<typeof IdentifyVersionStatusEnum>;
|
|
257
|
+
update: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
258
|
+
status: z.ZodLiteral<IdentifyVersionStatusEnum.UPDATE_AVAILABLE>;
|
|
259
|
+
update: z.ZodObject<{
|
|
260
|
+
version: z.ZodString;
|
|
261
|
+
build: z.ZodString;
|
|
262
|
+
update_id: z.ZodString;
|
|
263
|
+
effective_date: z.ZodCoercedDate<unknown>;
|
|
264
|
+
}, z.core.$strip>;
|
|
265
|
+
}, z.core.$strip>>>;
|
|
266
|
+
}, z.core.$strip>;
|
|
267
|
+
}, z.core.$strip>;
|
|
268
|
+
}, z.core.$strip>;
|
|
269
|
+
export type IdentifyResponse = z.infer<typeof IdentifyResponseSchema>;
|
|
270
|
+
export declare const IdentifyErrorResponseSchema: z.ZodObject<{
|
|
271
|
+
success: z.ZodLiteral<false>;
|
|
272
|
+
error: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
273
|
+
code: z.ZodLiteral<"MISSING_ORG_ID">;
|
|
274
|
+
message: z.ZodString;
|
|
275
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
276
|
+
code: z.ZodLiteral<"MISSING_PROJECT_ID">;
|
|
277
|
+
message: z.ZodString;
|
|
278
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
279
|
+
code: z.ZodLiteral<"MISSING_ENVIRONMENT_SLUG">;
|
|
280
|
+
message: z.ZodString;
|
|
281
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
282
|
+
code: z.ZodLiteral<"MISSING_DEVICE_ID">;
|
|
283
|
+
message: z.ZodString;
|
|
284
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
285
|
+
code: z.ZodLiteral<"IDENTIFY_FAILED">;
|
|
286
|
+
message: z.ZodString;
|
|
287
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
288
|
+
code: z.ZodLiteral<"NO_SESSION_ID_GENERATED">;
|
|
289
|
+
message: z.ZodString;
|
|
290
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
291
|
+
code: z.ZodLiteral<"NO_DEVICE_ID_GENERATED">;
|
|
292
|
+
message: z.ZodString;
|
|
293
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
294
|
+
code: z.ZodLiteral<"NO_PERSONA_ID_GENERATED">;
|
|
295
|
+
message: z.ZodString;
|
|
296
|
+
}, z.core.$strip>], "code">;
|
|
297
|
+
}, z.core.$strip>;
|
|
298
|
+
export type IdentifyErrorResponse = z.infer<typeof IdentifyErrorResponseSchema>;
|
|
299
|
+
export declare const ValidationErrorSchema: z.ZodObject<{
|
|
300
|
+
success: z.ZodLiteral<false>;
|
|
301
|
+
error: z.ZodLiteral<"VALIDATION">;
|
|
302
|
+
message: z.ZodString;
|
|
303
|
+
}, z.core.$strip>;
|