@teardown/ingest-api 0.0.21-alpha.11 → 0.0.21-alpha.13

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.
@@ -35,51 +35,51 @@ export declare const client: (server: string, config?: import("@elysiajs/eden/fe
35
35
  "/v1/identify": {
36
36
  post: {
37
37
  body: {
38
+ persona?: {
39
+ name?: string | undefined;
40
+ email?: string | undefined;
41
+ user_id?: string | undefined;
42
+ } | undefined;
38
43
  device: {
39
- application: {
40
- version: string;
41
- build_number: string;
42
- };
44
+ timestamp?: Date | undefined;
43
45
  update: {
44
- is_enabled: boolean;
46
+ created_at: string;
47
+ is_embedded_launch: boolean;
45
48
  update_id: string;
49
+ is_enabled: boolean;
46
50
  update_channel: string;
47
51
  runtime_version: string;
48
52
  emergency_launch: {
49
53
  is_emergency_launch: true;
50
54
  reason: string;
51
55
  } | {
52
- is_emergency_launch: false;
53
56
  reason?: undefined;
57
+ is_emergency_launch: false;
54
58
  };
55
- is_embedded_launch: boolean;
56
- created_at: Date;
57
59
  } | null;
60
+ application: {
61
+ version: string;
62
+ build_number: string;
63
+ };
58
64
  hardware: {
65
+ device_brand: string;
59
66
  device_name: string;
60
67
  device_type: string;
61
- device_brand: string;
62
68
  };
63
69
  os: {
64
- platform: import("@teardown/types").DevicePlatformEnum;
65
70
  name: string;
66
71
  version: string;
72
+ platform: import("@teardown/types").DevicePlatformEnum;
67
73
  };
68
74
  notifications: {
69
75
  push: {
70
- enabled: boolean;
71
- granted: boolean;
72
76
  token: string | null;
73
77
  platform: import("@teardown/schemas").NotificationPlatform;
78
+ enabled: boolean;
79
+ granted: boolean;
74
80
  };
75
81
  };
76
- timestamp?: Date | undefined;
77
82
  };
78
- persona?: {
79
- user_id?: string | undefined;
80
- email?: string | undefined;
81
- name?: string | undefined;
82
- } | undefined;
83
83
  };
84
84
  params: {};
85
85
  query: unknown;
@@ -87,58 +87,58 @@ export declare const client: (server: string, config?: import("@elysiajs/eden/fe
87
87
  "td-org-id": string;
88
88
  "td-project-id": string;
89
89
  "td-environment-slug": string;
90
+ "td-api-key": string;
90
91
  "td-device-id": string;
91
- authorization?: string | undefined;
92
92
  "td-session-id"?: string | undefined;
93
93
  };
94
94
  response: {
95
95
  200: {
96
96
  success: true;
97
97
  data: {
98
- session_id: string;
99
98
  device_id: string;
100
99
  persona_id: string;
100
+ session_id: string;
101
101
  token: string;
102
102
  version_info: {
103
- status: import("@teardown/schemas").IdentifyVersionStatusEnum;
104
103
  update?: {
105
104
  status: import("@teardown/schemas").IdentifyVersionStatusEnum.UPDATE_AVAILABLE;
106
105
  update: {
107
106
  version: string;
108
- build: string;
109
107
  update_id: string;
108
+ build: string;
110
109
  effective_date: Date;
111
110
  };
112
111
  } | null | undefined;
112
+ status: import("@teardown/schemas").IdentifyVersionStatusEnum;
113
113
  };
114
114
  };
115
115
  };
116
116
  400: {
117
117
  success: false;
118
118
  error: {
119
- code: "MISSING_ORG_ID";
120
119
  message: string;
120
+ code: "MISSING_ORG_ID";
121
121
  } | {
122
- code: "MISSING_PROJECT_ID";
123
122
  message: string;
123
+ code: "MISSING_PROJECT_ID";
124
124
  } | {
125
- code: "MISSING_ENVIRONMENT_SLUG";
126
125
  message: string;
126
+ code: "MISSING_ENVIRONMENT_SLUG";
127
127
  } | {
128
- code: "MISSING_DEVICE_ID";
129
128
  message: string;
129
+ code: "MISSING_DEVICE_ID";
130
130
  } | {
131
- code: "IDENTIFY_FAILED";
132
131
  message: string;
132
+ code: "IDENTIFY_FAILED";
133
133
  } | {
134
- code: "NO_SESSION_ID_GENERATED";
135
134
  message: string;
135
+ code: "NO_SESSION_ID_GENERATED";
136
136
  } | {
137
- code: "NO_DEVICE_ID_GENERATED";
138
137
  message: string;
138
+ code: "NO_DEVICE_ID_GENERATED";
139
139
  } | {
140
- code: "NO_PERSONA_ID_GENERATED";
141
140
  message: string;
141
+ code: "NO_PERSONA_ID_GENERATED";
142
142
  };
143
143
  };
144
144
  422: {
@@ -157,16 +157,16 @@ export declare const client: (server: string, config?: import("@elysiajs/eden/fe
157
157
  "/v1/events": {
158
158
  post: {
159
159
  body: {
160
+ device_id?: string | undefined;
161
+ session_id?: string | undefined;
160
162
  events: {
163
+ properties?: {} | undefined;
164
+ device_id?: string | undefined;
165
+ session_id?: string | undefined;
166
+ timestamp?: string | undefined;
161
167
  event_name: string;
162
168
  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
169
  }[];
168
- session_id?: string | undefined;
169
- device_id?: string | undefined;
170
170
  };
171
171
  params: {};
172
172
  query: unknown;
@@ -174,7 +174,7 @@ export declare const client: (server: string, config?: import("@elysiajs/eden/fe
174
174
  "td-org-id": string;
175
175
  "td-project-id": string;
176
176
  "td-environment-slug": string;
177
- authorization?: string | undefined;
177
+ "td-api-key": string;
178
178
  "td-device-id"?: string | undefined;
179
179
  "td-session-id"?: string | undefined;
180
180
  };
@@ -190,32 +190,32 @@ export declare const client: (server: string, config?: import("@elysiajs/eden/fe
190
190
  400: {
191
191
  success: false;
192
192
  error: {
193
- code: "MISSING_ORG_ID";
194
193
  message: string;
194
+ code: "MISSING_ORG_ID";
195
195
  } | {
196
- code: "MISSING_PROJECT_ID";
197
196
  message: string;
197
+ code: "MISSING_PROJECT_ID";
198
198
  } | {
199
- code: "MISSING_ENVIRONMENT_SLUG";
200
199
  message: string;
200
+ code: "MISSING_ENVIRONMENT_SLUG";
201
201
  } | {
202
- code: "MISSING_DEVICE_ID";
203
202
  message: string;
203
+ code: "MISSING_DEVICE_ID";
204
204
  } | {
205
- code: "EVENTS_PROCESSING_FAILED";
206
205
  message: string;
206
+ code: "EVENTS_PROCESSING_FAILED";
207
207
  } | {
208
- code: "INVALID_SESSION";
209
208
  message: string;
209
+ code: "INVALID_SESSION";
210
210
  } | {
211
- code: "INVALID_DEVICE";
212
211
  message: string;
212
+ code: "INVALID_DEVICE";
213
213
  } | {
214
- code: "BATCH_SIZE_EXCEEDED";
215
214
  message: string;
215
+ code: "BATCH_SIZE_EXCEEDED";
216
216
  } | {
217
- code: "VALIDATION_ERROR";
218
217
  message: string;
218
+ code: "VALIDATION_ERROR";
219
219
  };
220
220
  };
221
221
  422: {
@@ -0,0 +1,11 @@
1
+ import { type Static } from "elysia";
2
+ export declare const UUIDSchema: import("@sinclair/typebox").TString;
3
+ export declare const SlugSchema: import("@sinclair/typebox").TString;
4
+ export declare const URLSchema: import("@sinclair/typebox").TString;
5
+ export declare const TimestampSchema: import("@sinclair/typebox").TString;
6
+ export type UUID = Static<typeof UUIDSchema>;
7
+ export type Slug = Static<typeof SlugSchema>;
8
+ export type URL = Static<typeof URLSchema>;
9
+ export type Timestamp = Static<typeof TimestampSchema>;
10
+ export declare const EmailSchema: import("@sinclair/typebox").TTransform<import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TLiteral<"">, import("@sinclair/typebox").TUndefined]>>, string | undefined>;
11
+ export type Email = Static<typeof EmailSchema>;
@@ -0,0 +1,9 @@
1
+ import { Type } from "@sinclair/typebox";
2
+ import { t } from "elysia";
3
+ export const UUIDSchema = t.String({ format: "uuid", error: "Invalid UUID" });
4
+ export const SlugSchema = t.String({ pattern: "^[a-z0-9]+(?:-[a-z0-9]+)*$", error: "Invalid slug" });
5
+ export const URLSchema = t.String({ format: "uri", error: "Invalid URL" });
6
+ export const TimestampSchema = t.String({ format: "date-time", error: "Invalid timestamp" });
7
+ export const EmailSchema = Type.Transform(Type.Optional(Type.Union([Type.String({ format: "email", error: "Invalid email address" }), Type.Literal(""), t.Undefined()])))
8
+ .Decode((value) => (value === "" ? undefined : value))
9
+ .Encode((value) => value ?? "");