@teardown/schemas 0.1.21 → 0.1.23
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 +49 -52
- package/src/common/primitives.ts +21 -0
- package/src/common/responses.ts +25 -0
- package/{dist/common/type-checks.d.ts → src/common/type-checks.ts} +23 -4
- package/{dist/index.js → src/index.ts} +1 -0
- package/src/modules/analytics/schemas.ts +178 -0
- package/src/modules/builds/schemas.ts +171 -0
- package/src/modules/devices/schemas.ts +196 -0
- package/src/modules/environment/schemas.ts +81 -0
- package/src/modules/events/index.ts +2 -0
- package/src/modules/events/schemas.ts +129 -0
- package/src/modules/identify/schemas.ts +257 -0
- package/src/modules/me/schemas.ts +87 -0
- package/src/modules/orgs/schemas.ts +260 -0
- package/src/modules/personas/schemas.ts +123 -0
- package/src/modules/projects/schemas.ts +179 -0
- package/src/modules/sessions/schemas.ts +158 -0
- package/src/modules/versions/schemas.ts +192 -0
- package/dist/common/index.js +0 -3
- package/dist/common/primitives.d.ts +0 -11
- package/dist/common/primitives.js +0 -8
- package/dist/common/responses.d.ts +0 -27
- package/dist/common/responses.js +0 -13
- package/dist/common/type-checks.js +0 -1
- package/dist/index.d.ts +0 -13
- package/dist/modules/analytics/schemas.d.ts +0 -239
- package/dist/modules/analytics/schemas.js +0 -136
- package/dist/modules/builds/schemas.d.ts +0 -248
- package/dist/modules/builds/schemas.js +0 -137
- package/dist/modules/devices/schemas.d.ts +0 -207
- package/dist/modules/devices/schemas.js +0 -165
- package/dist/modules/environment/schemas.d.ts +0 -56
- package/dist/modules/environment/schemas.js +0 -57
- package/dist/modules/events/schemas.d.ts +0 -138
- package/dist/modules/events/schemas.js +0 -116
- package/dist/modules/identify/index.js +0 -1
- package/dist/modules/identify/schemas.d.ts +0 -377
- package/dist/modules/identify/schemas.js +0 -221
- package/dist/modules/index.js +0 -12
- package/dist/modules/me/index.d.ts +0 -1
- package/dist/modules/me/index.js +0 -1
- package/dist/modules/me/schemas.d.ts +0 -75
- package/dist/modules/me/schemas.js +0 -76
- package/dist/modules/orgs/index.d.ts +0 -1
- package/dist/modules/orgs/index.js +0 -1
- package/dist/modules/orgs/schemas.d.ts +0 -308
- package/dist/modules/orgs/schemas.js +0 -214
- package/dist/modules/personas/index.d.ts +0 -1
- package/dist/modules/personas/index.js +0 -1
- package/dist/modules/personas/schemas.d.ts +0 -170
- package/dist/modules/personas/schemas.js +0 -100
- package/dist/modules/projects/index.d.ts +0 -1
- package/dist/modules/projects/index.js +0 -1
- package/dist/modules/projects/schemas.d.ts +0 -222
- package/dist/modules/projects/schemas.js +0 -145
- package/dist/modules/sessions/index.d.ts +0 -1
- package/dist/modules/sessions/index.js +0 -1
- package/dist/modules/sessions/schemas.d.ts +0 -258
- package/dist/modules/sessions/schemas.js +0 -128
- package/dist/modules/versions/index.d.ts +0 -1
- package/dist/modules/versions/index.js +0 -1
- package/dist/modules/versions/schemas.d.ts +0 -248
- package/dist/modules/versions/schemas.js +0 -155
- /package/{dist/common/index.d.ts → src/common/index.ts} +0 -0
- /package/{dist/modules/analytics/index.d.ts → src/modules/analytics/index.ts} +0 -0
- /package/{dist/modules/analytics/index.js → src/modules/builds/index.ts} +0 -0
- /package/{dist/modules/builds/index.d.ts → src/modules/devices/index.ts} +0 -0
- /package/{dist/modules/builds/index.js → src/modules/environment/index.ts} +0 -0
- /package/{dist/modules/devices/index.d.ts → src/modules/identify/index.ts} +0 -0
- /package/{dist/modules/index.d.ts → src/modules/index.ts} +0 -0
- /package/{dist/modules/devices/index.js → src/modules/me/index.ts} +0 -0
- /package/{dist/modules/environment/index.d.ts → src/modules/orgs/index.ts} +0 -0
- /package/{dist/modules/environment/index.js → src/modules/personas/index.ts} +0 -0
- /package/{dist/modules/events/index.d.ts → src/modules/projects/index.ts} +0 -0
- /package/{dist/modules/events/index.js → src/modules/sessions/index.ts} +0 -0
- /package/{dist/modules/identify/index.d.ts → src/modules/versions/index.ts} +0 -0
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import { type Static } from "@sinclair/typebox";
|
|
2
|
-
import type { AssertSchemaCompatibleWithRow, AssertTrue } from "../../common";
|
|
3
|
-
/**
|
|
4
|
-
* Event type enum
|
|
5
|
-
*/
|
|
6
|
-
export declare const EventTypeEnum: readonly ["action", "screen_view", "custom"];
|
|
7
|
-
export type EventType = (typeof EventTypeEnum)[number];
|
|
8
|
-
/**
|
|
9
|
-
* Single event schema
|
|
10
|
-
*/
|
|
11
|
-
export declare const EventSchema: import("@sinclair/typebox").TObject<{
|
|
12
|
-
/**
|
|
13
|
-
* Name of the event (required)
|
|
14
|
-
*/
|
|
15
|
-
event_name: import("@sinclair/typebox").TString;
|
|
16
|
-
/**
|
|
17
|
-
* Type of event
|
|
18
|
-
*/
|
|
19
|
-
event_type: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"action">, import("@sinclair/typebox").TLiteral<"screen_view">, import("@sinclair/typebox").TLiteral<"custom">]>;
|
|
20
|
-
/**
|
|
21
|
-
* Custom properties for the event (optional)
|
|
22
|
-
*/
|
|
23
|
-
properties: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>>;
|
|
24
|
-
/**
|
|
25
|
-
* Client-side timestamp (optional, defaults to server time)
|
|
26
|
-
*/
|
|
27
|
-
timestamp: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
28
|
-
/**
|
|
29
|
-
* Session ID (optional, can come from header)
|
|
30
|
-
*/
|
|
31
|
-
session_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
32
|
-
/**
|
|
33
|
-
* Device ID (optional, can come from header)
|
|
34
|
-
*/
|
|
35
|
-
device_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
36
|
-
}>;
|
|
37
|
-
export type Event = Static<typeof EventSchema>;
|
|
38
|
-
/**
|
|
39
|
-
* Batch events request schema
|
|
40
|
-
* Accepts 1-100 events per request
|
|
41
|
-
*/
|
|
42
|
-
export declare const EventsRequestSchema: import("@sinclair/typebox").TObject<{
|
|
43
|
-
/**
|
|
44
|
-
* Array of events to ingest (1-100)
|
|
45
|
-
*/
|
|
46
|
-
events: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
47
|
-
/**
|
|
48
|
-
* Name of the event (required)
|
|
49
|
-
*/
|
|
50
|
-
event_name: import("@sinclair/typebox").TString;
|
|
51
|
-
/**
|
|
52
|
-
* Type of event
|
|
53
|
-
*/
|
|
54
|
-
event_type: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"action">, import("@sinclair/typebox").TLiteral<"screen_view">, import("@sinclair/typebox").TLiteral<"custom">]>;
|
|
55
|
-
/**
|
|
56
|
-
* Custom properties for the event (optional)
|
|
57
|
-
*/
|
|
58
|
-
properties: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>>;
|
|
59
|
-
/**
|
|
60
|
-
* Client-side timestamp (optional, defaults to server time)
|
|
61
|
-
*/
|
|
62
|
-
timestamp: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
63
|
-
/**
|
|
64
|
-
* Session ID (optional, can come from header)
|
|
65
|
-
*/
|
|
66
|
-
session_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
67
|
-
/**
|
|
68
|
-
* Device ID (optional, can come from header)
|
|
69
|
-
*/
|
|
70
|
-
device_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
71
|
-
}>>;
|
|
72
|
-
/**
|
|
73
|
-
* Session ID (optional, applies to all events if not specified per-event)
|
|
74
|
-
*/
|
|
75
|
-
session_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
76
|
-
/**
|
|
77
|
-
* Device ID (optional, applies to all events if not specified per-event)
|
|
78
|
-
*/
|
|
79
|
-
device_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
80
|
-
}>;
|
|
81
|
-
export type EventsRequest = Static<typeof EventsRequestSchema>;
|
|
82
|
-
/**
|
|
83
|
-
* Events response schema
|
|
84
|
-
*/
|
|
85
|
-
export declare const EventsResponseSchema: import("@sinclair/typebox").TObject<{
|
|
86
|
-
success: import("@sinclair/typebox").TLiteral<true>;
|
|
87
|
-
data: import("@sinclair/typebox").TObject<{
|
|
88
|
-
/**
|
|
89
|
-
* IDs of created events
|
|
90
|
-
*/
|
|
91
|
-
event_ids: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
|
|
92
|
-
/**
|
|
93
|
-
* Number of successfully processed events
|
|
94
|
-
*/
|
|
95
|
-
processed_count: import("@sinclair/typebox").TNumber;
|
|
96
|
-
/**
|
|
97
|
-
* Number of failed events
|
|
98
|
-
*/
|
|
99
|
-
failed_count: import("@sinclair/typebox").TNumber;
|
|
100
|
-
}>;
|
|
101
|
-
}>;
|
|
102
|
-
export type EventsResponse = Static<typeof EventsResponseSchema>;
|
|
103
|
-
/**
|
|
104
|
-
* Events error response schema
|
|
105
|
-
*/
|
|
106
|
-
export declare const EventsErrorResponseSchema: import("@sinclair/typebox").TObject<{
|
|
107
|
-
success: import("@sinclair/typebox").TLiteral<false>;
|
|
108
|
-
error: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
109
|
-
code: import("@sinclair/typebox").TLiteral<"MISSING_ORG_ID">;
|
|
110
|
-
message: import("@sinclair/typebox").TString;
|
|
111
|
-
}>, import("@sinclair/typebox").TObject<{
|
|
112
|
-
code: import("@sinclair/typebox").TLiteral<"MISSING_PROJECT_ID">;
|
|
113
|
-
message: import("@sinclair/typebox").TString;
|
|
114
|
-
}>, import("@sinclair/typebox").TObject<{
|
|
115
|
-
code: import("@sinclair/typebox").TLiteral<"MISSING_ENVIRONMENT_SLUG">;
|
|
116
|
-
message: import("@sinclair/typebox").TString;
|
|
117
|
-
}>, import("@sinclair/typebox").TObject<{
|
|
118
|
-
code: import("@sinclair/typebox").TLiteral<"MISSING_DEVICE_ID">;
|
|
119
|
-
message: import("@sinclair/typebox").TString;
|
|
120
|
-
}>, import("@sinclair/typebox").TObject<{
|
|
121
|
-
code: import("@sinclair/typebox").TLiteral<"EVENTS_PROCESSING_FAILED">;
|
|
122
|
-
message: import("@sinclair/typebox").TString;
|
|
123
|
-
}>, import("@sinclair/typebox").TObject<{
|
|
124
|
-
code: import("@sinclair/typebox").TLiteral<"INVALID_SESSION">;
|
|
125
|
-
message: import("@sinclair/typebox").TString;
|
|
126
|
-
}>, import("@sinclair/typebox").TObject<{
|
|
127
|
-
code: import("@sinclair/typebox").TLiteral<"INVALID_DEVICE">;
|
|
128
|
-
message: import("@sinclair/typebox").TString;
|
|
129
|
-
}>, import("@sinclair/typebox").TObject<{
|
|
130
|
-
code: import("@sinclair/typebox").TLiteral<"BATCH_SIZE_EXCEEDED">;
|
|
131
|
-
message: import("@sinclair/typebox").TString;
|
|
132
|
-
}>, import("@sinclair/typebox").TObject<{
|
|
133
|
-
code: import("@sinclair/typebox").TLiteral<"VALIDATION_ERROR">;
|
|
134
|
-
message: import("@sinclair/typebox").TString;
|
|
135
|
-
}>]>;
|
|
136
|
-
}>;
|
|
137
|
-
export type EventsErrorResponse = Static<typeof EventsErrorResponseSchema>;
|
|
138
|
-
export type _CheckEventRow = AssertTrue<AssertSchemaCompatibleWithRow<Event, "events">>;
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { Type } from "@sinclair/typebox";
|
|
2
|
-
/**
|
|
3
|
-
* Event type enum
|
|
4
|
-
*/
|
|
5
|
-
export const EventTypeEnum = ["action", "screen_view", "custom"];
|
|
6
|
-
/**
|
|
7
|
-
* Single event schema
|
|
8
|
-
*/
|
|
9
|
-
export const EventSchema = Type.Object({
|
|
10
|
-
/**
|
|
11
|
-
* Name of the event (required)
|
|
12
|
-
*/
|
|
13
|
-
event_name: Type.String({ minLength: 1, error: "event_name is required" }),
|
|
14
|
-
/**
|
|
15
|
-
* Type of event
|
|
16
|
-
*/
|
|
17
|
-
event_type: Type.Union([Type.Literal("action"), Type.Literal("screen_view"), Type.Literal("custom")], { default: "custom" }),
|
|
18
|
-
/**
|
|
19
|
-
* Custom properties for the event (optional)
|
|
20
|
-
*/
|
|
21
|
-
properties: Type.Optional(Type.Record(Type.String(), Type.Unknown())),
|
|
22
|
-
/**
|
|
23
|
-
* Client-side timestamp (optional, defaults to server time)
|
|
24
|
-
*/
|
|
25
|
-
timestamp: Type.Optional(Type.String()),
|
|
26
|
-
/**
|
|
27
|
-
* Session ID (optional, can come from header)
|
|
28
|
-
*/
|
|
29
|
-
session_id: Type.Optional(Type.String({ format: "uuid" })),
|
|
30
|
-
/**
|
|
31
|
-
* Device ID (optional, can come from header)
|
|
32
|
-
*/
|
|
33
|
-
device_id: Type.Optional(Type.String()),
|
|
34
|
-
});
|
|
35
|
-
/**
|
|
36
|
-
* Batch events request schema
|
|
37
|
-
* Accepts 1-100 events per request
|
|
38
|
-
*/
|
|
39
|
-
export const EventsRequestSchema = Type.Object({
|
|
40
|
-
/**
|
|
41
|
-
* Array of events to ingest (1-100)
|
|
42
|
-
*/
|
|
43
|
-
events: Type.Array(EventSchema, { minItems: 1, maxItems: 100, error: "At least one event is required, maximum 100" }),
|
|
44
|
-
/**
|
|
45
|
-
* Session ID (optional, applies to all events if not specified per-event)
|
|
46
|
-
*/
|
|
47
|
-
session_id: Type.Optional(Type.String({ format: "uuid" })),
|
|
48
|
-
/**
|
|
49
|
-
* Device ID (optional, applies to all events if not specified per-event)
|
|
50
|
-
*/
|
|
51
|
-
device_id: Type.Optional(Type.String()),
|
|
52
|
-
});
|
|
53
|
-
/**
|
|
54
|
-
* Events response schema
|
|
55
|
-
*/
|
|
56
|
-
export const EventsResponseSchema = Type.Object({
|
|
57
|
-
success: Type.Literal(true),
|
|
58
|
-
data: Type.Object({
|
|
59
|
-
/**
|
|
60
|
-
* IDs of created events
|
|
61
|
-
*/
|
|
62
|
-
event_ids: Type.Array(Type.String()),
|
|
63
|
-
/**
|
|
64
|
-
* Number of successfully processed events
|
|
65
|
-
*/
|
|
66
|
-
processed_count: Type.Number(),
|
|
67
|
-
/**
|
|
68
|
-
* Number of failed events
|
|
69
|
-
*/
|
|
70
|
-
failed_count: Type.Number(),
|
|
71
|
-
}),
|
|
72
|
-
});
|
|
73
|
-
/**
|
|
74
|
-
* Events error response schema
|
|
75
|
-
*/
|
|
76
|
-
export const EventsErrorResponseSchema = Type.Object({
|
|
77
|
-
success: Type.Literal(false),
|
|
78
|
-
error: Type.Union([
|
|
79
|
-
Type.Object({
|
|
80
|
-
code: Type.Literal("MISSING_ORG_ID"),
|
|
81
|
-
message: Type.String(),
|
|
82
|
-
}),
|
|
83
|
-
Type.Object({
|
|
84
|
-
code: Type.Literal("MISSING_PROJECT_ID"),
|
|
85
|
-
message: Type.String(),
|
|
86
|
-
}),
|
|
87
|
-
Type.Object({
|
|
88
|
-
code: Type.Literal("MISSING_ENVIRONMENT_SLUG"),
|
|
89
|
-
message: Type.String(),
|
|
90
|
-
}),
|
|
91
|
-
Type.Object({
|
|
92
|
-
code: Type.Literal("MISSING_DEVICE_ID"),
|
|
93
|
-
message: Type.String(),
|
|
94
|
-
}),
|
|
95
|
-
Type.Object({
|
|
96
|
-
code: Type.Literal("EVENTS_PROCESSING_FAILED"),
|
|
97
|
-
message: Type.String(),
|
|
98
|
-
}),
|
|
99
|
-
Type.Object({
|
|
100
|
-
code: Type.Literal("INVALID_SESSION"),
|
|
101
|
-
message: Type.String(),
|
|
102
|
-
}),
|
|
103
|
-
Type.Object({
|
|
104
|
-
code: Type.Literal("INVALID_DEVICE"),
|
|
105
|
-
message: Type.String(),
|
|
106
|
-
}),
|
|
107
|
-
Type.Object({
|
|
108
|
-
code: Type.Literal("BATCH_SIZE_EXCEEDED"),
|
|
109
|
-
message: Type.String(),
|
|
110
|
-
}),
|
|
111
|
-
Type.Object({
|
|
112
|
-
code: Type.Literal("VALIDATION_ERROR"),
|
|
113
|
-
message: Type.String(),
|
|
114
|
-
}),
|
|
115
|
-
]),
|
|
116
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./schemas";
|
|
@@ -1,377 +0,0 @@
|
|
|
1
|
-
import { type Static } from "@sinclair/typebox";
|
|
2
|
-
import { DevicePlatformEnum } from "@teardown/types";
|
|
3
|
-
export { DevicePlatformEnum };
|
|
4
|
-
/**
|
|
5
|
-
* Application info schema
|
|
6
|
-
*/
|
|
7
|
-
export declare const ApplicationInfoSchema: import("@sinclair/typebox").TObject<{
|
|
8
|
-
version: import("@sinclair/typebox").TString;
|
|
9
|
-
build_number: import("@sinclair/typebox").TString;
|
|
10
|
-
}>;
|
|
11
|
-
export type ApplicationInfo = Static<typeof ApplicationInfoSchema>;
|
|
12
|
-
/**
|
|
13
|
-
* OS info schema
|
|
14
|
-
*/
|
|
15
|
-
export declare const OSInfoSchema: import("@sinclair/typebox").TObject<{
|
|
16
|
-
/**
|
|
17
|
-
* Device platform
|
|
18
|
-
*/
|
|
19
|
-
platform: import("@sinclair/typebox").TEnum<typeof DevicePlatformEnum>;
|
|
20
|
-
/**
|
|
21
|
-
* OS name
|
|
22
|
-
*/
|
|
23
|
-
name: import("@sinclair/typebox").TString;
|
|
24
|
-
/**
|
|
25
|
-
* OS version
|
|
26
|
-
*/
|
|
27
|
-
version: import("@sinclair/typebox").TString;
|
|
28
|
-
}>;
|
|
29
|
-
export type OSInfo = Static<typeof OSInfoSchema>;
|
|
30
|
-
/**
|
|
31
|
-
* Hardware info schema
|
|
32
|
-
*/
|
|
33
|
-
export declare const HardwareInfoSchema: import("@sinclair/typebox").TObject<{
|
|
34
|
-
device_name: import("@sinclair/typebox").TString;
|
|
35
|
-
device_type: import("@sinclair/typebox").TString;
|
|
36
|
-
device_brand: import("@sinclair/typebox").TString;
|
|
37
|
-
}>;
|
|
38
|
-
export type HardwareInfo = Static<typeof HardwareInfoSchema>;
|
|
39
|
-
export declare const EmergencyLaunchSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
40
|
-
is_emergency_launch: import("@sinclair/typebox").TLiteral<true>;
|
|
41
|
-
reason: import("@sinclair/typebox").TString;
|
|
42
|
-
}>, import("@sinclair/typebox").TObject<{
|
|
43
|
-
is_emergency_launch: import("@sinclair/typebox").TLiteral<false>;
|
|
44
|
-
reason: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNever>;
|
|
45
|
-
}>]>;
|
|
46
|
-
export type EmergencyLaunch = Static<typeof EmergencyLaunchSchema>;
|
|
47
|
-
/**
|
|
48
|
-
* Update info schema
|
|
49
|
-
*/
|
|
50
|
-
export declare const DeviceUpdateInfoSchema: import("@sinclair/typebox").TObject<{
|
|
51
|
-
is_enabled: import("@sinclair/typebox").TBoolean;
|
|
52
|
-
update_id: import("@sinclair/typebox").TString;
|
|
53
|
-
update_channel: import("@sinclair/typebox").TString;
|
|
54
|
-
runtime_version: import("@sinclair/typebox").TString;
|
|
55
|
-
emergency_launch: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
56
|
-
is_emergency_launch: import("@sinclair/typebox").TLiteral<true>;
|
|
57
|
-
reason: import("@sinclair/typebox").TString;
|
|
58
|
-
}>, import("@sinclair/typebox").TObject<{
|
|
59
|
-
is_emergency_launch: import("@sinclair/typebox").TLiteral<false>;
|
|
60
|
-
reason: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNever>;
|
|
61
|
-
}>]>;
|
|
62
|
-
is_embedded_launch: import("@sinclair/typebox").TBoolean;
|
|
63
|
-
created_at: import("@sinclair/typebox").TString;
|
|
64
|
-
}>;
|
|
65
|
-
export type DeviceUpdateInfo = Static<typeof DeviceUpdateInfoSchema>;
|
|
66
|
-
export declare enum NotificationPlatformEnum {
|
|
67
|
-
APNS = "APNS",// Apple Push Notification Service
|
|
68
|
-
FCM = "FCM",// Firebase Cloud Messaging
|
|
69
|
-
EXPO = "EXPO"
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Push notification info schema
|
|
73
|
-
*/
|
|
74
|
-
export declare const PushNotificationInfoSchema: import("@sinclair/typebox").TObject<{
|
|
75
|
-
enabled: import("@sinclair/typebox").TBoolean;
|
|
76
|
-
granted: import("@sinclair/typebox").TBoolean;
|
|
77
|
-
token: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
78
|
-
platform: import("@sinclair/typebox").TEnum<typeof NotificationPlatformEnum>;
|
|
79
|
-
}>;
|
|
80
|
-
export type PushNotificationInfo = Static<typeof PushNotificationInfoSchema>;
|
|
81
|
-
export declare const NotificationsInfoSchema: import("@sinclair/typebox").TObject<{
|
|
82
|
-
push: import("@sinclair/typebox").TObject<{
|
|
83
|
-
enabled: import("@sinclair/typebox").TBoolean;
|
|
84
|
-
granted: import("@sinclair/typebox").TBoolean;
|
|
85
|
-
token: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
86
|
-
platform: import("@sinclair/typebox").TEnum<typeof NotificationPlatformEnum>;
|
|
87
|
-
}>;
|
|
88
|
-
}>;
|
|
89
|
-
export type NotificationsInfo = Static<typeof NotificationsInfoSchema>;
|
|
90
|
-
/**
|
|
91
|
-
* Device info schema
|
|
92
|
-
*/
|
|
93
|
-
export declare const DeviceInfoSchema: import("@sinclair/typebox").TObject<{
|
|
94
|
-
/**
|
|
95
|
-
* Timestamp of collection on device (optional, generated server-side if not provided)
|
|
96
|
-
*/
|
|
97
|
-
timestamp: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TDate>;
|
|
98
|
-
/**
|
|
99
|
-
* Application info, required
|
|
100
|
-
*/
|
|
101
|
-
application: import("@sinclair/typebox").TObject<{
|
|
102
|
-
version: import("@sinclair/typebox").TString;
|
|
103
|
-
build_number: import("@sinclair/typebox").TString;
|
|
104
|
-
}>;
|
|
105
|
-
/**
|
|
106
|
-
* Update info (optional) - not all builds will have an update
|
|
107
|
-
*/
|
|
108
|
-
update: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
109
|
-
is_enabled: import("@sinclair/typebox").TBoolean;
|
|
110
|
-
update_id: import("@sinclair/typebox").TString;
|
|
111
|
-
update_channel: import("@sinclair/typebox").TString;
|
|
112
|
-
runtime_version: import("@sinclair/typebox").TString;
|
|
113
|
-
emergency_launch: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
114
|
-
is_emergency_launch: import("@sinclair/typebox").TLiteral<true>;
|
|
115
|
-
reason: import("@sinclair/typebox").TString;
|
|
116
|
-
}>, import("@sinclair/typebox").TObject<{
|
|
117
|
-
is_emergency_launch: import("@sinclair/typebox").TLiteral<false>;
|
|
118
|
-
reason: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNever>;
|
|
119
|
-
}>]>;
|
|
120
|
-
is_embedded_launch: import("@sinclair/typebox").TBoolean;
|
|
121
|
-
created_at: import("@sinclair/typebox").TString;
|
|
122
|
-
}>, import("@sinclair/typebox").TNull]>;
|
|
123
|
-
/**
|
|
124
|
-
* Hardware info, required
|
|
125
|
-
*/
|
|
126
|
-
hardware: import("@sinclair/typebox").TObject<{
|
|
127
|
-
device_name: import("@sinclair/typebox").TString;
|
|
128
|
-
device_type: import("@sinclair/typebox").TString;
|
|
129
|
-
device_brand: import("@sinclair/typebox").TString;
|
|
130
|
-
}>;
|
|
131
|
-
/**
|
|
132
|
-
* OS info, required
|
|
133
|
-
*/
|
|
134
|
-
os: import("@sinclair/typebox").TObject<{
|
|
135
|
-
/**
|
|
136
|
-
* Device platform
|
|
137
|
-
*/
|
|
138
|
-
platform: import("@sinclair/typebox").TEnum<typeof DevicePlatformEnum>;
|
|
139
|
-
/**
|
|
140
|
-
* OS name
|
|
141
|
-
*/
|
|
142
|
-
name: import("@sinclair/typebox").TString;
|
|
143
|
-
/**
|
|
144
|
-
* OS version
|
|
145
|
-
*/
|
|
146
|
-
version: import("@sinclair/typebox").TString;
|
|
147
|
-
}>;
|
|
148
|
-
/**
|
|
149
|
-
* Notifications info, required
|
|
150
|
-
*/
|
|
151
|
-
notifications: import("@sinclair/typebox").TObject<{
|
|
152
|
-
push: import("@sinclair/typebox").TObject<{
|
|
153
|
-
enabled: import("@sinclair/typebox").TBoolean;
|
|
154
|
-
granted: import("@sinclair/typebox").TBoolean;
|
|
155
|
-
token: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
156
|
-
platform: import("@sinclair/typebox").TEnum<typeof NotificationPlatformEnum>;
|
|
157
|
-
}>;
|
|
158
|
-
}>;
|
|
159
|
-
}>;
|
|
160
|
-
export type DeviceInfo = Static<typeof DeviceInfoSchema>;
|
|
161
|
-
/**
|
|
162
|
-
* Persona info schema (optional fields)
|
|
163
|
-
* Matches personas table structure
|
|
164
|
-
*/
|
|
165
|
-
export declare const PersonaInfoSchema: import("@sinclair/typebox").TObject<{
|
|
166
|
-
user_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
167
|
-
email: import("@sinclair/typebox").TOptional<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>>;
|
|
168
|
-
name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
169
|
-
}>;
|
|
170
|
-
export type PersonaInfo = Static<typeof PersonaInfoSchema>;
|
|
171
|
-
/**
|
|
172
|
-
* Identify request schema
|
|
173
|
-
* Ties a device to a persona with optional persona data
|
|
174
|
-
*/
|
|
175
|
-
export declare const IdentifyRequestSchema: import("@sinclair/typebox").TObject<{
|
|
176
|
-
device: import("@sinclair/typebox").TObject<{
|
|
177
|
-
/**
|
|
178
|
-
* Timestamp of collection on device (optional, generated server-side if not provided)
|
|
179
|
-
*/
|
|
180
|
-
timestamp: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TDate>;
|
|
181
|
-
/**
|
|
182
|
-
* Application info, required
|
|
183
|
-
*/
|
|
184
|
-
application: import("@sinclair/typebox").TObject<{
|
|
185
|
-
version: import("@sinclair/typebox").TString;
|
|
186
|
-
build_number: import("@sinclair/typebox").TString;
|
|
187
|
-
}>;
|
|
188
|
-
/**
|
|
189
|
-
* Update info (optional) - not all builds will have an update
|
|
190
|
-
*/
|
|
191
|
-
update: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
192
|
-
is_enabled: import("@sinclair/typebox").TBoolean;
|
|
193
|
-
update_id: import("@sinclair/typebox").TString;
|
|
194
|
-
update_channel: import("@sinclair/typebox").TString;
|
|
195
|
-
runtime_version: import("@sinclair/typebox").TString;
|
|
196
|
-
emergency_launch: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
197
|
-
is_emergency_launch: import("@sinclair/typebox").TLiteral<true>;
|
|
198
|
-
reason: import("@sinclair/typebox").TString;
|
|
199
|
-
}>, import("@sinclair/typebox").TObject<{
|
|
200
|
-
is_emergency_launch: import("@sinclair/typebox").TLiteral<false>;
|
|
201
|
-
reason: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNever>;
|
|
202
|
-
}>]>;
|
|
203
|
-
is_embedded_launch: import("@sinclair/typebox").TBoolean;
|
|
204
|
-
created_at: import("@sinclair/typebox").TString;
|
|
205
|
-
}>, import("@sinclair/typebox").TNull]>;
|
|
206
|
-
/**
|
|
207
|
-
* Hardware info, required
|
|
208
|
-
*/
|
|
209
|
-
hardware: import("@sinclair/typebox").TObject<{
|
|
210
|
-
device_name: import("@sinclair/typebox").TString;
|
|
211
|
-
device_type: import("@sinclair/typebox").TString;
|
|
212
|
-
device_brand: import("@sinclair/typebox").TString;
|
|
213
|
-
}>;
|
|
214
|
-
/**
|
|
215
|
-
* OS info, required
|
|
216
|
-
*/
|
|
217
|
-
os: import("@sinclair/typebox").TObject<{
|
|
218
|
-
/**
|
|
219
|
-
* Device platform
|
|
220
|
-
*/
|
|
221
|
-
platform: import("@sinclair/typebox").TEnum<typeof DevicePlatformEnum>;
|
|
222
|
-
/**
|
|
223
|
-
* OS name
|
|
224
|
-
*/
|
|
225
|
-
name: import("@sinclair/typebox").TString;
|
|
226
|
-
/**
|
|
227
|
-
* OS version
|
|
228
|
-
*/
|
|
229
|
-
version: import("@sinclair/typebox").TString;
|
|
230
|
-
}>;
|
|
231
|
-
/**
|
|
232
|
-
* Notifications info, required
|
|
233
|
-
*/
|
|
234
|
-
notifications: import("@sinclair/typebox").TObject<{
|
|
235
|
-
push: import("@sinclair/typebox").TObject<{
|
|
236
|
-
enabled: import("@sinclair/typebox").TBoolean;
|
|
237
|
-
granted: import("@sinclair/typebox").TBoolean;
|
|
238
|
-
token: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
|
|
239
|
-
platform: import("@sinclair/typebox").TEnum<typeof NotificationPlatformEnum>;
|
|
240
|
-
}>;
|
|
241
|
-
}>;
|
|
242
|
-
}>;
|
|
243
|
-
persona: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
244
|
-
user_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
245
|
-
email: import("@sinclair/typebox").TOptional<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>>;
|
|
246
|
-
name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
247
|
-
}>>;
|
|
248
|
-
}>;
|
|
249
|
-
export type IdentifyRequest = Static<typeof IdentifyRequestSchema>;
|
|
250
|
-
export declare enum IdentifyVersionStatusEnum {
|
|
251
|
-
/**
|
|
252
|
-
* A new version is available
|
|
253
|
-
*/
|
|
254
|
-
UPDATE_AVAILABLE = "UPDATE_AVAILABLE",
|
|
255
|
-
/**
|
|
256
|
-
* An update is required
|
|
257
|
-
*/
|
|
258
|
-
UPDATE_REQUIRED = "UPDATE_REQUIRED",
|
|
259
|
-
/**
|
|
260
|
-
* The current version is valid & up to date
|
|
261
|
-
*/
|
|
262
|
-
UP_TO_DATE = "UP_TO_DATE",
|
|
263
|
-
/**
|
|
264
|
-
* The version or build has been disabled
|
|
265
|
-
*/
|
|
266
|
-
DISABLED = "DISABLED"
|
|
267
|
-
}
|
|
268
|
-
export declare const UpdateInfoSchema: import("@sinclair/typebox").TObject<{
|
|
269
|
-
version: import("@sinclair/typebox").TString;
|
|
270
|
-
build: import("@sinclair/typebox").TString;
|
|
271
|
-
update_id: import("@sinclair/typebox").TString;
|
|
272
|
-
effective_date: import("@sinclair/typebox").TDate;
|
|
273
|
-
}>;
|
|
274
|
-
export type UpdateInfo = Static<typeof UpdateInfoSchema>;
|
|
275
|
-
export declare const UpToDateInfoSchema: import("@sinclair/typebox").TObject<{
|
|
276
|
-
status: import("@sinclair/typebox").TLiteral<IdentifyVersionStatusEnum.UP_TO_DATE>;
|
|
277
|
-
update: import("@sinclair/typebox").TNull;
|
|
278
|
-
}>;
|
|
279
|
-
export type UpToDateInfo = Static<typeof UpToDateInfoSchema>;
|
|
280
|
-
export declare const UpdateRequiredInfoSchema: import("@sinclair/typebox").TObject<{
|
|
281
|
-
status: import("@sinclair/typebox").TLiteral<IdentifyVersionStatusEnum.UPDATE_REQUIRED>;
|
|
282
|
-
update: import("@sinclair/typebox").TObject<{
|
|
283
|
-
version: import("@sinclair/typebox").TString;
|
|
284
|
-
build: import("@sinclair/typebox").TString;
|
|
285
|
-
update_id: import("@sinclair/typebox").TString;
|
|
286
|
-
effective_date: import("@sinclair/typebox").TDate;
|
|
287
|
-
}>;
|
|
288
|
-
}>;
|
|
289
|
-
export type UpdateRequiredInfo = Static<typeof UpdateRequiredInfoSchema>;
|
|
290
|
-
export declare const UpdateAvailableInfoSchema: import("@sinclair/typebox").TObject<{
|
|
291
|
-
status: import("@sinclair/typebox").TLiteral<IdentifyVersionStatusEnum.UPDATE_AVAILABLE>;
|
|
292
|
-
update: import("@sinclair/typebox").TObject<{
|
|
293
|
-
version: import("@sinclair/typebox").TString;
|
|
294
|
-
build: import("@sinclair/typebox").TString;
|
|
295
|
-
update_id: import("@sinclair/typebox").TString;
|
|
296
|
-
effective_date: import("@sinclair/typebox").TDate;
|
|
297
|
-
}>;
|
|
298
|
-
}>;
|
|
299
|
-
export type UpdateAvailableInfo = Static<typeof UpdateAvailableInfoSchema>;
|
|
300
|
-
export declare const VersionInfoSchema: import("@sinclair/typebox").TObject<{
|
|
301
|
-
/**
|
|
302
|
-
* The status of the version
|
|
303
|
-
*/
|
|
304
|
-
status: import("@sinclair/typebox").TEnum<typeof IdentifyVersionStatusEnum>;
|
|
305
|
-
update: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
306
|
-
status: import("@sinclair/typebox").TLiteral<IdentifyVersionStatusEnum.UPDATE_AVAILABLE>;
|
|
307
|
-
update: import("@sinclair/typebox").TObject<{
|
|
308
|
-
version: import("@sinclair/typebox").TString;
|
|
309
|
-
build: import("@sinclair/typebox").TString;
|
|
310
|
-
update_id: import("@sinclair/typebox").TString;
|
|
311
|
-
effective_date: import("@sinclair/typebox").TDate;
|
|
312
|
-
}>;
|
|
313
|
-
}>, import("@sinclair/typebox").TNull]>>;
|
|
314
|
-
}>;
|
|
315
|
-
export type VersionInfo = Static<typeof VersionInfoSchema>;
|
|
316
|
-
/**
|
|
317
|
-
* Identify response schema
|
|
318
|
-
*/
|
|
319
|
-
export declare const IdentifyResponseSchema: import("@sinclair/typebox").TObject<{
|
|
320
|
-
success: import("@sinclair/typebox").TLiteral<true>;
|
|
321
|
-
data: import("@sinclair/typebox").TObject<{
|
|
322
|
-
session_id: import("@sinclair/typebox").TString;
|
|
323
|
-
device_id: import("@sinclair/typebox").TString;
|
|
324
|
-
persona_id: import("@sinclair/typebox").TString;
|
|
325
|
-
token: import("@sinclair/typebox").TString;
|
|
326
|
-
version_info: import("@sinclair/typebox").TObject<{
|
|
327
|
-
/**
|
|
328
|
-
* The status of the version
|
|
329
|
-
*/
|
|
330
|
-
status: import("@sinclair/typebox").TEnum<typeof IdentifyVersionStatusEnum>;
|
|
331
|
-
update: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
332
|
-
status: import("@sinclair/typebox").TLiteral<IdentifyVersionStatusEnum.UPDATE_AVAILABLE>;
|
|
333
|
-
update: import("@sinclair/typebox").TObject<{
|
|
334
|
-
version: import("@sinclair/typebox").TString;
|
|
335
|
-
build: import("@sinclair/typebox").TString;
|
|
336
|
-
update_id: import("@sinclair/typebox").TString;
|
|
337
|
-
effective_date: import("@sinclair/typebox").TDate;
|
|
338
|
-
}>;
|
|
339
|
-
}>, import("@sinclair/typebox").TNull]>>;
|
|
340
|
-
}>;
|
|
341
|
-
}>;
|
|
342
|
-
}>;
|
|
343
|
-
export type IdentifyResponse = Static<typeof IdentifyResponseSchema>;
|
|
344
|
-
export declare const IdentifyErrorResponseSchema: import("@sinclair/typebox").TObject<{
|
|
345
|
-
success: import("@sinclair/typebox").TLiteral<false>;
|
|
346
|
-
error: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
347
|
-
code: import("@sinclair/typebox").TLiteral<"MISSING_ORG_ID">;
|
|
348
|
-
message: import("@sinclair/typebox").TString;
|
|
349
|
-
}>, import("@sinclair/typebox").TObject<{
|
|
350
|
-
code: import("@sinclair/typebox").TLiteral<"MISSING_PROJECT_ID">;
|
|
351
|
-
message: import("@sinclair/typebox").TString;
|
|
352
|
-
}>, import("@sinclair/typebox").TObject<{
|
|
353
|
-
code: import("@sinclair/typebox").TLiteral<"MISSING_ENVIRONMENT_SLUG">;
|
|
354
|
-
message: import("@sinclair/typebox").TString;
|
|
355
|
-
}>, import("@sinclair/typebox").TObject<{
|
|
356
|
-
code: import("@sinclair/typebox").TLiteral<"MISSING_DEVICE_ID">;
|
|
357
|
-
message: import("@sinclair/typebox").TString;
|
|
358
|
-
}>, import("@sinclair/typebox").TObject<{
|
|
359
|
-
code: import("@sinclair/typebox").TLiteral<"IDENTIFY_FAILED">;
|
|
360
|
-
message: import("@sinclair/typebox").TString;
|
|
361
|
-
}>, import("@sinclair/typebox").TObject<{
|
|
362
|
-
code: import("@sinclair/typebox").TLiteral<"NO_SESSION_ID_GENERATED">;
|
|
363
|
-
message: import("@sinclair/typebox").TString;
|
|
364
|
-
}>, import("@sinclair/typebox").TObject<{
|
|
365
|
-
code: import("@sinclair/typebox").TLiteral<"NO_DEVICE_ID_GENERATED">;
|
|
366
|
-
message: import("@sinclair/typebox").TString;
|
|
367
|
-
}>, import("@sinclair/typebox").TObject<{
|
|
368
|
-
code: import("@sinclair/typebox").TLiteral<"NO_PERSONA_ID_GENERATED">;
|
|
369
|
-
message: import("@sinclair/typebox").TString;
|
|
370
|
-
}>]>;
|
|
371
|
-
}>;
|
|
372
|
-
export type IdentifyErrorResponse = Static<typeof IdentifyErrorResponseSchema>;
|
|
373
|
-
export declare const ValidationErrorSchema: import("@sinclair/typebox").TObject<{
|
|
374
|
-
success: import("@sinclair/typebox").TLiteral<false>;
|
|
375
|
-
error: import("@sinclair/typebox").TLiteral<"VALIDATION">;
|
|
376
|
-
message: import("@sinclair/typebox").TString;
|
|
377
|
-
}>;
|