@krak-stack/registry 0.1.51 → 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.
@@ -5,6 +5,7 @@ import { Otlp } from "../opentelemetry/index.js";
5
5
  import { EventIdentity, EventGeolocation, EventConflictError, EventsPersistenceError } from "./schema.js";
6
6
  export declare const SESSION_TIMEOUT_MS: number;
7
7
  export type { EventGeolocation } from "./schema.js";
8
+ export { AuditTarget, TrackEvent, EventLogRecord, ListAudit } from "./schema.js";
8
9
  export type EventGeolocationResolver = (request: HttpServerRequest.HttpServerRequest) => Effect.Effect<EventGeolocation | null, unknown>;
9
10
  export interface EventsOptions {
10
11
  /** Defaults to the server's OTEL_SERVICE_NAME / OTEL_RESOURCE_ATTRIBUTES. */
@@ -35,7 +36,7 @@ declare const Events_base: Context.ServiceClass<Events, "krakstack/events/Events
35
36
  persisted: boolean;
36
37
  }, OtlpProcessingError, HttpServerRequest.HttpServerRequest>;
37
38
  track: (input: {
38
- readonly eventId: string;
39
+ readonly eventId?: string | undefined;
39
40
  readonly name: string;
40
41
  readonly properties?: {
41
42
  readonly [x: string]: string | number | boolean | readonly string[] | readonly number[] | readonly boolean[];
@@ -45,11 +46,77 @@ declare const Events_base: Context.ServiceClass<Events, "krakstack/events/Events
45
46
  readonly organizationId?: string | undefined;
46
47
  } | undefined;
47
48
  readonly timestamp?: DateTime.Utc | undefined;
48
- readonly category?: "analytics" | "audit" | undefined;
49
+ readonly category?: "analytics" | undefined;
50
+ } | {
51
+ readonly eventId?: string | undefined;
52
+ readonly name: string;
53
+ readonly properties?: {
54
+ readonly [x: string]: string | number | boolean | readonly string[] | readonly number[] | readonly boolean[];
55
+ } | undefined;
56
+ readonly identity?: {
57
+ readonly userId?: string | undefined;
58
+ readonly organizationId?: string | undefined;
59
+ } | undefined;
60
+ readonly timestamp?: DateTime.Utc | undefined;
61
+ readonly category: "audit";
62
+ readonly target: {
63
+ readonly id: string;
64
+ readonly name: string;
65
+ readonly type: string;
66
+ };
49
67
  }) => Effect.Effect<{
50
68
  eventId: string;
51
69
  inserted: boolean;
52
70
  }, EventConflictError | EventsPersistenceError | Schema.SchemaError, never>;
71
+ listAudit: (input: {
72
+ readonly page?: string | number | undefined;
73
+ readonly pageSize?: string | number | undefined;
74
+ readonly globalFilter?: string | undefined;
75
+ readonly sort?: readonly {
76
+ readonly id: string;
77
+ readonly direction: "asc" | "desc";
78
+ }[] | undefined;
79
+ readonly organizationId: string;
80
+ }) => Effect.Effect<{
81
+ data: {
82
+ readonly eventName: string;
83
+ readonly timeUnixNano: string;
84
+ readonly observedTimeUnixNano?: string | undefined;
85
+ readonly severityNumber?: number | undefined;
86
+ readonly traceId?: string | undefined;
87
+ readonly spanId?: string | undefined;
88
+ readonly attributes: readonly {
89
+ readonly key: string;
90
+ readonly value: {
91
+ readonly stringValue: string;
92
+ } | {
93
+ readonly intValue: string | number;
94
+ } | {
95
+ readonly doubleValue: number;
96
+ } | {
97
+ readonly boolValue: boolean;
98
+ } | {
99
+ readonly arrayValue: {
100
+ readonly values: readonly ({
101
+ readonly stringValue: string;
102
+ } | {
103
+ readonly intValue: string | number;
104
+ } | {
105
+ readonly doubleValue: number;
106
+ } | {
107
+ readonly boolValue: boolean;
108
+ })[];
109
+ };
110
+ };
111
+ }[];
112
+ }[];
113
+ meta: {
114
+ page: number;
115
+ pageSize: number;
116
+ total: number;
117
+ pageCount: number;
118
+ };
119
+ }, EventsPersistenceError | import("effect/Cause").NoSuchElementError | Schema.SchemaError | import("effect/sql/SqlError").SqlError, never>;
53
120
  }> & {
54
121
  readonly make: (options: EventsOptions) => Effect.Effect<{
55
122
  process: (body: Uint8Array<ArrayBufferLike>) => Effect.Effect<{
@@ -57,7 +124,7 @@ declare const Events_base: Context.ServiceClass<Events, "krakstack/events/Events
57
124
  persisted: boolean;
58
125
  }, OtlpProcessingError, HttpServerRequest.HttpServerRequest>;
59
126
  track: (input: {
60
- readonly eventId: string;
127
+ readonly eventId?: string | undefined;
61
128
  readonly name: string;
62
129
  readonly properties?: {
63
130
  readonly [x: string]: string | number | boolean | readonly string[] | readonly number[] | readonly boolean[];
@@ -67,11 +134,77 @@ declare const Events_base: Context.ServiceClass<Events, "krakstack/events/Events
67
134
  readonly organizationId?: string | undefined;
68
135
  } | undefined;
69
136
  readonly timestamp?: DateTime.Utc | undefined;
70
- readonly category?: "analytics" | "audit" | undefined;
137
+ readonly category?: "analytics" | undefined;
138
+ } | {
139
+ readonly eventId?: string | undefined;
140
+ readonly name: string;
141
+ readonly properties?: {
142
+ readonly [x: string]: string | number | boolean | readonly string[] | readonly number[] | readonly boolean[];
143
+ } | undefined;
144
+ readonly identity?: {
145
+ readonly userId?: string | undefined;
146
+ readonly organizationId?: string | undefined;
147
+ } | undefined;
148
+ readonly timestamp?: DateTime.Utc | undefined;
149
+ readonly category: "audit";
150
+ readonly target: {
151
+ readonly id: string;
152
+ readonly name: string;
153
+ readonly type: string;
154
+ };
71
155
  }) => Effect.Effect<{
72
156
  eventId: string;
73
157
  inserted: boolean;
74
158
  }, EventConflictError | EventsPersistenceError | Schema.SchemaError, never>;
159
+ listAudit: (input: {
160
+ readonly page?: string | number | undefined;
161
+ readonly pageSize?: string | number | undefined;
162
+ readonly globalFilter?: string | undefined;
163
+ readonly sort?: readonly {
164
+ readonly id: string;
165
+ readonly direction: "asc" | "desc";
166
+ }[] | undefined;
167
+ readonly organizationId: string;
168
+ }) => Effect.Effect<{
169
+ data: {
170
+ readonly eventName: string;
171
+ readonly timeUnixNano: string;
172
+ readonly observedTimeUnixNano?: string | undefined;
173
+ readonly severityNumber?: number | undefined;
174
+ readonly traceId?: string | undefined;
175
+ readonly spanId?: string | undefined;
176
+ readonly attributes: readonly {
177
+ readonly key: string;
178
+ readonly value: {
179
+ readonly stringValue: string;
180
+ } | {
181
+ readonly intValue: string | number;
182
+ } | {
183
+ readonly doubleValue: number;
184
+ } | {
185
+ readonly boolValue: boolean;
186
+ } | {
187
+ readonly arrayValue: {
188
+ readonly values: readonly ({
189
+ readonly stringValue: string;
190
+ } | {
191
+ readonly intValue: string | number;
192
+ } | {
193
+ readonly doubleValue: number;
194
+ } | {
195
+ readonly boolValue: boolean;
196
+ })[];
197
+ };
198
+ };
199
+ }[];
200
+ }[];
201
+ meta: {
202
+ page: number;
203
+ pageSize: number;
204
+ total: number;
205
+ pageCount: number;
206
+ };
207
+ }, EventsPersistenceError | import("effect/Cause").NoSuchElementError | Schema.SchemaError | import("effect/sql/SqlError").SqlError, never>;
75
208
  }, EventsConfigurationError, Otlp>;
76
209
  };
77
210
  export declare class Events extends Events_base {