@krak-stack/registry 0.1.59 → 0.1.61

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.
Files changed (37) hide show
  1. package/CHANGELOG.md +13 -1
  2. package/dist/components/ui/data-table.d.ts +2 -0
  3. package/dist/components/ui/data-table.js +6 -2
  4. package/dist/components/ui/item.d.ts +22 -0
  5. package/dist/components/ui/trace.d.ts +18 -0
  6. package/dist/services/agent/client/index.js +584 -434
  7. package/dist/services/agent/client/widget.d.ts +1 -0
  8. package/dist/services/events/browser.js +29 -3
  9. package/dist/services/events/client/audit-log-table.js +6 -2
  10. package/dist/services/events/client/tracking-notice.js +2 -1
  11. package/dist/services/events/index.d.ts +26 -56
  12. package/dist/services/events/index.js +118 -7
  13. package/dist/services/events/schema.d.ts +66 -24
  14. package/dist/services/events/schema.js +34 -3
  15. package/dist/services/opentelemetry/api.js +2 -1
  16. package/dist/services/opentelemetry/browser.d.ts +1 -1
  17. package/dist/services/opentelemetry/browser.js +2 -1
  18. package/dist/services/opentelemetry/events.d.ts +1 -1
  19. package/dist/services/opentelemetry/index.d.ts +1 -1
  20. package/dist/services/opentelemetry/index.js +2 -1
  21. package/dist/services/opentelemetry/schema.d.ts +3 -1
  22. package/dist/services/opentelemetry/web-vitals.js +2 -1
  23. package/dist/services/webhooks/client/delivery-table.d.ts +62 -0
  24. package/dist/services/webhooks/client/delivery-table.js +4698 -0
  25. package/dist/services/webhooks/http-client.d.ts +8 -0
  26. package/dist/services/webhooks/http-client.js +69 -0
  27. package/dist/services/webhooks/index.d.ts +343 -0
  28. package/dist/services/webhooks/index.js +872 -0
  29. package/dist/services/webhooks/migrations.d.ts +8 -0
  30. package/dist/services/webhooks/migrations.js +63 -0
  31. package/dist/services/webhooks/receiver.d.ts +41 -0
  32. package/dist/services/webhooks/schema.d.ts +251 -0
  33. package/dist/services/webhooks/schema.js +353 -0
  34. package/dist/services/webhooks/url.d.ts +8 -0
  35. package/dist/services/webhooks/url.js +48 -0
  36. package/package.json +29 -1
  37. package/dist/components/ui/marker.d.ts +0 -10
@@ -37,6 +37,7 @@ var EventAttributeValue = Schema.Union([
37
37
  Schema.Array(Schema.Boolean)
38
38
  ]);
39
39
  var EventAttributesSchema = Schema.Record(Schema.String, EventAttributeValue).annotate({ identifier: "EventAttributes" });
40
+ var EventPropertiesSchema = Schema.Record(Schema.String, Schema.Json).annotate({ identifier: "EventProperties" });
40
41
  var EventOptionsSchema = Schema.Struct({
41
42
  userId: Schema.optional(Schema.NonEmptyString),
42
43
  anonymousId: Schema.optional(Schema.NonEmptyString),
@@ -47,7 +48,7 @@ var EventOptionsSchema = Schema.Struct({
47
48
  }).annotate({ identifier: "EventOptions" });
48
49
  var TelemetryEvent = Schema.Struct({
49
50
  name: Schema.NonEmptyString,
50
- properties: Schema.optional(EventAttributesSchema),
51
+ properties: Schema.optional(EventPropertiesSchema),
51
52
  options: Schema.optional(EventOptionsSchema)
52
53
  }).annotate({ identifier: "TelemetryEvent" });
53
54
 
@@ -259,7 +260,7 @@ var AuditTarget = Schema3.Struct({
259
260
  var trackEventFields = {
260
261
  eventId: Schema3.optional(EventId),
261
262
  name: Schema3.NonEmptyString.check(Schema3.isMaxLength(128)),
262
- properties: Schema3.optional(EventAttributesSchema),
263
+ properties: Schema3.optional(EventPropertiesSchema),
263
264
  identity: Schema3.optional(EventIdentity),
264
265
  timestamp: Schema3.optional(Schema3.DateTimeUtc)
265
266
  };
@@ -274,6 +275,24 @@ var TrackEvent = Schema3.Union([
274
275
  target: AuditTarget
275
276
  })
276
277
  ]).annotate({ identifier: "TrackEvent" });
278
+ var EventInputProperties = Schema3.Record(Schema3.String, Schema3.Unknown).annotate({ identifier: "EventInputProperties" });
279
+ var TrackEventInput = Schema3.Union([
280
+ Schema3.Struct({
281
+ ...TrackEvent.members[0].fields,
282
+ properties: Schema3.optional(EventInputProperties)
283
+ }),
284
+ Schema3.Struct({
285
+ ...TrackEvent.members[1].fields,
286
+ properties: Schema3.optional(EventInputProperties)
287
+ })
288
+ ]).annotate({ identifier: "TrackEventInput" });
289
+ var EventSubscription = Schema3.Struct({
290
+ name: Schema3.NonEmptyString.check(Schema3.isMaxLength(128)),
291
+ events: Schema3.NonEmptyArray(trackEventFields.name)
292
+ }).annotate({ identifier: "EventSubscription" });
293
+
294
+ class EventSubscriberError extends Schema3.TaggedError()("EventSubscriberError", { subscription: Schema3.String }) {
295
+ }
277
296
  var EventActionFilter = Schema3.Struct({
278
297
  id: Schema3.Literal("eventName"),
279
298
  kind: Schema3.Literal("values"),
@@ -364,7 +383,7 @@ var AttributeValue = Schema3.Union([
364
383
  ]);
365
384
  var EventAttribute = Schema3.Struct({
366
385
  key: Schema3.NonEmptyString.check(Schema3.isMaxLength(128)),
367
- value: AttributeValue
386
+ value: Schema3.StructWithRest(Schema3.Struct({ stringValue: Schema3.optional(Schema3.String) }), [Schema3.Record(Schema3.String, Schema3.Json)])
368
387
  }).annotate({ identifier: "EventAttribute" });
369
388
  var EventLogRecord = Schema3.Struct({
370
389
  eventName: Schema3.NonEmptyString.check(Schema3.isMaxLength(128), Schema3.isPattern(/^[^\r\n]+$/)),
@@ -375,6 +394,13 @@ var EventLogRecord = Schema3.Struct({
375
394
  spanId: Schema3.optional(Schema3.String.check(Schema3.isPattern(/^[a-f0-9]{16}$/))),
376
395
  attributes: Schema3.Array(EventAttribute).check(Schema3.isMaxLength(64), Schema3.makeFilter((values) => new Set(values.map(({ key }) => key)).size === values.length || "Duplicate attribute keys"))
377
396
  }).annotate({ identifier: "EventLogRecord" });
397
+ var BrowserEventLogRecord = Schema3.Struct({
398
+ ...EventLogRecord.fields,
399
+ attributes: Schema3.Array(Schema3.Struct({
400
+ key: EventAttribute.fields.key,
401
+ value: AttributeValue
402
+ })).check(Schema3.isMaxLength(64), Schema3.makeFilter((values) => new Set(values.map(({ key }) => key)).size === values.length || "Duplicate attribute keys"))
403
+ }).annotate({ identifier: "BrowserEventLogRecord" });
378
404
  var extensions = Schema3.Record(Schema3.String, Schema3.Unknown);
379
405
  var OtlpLogs = Schema3.StructWithRest(Schema3.Struct({
380
406
  resourceLogs: Schema3.Array(Schema3.StructWithRest(Schema3.Struct({
@@ -400,6 +426,7 @@ export {
400
426
  AuditCount,
401
427
  AuditSortId,
402
428
  AuditTarget,
429
+ BrowserEventLogRecord,
403
430
  BrowserEventOptions,
404
431
  BrowserEventPath,
405
432
  BrowserPage,
@@ -413,12 +440,15 @@ export {
413
440
  EventGeolocationError,
414
441
  EventId,
415
442
  EventIdentity,
443
+ EventInputProperties,
416
444
  EventIpAddress,
417
445
  EventLogRecord,
418
446
  EventQuery,
419
447
  EventQueryStandard,
420
448
  EventRegion,
421
449
  EventSource,
450
+ EventSubscriberError,
451
+ EventSubscription,
422
452
  EventUuid,
423
453
  EventsPersistenceError,
424
454
  ExistingEventRequest,
@@ -429,6 +459,7 @@ export {
429
459
  StoredEventPayload,
430
460
  StoredEventRequest,
431
461
  TrackEvent,
462
+ TrackEventInput,
432
463
  VisitorEventSession,
433
464
  VisitorEventsRequest
434
465
  };
@@ -74,6 +74,7 @@ var EventAttributeValue = Schema.Union([
74
74
  Schema.Array(Schema.Boolean)
75
75
  ]);
76
76
  var EventAttributesSchema = Schema.Record(Schema.String, EventAttributeValue).annotate({ identifier: "EventAttributes" });
77
+ var EventPropertiesSchema = Schema.Record(Schema.String, Schema.Json).annotate({ identifier: "EventProperties" });
77
78
  var EventOptionsSchema = Schema.Struct({
78
79
  userId: Schema.optional(Schema.NonEmptyString),
79
80
  anonymousId: Schema.optional(Schema.NonEmptyString),
@@ -84,7 +85,7 @@ var EventOptionsSchema = Schema.Struct({
84
85
  }).annotate({ identifier: "EventOptions" });
85
86
  var TelemetryEvent = Schema.Struct({
86
87
  name: Schema.NonEmptyString,
87
- properties: Schema.optional(EventAttributesSchema),
88
+ properties: Schema.optional(EventPropertiesSchema),
88
89
  options: Schema.optional(EventOptionsSchema)
89
90
  }).annotate({ identifier: "TelemetryEvent" });
90
91
 
@@ -26,7 +26,7 @@ export interface BrowserOtlpOptions {
26
26
  }
27
27
  export declare class BrowserOtlp {
28
28
  static readonly event: (name: string, properties?: {
29
- readonly [x: string]: string | number | boolean | readonly string[] | readonly number[] | readonly boolean[];
29
+ readonly [x: string]: Schema.Json;
30
30
  } | undefined, options?: {
31
31
  readonly userId?: string | undefined;
32
32
  readonly anonymousId?: string | undefined;
@@ -62,6 +62,7 @@ var EventAttributeValue = Schema.Union([
62
62
  Schema.Array(Schema.Boolean)
63
63
  ]);
64
64
  var EventAttributesSchema = Schema.Record(Schema.String, EventAttributeValue).annotate({ identifier: "EventAttributes" });
65
+ var EventPropertiesSchema = Schema.Record(Schema.String, Schema.Json).annotate({ identifier: "EventProperties" });
65
66
  var EventOptionsSchema = Schema.Struct({
66
67
  userId: Schema.optional(Schema.NonEmptyString),
67
68
  anonymousId: Schema.optional(Schema.NonEmptyString),
@@ -72,7 +73,7 @@ var EventOptionsSchema = Schema.Struct({
72
73
  }).annotate({ identifier: "EventOptions" });
73
74
  var TelemetryEvent = Schema.Struct({
74
75
  name: Schema.NonEmptyString,
75
- properties: Schema.optional(EventAttributesSchema),
76
+ properties: Schema.optional(EventPropertiesSchema),
76
77
  options: Schema.optional(EventOptionsSchema)
77
78
  }).annotate({ identifier: "TelemetryEvent" });
78
79
 
@@ -27,7 +27,7 @@ interface EventRecord {
27
27
  }
28
28
  /** Emits an INFO event without creating a tracing span or persisting identity. */
29
29
  export declare const event: (name: string, properties?: {
30
- readonly [x: string]: string | number | boolean | readonly string[] | readonly number[] | readonly boolean[];
30
+ readonly [x: string]: Schema.Json;
31
31
  } | undefined, options?: {
32
32
  readonly userId?: string | undefined;
33
33
  readonly anonymousId?: string | undefined;
@@ -8,7 +8,7 @@ declare const Otlp_base: Context.ServiceClass<Otlp, "krakstack/opentelemetry/Otl
8
8
  /** Runtime-neutral server telemetry for HTTP applications, workers, and CLIs. */
9
9
  export declare class Otlp extends Otlp_base {
10
10
  static readonly event: (name: string, properties?: {
11
- readonly [x: string]: string | number | boolean | readonly string[] | readonly number[] | readonly boolean[];
11
+ readonly [x: string]: Schema.Json;
12
12
  } | undefined, options?: {
13
13
  readonly userId?: string | undefined;
14
14
  readonly anonymousId?: string | undefined;
@@ -61,6 +61,7 @@ var EventAttributeValue = Schema.Union([
61
61
  Schema.Array(Schema.Boolean)
62
62
  ]);
63
63
  var EventAttributesSchema = Schema.Record(Schema.String, EventAttributeValue).annotate({ identifier: "EventAttributes" });
64
+ var EventPropertiesSchema = Schema.Record(Schema.String, Schema.Json).annotate({ identifier: "EventProperties" });
64
65
  var EventOptionsSchema = Schema.Struct({
65
66
  userId: Schema.optional(Schema.NonEmptyString),
66
67
  anonymousId: Schema.optional(Schema.NonEmptyString),
@@ -71,7 +72,7 @@ var EventOptionsSchema = Schema.Struct({
71
72
  }).annotate({ identifier: "EventOptions" });
72
73
  var TelemetryEvent = Schema.Struct({
73
74
  name: Schema.NonEmptyString,
74
- properties: Schema.optional(EventAttributesSchema),
75
+ properties: Schema.optional(EventPropertiesSchema),
75
76
  options: Schema.optional(EventOptionsSchema)
76
77
  }).annotate({ identifier: "TelemetryEvent" });
77
78
 
@@ -19,6 +19,7 @@ export declare const BrowserWebVital: Schema.Struct<{
19
19
  readonly navigationType: Schema.Literals<readonly ["navigate", "reload", "back-forward", "back-forward-cache", "prerender", "restore"]>;
20
20
  }>;
21
21
  export declare const EventAttributesSchema: 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>]>>;
22
+ export declare const EventPropertiesSchema: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
22
23
  export declare const EventOptionsSchema: Schema.Struct<{
23
24
  readonly userId: Schema.optional<Schema.NonEmptyString>;
24
25
  readonly anonymousId: Schema.optional<Schema.NonEmptyString>;
@@ -29,7 +30,7 @@ export declare const EventOptionsSchema: Schema.Struct<{
29
30
  }>;
30
31
  export declare const TelemetryEvent: Schema.Struct<{
31
32
  readonly name: Schema.NonEmptyString;
32
- 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>]>>>;
33
+ readonly properties: Schema.optional<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
33
34
  readonly options: Schema.optional<Schema.Struct<{
34
35
  readonly userId: Schema.optional<Schema.NonEmptyString>;
35
36
  readonly anonymousId: Schema.optional<Schema.NonEmptyString>;
@@ -40,4 +41,5 @@ export declare const TelemetryEvent: Schema.Struct<{
40
41
  }>>;
41
42
  }>;
42
43
  export type EventAttributes = typeof EventAttributesSchema.Type;
44
+ export type EventProperties = typeof EventPropertiesSchema.Type;
43
45
  export type EventOptions = typeof EventOptionsSchema.Type;
@@ -55,6 +55,7 @@ var EventAttributeValue = Schema.Union([
55
55
  Schema.Array(Schema.Boolean)
56
56
  ]);
57
57
  var EventAttributesSchema = Schema.Record(Schema.String, EventAttributeValue).annotate({ identifier: "EventAttributes" });
58
+ var EventPropertiesSchema = Schema.Record(Schema.String, Schema.Json).annotate({ identifier: "EventProperties" });
58
59
  var EventOptionsSchema = Schema.Struct({
59
60
  userId: Schema.optional(Schema.NonEmptyString),
60
61
  anonymousId: Schema.optional(Schema.NonEmptyString),
@@ -65,7 +66,7 @@ var EventOptionsSchema = Schema.Struct({
65
66
  }).annotate({ identifier: "EventOptions" });
66
67
  var TelemetryEvent = Schema.Struct({
67
68
  name: Schema.NonEmptyString,
68
- properties: Schema.optional(EventAttributesSchema),
69
+ properties: Schema.optional(EventPropertiesSchema),
69
70
  options: Schema.optional(EventOptionsSchema)
70
71
  }).annotate({ identifier: "TelemetryEvent" });
71
72
 
@@ -0,0 +1,62 @@
1
+ import type { Schema } from "effect";
2
+ import { type DataTableColDef, type DataTableProps } from "../../../components/ui/data-table.js";
3
+ export interface WebhookDeliveryRow {
4
+ readonly id: string;
5
+ readonly event: string;
6
+ readonly status: "pending" | "success" | "failed";
7
+ readonly retries: number;
8
+ readonly error: string | null;
9
+ readonly retryAt: Date;
10
+ readonly createdAt: Date;
11
+ readonly completedAt: Date | null;
12
+ readonly data: Schema.Json;
13
+ }
14
+ declare const translations: {
15
+ en: {
16
+ identifier: string;
17
+ event: string;
18
+ status: string;
19
+ pending: string;
20
+ success: string;
21
+ failed: string;
22
+ retries: string;
23
+ retryAt: string;
24
+ errorUnavailable: string;
25
+ payload: string;
26
+ viewPayload: string;
27
+ createdAt: string;
28
+ completedAt: string;
29
+ };
30
+ fr: {
31
+ identifier: string;
32
+ event: string;
33
+ status: string;
34
+ pending: string;
35
+ success: string;
36
+ failed: string;
37
+ retries: string;
38
+ retryAt: string;
39
+ errorUnavailable: string;
40
+ payload: string;
41
+ viewPayload: string;
42
+ createdAt: string;
43
+ completedAt: string;
44
+ };
45
+ };
46
+ export type WebhookDeliveryMessages = typeof translations.en;
47
+ /** A failed attempt remains failed while its next retry is pending. */
48
+ export declare const webhookDeliveryStatus: (delivery: Pick<WebhookDeliveryRow, "status" | "retries">) => "failed" | "pending" | "success";
49
+ export type WebhookDeliveryTableProps<T extends WebhookDeliveryRow> = Pick<DataTableProps<T>, "state" | "onStateChange" | "status"> & {
50
+ entries: readonly T[];
51
+ rowCount: number;
52
+ locale?: string;
53
+ messages?: Readonly<Record<string, Partial<WebhookDeliveryMessages>>>;
54
+ events?: readonly {
55
+ value: string;
56
+ label: string;
57
+ }[];
58
+ /** Application-owned navigation and resource references. */
59
+ linksColumn?: DataTableColDef<T>;
60
+ };
61
+ export declare const WebhookDeliveryTable: <T extends WebhookDeliveryRow>({ entries, rowCount, locale: localeOverride, messages, events, linksColumn, state, onStateChange, status, }: WebhookDeliveryTableProps<T>) => import("react").JSX.Element;
62
+ export {};