@krak-stack/registry 0.2.0 → 0.2.1
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 +6 -0
- package/dist/components/ui/app-brand.js +17 -17
- package/dist/components/ui/code-block.js +6 -6
- package/dist/components/ui/color-picker.js +26 -28
- package/dist/components/ui/copy-button.js +4 -4
- package/dist/components/ui/data-table.js +441 -442
- package/dist/components/ui/editing-locale-switcher.js +10 -10
- package/dist/components/ui/effect-form.js +183 -184
- package/dist/components/ui/error-component.js +6 -6
- package/dist/components/ui/file-picker.js +2 -2
- package/dist/components/ui/form.d.ts +5 -5
- package/dist/components/ui/form.js +136 -137
- package/dist/components/ui/google-map.js +2 -2
- package/dist/components/ui/icon-input.js +45 -48
- package/dist/components/ui/krakstack-provider.js +2 -2
- package/dist/components/ui/locale-switcher.js +4 -4
- package/dist/components/ui/pagination.js +2 -2
- package/dist/components/ui/search-menu.js +2 -2
- package/dist/components/ui/sidebar-layout.js +67 -72
- package/dist/components/ui/theme-switcher.js +6 -6
- package/dist/components/ui/virtualized-combobox.js +31 -34
- package/dist/lib/docs.js +166 -171
- package/dist/lib/docs.server.js +18 -40
- package/dist/lib/documentation-toolkit.js +19 -41
- package/dist/lib/httpapi-adapter.js +2 -2
- package/dist/lib/httpapi-cli.js +7 -7
- package/dist/lib/query.js +11 -11
- package/dist/lib/seo.js +2 -2
- package/dist/lib/webfetch-toolkit.js +6 -6
- package/dist/oxlint/anti-slop/index.js +2 -2
- package/dist/services/agent/client/index.js +153 -155
- package/dist/services/agent/index.js +2 -2
- package/dist/services/agent/schema.js +5 -5
- package/dist/services/events/browser.js +6 -6
- package/dist/services/events/client/audit-log-table.js +445 -446
- package/dist/services/events/index.js +59 -59
- package/dist/services/events/migrations.js +2 -2
- package/dist/services/events/record.js +2 -2
- package/dist/services/events/schema.js +39 -39
- package/dist/services/file-extraction/index.js +4 -4
- package/dist/services/file-extraction/schema.js +2 -2
- package/dist/services/health/index.js +9 -9
- package/dist/services/notification/channels/ses/index.js +2 -2
- package/dist/services/notification/channels/ses/schema.js +2 -2
- package/dist/services/notification/client/index.js +5 -5
- package/dist/services/notification/index.js +2 -2
- package/dist/services/notification/persistence/drizzle.js +2 -2
- package/dist/services/notification/persistence/index.js +15 -15
- package/dist/services/notification/persistence/schema.js +12 -12
- package/dist/services/notification/public.js +7 -7
- package/dist/services/notification/schema.js +2 -2
- package/dist/services/opentelemetry/api.js +2 -2
- package/dist/services/opentelemetry/browser.js +7 -7
- package/dist/services/opentelemetry/web-vitals.js +2 -2
- package/dist/services/s3/index.js +2 -2
- package/dist/services/s3/schema.js +2 -2
- package/dist/services/speech/schema.js +9 -9
- package/dist/services/webhooks/client/delivery-table.js +479 -480
- package/dist/services/webhooks/http-client.js +5 -5
- package/dist/services/webhooks/index.js +34 -34
- package/dist/services/webhooks/migrations.js +5 -5
- package/dist/services/webhooks/schema.js +20 -20
- package/dist/services/webhooks/url.js +5 -5
- package/package.json +1 -1
|
@@ -820,8 +820,8 @@ class Events extends Context4.Service()("krakstack/events/Events", {
|
|
|
820
820
|
const insertEvent = SqlSchema.findOneOption({
|
|
821
821
|
Request: StoredEventRequest,
|
|
822
822
|
Result: StoredEventId,
|
|
823
|
-
execute: (
|
|
824
|
-
INSERT INTO events ${sql.insert({ service_name: configuration.serviceName, ...
|
|
823
|
+
execute: (event) => sql`
|
|
824
|
+
INSERT INTO events ${sql.insert({ service_name: configuration.serviceName, ...event })}
|
|
825
825
|
ON CONFLICT (service_name, source, event_id) DO NOTHING RETURNING event_id
|
|
826
826
|
`
|
|
827
827
|
});
|
|
@@ -910,7 +910,7 @@ class Events extends Context4.Service()("krakstack/events/Events", {
|
|
|
910
910
|
error: EventSubscriberError,
|
|
911
911
|
idempotencyKey: ({ eventId }) => eventId
|
|
912
912
|
});
|
|
913
|
-
yield* engine.register(workflow, ({ event
|
|
913
|
+
yield* engine.register(workflow, ({ event, eventId }) => Effect8.gen(function* () {
|
|
914
914
|
const step = yield* Schedule.toStep(Schedule.min([
|
|
915
915
|
Schedule.exponential("5 seconds", 4),
|
|
916
916
|
Schedule.spaced("10 hours")
|
|
@@ -920,7 +920,7 @@ class Events extends Context4.Service()("krakstack/events/Events", {
|
|
|
920
920
|
name: `HandleEventV1-${attempt}`,
|
|
921
921
|
success: Schema9.Void,
|
|
922
922
|
error: EventSubscriberError,
|
|
923
|
-
execute: definition.handle({ ...
|
|
923
|
+
execute: definition.handle({ ...event, eventId }).pipe(Effect8.scoped, Effect8.updateContext(() => subscriberContext), Effect8.asVoid, Effect8.mapError(() => new EventSubscriberError({
|
|
924
924
|
subscription: subscription.name
|
|
925
925
|
})))
|
|
926
926
|
}).pipe(Effect8.result);
|
|
@@ -939,7 +939,7 @@ class Events extends Context4.Service()("krakstack/events/Events", {
|
|
|
939
939
|
}));
|
|
940
940
|
const registered = {
|
|
941
941
|
events: new Set(subscription.events),
|
|
942
|
-
dispatch: (
|
|
942
|
+
dispatch: (event) => workflow.execute({ event, eventId: event.eventId }, { discard: true }).pipe(Effect8.provideService(WorkflowEngine.WorkflowEngine, engine), Effect8.catchCause((cause) => Cause.hasInterruptsOnly(cause) ? Effect8.interrupt : Effect8.fail(new EventsPersistenceError({
|
|
943
943
|
operation: "subscriber.dispatch"
|
|
944
944
|
}))), Effect8.asVoid)
|
|
945
945
|
};
|
|
@@ -952,12 +952,12 @@ class Events extends Context4.Service()("krakstack/events/Events", {
|
|
|
952
952
|
const track = Effect8.fn("Events.track")(function* (input) {
|
|
953
953
|
const decoded = yield* Schema9.decodeEffect(TrackEventInput)(input);
|
|
954
954
|
const properties = decoded.properties === undefined ? undefined : yield* Schema9.encodeEffect(Schema9.fromJsonString(EventInputProperties))(decoded.properties).pipe(Effect8.flatMap(Schema9.decodeUnknownEffect(Schema9.fromJsonString(EventPropertiesSchema))));
|
|
955
|
-
const
|
|
955
|
+
const event = yield* Schema9.decodeEffect(TrackEvent)({
|
|
956
956
|
...decoded,
|
|
957
957
|
properties
|
|
958
958
|
});
|
|
959
|
-
const eventId =
|
|
960
|
-
const category =
|
|
959
|
+
const eventId = event.eventId ?? (yield* random.uuidV7());
|
|
960
|
+
const category = event.category ?? "analytics";
|
|
961
961
|
const receivedAt = yield* DateTime3.now;
|
|
962
962
|
const now = DateTime3.toEpochMillis(receivedAt);
|
|
963
963
|
const request = yield* Effect8.serviceOption(HttpServerRequest.HttpServerRequest);
|
|
@@ -973,12 +973,12 @@ class Events extends Context4.Service()("krakstack/events/Events", {
|
|
|
973
973
|
const identity = hasIdentity ? yield* Schema9.decodeUnknownEffect(EventIdentity)({
|
|
974
974
|
userId: annotations["user.id"],
|
|
975
975
|
organizationId: annotations["organization.id"]
|
|
976
|
-
}) :
|
|
976
|
+
}) : event.identity;
|
|
977
977
|
if (category === "audit") {
|
|
978
978
|
yield* Schema9.decodeUnknownEffect(AuditAttribution)(annotations);
|
|
979
979
|
}
|
|
980
980
|
const attributes = {};
|
|
981
|
-
for (const [key, value] of Object.entries(
|
|
981
|
+
for (const [key, value] of Object.entries(event.properties ?? {})) {
|
|
982
982
|
const name = key.startsWith("app.") ? key : `app.${key}`;
|
|
983
983
|
if (!reservedBrowserAttribute(name))
|
|
984
984
|
attributes[name] = value;
|
|
@@ -986,10 +986,10 @@ class Events extends Context4.Service()("krakstack/events/Events", {
|
|
|
986
986
|
Object.assign(attributes, identityAttributes(identity));
|
|
987
987
|
Object.assign(attributes, Object.fromEntries(Object.entries(annotations).filter(([key]) => (category === "audit" || !["user.full_name", "user.name", "user.email"].includes(key)) && key !== "user.image" && key !== "app.user.image")));
|
|
988
988
|
attributes["log.record.uid"] = eventId;
|
|
989
|
-
if (
|
|
990
|
-
attributes["app.audit.target.id"] =
|
|
991
|
-
attributes["app.audit.target.name"] =
|
|
992
|
-
attributes["app.audit.target.type"] =
|
|
989
|
+
if (event.category === "audit") {
|
|
990
|
+
attributes["app.audit.target.id"] = event.target.id;
|
|
991
|
+
attributes["app.audit.target.name"] = event.target.name;
|
|
992
|
+
attributes["app.audit.target.type"] = event.target.type;
|
|
993
993
|
}
|
|
994
994
|
attributes["app.event.schema.version"] = "1";
|
|
995
995
|
attributes["app.event.type"] = "track";
|
|
@@ -998,8 +998,8 @@ class Events extends Context4.Service()("krakstack/events/Events", {
|
|
|
998
998
|
const span = yield* Effect8.currentSpan.pipe(Effect8.option);
|
|
999
999
|
const location2 = Option6.isSome(request) && (!options.requireConsent || hasAnalyticsConsent(request.value.headers.cookie ?? "", request.value.headers)) ? yield* resolveGeolocation(request.value).pipe(Effect8.mapError(() => new EventsPersistenceError({ operation: "geolocation" }))) : null;
|
|
1000
1000
|
const entry = {
|
|
1001
|
-
eventName:
|
|
1002
|
-
timeUnixNano: (BigInt(
|
|
1001
|
+
eventName: event.name,
|
|
1002
|
+
timeUnixNano: (BigInt(event.timestamp ? DateTime3.toEpochMillis(event.timestamp) : now) * 1000000n).toString(),
|
|
1003
1003
|
observedTimeUnixNano: (BigInt(now) * 1000000n).toString()
|
|
1004
1004
|
};
|
|
1005
1005
|
return yield* Effect8.gen(function* () {
|
|
@@ -1012,7 +1012,7 @@ class Events extends Context4.Service()("krakstack/events/Events", {
|
|
|
1012
1012
|
});
|
|
1013
1013
|
const result = storage ? yield* storage.persist({
|
|
1014
1014
|
source: "server",
|
|
1015
|
-
compareTimestamp:
|
|
1015
|
+
compareTimestamp: event.timestamp !== undefined,
|
|
1016
1016
|
record: validated,
|
|
1017
1017
|
now,
|
|
1018
1018
|
payload: {
|
|
@@ -1030,28 +1030,28 @@ class Events extends Context4.Service()("krakstack/events/Events", {
|
|
|
1030
1030
|
}
|
|
1031
1031
|
}) : { eventId, inserted: false };
|
|
1032
1032
|
for (const subscriber of subscribers.values()) {
|
|
1033
|
-
if (!subscriber.events.has(
|
|
1033
|
+
if (!subscriber.events.has(event.name))
|
|
1034
1034
|
continue;
|
|
1035
1035
|
yield* subscriber.dispatch({
|
|
1036
|
-
...
|
|
1036
|
+
...event,
|
|
1037
1037
|
eventId,
|
|
1038
1038
|
identity,
|
|
1039
|
-
timestamp:
|
|
1039
|
+
timestamp: event.timestamp ?? receivedAt
|
|
1040
1040
|
});
|
|
1041
1041
|
}
|
|
1042
1042
|
return {
|
|
1043
1043
|
...result,
|
|
1044
1044
|
attributes: { ...requestContext, ...attributes }
|
|
1045
1045
|
};
|
|
1046
|
-
}).pipe((effect) => storage ? storage.sql.withTransaction(effect) : effect, Effect8.tap((result) => !storage || result.inserted ? Otlp.event(
|
|
1046
|
+
}).pipe((effect) => storage ? storage.sql.withTransaction(effect) : effect, Effect8.tap((result) => !storage || result.inserted ? Otlp.event(event.name, result.attributes, {
|
|
1047
1047
|
messageId: result.eventId,
|
|
1048
|
-
timestamp:
|
|
1048
|
+
timestamp: event.timestamp ?? receivedAt
|
|
1049
1049
|
}).pipe(Effect8.provideService(OtlpEvents, {
|
|
1050
1050
|
push: (record) => exporter.push({
|
|
1051
1051
|
...record,
|
|
1052
1052
|
scopeName: "krakstack.application.events"
|
|
1053
1053
|
})
|
|
1054
|
-
}), Effect8.provideService(References2.CurrentLogAnnotations, {})) : Effect8.void), Effect8.map(({ eventId
|
|
1054
|
+
}), Effect8.provideService(References2.CurrentLogAnnotations, {})) : Effect8.void), Effect8.map(({ eventId, inserted }) => ({ eventId, inserted })), Effect8.mapError((error) => error._tag === "EventConflictError" ? error : new EventsPersistenceError({
|
|
1055
1055
|
operation: "track"
|
|
1056
1056
|
})));
|
|
1057
1057
|
});
|
|
@@ -1085,29 +1085,29 @@ class Events extends Context4.Service()("krakstack/events/Events", {
|
|
|
1085
1085
|
return sql`${sortColumns[id]} ${sql.literal(part.direction === "desc" ? "DESC" : "ASC")}`;
|
|
1086
1086
|
}));
|
|
1087
1087
|
const source = request.category === "audit" ? sql`AND source = 'server'` : sql``;
|
|
1088
|
-
const
|
|
1088
|
+
const event = request.eventName ? sql`AND event_name = ${request.eventName}` : sql``;
|
|
1089
1089
|
const actorName = sql`COALESCE(NULLIF(${text("user.full_name")}, ''), NULLIF(${text("user.name")}, ''), NULLIF(${text("user.email")}, ''), ${text("app.actor.type")}, '')`;
|
|
1090
1090
|
const actor = sql`${actorName} || ' ' || COALESCE(${text("user.email")}, '') || ' ' || COALESCE(${text("app.actor.id")}, ${text("user.id")}, '')`;
|
|
1091
1091
|
const record = sql`COALESCE(${text("app.audit.target.name")}, '') || ' ' || COALESCE(${text("app.audit.target.type")}, '') || ' ' || COALESCE(${text("app.audit.target.id")}, '')`;
|
|
1092
1092
|
const method = sql`CASE WHEN ${text("app.auth.method")} IN ('session', 'api_key') THEN ${text("app.auth.method")} ELSE 'unknown' END`;
|
|
1093
|
-
const predicates = columnFilters.map((
|
|
1094
|
-
switch (
|
|
1093
|
+
const predicates = columnFilters.map((filter) => {
|
|
1094
|
+
switch (filter.kind) {
|
|
1095
1095
|
case "values": {
|
|
1096
|
-
const column =
|
|
1097
|
-
return sql`AND ${sql.or(
|
|
1096
|
+
const column = filter.id === "eventName" ? sql`event_name` : method;
|
|
1097
|
+
return sql`AND ${sql.or(filter.values.map((value) => sql`${column} = ${value}`))}`;
|
|
1098
1098
|
}
|
|
1099
1099
|
case "date": {
|
|
1100
|
-
const from =
|
|
1101
|
-
const to =
|
|
1100
|
+
const from = filter.from ? sql`AND occurred_at >= ${new Date(`${filter.from}T00:00:00.000Z`).getTime()}` : sql``;
|
|
1101
|
+
const to = filter.to ? sql`AND occurred_at < ${new Date(`${filter.to}T00:00:00.000Z`).getTime() + 86400000}` : sql``;
|
|
1102
1102
|
return sql`${from} ${to}`;
|
|
1103
1103
|
}
|
|
1104
1104
|
case "text": {
|
|
1105
|
-
const column =
|
|
1106
|
-
const value =
|
|
1107
|
-
if (
|
|
1105
|
+
const column = filter.id === "actor" ? actor : record;
|
|
1106
|
+
const value = filter.value.toLowerCase();
|
|
1107
|
+
if (filter.operator === "equals")
|
|
1108
1108
|
return sql`AND LOWER(${column}) = ${value}`;
|
|
1109
1109
|
const escaped = value.replace(/[\\%_]/g, "\\$&");
|
|
1110
|
-
const pattern =
|
|
1110
|
+
const pattern = filter.operator === "startsWith" ? `${escaped}%` : filter.operator === "endsWith" ? `%${escaped}` : `%${escaped}%`;
|
|
1111
1111
|
return sql`AND LOWER(${column}) LIKE ${pattern} ESCAPE ${"\\"}`;
|
|
1112
1112
|
}
|
|
1113
1113
|
default:
|
|
@@ -1128,7 +1128,7 @@ class Events extends Context4.Service()("krakstack/events/Events", {
|
|
|
1128
1128
|
].map((key) => sql`LOWER(${text(key)}) LIKE ${`%${search.toLowerCase()}%`}`)
|
|
1129
1129
|
])}` : sql``;
|
|
1130
1130
|
const predicate = sql`service_name = ${configuration.serviceName} AND organization_id = ${request.organizationId}
|
|
1131
|
-
AND ${text("app.event.category")} = ${request.category} ${source} ${
|
|
1131
|
+
AND ${text("app.event.category")} = ${request.category} ${source} ${event} ${actions} ${filter}`;
|
|
1132
1132
|
const total = yield* SqlSchema.findOne({
|
|
1133
1133
|
Request: ListEvents,
|
|
1134
1134
|
Result: AuditCount,
|
|
@@ -1145,7 +1145,7 @@ class Events extends Context4.Service()("krakstack/events/Events", {
|
|
|
1145
1145
|
`
|
|
1146
1146
|
});
|
|
1147
1147
|
const rows = yield* find(request);
|
|
1148
|
-
const data = yield* Effect8.forEach(rows, (row) => Schema9.decodeUnknownEffect(EventLogRecord)(row.payload_json.resourceLogs.flatMap((
|
|
1148
|
+
const data = yield* Effect8.forEach(rows, (row) => Schema9.decodeUnknownEffect(EventLogRecord)(row.payload_json.resourceLogs.flatMap((resource) => resource.scopeLogs.flatMap((scope) => scope.logRecords))[0]));
|
|
1149
1149
|
return {
|
|
1150
1150
|
data,
|
|
1151
1151
|
meta: {
|
|
@@ -1162,9 +1162,9 @@ class Events extends Context4.Service()("krakstack/events/Events", {
|
|
|
1162
1162
|
if (options.requireConsent && !hasAnalyticsConsent(request.headers.cookie ?? "", request.headers)) {
|
|
1163
1163
|
payload = {
|
|
1164
1164
|
...payload,
|
|
1165
|
-
resourceLogs: payload.resourceLogs.map((
|
|
1166
|
-
...
|
|
1167
|
-
scopeLogs:
|
|
1165
|
+
resourceLogs: payload.resourceLogs.map((resource) => ({
|
|
1166
|
+
...resource,
|
|
1167
|
+
scopeLogs: resource.scopeLogs.filter((scope) => scope.scope?.name !== "krakstack.application.events").map((scope) => ({
|
|
1168
1168
|
...scope,
|
|
1169
1169
|
logRecords: scope.logRecords.filter((record) => {
|
|
1170
1170
|
const parsed = Schema9.decodeUnknownOption(Schema9.Struct({
|
|
@@ -1180,7 +1180,7 @@ class Events extends Context4.Service()("krakstack/events/Events", {
|
|
|
1180
1180
|
persisted: false
|
|
1181
1181
|
};
|
|
1182
1182
|
}
|
|
1183
|
-
const analyticsScopes = payload.resourceLogs.flatMap((
|
|
1183
|
+
const analyticsScopes = payload.resourceLogs.flatMap((resource) => resource.scopeLogs).filter((scope) => scope.scope?.name === "krakstack.application.events");
|
|
1184
1184
|
if (analyticsScopes.length === 0)
|
|
1185
1185
|
return { body, persisted: false };
|
|
1186
1186
|
if (request.headers.origin !== configuration.origin.origin || request.headers["sec-fetch-site"] === "cross-site") {
|
|
@@ -1215,9 +1215,9 @@ class Events extends Context4.Service()("krakstack/events/Events", {
|
|
|
1215
1215
|
const ingest = Effect8.gen(function* () {
|
|
1216
1216
|
const requestContext = yield* resolveRequestContext(request, now, location2);
|
|
1217
1217
|
let index = 0;
|
|
1218
|
-
const resourceLogs = payload.resourceLogs.map((
|
|
1219
|
-
...
|
|
1220
|
-
scopeLogs:
|
|
1218
|
+
const resourceLogs = payload.resourceLogs.map((resource) => ({
|
|
1219
|
+
...resource,
|
|
1220
|
+
scopeLogs: resource.scopeLogs.map((scope) => scope.scope?.name !== "krakstack.application.events" ? scope : {
|
|
1221
1221
|
...scope,
|
|
1222
1222
|
logRecords: scope.logRecords.map(() => {
|
|
1223
1223
|
const record = records[index++];
|
|
@@ -1246,13 +1246,13 @@ class Events extends Context4.Service()("krakstack/events/Events", {
|
|
|
1246
1246
|
}));
|
|
1247
1247
|
const persistedRecords = new Map;
|
|
1248
1248
|
if (storage) {
|
|
1249
|
-
for (const
|
|
1250
|
-
for (const scope of
|
|
1249
|
+
for (const resource of resourceLogs) {
|
|
1250
|
+
for (const scope of resource.scopeLogs) {
|
|
1251
1251
|
if (scope.scope?.name !== "krakstack.application.events")
|
|
1252
1252
|
continue;
|
|
1253
1253
|
for (const raw of scope.logRecords) {
|
|
1254
1254
|
const record = yield* Schema9.decodeUnknownEffect(EventLogRecord)(raw);
|
|
1255
|
-
const
|
|
1255
|
+
const persisted = yield* storage.persist({
|
|
1256
1256
|
source: "browser",
|
|
1257
1257
|
record,
|
|
1258
1258
|
now: nowMillis,
|
|
@@ -1260,28 +1260,28 @@ class Events extends Context4.Service()("krakstack/events/Events", {
|
|
|
1260
1260
|
...payload,
|
|
1261
1261
|
resourceLogs: [
|
|
1262
1262
|
{
|
|
1263
|
-
...
|
|
1263
|
+
...resource,
|
|
1264
1264
|
scopeLogs: [{ ...scope, logRecords: [record] }]
|
|
1265
1265
|
}
|
|
1266
1266
|
]
|
|
1267
1267
|
}
|
|
1268
1268
|
});
|
|
1269
|
-
persistedRecords.set(raw,
|
|
1269
|
+
persistedRecords.set(raw, persisted.record);
|
|
1270
1270
|
}
|
|
1271
1271
|
}
|
|
1272
1272
|
}
|
|
1273
1273
|
}
|
|
1274
1274
|
const encoded = yield* Schema9.encodeEffect(codec2)({
|
|
1275
1275
|
...payload,
|
|
1276
|
-
resourceLogs: resourceLogs.map((
|
|
1277
|
-
...
|
|
1278
|
-
scopeLogs:
|
|
1276
|
+
resourceLogs: resourceLogs.map((resource) => ({
|
|
1277
|
+
...resource,
|
|
1278
|
+
scopeLogs: resource.scopeLogs.map((scope) => ({
|
|
1279
1279
|
...scope,
|
|
1280
1280
|
logRecords: scope.logRecords.map((raw) => persistedRecords.get(raw) ?? raw)
|
|
1281
1281
|
}))
|
|
1282
1282
|
}))
|
|
1283
1283
|
});
|
|
1284
|
-
const persisted = Boolean(storage) && payload.resourceLogs.every((
|
|
1284
|
+
const persisted = Boolean(storage) && payload.resourceLogs.every((resource) => resource.scopeLogs.every((scope) => scope.scope?.name === "krakstack.application.events" || scope.logRecords.length === 0));
|
|
1285
1285
|
return { body: new TextEncoder().encode(encoded), persisted };
|
|
1286
1286
|
});
|
|
1287
1287
|
return yield* (storage ? ingest.pipe(storage.sql.withTransaction) : ingest).pipe(Effect8.mapError((error) => new OtlpProcessingError({
|
|
@@ -1317,12 +1317,12 @@ class Events extends Context4.Service()("krakstack/events/Events", {
|
|
|
1317
1317
|
static subscribe = (definition) => Layer3.effectDiscard(Effect8.flatMap(Events, (events) => events.subscribe(definition)));
|
|
1318
1318
|
}
|
|
1319
1319
|
export {
|
|
1320
|
-
|
|
1321
|
-
TrackEvent,
|
|
1322
|
-
SESSION_TIMEOUT_MS,
|
|
1323
|
-
ListEvents,
|
|
1324
|
-
EventsConfigurationError,
|
|
1325
|
-
Events,
|
|
1320
|
+
AuditTarget,
|
|
1326
1321
|
EventLogRecord,
|
|
1327
|
-
|
|
1322
|
+
Events,
|
|
1323
|
+
EventsConfigurationError,
|
|
1324
|
+
ListEvents,
|
|
1325
|
+
SESSION_TIMEOUT_MS,
|
|
1326
|
+
TrackEvent,
|
|
1327
|
+
dailyVisitorId
|
|
1328
1328
|
};
|
|
@@ -9,6 +9,6 @@ var TextArrayValue = Schema.Struct({
|
|
|
9
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
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
11
|
export {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
eventStringArrayAttribute,
|
|
13
|
+
eventTextAttribute
|
|
14
14
|
};
|
|
@@ -422,44 +422,44 @@ var VisitorEventSession = Schema3.Struct({
|
|
|
422
422
|
received_at: Schema3.Finite
|
|
423
423
|
}).annotate({ identifier: "VisitorEventSession" });
|
|
424
424
|
export {
|
|
425
|
-
|
|
426
|
-
VisitorEventSession,
|
|
427
|
-
TrackEventInput,
|
|
428
|
-
TrackEvent,
|
|
429
|
-
StoredEventRequest,
|
|
430
|
-
StoredEventPayload,
|
|
431
|
-
StoredEventId,
|
|
432
|
-
RequestActorAttribution,
|
|
433
|
-
OtlpLogs,
|
|
434
|
-
ListEvents,
|
|
435
|
-
ExistingEventRequest,
|
|
436
|
-
EventsPersistenceError,
|
|
437
|
-
EventUuid,
|
|
438
|
-
EventSubscription,
|
|
439
|
-
EventSubscriberError,
|
|
440
|
-
EventSource,
|
|
441
|
-
EventRegion,
|
|
442
|
-
EventQueryStandard,
|
|
443
|
-
EventQuery,
|
|
444
|
-
EventLogRecord,
|
|
445
|
-
EventIpAddress,
|
|
446
|
-
EventInputProperties,
|
|
447
|
-
EventIdentity,
|
|
448
|
-
EventId,
|
|
449
|
-
EventGeolocationError,
|
|
450
|
-
EventGeolocation,
|
|
451
|
-
EventCountry,
|
|
452
|
-
EventConflictError,
|
|
453
|
-
EventColumnFilter,
|
|
454
|
-
EventCity,
|
|
455
|
-
EventAttribute,
|
|
456
|
-
EventActionFilter,
|
|
457
|
-
BrowserPage,
|
|
458
|
-
BrowserEventPath,
|
|
459
|
-
BrowserEventOptions,
|
|
460
|
-
BrowserEventLogRecord,
|
|
461
|
-
AuditTarget,
|
|
462
|
-
AuditSortId,
|
|
425
|
+
AuditAttribution,
|
|
463
426
|
AuditCount,
|
|
464
|
-
|
|
427
|
+
AuditSortId,
|
|
428
|
+
AuditTarget,
|
|
429
|
+
BrowserEventLogRecord,
|
|
430
|
+
BrowserEventOptions,
|
|
431
|
+
BrowserEventPath,
|
|
432
|
+
BrowserPage,
|
|
433
|
+
EventActionFilter,
|
|
434
|
+
EventAttribute,
|
|
435
|
+
EventCity,
|
|
436
|
+
EventColumnFilter,
|
|
437
|
+
EventConflictError,
|
|
438
|
+
EventCountry,
|
|
439
|
+
EventGeolocation,
|
|
440
|
+
EventGeolocationError,
|
|
441
|
+
EventId,
|
|
442
|
+
EventIdentity,
|
|
443
|
+
EventInputProperties,
|
|
444
|
+
EventIpAddress,
|
|
445
|
+
EventLogRecord,
|
|
446
|
+
EventQuery,
|
|
447
|
+
EventQueryStandard,
|
|
448
|
+
EventRegion,
|
|
449
|
+
EventSource,
|
|
450
|
+
EventSubscriberError,
|
|
451
|
+
EventSubscription,
|
|
452
|
+
EventUuid,
|
|
453
|
+
EventsPersistenceError,
|
|
454
|
+
ExistingEventRequest,
|
|
455
|
+
ListEvents,
|
|
456
|
+
OtlpLogs,
|
|
457
|
+
RequestActorAttribution,
|
|
458
|
+
StoredEventId,
|
|
459
|
+
StoredEventPayload,
|
|
460
|
+
StoredEventRequest,
|
|
461
|
+
TrackEvent,
|
|
462
|
+
TrackEventInput,
|
|
463
|
+
VisitorEventSession,
|
|
464
|
+
VisitorEventsRequest
|
|
465
465
|
};
|
|
@@ -111,9 +111,9 @@ class FileExtractionService extends Context.Service()("FileExtractionService", {
|
|
|
111
111
|
static testLayer = (service) => Layer.succeed(this, service);
|
|
112
112
|
}
|
|
113
113
|
export {
|
|
114
|
-
|
|
115
|
-
OutputFormat2 as OutputFormat,
|
|
116
|
-
FileExtractionService,
|
|
114
|
+
FileExtractedTextSchema,
|
|
117
115
|
FileExtractionFailed,
|
|
118
|
-
|
|
116
|
+
FileExtractionService,
|
|
117
|
+
OutputFormat2 as OutputFormat,
|
|
118
|
+
defaultFileExtractionOptions
|
|
119
119
|
};
|
|
@@ -9,6 +9,6 @@ var FileExtractedTextSchema = Schema.Struct({
|
|
|
9
9
|
class FileExtractionFailed extends Schema.TaggedError()("FileExtractionFailed", { message: Schema.String }) {
|
|
10
10
|
}
|
|
11
11
|
export {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
FileExtractedTextSchema,
|
|
13
|
+
FileExtractionFailed
|
|
14
14
|
};
|
|
@@ -177,14 +177,14 @@ class HealthService extends Context.Service()("@krak-stack/registry/HealthServic
|
|
|
177
177
|
static layerWith = (options) => Layer.effect(this, this.make).pipe(Layer.provide(HealthServiceConfig.layerWith(options)));
|
|
178
178
|
}
|
|
179
179
|
export {
|
|
180
|
-
|
|
181
|
-
HealthUpResponse,
|
|
182
|
-
HealthStatus,
|
|
183
|
-
HealthService,
|
|
184
|
-
HealthResponse,
|
|
185
|
-
HealthDownResponse,
|
|
186
|
-
HealthCheckResult,
|
|
187
|
-
HealthCheckOutcome,
|
|
180
|
+
HealthApiGroup,
|
|
188
181
|
HealthCheckData,
|
|
189
|
-
|
|
182
|
+
HealthCheckOutcome,
|
|
183
|
+
HealthCheckResult,
|
|
184
|
+
HealthDownResponse,
|
|
185
|
+
HealthResponse,
|
|
186
|
+
HealthService,
|
|
187
|
+
HealthStatus,
|
|
188
|
+
HealthUpResponse,
|
|
189
|
+
healthHandler
|
|
190
190
|
};
|
|
@@ -682,10 +682,10 @@ var formatNotificationDate = (value, locale) => {
|
|
|
682
682
|
};
|
|
683
683
|
var notificationTitle = (notification) => Schema.is(Schema.String)(notification.title) ? notification.title : defaultMessages.en.notifications;
|
|
684
684
|
export {
|
|
685
|
-
|
|
686
|
-
NotificationMenuTrigger,
|
|
687
|
-
NotificationMenu,
|
|
688
|
-
NotificationListItem,
|
|
685
|
+
NotificationEmpty,
|
|
689
686
|
NotificationList,
|
|
690
|
-
|
|
687
|
+
NotificationListItem,
|
|
688
|
+
NotificationMenu,
|
|
689
|
+
NotificationMenuTrigger,
|
|
690
|
+
notificationMenuMessages
|
|
691
691
|
};
|
|
@@ -208,7 +208,7 @@ var notificationDeliveries = pgTable("notification_deliveries", {
|
|
|
208
208
|
check("notification_deliveries_lease_check", sql`(${table.claimedBy} is null and ${table.leaseExpiresAt} is null) or (${table.claimedBy} is not null and ${table.leaseExpiresAt} is not null)`)
|
|
209
209
|
]);
|
|
210
210
|
export {
|
|
211
|
-
|
|
211
|
+
notificationDeliveries,
|
|
212
212
|
notificationSettings,
|
|
213
|
-
|
|
213
|
+
notifications
|
|
214
214
|
};
|
|
@@ -208,20 +208,20 @@ var notificationDeliveries = pgTable("notification_deliveries", {
|
|
|
208
208
|
check("notification_deliveries_lease_check", sql`(${table.claimedBy} is null and ${table.leaseExpiresAt} is null) or (${table.claimedBy} is not null and ${table.leaseExpiresAt} is not null)`)
|
|
209
209
|
]);
|
|
210
210
|
export {
|
|
211
|
-
|
|
212
|
-
notificationSettings,
|
|
213
|
-
notificationDeliveries,
|
|
214
|
-
decodeNotificationDeliveryPayload,
|
|
215
|
-
PersistedNotificationDeliveryPayload,
|
|
216
|
-
NotificationSettingSchema,
|
|
217
|
-
NotificationSettingId,
|
|
218
|
-
NotificationId,
|
|
219
|
-
NotificationDeliveryStatus,
|
|
220
|
-
NotificationDeliverySchema,
|
|
221
|
-
NotificationDeliveryPurpose,
|
|
222
|
-
NotificationDeliveryId,
|
|
223
|
-
NOTIFICATION_DELIVERY_STATUSES,
|
|
224
|
-
NOTIFICATION_DELIVERY_PURPOSES,
|
|
211
|
+
EmailDeliveryPayloadV1,
|
|
225
212
|
InboxNotificationSchema,
|
|
226
|
-
|
|
213
|
+
NOTIFICATION_DELIVERY_PURPOSES,
|
|
214
|
+
NOTIFICATION_DELIVERY_STATUSES,
|
|
215
|
+
NotificationDeliveryId,
|
|
216
|
+
NotificationDeliveryPurpose,
|
|
217
|
+
NotificationDeliverySchema,
|
|
218
|
+
NotificationDeliveryStatus,
|
|
219
|
+
NotificationId,
|
|
220
|
+
NotificationSettingId,
|
|
221
|
+
NotificationSettingSchema,
|
|
222
|
+
PersistedNotificationDeliveryPayload,
|
|
223
|
+
decodeNotificationDeliveryPayload,
|
|
224
|
+
notificationDeliveries,
|
|
225
|
+
notificationSettings,
|
|
226
|
+
notifications
|
|
227
227
|
};
|
|
@@ -102,17 +102,17 @@ var PersistedNotificationDeliveryPayload = Schema.Union([
|
|
|
102
102
|
]).annotate({ identifier: "PersistedNotificationDeliveryPayload" });
|
|
103
103
|
var decodeNotificationDeliveryPayload = Schema.decodeUnknownEffect(PersistedNotificationDeliveryPayload);
|
|
104
104
|
export {
|
|
105
|
-
|
|
106
|
-
PersistedNotificationDeliveryPayload,
|
|
107
|
-
NotificationSettingSchema,
|
|
108
|
-
NotificationSettingId,
|
|
109
|
-
NotificationId,
|
|
110
|
-
NotificationDeliveryStatus,
|
|
111
|
-
NotificationDeliverySchema,
|
|
112
|
-
NotificationDeliveryPurpose,
|
|
113
|
-
NotificationDeliveryId,
|
|
114
|
-
NOTIFICATION_DELIVERY_STATUSES,
|
|
115
|
-
NOTIFICATION_DELIVERY_PURPOSES,
|
|
105
|
+
EmailDeliveryPayloadV1,
|
|
116
106
|
InboxNotificationSchema,
|
|
117
|
-
|
|
107
|
+
NOTIFICATION_DELIVERY_PURPOSES,
|
|
108
|
+
NOTIFICATION_DELIVERY_STATUSES,
|
|
109
|
+
NotificationDeliveryId,
|
|
110
|
+
NotificationDeliveryPurpose,
|
|
111
|
+
NotificationDeliverySchema,
|
|
112
|
+
NotificationDeliveryStatus,
|
|
113
|
+
NotificationId,
|
|
114
|
+
NotificationSettingId,
|
|
115
|
+
NotificationSettingSchema,
|
|
116
|
+
PersistedNotificationDeliveryPayload,
|
|
117
|
+
decodeNotificationDeliveryPayload
|
|
118
118
|
};
|
|
@@ -775,12 +775,12 @@ var formatNotificationDate = (value, locale) => {
|
|
|
775
775
|
};
|
|
776
776
|
var notificationTitle = (notification) => Schema2.is(Schema2.String)(notification.title) ? notification.title : defaultMessages.en.notifications;
|
|
777
777
|
export {
|
|
778
|
-
|
|
779
|
-
NotificationService,
|
|
780
|
-
NotificationPersistenceStore,
|
|
781
|
-
NotificationMenuTrigger,
|
|
782
|
-
NotificationMenu,
|
|
783
|
-
NotificationListItem,
|
|
778
|
+
NotificationEmpty,
|
|
784
779
|
NotificationList,
|
|
785
|
-
|
|
780
|
+
NotificationListItem,
|
|
781
|
+
NotificationMenu,
|
|
782
|
+
NotificationMenuTrigger,
|
|
783
|
+
NotificationPersistenceStore,
|
|
784
|
+
NotificationService,
|
|
785
|
+
notificationMenuMessages
|
|
786
786
|
};
|
|
@@ -182,15 +182,15 @@ var sanitizeBrowserException = (input) => ({
|
|
|
182
182
|
});
|
|
183
183
|
var BrowserExceptionTrackingLive = Layer2.effectDiscard(Stream.merge(Stream.fromEventListener(globalThis, "error", {
|
|
184
184
|
bufferSize: 100
|
|
185
|
-
}).pipe(Stream.map((
|
|
186
|
-
const error =
|
|
185
|
+
}).pipe(Stream.map((event) => {
|
|
186
|
+
const error = event.error;
|
|
187
187
|
return new BrowserReportedError({
|
|
188
188
|
type: "window.error",
|
|
189
|
-
message:
|
|
189
|
+
message: event.message,
|
|
190
190
|
stack: Predicate.isError(error) ? error.stack : undefined
|
|
191
191
|
});
|
|
192
|
-
})), Stream.fromEventListener(globalThis, "unhandledrejection", { bufferSize: 100 }).pipe(Stream.map((
|
|
193
|
-
const reason =
|
|
192
|
+
})), Stream.fromEventListener(globalThis, "unhandledrejection", { bufferSize: 100 }).pipe(Stream.map((event) => {
|
|
193
|
+
const reason = event.reason;
|
|
194
194
|
return new BrowserReportedError(Predicate.isError(reason) ? {
|
|
195
195
|
type: "unhandledrejection",
|
|
196
196
|
message: reason.message,
|
|
@@ -271,6 +271,6 @@ class BrowserOtlp {
|
|
|
271
271
|
};
|
|
272
272
|
}
|
|
273
273
|
export {
|
|
274
|
-
|
|
275
|
-
|
|
274
|
+
BrowserOtlp,
|
|
275
|
+
sanitizeBrowserException
|
|
276
276
|
};
|