@krak-stack/registry 0.1.50 → 0.1.52
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/CHANGELOG.md +34 -0
- package/README.md +16 -424
- package/dist/components/ui/data-table.d.ts +20 -1
- package/dist/components/ui/data-table.js +52 -1
- package/dist/lib/docs.js +2 -2
- package/dist/services/agent/client/index.js +1 -1
- package/dist/services/events/browser.d.ts +26 -0
- package/dist/services/events/browser.js +579 -0
- package/dist/services/events/client/audit-log-table.d.ts +53 -0
- package/dist/services/events/client/audit-log-table.js +3655 -0
- package/dist/services/events/index.d.ts +215 -0
- package/dist/services/events/index.js +1046 -0
- package/dist/services/events/migrations.d.ts +4 -0
- package/dist/services/events/migrations.js +42 -0
- package/dist/services/events/record.d.ts +3 -0
- package/dist/services/events/record.js +14 -0
- package/dist/services/events/request-context.d.ts +6 -0
- package/dist/services/events/schema.d.ts +237 -0
- package/dist/services/events/schema.js +361 -0
- package/dist/services/opentelemetry/api.d.ts +3 -1
- package/dist/services/opentelemetry/api.js +133 -64
- package/dist/services/opentelemetry/browser.d.ts +17 -20
- package/dist/services/opentelemetry/browser.js +58 -162
- package/dist/services/opentelemetry/events.d.ts +3 -1
- package/dist/services/opentelemetry/{server.d.ts → index.d.ts} +8 -5
- package/dist/services/opentelemetry/{server.js → index.js} +66 -48
- package/dist/services/opentelemetry/processor.d.ts +19 -0
- package/dist/services/opentelemetry/schema.d.ts +8 -20
- package/dist/services/opentelemetry/web-vitals.d.ts +15 -0
- package/dist/services/opentelemetry/web-vitals.js +229 -0
- package/package.json +35 -5
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import { Migrator, SqlClient } from "effect/sql";
|
|
3
|
+
export declare const eventsMigrations: Migrator.Loader<never>;
|
|
4
|
+
export declare const migrateEvents: Effect.Effect<readonly (readonly [id: number, name: string])[], Migrator.MigrationError | import("effect/sql/SqlError").SqlError, SqlClient.SqlClient>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// ../../src/services/events/migrations.ts
|
|
2
|
+
import { Effect } from "effect";
|
|
3
|
+
import { Migrator, SqlClient } from "effect/sql";
|
|
4
|
+
var eventsMigrations = Migrator.fromRecord({
|
|
5
|
+
"1_events_initial": Effect.gen(function* () {
|
|
6
|
+
const sql = yield* SqlClient.SqlClient;
|
|
7
|
+
const payloadType = sql.onDialectOrElse({
|
|
8
|
+
pg: () => sql.literal("jsonb"),
|
|
9
|
+
orElse: () => sql.literal("text")
|
|
10
|
+
});
|
|
11
|
+
yield* sql`CREATE TABLE events (
|
|
12
|
+
service_name text NOT NULL,
|
|
13
|
+
source text NOT NULL CHECK (source IN ('browser', 'server')),
|
|
14
|
+
event_id text NOT NULL,
|
|
15
|
+
event_name text NOT NULL,
|
|
16
|
+
event_type text NOT NULL,
|
|
17
|
+
occurred_at double precision NOT NULL,
|
|
18
|
+
received_at double precision NOT NULL,
|
|
19
|
+
organization_id text,
|
|
20
|
+
user_id text,
|
|
21
|
+
session_id text,
|
|
22
|
+
anonymous_id text,
|
|
23
|
+
payload_json ${payloadType} NOT NULL,
|
|
24
|
+
PRIMARY KEY (service_name, source, event_id)
|
|
25
|
+
)`;
|
|
26
|
+
yield* sql`CREATE INDEX events_organization_time ON events (service_name, organization_id, occurred_at)`;
|
|
27
|
+
yield* sql`CREATE INDEX events_visitor_time ON events (service_name, anonymous_id, received_at DESC, event_id DESC)`;
|
|
28
|
+
yield* sql`CREATE INDEX events_session_time ON events (service_name, session_id, occurred_at, event_id)`;
|
|
29
|
+
yield* sql.onDialectOrElse({
|
|
30
|
+
pg: () => sql`CREATE INDEX events_payload ON events USING gin (payload_json jsonb_path_ops)`,
|
|
31
|
+
orElse: () => Effect.void
|
|
32
|
+
});
|
|
33
|
+
})
|
|
34
|
+
});
|
|
35
|
+
var migrateEvents = Migrator.make({})({
|
|
36
|
+
loader: eventsMigrations,
|
|
37
|
+
table: "events_migrations"
|
|
38
|
+
});
|
|
39
|
+
export {
|
|
40
|
+
eventsMigrations,
|
|
41
|
+
migrateEvents
|
|
42
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// ../../src/services/events/record.ts
|
|
2
|
+
import { Option, Schema } from "effect";
|
|
3
|
+
var TextValue = Schema.Struct({ stringValue: Schema.String }).annotate({
|
|
4
|
+
identifier: "EventTextValue"
|
|
5
|
+
});
|
|
6
|
+
var TextArrayValue = Schema.Struct({
|
|
7
|
+
arrayValue: Schema.Struct({ values: Schema.Array(TextValue) })
|
|
8
|
+
}).annotate({ identifier: "EventTextArrayValue" });
|
|
9
|
+
var eventTextAttribute = (record, key) => Schema.decodeUnknownOption(TextValue)(record.attributes.find((attribute) => attribute.key === key)?.value).pipe(Option.map((value) => value.stringValue), Option.getOrNull);
|
|
10
|
+
var eventStringArrayAttribute = (record, key) => Schema.decodeUnknownOption(TextArrayValue)(record.attributes.find((attribute) => attribute.key === key)?.value).pipe(Option.map((value) => value.arrayValue.values.map((item) => item.stringValue)), Option.getOrElse(() => []));
|
|
11
|
+
export {
|
|
12
|
+
eventStringArrayAttribute,
|
|
13
|
+
eventTextAttribute
|
|
14
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { EventAttributes } from "../opentelemetry/schema.js";
|
|
2
|
+
import { type EventGeolocation } from "./schema.js";
|
|
3
|
+
/** Enable only behind a verified Cloudflare ingress that prevents origin bypass. */
|
|
4
|
+
export declare const cloudflareGeolocation: (headers: Readonly<Record<string, string | undefined>>) => EventGeolocation;
|
|
5
|
+
export declare const geolocationAttributes: (location: EventGeolocation | null) => Record<string, string | number | boolean | readonly string[] | readonly number[] | readonly boolean[]>;
|
|
6
|
+
export declare const deviceContext: (userAgent: string) => EventAttributes;
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export declare const EventUuid: Schema.String;
|
|
3
|
+
export declare const EventId: Schema.NonEmptyString;
|
|
4
|
+
export declare const BrowserEventPath: Schema.String;
|
|
5
|
+
export declare const EventIdentity: Schema.Struct<{
|
|
6
|
+
readonly userId: Schema.optional<Schema.NonEmptyString>;
|
|
7
|
+
readonly organizationId: Schema.optional<Schema.NonEmptyString>;
|
|
8
|
+
}>;
|
|
9
|
+
export type EventIdentity = typeof EventIdentity.Type;
|
|
10
|
+
export declare const EventIpAddress: Schema.String;
|
|
11
|
+
export declare const EventCountry: Schema.String;
|
|
12
|
+
export declare const EventRegion: Schema.String;
|
|
13
|
+
export declare const EventCity: Schema.NonEmptyString;
|
|
14
|
+
export declare const EventGeolocation: Schema.Struct<{
|
|
15
|
+
readonly ip: Schema.optional<Schema.String>;
|
|
16
|
+
readonly country: Schema.optional<Schema.String>;
|
|
17
|
+
readonly region: Schema.optional<Schema.String>;
|
|
18
|
+
readonly city: Schema.optional<Schema.NonEmptyString>;
|
|
19
|
+
}>;
|
|
20
|
+
export type EventGeolocation = typeof EventGeolocation.Type;
|
|
21
|
+
declare const EventGeolocationError_base: Schema.Class<EventGeolocationError, Schema.TaggedStruct<"EventGeolocationError", {}>, import("effect/Cause").YieldableError>;
|
|
22
|
+
export declare class EventGeolocationError extends EventGeolocationError_base {
|
|
23
|
+
}
|
|
24
|
+
export declare const BrowserEventOptions: Schema.Struct<{
|
|
25
|
+
readonly messageId: Schema.optional<Schema.NonEmptyString>;
|
|
26
|
+
readonly timestamp: Schema.optional<Schema.DateTimeUtc>;
|
|
27
|
+
readonly context: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean, Schema.$Array<Schema.String>, Schema.$Array<Schema.Finite>, Schema.$Array<Schema.Boolean>]>>>;
|
|
28
|
+
}>;
|
|
29
|
+
export declare const BrowserPage: Schema.Struct<{
|
|
30
|
+
readonly name: Schema.optional<Schema.NonEmptyString>;
|
|
31
|
+
readonly category: Schema.optional<Schema.NonEmptyString>;
|
|
32
|
+
readonly path: Schema.optional<Schema.NonEmptyString>;
|
|
33
|
+
readonly properties: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean, Schema.$Array<Schema.String>, Schema.$Array<Schema.Finite>, Schema.$Array<Schema.Boolean>]>>>;
|
|
34
|
+
readonly options: Schema.optional<Schema.Struct<{
|
|
35
|
+
readonly messageId: Schema.optional<Schema.NonEmptyString>;
|
|
36
|
+
readonly timestamp: Schema.optional<Schema.DateTimeUtc>;
|
|
37
|
+
readonly context: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean, Schema.$Array<Schema.String>, Schema.$Array<Schema.Finite>, Schema.$Array<Schema.Boolean>]>>>;
|
|
38
|
+
}>>;
|
|
39
|
+
}>;
|
|
40
|
+
export type BrowserEventOptions = typeof BrowserEventOptions.Type;
|
|
41
|
+
export type BrowserPageOptions = typeof BrowserPage.Type;
|
|
42
|
+
export declare const AuditTarget: Schema.Struct<{
|
|
43
|
+
readonly id: Schema.NonEmptyString;
|
|
44
|
+
readonly name: Schema.NonEmptyString;
|
|
45
|
+
readonly type: Schema.NonEmptyString;
|
|
46
|
+
}>;
|
|
47
|
+
export type AuditTarget = typeof AuditTarget.Type;
|
|
48
|
+
export declare const TrackEvent: Schema.Union<readonly [Schema.Struct<{
|
|
49
|
+
readonly eventId: Schema.optional<Schema.NonEmptyString>;
|
|
50
|
+
readonly name: Schema.NonEmptyString;
|
|
51
|
+
readonly properties: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean, Schema.$Array<Schema.String>, Schema.$Array<Schema.Finite>, Schema.$Array<Schema.Boolean>]>>>;
|
|
52
|
+
readonly identity: Schema.optional<Schema.Struct<{
|
|
53
|
+
readonly userId: Schema.optional<Schema.NonEmptyString>;
|
|
54
|
+
readonly organizationId: Schema.optional<Schema.NonEmptyString>;
|
|
55
|
+
}>>;
|
|
56
|
+
readonly timestamp: Schema.optional<Schema.DateTimeUtc>;
|
|
57
|
+
readonly category: Schema.optional<Schema.Literal<"analytics">>;
|
|
58
|
+
}>, Schema.Struct<{
|
|
59
|
+
readonly eventId: Schema.optional<Schema.NonEmptyString>;
|
|
60
|
+
readonly name: Schema.NonEmptyString;
|
|
61
|
+
readonly properties: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean, Schema.$Array<Schema.String>, Schema.$Array<Schema.Finite>, Schema.$Array<Schema.Boolean>]>>>;
|
|
62
|
+
readonly identity: Schema.optional<Schema.Struct<{
|
|
63
|
+
readonly userId: Schema.optional<Schema.NonEmptyString>;
|
|
64
|
+
readonly organizationId: Schema.optional<Schema.NonEmptyString>;
|
|
65
|
+
}>>;
|
|
66
|
+
readonly timestamp: Schema.optional<Schema.DateTimeUtc>;
|
|
67
|
+
readonly category: Schema.Literal<"audit">;
|
|
68
|
+
readonly target: Schema.Struct<{
|
|
69
|
+
readonly id: Schema.NonEmptyString;
|
|
70
|
+
readonly name: Schema.NonEmptyString;
|
|
71
|
+
readonly type: Schema.NonEmptyString;
|
|
72
|
+
}>;
|
|
73
|
+
}>]>;
|
|
74
|
+
export type TrackEvent = typeof TrackEvent.Type;
|
|
75
|
+
export declare const ListAudit: Schema.Struct<{
|
|
76
|
+
readonly page: Schema.decodeTo<Schema.Int, Schema.optional<Schema.Union<readonly [Schema.Number, Schema.NumberFromString]>>, never, never>;
|
|
77
|
+
readonly pageSize: Schema.decodeTo<Schema.Int, Schema.optional<Schema.Union<readonly [Schema.Number, Schema.NumberFromString]>>, never, never>;
|
|
78
|
+
readonly globalFilter: Schema.optional<Schema.String>;
|
|
79
|
+
readonly sort: Schema.optional<Schema.declare<readonly {
|
|
80
|
+
readonly id: string;
|
|
81
|
+
readonly direction: "asc" | "desc";
|
|
82
|
+
}[], readonly {
|
|
83
|
+
readonly id: string;
|
|
84
|
+
readonly direction: "asc" | "desc";
|
|
85
|
+
}[]>>;
|
|
86
|
+
readonly organizationId: Schema.NonEmptyString;
|
|
87
|
+
}>;
|
|
88
|
+
export declare const AuditSortId: Schema.Literals<readonly ["time", "eventName", "recordType", "record", "actorType", "actorId"]>;
|
|
89
|
+
export declare const AuditCount: Schema.Struct<{
|
|
90
|
+
readonly total: Schema.Int;
|
|
91
|
+
}>;
|
|
92
|
+
/** Minimal attribution contract; actor types and resolution belong to auth. */
|
|
93
|
+
export declare const AuditAttribution: Schema.Struct<{
|
|
94
|
+
readonly "app.actor.type": Schema.NonEmptyString;
|
|
95
|
+
readonly "app.actor.id": Schema.NonEmptyString;
|
|
96
|
+
}>;
|
|
97
|
+
/** Verified request attribution, never decoded from browser event attributes. */
|
|
98
|
+
export declare const RequestActorAttribution: Schema.Struct<{
|
|
99
|
+
readonly "app.actor.type": Schema.NonEmptyString;
|
|
100
|
+
readonly "app.actor.id": Schema.NonEmptyString;
|
|
101
|
+
readonly "app.auth.method": Schema.optional<Schema.NonEmptyString>;
|
|
102
|
+
readonly "app.auth.credential.id": Schema.optional<Schema.NonEmptyString>;
|
|
103
|
+
/** Initiating admin from a verified session; actor and user IDs remain the effective user. */
|
|
104
|
+
readonly "app.auth.impersonator.id": Schema.optional<Schema.NonEmptyString>;
|
|
105
|
+
readonly "user.roles": Schema.optional<Schema.$Array<Schema.String>>;
|
|
106
|
+
}>;
|
|
107
|
+
declare const EventsPersistenceError_base: Schema.Class<EventsPersistenceError, Schema.TaggedStruct<"EventsPersistenceError", {
|
|
108
|
+
readonly operation: Schema.String;
|
|
109
|
+
}>, import("effect/Cause").YieldableError>;
|
|
110
|
+
export declare class EventsPersistenceError extends EventsPersistenceError_base {
|
|
111
|
+
}
|
|
112
|
+
declare const EventConflictError_base: Schema.Class<EventConflictError, Schema.TaggedStruct<"EventConflictError", {
|
|
113
|
+
readonly eventId: Schema.NonEmptyString;
|
|
114
|
+
}>, import("effect/Cause").YieldableError>;
|
|
115
|
+
export declare class EventConflictError extends EventConflictError_base {
|
|
116
|
+
}
|
|
117
|
+
export declare const EventSource: Schema.Literals<readonly ["browser", "server"]>;
|
|
118
|
+
export type EventSource = typeof EventSource.Type;
|
|
119
|
+
export declare const ExistingEventRequest: Schema.Struct<{
|
|
120
|
+
readonly eventId: Schema.NonEmptyString;
|
|
121
|
+
readonly source: Schema.Literals<readonly ["browser", "server"]>;
|
|
122
|
+
}>;
|
|
123
|
+
export declare const StoredEventRequest: Schema.Struct<{
|
|
124
|
+
readonly source: Schema.Literals<readonly ["browser", "server"]>;
|
|
125
|
+
readonly event_id: Schema.NonEmptyString;
|
|
126
|
+
readonly event_name: Schema.NonEmptyString;
|
|
127
|
+
readonly event_type: Schema.Literals<readonly ["page", "track"]>;
|
|
128
|
+
readonly occurred_at: Schema.Finite;
|
|
129
|
+
readonly received_at: Schema.Finite;
|
|
130
|
+
readonly organization_id: Schema.NullOr<Schema.NonEmptyString>;
|
|
131
|
+
readonly user_id: Schema.NullOr<Schema.NonEmptyString>;
|
|
132
|
+
readonly session_id: Schema.NullOr<Schema.NonEmptyString>;
|
|
133
|
+
readonly anonymous_id: Schema.NullOr<Schema.NonEmptyString>;
|
|
134
|
+
readonly payload_json: Schema.String;
|
|
135
|
+
}>;
|
|
136
|
+
export declare const StoredEventId: Schema.Struct<{
|
|
137
|
+
readonly event_id: Schema.NonEmptyString;
|
|
138
|
+
}>;
|
|
139
|
+
export declare const EventAttribute: Schema.Struct<{
|
|
140
|
+
readonly key: Schema.NonEmptyString;
|
|
141
|
+
readonly value: Schema.Union<readonly [Schema.Union<readonly [Schema.Struct<{
|
|
142
|
+
readonly stringValue: Schema.String;
|
|
143
|
+
}>, Schema.Struct<{
|
|
144
|
+
readonly intValue: Schema.Union<readonly [Schema.String, Schema.Int]>;
|
|
145
|
+
}>, Schema.Struct<{
|
|
146
|
+
readonly doubleValue: Schema.Finite;
|
|
147
|
+
}>, Schema.Struct<{
|
|
148
|
+
readonly boolValue: Schema.Boolean;
|
|
149
|
+
}>]>, Schema.Struct<{
|
|
150
|
+
readonly arrayValue: Schema.Struct<{
|
|
151
|
+
readonly values: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
152
|
+
readonly stringValue: Schema.String;
|
|
153
|
+
}>, Schema.Struct<{
|
|
154
|
+
readonly intValue: Schema.Union<readonly [Schema.String, Schema.Int]>;
|
|
155
|
+
}>, Schema.Struct<{
|
|
156
|
+
readonly doubleValue: Schema.Finite;
|
|
157
|
+
}>, Schema.Struct<{
|
|
158
|
+
readonly boolValue: Schema.Boolean;
|
|
159
|
+
}>]>>;
|
|
160
|
+
}>;
|
|
161
|
+
}>]>;
|
|
162
|
+
}>;
|
|
163
|
+
export declare const EventLogRecord: Schema.Struct<{
|
|
164
|
+
readonly eventName: Schema.NonEmptyString;
|
|
165
|
+
readonly timeUnixNano: Schema.String;
|
|
166
|
+
readonly observedTimeUnixNano: Schema.optional<Schema.String>;
|
|
167
|
+
readonly severityNumber: Schema.optional<Schema.Int>;
|
|
168
|
+
readonly traceId: Schema.optional<Schema.String>;
|
|
169
|
+
readonly spanId: Schema.optional<Schema.String>;
|
|
170
|
+
readonly attributes: Schema.$Array<Schema.Struct<{
|
|
171
|
+
readonly key: Schema.NonEmptyString;
|
|
172
|
+
readonly value: Schema.Union<readonly [Schema.Union<readonly [Schema.Struct<{
|
|
173
|
+
readonly stringValue: Schema.String;
|
|
174
|
+
}>, Schema.Struct<{
|
|
175
|
+
readonly intValue: Schema.Union<readonly [Schema.String, Schema.Int]>;
|
|
176
|
+
}>, Schema.Struct<{
|
|
177
|
+
readonly doubleValue: Schema.Finite;
|
|
178
|
+
}>, Schema.Struct<{
|
|
179
|
+
readonly boolValue: Schema.Boolean;
|
|
180
|
+
}>]>, Schema.Struct<{
|
|
181
|
+
readonly arrayValue: Schema.Struct<{
|
|
182
|
+
readonly values: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
183
|
+
readonly stringValue: Schema.String;
|
|
184
|
+
}>, Schema.Struct<{
|
|
185
|
+
readonly intValue: Schema.Union<readonly [Schema.String, Schema.Int]>;
|
|
186
|
+
}>, Schema.Struct<{
|
|
187
|
+
readonly doubleValue: Schema.Finite;
|
|
188
|
+
}>, Schema.Struct<{
|
|
189
|
+
readonly boolValue: Schema.Boolean;
|
|
190
|
+
}>]>>;
|
|
191
|
+
}>;
|
|
192
|
+
}>]>;
|
|
193
|
+
}>>;
|
|
194
|
+
}>;
|
|
195
|
+
export declare const OtlpLogs: Schema.StructWithRest<Schema.Struct<{
|
|
196
|
+
readonly resourceLogs: Schema.withDecodingDefaultKey<Schema.$Array<Schema.StructWithRest<Schema.Struct<{
|
|
197
|
+
readonly scopeLogs: Schema.withDecodingDefaultKey<Schema.$Array<Schema.StructWithRest<Schema.Struct<{
|
|
198
|
+
readonly scope: Schema.optional<Schema.StructWithRest<Schema.Struct<{
|
|
199
|
+
readonly name: Schema.optional<Schema.String>;
|
|
200
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>;
|
|
201
|
+
readonly logRecords: Schema.withDecodingDefaultKey<Schema.$Array<Schema.Unknown>, never>;
|
|
202
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>, never>;
|
|
203
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>, never>;
|
|
204
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>;
|
|
205
|
+
export declare const StoredEventPayload: Schema.Struct<{
|
|
206
|
+
readonly payload_json: Schema.Union<readonly [Schema.StructWithRest<Schema.Struct<{
|
|
207
|
+
readonly resourceLogs: Schema.withDecodingDefaultKey<Schema.$Array<Schema.StructWithRest<Schema.Struct<{
|
|
208
|
+
readonly scopeLogs: Schema.withDecodingDefaultKey<Schema.$Array<Schema.StructWithRest<Schema.Struct<{
|
|
209
|
+
readonly scope: Schema.optional<Schema.StructWithRest<Schema.Struct<{
|
|
210
|
+
readonly name: Schema.optional<Schema.String>;
|
|
211
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>;
|
|
212
|
+
readonly logRecords: Schema.withDecodingDefaultKey<Schema.$Array<Schema.Unknown>, never>;
|
|
213
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>, never>;
|
|
214
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>, never>;
|
|
215
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>, Schema.fromJsonString<Schema.StructWithRest<Schema.Struct<{
|
|
216
|
+
readonly resourceLogs: Schema.withDecodingDefaultKey<Schema.$Array<Schema.StructWithRest<Schema.Struct<{
|
|
217
|
+
readonly scopeLogs: Schema.withDecodingDefaultKey<Schema.$Array<Schema.StructWithRest<Schema.Struct<{
|
|
218
|
+
readonly scope: Schema.optional<Schema.StructWithRest<Schema.Struct<{
|
|
219
|
+
readonly name: Schema.optional<Schema.String>;
|
|
220
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>;
|
|
221
|
+
readonly logRecords: Schema.withDecodingDefaultKey<Schema.$Array<Schema.Unknown>, never>;
|
|
222
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>, never>;
|
|
223
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>, never>;
|
|
224
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>>]>;
|
|
225
|
+
}>;
|
|
226
|
+
export declare const VisitorEventsRequest: Schema.Struct<{
|
|
227
|
+
readonly visitorId: Schema.NonEmptyString;
|
|
228
|
+
}>;
|
|
229
|
+
export declare const VisitorEventSession: Schema.Struct<{
|
|
230
|
+
readonly event_id: Schema.NonEmptyString;
|
|
231
|
+
readonly session_id: Schema.NullOr<Schema.NonEmptyString>;
|
|
232
|
+
readonly received_at: Schema.Finite;
|
|
233
|
+
}>;
|
|
234
|
+
export type EventLogRecord = typeof EventLogRecord.Type;
|
|
235
|
+
export type EventAttribute = typeof EventAttribute.Type;
|
|
236
|
+
export type OtlpLogs = typeof OtlpLogs.Type;
|
|
237
|
+
export {};
|
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
// ../../src/services/events/schema.ts
|
|
2
|
+
import { Effect as Effect2, Option as Option2, Schema as Schema3 } from "effect";
|
|
3
|
+
|
|
4
|
+
// ../../src/services/opentelemetry/schema.ts
|
|
5
|
+
import { Schema } from "effect";
|
|
6
|
+
var BrowserWebVital = Schema.Struct({
|
|
7
|
+
name: Schema.Literals(["LCP", "INP", "CLS", "FCP", "TTFB"]),
|
|
8
|
+
id: Schema.NonEmptyString.check(Schema.isMaxLength(64)),
|
|
9
|
+
value: Schema.Finite.check(Schema.isGreaterThanOrEqualTo(0)),
|
|
10
|
+
delta: Schema.Finite,
|
|
11
|
+
rating: Schema.Literals(["good", "needs-improvement", "poor"]),
|
|
12
|
+
navigationType: Schema.Literals([
|
|
13
|
+
"navigate",
|
|
14
|
+
"reload",
|
|
15
|
+
"back-forward",
|
|
16
|
+
"back-forward-cache",
|
|
17
|
+
"prerender",
|
|
18
|
+
"restore"
|
|
19
|
+
])
|
|
20
|
+
}).annotate({ identifier: "BrowserWebVital" });
|
|
21
|
+
var EventAttributeValue = Schema.Union([
|
|
22
|
+
Schema.String,
|
|
23
|
+
Schema.Finite,
|
|
24
|
+
Schema.Boolean,
|
|
25
|
+
Schema.Array(Schema.String),
|
|
26
|
+
Schema.Array(Schema.Finite),
|
|
27
|
+
Schema.Array(Schema.Boolean)
|
|
28
|
+
]);
|
|
29
|
+
var EventAttributesSchema = Schema.Record(Schema.String, EventAttributeValue).annotate({ identifier: "EventAttributes" });
|
|
30
|
+
var EventOptionsSchema = Schema.Struct({
|
|
31
|
+
userId: Schema.optional(Schema.NonEmptyString),
|
|
32
|
+
anonymousId: Schema.optional(Schema.NonEmptyString),
|
|
33
|
+
sessionId: Schema.optional(Schema.NonEmptyString),
|
|
34
|
+
messageId: Schema.optional(Schema.NonEmptyString),
|
|
35
|
+
timestamp: Schema.optional(Schema.DateTimeUtc),
|
|
36
|
+
context: Schema.optional(EventAttributesSchema)
|
|
37
|
+
}).annotate({ identifier: "EventOptions" });
|
|
38
|
+
var TelemetryEvent = Schema.Struct({
|
|
39
|
+
name: Schema.NonEmptyString,
|
|
40
|
+
properties: Schema.optional(EventAttributesSchema),
|
|
41
|
+
options: Schema.optional(EventOptionsSchema)
|
|
42
|
+
}).annotate({ identifier: "TelemetryEvent" });
|
|
43
|
+
|
|
44
|
+
// ../../src/lib/query.ts
|
|
45
|
+
import {
|
|
46
|
+
Effect,
|
|
47
|
+
Option,
|
|
48
|
+
Schema as Schema2,
|
|
49
|
+
SchemaGetter,
|
|
50
|
+
SchemaIssue,
|
|
51
|
+
SchemaTransformation
|
|
52
|
+
} from "effect";
|
|
53
|
+
var parseSortParam = (sort) => {
|
|
54
|
+
const id = sort.startsWith("-") ? sort.slice(1) : sort;
|
|
55
|
+
if (!id || id.includes(",") || id.includes(":")) {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
return { id, direction: sort.startsWith("-") ? "desc" : "asc" };
|
|
59
|
+
};
|
|
60
|
+
var SortDirection = Schema2.Union([
|
|
61
|
+
Schema2.Literal("asc"),
|
|
62
|
+
Schema2.Literal("desc")
|
|
63
|
+
]).pipe(Schema2.annotate({
|
|
64
|
+
identifier: "SortDirection",
|
|
65
|
+
title: "Sort Direction",
|
|
66
|
+
description: "Sort direction for list query results.",
|
|
67
|
+
examples: ["asc", "desc"]
|
|
68
|
+
}));
|
|
69
|
+
var SortParam = Schema2.Struct({
|
|
70
|
+
id: Schema2.NonEmptyString,
|
|
71
|
+
direction: SortDirection
|
|
72
|
+
}).pipe(Schema2.annotate({
|
|
73
|
+
identifier: "SortParam",
|
|
74
|
+
title: "Sort Parameter",
|
|
75
|
+
description: "Decoded sort parameter with a field id and direction.",
|
|
76
|
+
examples: [{ id: "publicName", direction: "asc" }]
|
|
77
|
+
}));
|
|
78
|
+
var SortParamFromString = Schema2.String.pipe(Schema2.decodeTo(SortParam, SchemaTransformation.transformEffect({
|
|
79
|
+
decode: (sort) => {
|
|
80
|
+
const sortParam = parseSortParam(sort);
|
|
81
|
+
if (!sortParam) {
|
|
82
|
+
return Effect.fail(new SchemaIssue.InvalidValue({ message: 'Expected sort in the format "field" or "-field"' }, sort));
|
|
83
|
+
}
|
|
84
|
+
return Effect.succeed(sortParam);
|
|
85
|
+
},
|
|
86
|
+
encode: (sort) => Effect.succeed(sort.direction === "desc" ? `-${sort.id}` : sort.id)
|
|
87
|
+
})), Schema2.annotate({
|
|
88
|
+
identifier: "SortParamFromString",
|
|
89
|
+
title: "Sort Parameter From String",
|
|
90
|
+
description: 'URL encoded single sort parameter where descending fields are prefixed with "-".',
|
|
91
|
+
examples: [{ id: "publicName", direction: "asc" }]
|
|
92
|
+
}));
|
|
93
|
+
var SortParamsFromString = Schema2.String.pipe(Schema2.decodeTo(Schema2.Array(SortParam), SchemaTransformation.transformEffect({
|
|
94
|
+
decode: (sort) => {
|
|
95
|
+
if (sort === "")
|
|
96
|
+
return Effect.succeed([]);
|
|
97
|
+
const parts = sort.split(",");
|
|
98
|
+
const sortParams = [];
|
|
99
|
+
for (const part of parts) {
|
|
100
|
+
const sortParam = parseSortParam(part);
|
|
101
|
+
if (!sortParam) {
|
|
102
|
+
return Effect.fail(new SchemaIssue.InvalidValue({ message: 'Expected sort in the format "field,-otherField"' }, sort));
|
|
103
|
+
}
|
|
104
|
+
sortParams.push(sortParam);
|
|
105
|
+
}
|
|
106
|
+
return Effect.succeed(sortParams);
|
|
107
|
+
},
|
|
108
|
+
encode: (sort) => Effect.succeed(sort.map((part) => Schema2.encodeSync(SortParamFromString)(part)).join(","))
|
|
109
|
+
})), Schema2.annotate({
|
|
110
|
+
identifier: "SortParamsFromString",
|
|
111
|
+
title: "Sort Parameters From String",
|
|
112
|
+
description: 'URL encoded sort parameters where descending fields are prefixed with "-" and multiple fields are comma-separated.',
|
|
113
|
+
examples: [
|
|
114
|
+
[
|
|
115
|
+
{ id: "name", direction: "desc" },
|
|
116
|
+
{ id: "age", direction: "asc" }
|
|
117
|
+
]
|
|
118
|
+
]
|
|
119
|
+
}));
|
|
120
|
+
var SortParamsArray = Schema2.Array(SortParam);
|
|
121
|
+
var SortParams = Schema2.declare(Schema2.is(SortParamsArray), {
|
|
122
|
+
identifier: "SortParams",
|
|
123
|
+
toCodec: () => Schema2.link()(SortParamsArray, SchemaTransformation.passthrough()),
|
|
124
|
+
toCodecStringTree: () => Schema2.link()(SortParamsFromString, SchemaTransformation.passthrough())
|
|
125
|
+
});
|
|
126
|
+
var Query = Schema2.Struct({
|
|
127
|
+
page: Schema2.optional(Schema2.Union([Schema2.Number, Schema2.NumberFromString]).check(Schema2.isInt(), Schema2.isGreaterThanOrEqualTo(0))).pipe(Schema2.decodeTo(Schema2.Int.check(Schema2.isGreaterThanOrEqualTo(0)), {
|
|
128
|
+
decode: SchemaGetter.withDefault(Effect.succeed(0)),
|
|
129
|
+
encode: SchemaGetter.transformOptional(Option.filter((page) => page !== 0))
|
|
130
|
+
})),
|
|
131
|
+
pageSize: Schema2.optional(Schema2.Union([Schema2.Number, Schema2.NumberFromString]).check(Schema2.isInt(), Schema2.isBetween({ minimum: 1, maximum: 100 }))).pipe(Schema2.decodeTo(Schema2.Int.check(Schema2.isBetween({ minimum: 1, maximum: 100 })), {
|
|
132
|
+
decode: SchemaGetter.withDefault(Effect.succeed(20)),
|
|
133
|
+
encode: SchemaGetter.transformOptional(Option.filter((pageSize) => pageSize !== 20))
|
|
134
|
+
})),
|
|
135
|
+
globalFilter: Schema2.optional(Schema2.String),
|
|
136
|
+
sort: Schema2.optional(SortParams)
|
|
137
|
+
}).annotate({
|
|
138
|
+
identifier: "Query",
|
|
139
|
+
title: "Query",
|
|
140
|
+
description: "Zero-based page request parameters with optional filtering and sorting for list endpoints.",
|
|
141
|
+
examples: [
|
|
142
|
+
{
|
|
143
|
+
page: 0,
|
|
144
|
+
pageSize: 20,
|
|
145
|
+
globalFilter: "housing",
|
|
146
|
+
sort: [
|
|
147
|
+
{ id: "publicName", direction: "desc" },
|
|
148
|
+
{ id: "createdAt", direction: "asc" }
|
|
149
|
+
]
|
|
150
|
+
}
|
|
151
|
+
]
|
|
152
|
+
});
|
|
153
|
+
var QueryStandard = Schema2.toStandardSchemaV1(Query);
|
|
154
|
+
var PaginationMeta = Schema2.Struct({
|
|
155
|
+
page: Schema2.Int,
|
|
156
|
+
pageSize: Schema2.Int,
|
|
157
|
+
total: Schema2.Int,
|
|
158
|
+
pageCount: Schema2.Int
|
|
159
|
+
}).pipe(Schema2.annotate({
|
|
160
|
+
identifier: "PaginationMeta",
|
|
161
|
+
title: "Pagination Metadata",
|
|
162
|
+
description: "Pagination metadata returned with a paginated list response.",
|
|
163
|
+
examples: [{ page: 0, pageSize: 20, total: 125, pageCount: 7 }]
|
|
164
|
+
}));
|
|
165
|
+
|
|
166
|
+
// ../../src/services/events/schema.ts
|
|
167
|
+
var EventUuid = Schema3.String.check(Schema3.isUUID());
|
|
168
|
+
var EventId = Schema3.NonEmptyString.check(Schema3.isMaxLength(100));
|
|
169
|
+
var BrowserEventPath = Schema3.String.check(Schema3.isMaxLength(2048), Schema3.isPattern(/^\/(?!\/)[^?#]*$/));
|
|
170
|
+
var EventIdentity = Schema3.Struct({
|
|
171
|
+
userId: Schema3.optional(Schema3.NonEmptyString),
|
|
172
|
+
organizationId: Schema3.optional(Schema3.NonEmptyString)
|
|
173
|
+
}).annotate({ identifier: "EventIdentity" });
|
|
174
|
+
var EventIpAddress = Schema3.String.check(Schema3.makeFilter((value) => Option2.isSome(Schema3.decodeUnknownOption(Schema3.IpAddressFromString)(value)) || "Invalid IP address")).annotate({ identifier: "EventIpAddress" });
|
|
175
|
+
var EventCountry = Schema3.String.check(Schema3.isPattern(/^[A-Z]{2}$/), Schema3.makeFilter((value) => !["XX", "T1"].includes(value) || "Unknown country")).annotate({ identifier: "EventCountry" });
|
|
176
|
+
var EventRegion = Schema3.String.check(Schema3.isPattern(/^[A-Z0-9]{1,3}$/)).annotate({ identifier: "EventRegion" });
|
|
177
|
+
var EventCity = Schema3.NonEmptyString.check(Schema3.isMaxLength(128)).annotate({ identifier: "EventCity" });
|
|
178
|
+
var EventGeolocation = Schema3.Struct({
|
|
179
|
+
ip: Schema3.optional(EventIpAddress),
|
|
180
|
+
country: Schema3.optional(EventCountry),
|
|
181
|
+
region: Schema3.optional(EventRegion),
|
|
182
|
+
city: Schema3.optional(EventCity)
|
|
183
|
+
}).annotate({ identifier: "EventGeolocation" });
|
|
184
|
+
|
|
185
|
+
class EventGeolocationError extends Schema3.TaggedError()("EventGeolocationError", {}) {
|
|
186
|
+
}
|
|
187
|
+
var BrowserEventOptions = Schema3.Struct({
|
|
188
|
+
messageId: Schema3.optional(EventId),
|
|
189
|
+
timestamp: Schema3.optional(Schema3.DateTimeUtc),
|
|
190
|
+
context: Schema3.optional(EventAttributesSchema)
|
|
191
|
+
}).annotate({ identifier: "BrowserEventOptions" });
|
|
192
|
+
var BrowserPage = Schema3.Struct({
|
|
193
|
+
name: Schema3.optional(Schema3.NonEmptyString),
|
|
194
|
+
category: Schema3.optional(Schema3.NonEmptyString),
|
|
195
|
+
path: Schema3.optional(Schema3.NonEmptyString),
|
|
196
|
+
properties: Schema3.optional(EventAttributesSchema),
|
|
197
|
+
options: Schema3.optional(BrowserEventOptions)
|
|
198
|
+
}).annotate({ identifier: "BrowserPage" });
|
|
199
|
+
var AuditTarget = Schema3.Struct({
|
|
200
|
+
id: Schema3.NonEmptyString.check(Schema3.isMaxLength(256)),
|
|
201
|
+
name: Schema3.NonEmptyString.check(Schema3.isMaxLength(2048)),
|
|
202
|
+
type: Schema3.NonEmptyString.check(Schema3.isMaxLength(128))
|
|
203
|
+
}).annotate({ identifier: "AuditTarget" });
|
|
204
|
+
var trackEventFields = {
|
|
205
|
+
eventId: Schema3.optional(EventId),
|
|
206
|
+
name: Schema3.NonEmptyString.check(Schema3.isMaxLength(128)),
|
|
207
|
+
properties: Schema3.optional(EventAttributesSchema),
|
|
208
|
+
identity: Schema3.optional(EventIdentity),
|
|
209
|
+
timestamp: Schema3.optional(Schema3.DateTimeUtc)
|
|
210
|
+
};
|
|
211
|
+
var TrackEvent = Schema3.Union([
|
|
212
|
+
Schema3.Struct({
|
|
213
|
+
...trackEventFields,
|
|
214
|
+
category: Schema3.optional(Schema3.Literal("analytics"))
|
|
215
|
+
}),
|
|
216
|
+
Schema3.Struct({
|
|
217
|
+
...trackEventFields,
|
|
218
|
+
category: Schema3.Literal("audit"),
|
|
219
|
+
target: AuditTarget
|
|
220
|
+
})
|
|
221
|
+
]).annotate({ identifier: "TrackEvent" });
|
|
222
|
+
var ListAudit = Schema3.Struct({
|
|
223
|
+
organizationId: Schema3.NonEmptyString,
|
|
224
|
+
...Query.fields
|
|
225
|
+
}).annotate({ identifier: "ListAudit" });
|
|
226
|
+
var AuditSortId = Schema3.Literals([
|
|
227
|
+
"time",
|
|
228
|
+
"eventName",
|
|
229
|
+
"recordType",
|
|
230
|
+
"record",
|
|
231
|
+
"actorType",
|
|
232
|
+
"actorId"
|
|
233
|
+
]).annotate({ identifier: "AuditSortId" });
|
|
234
|
+
var AuditCount = Schema3.Struct({ total: Schema3.Int }).annotate({
|
|
235
|
+
identifier: "AuditCount"
|
|
236
|
+
});
|
|
237
|
+
var AuditAttribution = Schema3.Struct({
|
|
238
|
+
"app.actor.type": Schema3.NonEmptyString,
|
|
239
|
+
"app.actor.id": Schema3.NonEmptyString
|
|
240
|
+
}).annotate({ identifier: "AuditAttribution" });
|
|
241
|
+
var RequestActorAttribution = Schema3.Struct({
|
|
242
|
+
...AuditAttribution.fields,
|
|
243
|
+
"app.auth.method": Schema3.optional(Schema3.NonEmptyString),
|
|
244
|
+
"app.auth.credential.id": Schema3.optional(Schema3.NonEmptyString),
|
|
245
|
+
"app.auth.impersonator.id": Schema3.optional(Schema3.NonEmptyString),
|
|
246
|
+
"user.roles": Schema3.optional(Schema3.Array(Schema3.String))
|
|
247
|
+
}).annotate({ identifier: "RequestActorAttribution" });
|
|
248
|
+
|
|
249
|
+
class EventsPersistenceError extends Schema3.TaggedError()("EventsPersistenceError", { operation: Schema3.String }) {
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
class EventConflictError extends Schema3.TaggedError()("EventConflictError", { eventId: EventId }) {
|
|
253
|
+
}
|
|
254
|
+
var EventSource = Schema3.Literals(["browser", "server"]).annotate({
|
|
255
|
+
identifier: "EventSource"
|
|
256
|
+
});
|
|
257
|
+
var ExistingEventRequest = Schema3.Struct({
|
|
258
|
+
eventId: EventId,
|
|
259
|
+
source: EventSource
|
|
260
|
+
}).annotate({ identifier: "ExistingEventRequest" });
|
|
261
|
+
var StoredEventRequest = Schema3.Struct({
|
|
262
|
+
source: EventSource,
|
|
263
|
+
event_id: EventId,
|
|
264
|
+
event_name: Schema3.NonEmptyString,
|
|
265
|
+
event_type: Schema3.Literals(["page", "track"]),
|
|
266
|
+
occurred_at: Schema3.Finite,
|
|
267
|
+
received_at: Schema3.Finite,
|
|
268
|
+
organization_id: Schema3.NullOr(Schema3.NonEmptyString),
|
|
269
|
+
user_id: Schema3.NullOr(Schema3.NonEmptyString),
|
|
270
|
+
session_id: Schema3.NullOr(Schema3.NonEmptyString),
|
|
271
|
+
anonymous_id: Schema3.NullOr(Schema3.NonEmptyString),
|
|
272
|
+
payload_json: Schema3.String
|
|
273
|
+
}).annotate({ identifier: "StoredEventRequest" });
|
|
274
|
+
var StoredEventId = Schema3.Struct({
|
|
275
|
+
event_id: EventId
|
|
276
|
+
}).annotate({ identifier: "StoredEventId" });
|
|
277
|
+
var PrimitiveValue = Schema3.Union([
|
|
278
|
+
Schema3.Struct({ stringValue: Schema3.String.check(Schema3.isMaxLength(2048)) }),
|
|
279
|
+
Schema3.Struct({
|
|
280
|
+
intValue: Schema3.Union([
|
|
281
|
+
Schema3.String.check(Schema3.isPattern(/^-?\d{1,20}$/)),
|
|
282
|
+
Schema3.Int
|
|
283
|
+
])
|
|
284
|
+
}),
|
|
285
|
+
Schema3.Struct({ doubleValue: Schema3.Finite }),
|
|
286
|
+
Schema3.Struct({ boolValue: Schema3.Boolean })
|
|
287
|
+
]);
|
|
288
|
+
var AttributeValue = Schema3.Union([
|
|
289
|
+
PrimitiveValue,
|
|
290
|
+
Schema3.Struct({
|
|
291
|
+
arrayValue: Schema3.Struct({
|
|
292
|
+
values: Schema3.Array(PrimitiveValue).check(Schema3.isMaxLength(32))
|
|
293
|
+
})
|
|
294
|
+
})
|
|
295
|
+
]);
|
|
296
|
+
var EventAttribute = Schema3.Struct({
|
|
297
|
+
key: Schema3.NonEmptyString.check(Schema3.isMaxLength(128)),
|
|
298
|
+
value: AttributeValue
|
|
299
|
+
}).annotate({ identifier: "EventAttribute" });
|
|
300
|
+
var EventLogRecord = Schema3.Struct({
|
|
301
|
+
eventName: Schema3.NonEmptyString.check(Schema3.isMaxLength(128), Schema3.isPattern(/^[^\r\n]+$/)),
|
|
302
|
+
timeUnixNano: Schema3.String.check(Schema3.isPattern(/^\d{1,20}$/)),
|
|
303
|
+
observedTimeUnixNano: Schema3.optional(Schema3.String.check(Schema3.isPattern(/^\d{1,20}$/))),
|
|
304
|
+
severityNumber: Schema3.optional(Schema3.Int),
|
|
305
|
+
traceId: Schema3.optional(Schema3.String.check(Schema3.isPattern(/^[a-f0-9]{32}$/))),
|
|
306
|
+
spanId: Schema3.optional(Schema3.String.check(Schema3.isPattern(/^[a-f0-9]{16}$/))),
|
|
307
|
+
attributes: Schema3.Array(EventAttribute).check(Schema3.isMaxLength(64), Schema3.makeFilter((values) => new Set(values.map(({ key }) => key)).size === values.length || "Duplicate attribute keys"))
|
|
308
|
+
}).annotate({ identifier: "EventLogRecord" });
|
|
309
|
+
var extensions = Schema3.Record(Schema3.String, Schema3.Unknown);
|
|
310
|
+
var OtlpLogs = Schema3.StructWithRest(Schema3.Struct({
|
|
311
|
+
resourceLogs: Schema3.Array(Schema3.StructWithRest(Schema3.Struct({
|
|
312
|
+
scopeLogs: Schema3.Array(Schema3.StructWithRest(Schema3.Struct({
|
|
313
|
+
scope: Schema3.optional(Schema3.StructWithRest(Schema3.Struct({ name: Schema3.optional(Schema3.String) }), [extensions])),
|
|
314
|
+
logRecords: Schema3.Array(Schema3.Unknown).pipe(Schema3.withDecodingDefaultKey(Effect2.succeed([])))
|
|
315
|
+
}), [extensions])).pipe(Schema3.withDecodingDefaultKey(Effect2.succeed([])))
|
|
316
|
+
}), [extensions])).pipe(Schema3.withDecodingDefaultKey(Effect2.succeed([])))
|
|
317
|
+
}), [extensions]).annotate({ identifier: "EventsOtlpLogs" });
|
|
318
|
+
var StoredEventPayload = Schema3.Struct({
|
|
319
|
+
payload_json: Schema3.Union([OtlpLogs, Schema3.fromJsonString(OtlpLogs)])
|
|
320
|
+
}).annotate({ identifier: "StoredEventPayload" });
|
|
321
|
+
var VisitorEventsRequest = Schema3.Struct({
|
|
322
|
+
visitorId: Schema3.NonEmptyString
|
|
323
|
+
}).annotate({ identifier: "VisitorEventsRequest" });
|
|
324
|
+
var VisitorEventSession = Schema3.Struct({
|
|
325
|
+
event_id: EventId,
|
|
326
|
+
session_id: Schema3.NullOr(Schema3.NonEmptyString),
|
|
327
|
+
received_at: Schema3.Finite
|
|
328
|
+
}).annotate({ identifier: "VisitorEventSession" });
|
|
329
|
+
export {
|
|
330
|
+
AuditAttribution,
|
|
331
|
+
AuditCount,
|
|
332
|
+
AuditSortId,
|
|
333
|
+
AuditTarget,
|
|
334
|
+
BrowserEventOptions,
|
|
335
|
+
BrowserEventPath,
|
|
336
|
+
BrowserPage,
|
|
337
|
+
EventAttribute,
|
|
338
|
+
EventCity,
|
|
339
|
+
EventConflictError,
|
|
340
|
+
EventCountry,
|
|
341
|
+
EventGeolocation,
|
|
342
|
+
EventGeolocationError,
|
|
343
|
+
EventId,
|
|
344
|
+
EventIdentity,
|
|
345
|
+
EventIpAddress,
|
|
346
|
+
EventLogRecord,
|
|
347
|
+
EventRegion,
|
|
348
|
+
EventSource,
|
|
349
|
+
EventUuid,
|
|
350
|
+
EventsPersistenceError,
|
|
351
|
+
ExistingEventRequest,
|
|
352
|
+
ListAudit,
|
|
353
|
+
OtlpLogs,
|
|
354
|
+
RequestActorAttribution,
|
|
355
|
+
StoredEventId,
|
|
356
|
+
StoredEventPayload,
|
|
357
|
+
StoredEventRequest,
|
|
358
|
+
TrackEvent,
|
|
359
|
+
VisitorEventSession,
|
|
360
|
+
VisitorEventsRequest
|
|
361
|
+
};
|