@teardown/ingest-api 0.1.24 → 0.1.26
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/generated/app.d.ts +323 -0
- package/package.json +13 -11
- package/src/client/client.ts +4 -1
- package/src/vendored/consts.ts +0 -5
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
import type { Elysia } from "elysia";
|
|
2
|
+
import type z from "zod";
|
|
3
|
+
|
|
4
|
+
export declare const baseApp: Elysia<"", {
|
|
5
|
+
decorator: {};
|
|
6
|
+
store: {};
|
|
7
|
+
derive: {};
|
|
8
|
+
resolve: {};
|
|
9
|
+
}, {
|
|
10
|
+
typebox: {};
|
|
11
|
+
error: {};
|
|
12
|
+
} & {
|
|
13
|
+
typebox: {};
|
|
14
|
+
error: {
|
|
15
|
+
readonly FORBIDDEN: import("@teardown/errors").ForbiddenError;
|
|
16
|
+
readonly NOT_FOUND: import("@teardown/errors").NotFoundError;
|
|
17
|
+
readonly INTERNAL_SERVER_ERROR: import("@teardown/errors").InternalServerError;
|
|
18
|
+
readonly BAD_REQUEST: import("@teardown/errors").BadRequestError;
|
|
19
|
+
readonly UNAUTHORIZED: import("@teardown/errors").UnauthorizedError;
|
|
20
|
+
readonly UNPROCESSABLE_ENTITY: import("@teardown/errors").UnprocessableContentError;
|
|
21
|
+
readonly TOO_MANY_REQUESTS: import("@teardown/errors").RateLimitError;
|
|
22
|
+
readonly SERVICE_UNAVAILABLE: import("@teardown/errors").InternalServerError;
|
|
23
|
+
};
|
|
24
|
+
} & {
|
|
25
|
+
typebox: {};
|
|
26
|
+
error: {};
|
|
27
|
+
}, {
|
|
28
|
+
schema: {};
|
|
29
|
+
standaloneSchema: {};
|
|
30
|
+
macro: {};
|
|
31
|
+
macroFn: {};
|
|
32
|
+
parser: {};
|
|
33
|
+
response: {};
|
|
34
|
+
} & {
|
|
35
|
+
schema: {};
|
|
36
|
+
standaloneSchema: {};
|
|
37
|
+
macro: {};
|
|
38
|
+
macroFn: {};
|
|
39
|
+
parser: {};
|
|
40
|
+
response: {
|
|
41
|
+
200: import("@teardown/errors").ErrorResponse;
|
|
42
|
+
};
|
|
43
|
+
} & {
|
|
44
|
+
schema: {};
|
|
45
|
+
standaloneSchema: {};
|
|
46
|
+
macro: {};
|
|
47
|
+
macroFn: {};
|
|
48
|
+
parser: {};
|
|
49
|
+
response: {};
|
|
50
|
+
}, {
|
|
51
|
+
get: {
|
|
52
|
+
body: unknown;
|
|
53
|
+
params: {};
|
|
54
|
+
query: unknown;
|
|
55
|
+
headers: unknown;
|
|
56
|
+
response: {
|
|
57
|
+
200: import("@teardown/errors").ErrorResponse | {
|
|
58
|
+
message: string;
|
|
59
|
+
version: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
} & {
|
|
64
|
+
health: {
|
|
65
|
+
get: {
|
|
66
|
+
body: unknown;
|
|
67
|
+
params: {};
|
|
68
|
+
query: unknown;
|
|
69
|
+
headers: unknown;
|
|
70
|
+
response: {
|
|
71
|
+
200: import("@teardown/errors").ErrorResponse | {
|
|
72
|
+
status: string;
|
|
73
|
+
timestamp: string;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
} & {
|
|
79
|
+
v1: {
|
|
80
|
+
identify: {};
|
|
81
|
+
} & {
|
|
82
|
+
identify: {
|
|
83
|
+
post: {
|
|
84
|
+
body: {
|
|
85
|
+
persona?: {
|
|
86
|
+
name?: string | undefined;
|
|
87
|
+
email?: string | undefined;
|
|
88
|
+
user_id?: string | undefined;
|
|
89
|
+
} | undefined;
|
|
90
|
+
device: {
|
|
91
|
+
timestamp?: Date | undefined;
|
|
92
|
+
update: {
|
|
93
|
+
created_at: string;
|
|
94
|
+
is_embedded_launch: boolean;
|
|
95
|
+
update_id: string;
|
|
96
|
+
is_enabled: boolean;
|
|
97
|
+
update_channel: string;
|
|
98
|
+
runtime_version: string;
|
|
99
|
+
emergency_launch: {
|
|
100
|
+
is_emergency_launch: true;
|
|
101
|
+
reason: string;
|
|
102
|
+
} | {
|
|
103
|
+
reason?: undefined;
|
|
104
|
+
is_emergency_launch: false;
|
|
105
|
+
};
|
|
106
|
+
} | null;
|
|
107
|
+
application: {
|
|
108
|
+
build_number: number;
|
|
109
|
+
version: string;
|
|
110
|
+
};
|
|
111
|
+
hardware: {
|
|
112
|
+
device_brand: string;
|
|
113
|
+
device_name: string;
|
|
114
|
+
device_type: string;
|
|
115
|
+
};
|
|
116
|
+
os: {
|
|
117
|
+
name: string;
|
|
118
|
+
version: string;
|
|
119
|
+
platform: import("@teardown/types").DevicePlatformEnum;
|
|
120
|
+
};
|
|
121
|
+
notifications: {
|
|
122
|
+
push: {
|
|
123
|
+
token: string | null;
|
|
124
|
+
platform: import("@teardown/schemas").NotificationPlatformEnum;
|
|
125
|
+
enabled: boolean;
|
|
126
|
+
granted: boolean;
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
params: {};
|
|
132
|
+
query: unknown;
|
|
133
|
+
headers: {
|
|
134
|
+
"td-org-id": string;
|
|
135
|
+
"td-project-id": string;
|
|
136
|
+
"td-environment-slug": string;
|
|
137
|
+
"td-api-key": string;
|
|
138
|
+
"td-device-id": string;
|
|
139
|
+
"td-session-id"?: string | undefined;
|
|
140
|
+
};
|
|
141
|
+
response: {
|
|
142
|
+
200: {
|
|
143
|
+
success: true;
|
|
144
|
+
data: {
|
|
145
|
+
device_id: string;
|
|
146
|
+
persona_id: string;
|
|
147
|
+
session_id: string;
|
|
148
|
+
token: string;
|
|
149
|
+
version_info: {
|
|
150
|
+
status: import("@teardown/schemas").IdentifyVersionStatusEnum;
|
|
151
|
+
update: {
|
|
152
|
+
status: import("@teardown/schemas").IdentifyVersionStatusEnum.UPDATE_AVAILABLE;
|
|
153
|
+
update: {
|
|
154
|
+
version: string;
|
|
155
|
+
update_id: string;
|
|
156
|
+
build: string;
|
|
157
|
+
effective_date: Date;
|
|
158
|
+
};
|
|
159
|
+
} | {
|
|
160
|
+
status: import("@teardown/schemas").IdentifyVersionStatusEnum.UPDATE_RECOMMENDED;
|
|
161
|
+
update: {
|
|
162
|
+
version: string;
|
|
163
|
+
update_id: string;
|
|
164
|
+
build: string;
|
|
165
|
+
effective_date: Date;
|
|
166
|
+
};
|
|
167
|
+
} | null;
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
400: {
|
|
172
|
+
success: false;
|
|
173
|
+
error: {
|
|
174
|
+
message: string;
|
|
175
|
+
code: "MISSING_ORG_ID";
|
|
176
|
+
} | {
|
|
177
|
+
message: string;
|
|
178
|
+
code: "MISSING_PROJECT_ID";
|
|
179
|
+
} | {
|
|
180
|
+
message: string;
|
|
181
|
+
code: "MISSING_ENVIRONMENT_SLUG";
|
|
182
|
+
} | {
|
|
183
|
+
message: string;
|
|
184
|
+
code: "MISSING_DEVICE_ID";
|
|
185
|
+
} | {
|
|
186
|
+
message: string;
|
|
187
|
+
code: "IDENTIFY_FAILED";
|
|
188
|
+
} | {
|
|
189
|
+
message: string;
|
|
190
|
+
code: "NO_SESSION_ID_GENERATED";
|
|
191
|
+
} | {
|
|
192
|
+
message: string;
|
|
193
|
+
code: "NO_DEVICE_ID_GENERATED";
|
|
194
|
+
} | {
|
|
195
|
+
message: string;
|
|
196
|
+
code: "NO_PERSONA_ID_GENERATED";
|
|
197
|
+
};
|
|
198
|
+
};
|
|
199
|
+
422: {
|
|
200
|
+
type: "validation";
|
|
201
|
+
on: string;
|
|
202
|
+
summary?: string;
|
|
203
|
+
message?: string;
|
|
204
|
+
found?: unknown;
|
|
205
|
+
property?: string;
|
|
206
|
+
expected?: string;
|
|
207
|
+
};
|
|
208
|
+
};
|
|
209
|
+
};
|
|
210
|
+
};
|
|
211
|
+
};
|
|
212
|
+
} & {
|
|
213
|
+
v1: {
|
|
214
|
+
events: {};
|
|
215
|
+
} & {
|
|
216
|
+
events: {
|
|
217
|
+
post: {
|
|
218
|
+
body: {
|
|
219
|
+
device_id?: string | undefined;
|
|
220
|
+
session_id?: string | undefined;
|
|
221
|
+
events: {
|
|
222
|
+
properties?: {} | undefined;
|
|
223
|
+
device_id?: string | undefined;
|
|
224
|
+
session_id?: string | undefined;
|
|
225
|
+
timestamp?: string | undefined;
|
|
226
|
+
event_name: string;
|
|
227
|
+
event_type: "action" | "screen_view" | "custom";
|
|
228
|
+
}[];
|
|
229
|
+
};
|
|
230
|
+
params: {};
|
|
231
|
+
query: unknown;
|
|
232
|
+
headers: {
|
|
233
|
+
"td-org-id": string;
|
|
234
|
+
"td-project-id": string;
|
|
235
|
+
"td-environment-slug": string;
|
|
236
|
+
"td-api-key": string;
|
|
237
|
+
"td-device-id"?: string | undefined;
|
|
238
|
+
"td-session-id"?: string | undefined;
|
|
239
|
+
};
|
|
240
|
+
response: {
|
|
241
|
+
200: {
|
|
242
|
+
success: true;
|
|
243
|
+
data: {
|
|
244
|
+
event_ids: string[];
|
|
245
|
+
processed_count: number;
|
|
246
|
+
failed_count: number;
|
|
247
|
+
};
|
|
248
|
+
};
|
|
249
|
+
400: {
|
|
250
|
+
success: false;
|
|
251
|
+
error: {
|
|
252
|
+
message: string;
|
|
253
|
+
code: "MISSING_ORG_ID";
|
|
254
|
+
} | {
|
|
255
|
+
message: string;
|
|
256
|
+
code: "MISSING_PROJECT_ID";
|
|
257
|
+
} | {
|
|
258
|
+
message: string;
|
|
259
|
+
code: "MISSING_ENVIRONMENT_SLUG";
|
|
260
|
+
} | {
|
|
261
|
+
message: string;
|
|
262
|
+
code: "MISSING_DEVICE_ID";
|
|
263
|
+
} | {
|
|
264
|
+
message: string;
|
|
265
|
+
code: "EVENTS_PROCESSING_FAILED";
|
|
266
|
+
} | {
|
|
267
|
+
message: string;
|
|
268
|
+
code: "INVALID_SESSION";
|
|
269
|
+
} | {
|
|
270
|
+
message: string;
|
|
271
|
+
code: "INVALID_DEVICE";
|
|
272
|
+
} | {
|
|
273
|
+
message: string;
|
|
274
|
+
code: "BATCH_SIZE_EXCEEDED";
|
|
275
|
+
} | {
|
|
276
|
+
message: string;
|
|
277
|
+
code: "VALIDATION_ERROR";
|
|
278
|
+
};
|
|
279
|
+
};
|
|
280
|
+
422: {
|
|
281
|
+
type: "validation";
|
|
282
|
+
on: string;
|
|
283
|
+
summary?: string;
|
|
284
|
+
message?: string;
|
|
285
|
+
found?: unknown;
|
|
286
|
+
property?: string;
|
|
287
|
+
expected?: string;
|
|
288
|
+
};
|
|
289
|
+
};
|
|
290
|
+
};
|
|
291
|
+
};
|
|
292
|
+
};
|
|
293
|
+
}, {
|
|
294
|
+
derive: {};
|
|
295
|
+
resolve: {};
|
|
296
|
+
schema: {};
|
|
297
|
+
standaloneSchema: {};
|
|
298
|
+
response: {};
|
|
299
|
+
}, {
|
|
300
|
+
derive: {};
|
|
301
|
+
resolve: {};
|
|
302
|
+
schema: import("elysia").UnwrapRoute<{
|
|
303
|
+
headers: z.ZodObject<{
|
|
304
|
+
authorization: z.ZodOptional<z.ZodString>;
|
|
305
|
+
"td-api-key": z.ZodString;
|
|
306
|
+
"td-org-id": z.ZodString;
|
|
307
|
+
"td-project-id": z.ZodString;
|
|
308
|
+
"td-environment-slug": z.ZodOptional<z.ZodString>;
|
|
309
|
+
"td-device-id": z.ZodOptional<z.ZodString>;
|
|
310
|
+
"td-session-id": z.ZodOptional<z.ZodString>;
|
|
311
|
+
}, z.core.$strip>;
|
|
312
|
+
}, {}, "">;
|
|
313
|
+
standaloneSchema: {};
|
|
314
|
+
response: {};
|
|
315
|
+
} & {
|
|
316
|
+
derive: {};
|
|
317
|
+
resolve: {};
|
|
318
|
+
schema: {};
|
|
319
|
+
standaloneSchema: {};
|
|
320
|
+
response: {};
|
|
321
|
+
}>;
|
|
322
|
+
export declare const IngestApp: typeof baseApp;
|
|
323
|
+
export type IngestApp = typeof baseApp;
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teardown/ingest-api",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.26",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
8
8
|
"type": "module",
|
|
9
9
|
"files": [
|
|
10
|
-
"src/**/*"
|
|
10
|
+
"src/**/*",
|
|
11
|
+
"generated/**/*"
|
|
11
12
|
],
|
|
12
13
|
"main": "./src/index.ts",
|
|
13
14
|
"module": "./src/index.ts",
|
|
@@ -22,27 +23,28 @@
|
|
|
22
23
|
"types": "./src/types/index.ts",
|
|
23
24
|
"import": "./src/types/index.ts",
|
|
24
25
|
"default": "./src/types/index.ts"
|
|
25
|
-
},
|
|
26
|
-
"./vendored/consts": {
|
|
27
|
-
"types": "./src/vendored/consts.ts",
|
|
28
|
-
"import": "./src/vendored/consts.ts",
|
|
29
|
-
"default": "./src/vendored/consts.ts"
|
|
30
26
|
}
|
|
31
27
|
},
|
|
32
28
|
"scripts": {
|
|
33
|
-
"
|
|
29
|
+
"dev": "bun run typecheck --watch",
|
|
30
|
+
"typecheck": "tsc --noEmit --project ./tsconfig.lib.json",
|
|
31
|
+
"lint": "bun x biome lint .",
|
|
32
|
+
"fmt": "bun x biome format --write .",
|
|
33
|
+
"check": "bun x biome check ."
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@elysiajs/eden": "1.4.5",
|
|
37
|
-
"@teardown/
|
|
38
|
-
"@teardown/
|
|
37
|
+
"@teardown/errors": "0.0.1",
|
|
38
|
+
"@teardown/schemas": "0.1.26",
|
|
39
|
+
"@teardown/types": "0.1.26",
|
|
40
|
+
"zod": "^4"
|
|
39
41
|
},
|
|
40
42
|
"peerDependencies": {
|
|
41
43
|
"typescript": "^5.9.3"
|
|
42
44
|
},
|
|
43
45
|
"devDependencies": {
|
|
46
|
+
"@biomejs/biome": "2.3.7",
|
|
44
47
|
"@types/bun": "1.3.3",
|
|
45
|
-
"@teardown/ingest": "0.0.1",
|
|
46
48
|
"@teardown/tsconfig": "1.0.0",
|
|
47
49
|
"elysia": "1.4.16"
|
|
48
50
|
}
|
package/src/client/client.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { edenFetch } from "@elysiajs/eden";
|
|
2
|
-
import type { IngestApp } from "
|
|
2
|
+
import type { IngestApp } from "../../generated/app";
|
|
3
|
+
|
|
4
|
+
export type { IngestApp };
|
|
5
|
+
export { edenFetch };
|
|
3
6
|
|
|
4
7
|
export type ClientConfig = NonNullable<Parameters<typeof edenFetch<typeof IngestApp>>[1]>;
|
|
5
8
|
export const client = edenFetch<typeof IngestApp>;
|