@smplkit/sdk 3.0.53 → 3.0.55
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/dist/index.cjs +5 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +20 -8
- package/dist/index.d.ts +20 -8
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -22,20 +22,21 @@ interface AuditEvent {
|
|
|
22
22
|
/** ISO-8601-with-offset timestamp of when the audit service ingested the event. */
|
|
23
23
|
createdAt: string;
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
26
|
-
* `"
|
|
25
|
+
* Kind of actor that caused the event — e.g. `"USER"`, `"API_KEY"`,
|
|
26
|
+
* `"SYSTEM"`, or any label the caller chose. `null` when the caller
|
|
27
|
+
* did not supply one; the audit service never backfills.
|
|
27
28
|
*/
|
|
28
|
-
actorType: string;
|
|
29
|
+
actorType: string | null;
|
|
29
30
|
/**
|
|
30
|
-
*
|
|
31
|
-
*
|
|
31
|
+
* Identifier of the actor that caused the event. Free-form — any
|
|
32
|
+
* identifier scheme is accepted. `null` when not supplied.
|
|
32
33
|
*/
|
|
33
34
|
actorId: string | null;
|
|
34
35
|
/**
|
|
35
|
-
*
|
|
36
|
-
*
|
|
36
|
+
* Human-readable label for the actor (e.g. an email address or API
|
|
37
|
+
* key name). `null` when not supplied.
|
|
37
38
|
*/
|
|
38
|
-
actorLabel: string;
|
|
39
|
+
actorLabel: string | null;
|
|
39
40
|
/**
|
|
40
41
|
* Free-form per-event payload defined by the customer. Surfaced on
|
|
41
42
|
* the audit-event resource as a structured JSONB column.
|
|
@@ -61,6 +62,17 @@ interface CreateEventInput {
|
|
|
61
62
|
resourceId: string;
|
|
62
63
|
/** Defaults to server-side `now()` if omitted. */
|
|
63
64
|
occurredAt?: Date | string;
|
|
65
|
+
/**
|
|
66
|
+
* Free-form label for the kind of actor that caused the event (e.g.
|
|
67
|
+
* `"USER"`, `"API_KEY"`, `"SYSTEM"`, or any custom value). The audit
|
|
68
|
+
* service never backfills this from the request credential — supply
|
|
69
|
+
* it explicitly when you want the event attributed.
|
|
70
|
+
*/
|
|
71
|
+
actorType?: string;
|
|
72
|
+
/** Free-form identifier of the actor. Any string scheme is accepted. */
|
|
73
|
+
actorId?: string;
|
|
74
|
+
/** Human-readable label for the actor (e.g. email or API key name). */
|
|
75
|
+
actorLabel?: string;
|
|
64
76
|
/**
|
|
65
77
|
* Free-form contextual JSON. To record a resource snapshot, nest it
|
|
66
78
|
* inside `data` — smplkit's internal convention is `data.snapshot`,
|
package/dist/index.d.ts
CHANGED
|
@@ -22,20 +22,21 @@ interface AuditEvent {
|
|
|
22
22
|
/** ISO-8601-with-offset timestamp of when the audit service ingested the event. */
|
|
23
23
|
createdAt: string;
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
26
|
-
* `"
|
|
25
|
+
* Kind of actor that caused the event — e.g. `"USER"`, `"API_KEY"`,
|
|
26
|
+
* `"SYSTEM"`, or any label the caller chose. `null` when the caller
|
|
27
|
+
* did not supply one; the audit service never backfills.
|
|
27
28
|
*/
|
|
28
|
-
actorType: string;
|
|
29
|
+
actorType: string | null;
|
|
29
30
|
/**
|
|
30
|
-
*
|
|
31
|
-
*
|
|
31
|
+
* Identifier of the actor that caused the event. Free-form — any
|
|
32
|
+
* identifier scheme is accepted. `null` when not supplied.
|
|
32
33
|
*/
|
|
33
34
|
actorId: string | null;
|
|
34
35
|
/**
|
|
35
|
-
*
|
|
36
|
-
*
|
|
36
|
+
* Human-readable label for the actor (e.g. an email address or API
|
|
37
|
+
* key name). `null` when not supplied.
|
|
37
38
|
*/
|
|
38
|
-
actorLabel: string;
|
|
39
|
+
actorLabel: string | null;
|
|
39
40
|
/**
|
|
40
41
|
* Free-form per-event payload defined by the customer. Surfaced on
|
|
41
42
|
* the audit-event resource as a structured JSONB column.
|
|
@@ -61,6 +62,17 @@ interface CreateEventInput {
|
|
|
61
62
|
resourceId: string;
|
|
62
63
|
/** Defaults to server-side `now()` if omitted. */
|
|
63
64
|
occurredAt?: Date | string;
|
|
65
|
+
/**
|
|
66
|
+
* Free-form label for the kind of actor that caused the event (e.g.
|
|
67
|
+
* `"USER"`, `"API_KEY"`, `"SYSTEM"`, or any custom value). The audit
|
|
68
|
+
* service never backfills this from the request credential — supply
|
|
69
|
+
* it explicitly when you want the event attributed.
|
|
70
|
+
*/
|
|
71
|
+
actorType?: string;
|
|
72
|
+
/** Free-form identifier of the actor. Any string scheme is accepted. */
|
|
73
|
+
actorId?: string;
|
|
74
|
+
/** Human-readable label for the actor (e.g. email or API key name). */
|
|
75
|
+
actorLabel?: string;
|
|
64
76
|
/**
|
|
65
77
|
* Free-form contextual JSON. To record a resource snapshot, nest it
|
|
66
78
|
* inside `data` — smplkit's internal convention is `data.snapshot`,
|
package/dist/index.js
CHANGED
|
@@ -16856,6 +16856,9 @@ function _eventBodyFromInput(input) {
|
|
|
16856
16856
|
if (input.occurredAt !== void 0) {
|
|
16857
16857
|
attrs.occurred_at = input.occurredAt instanceof Date ? input.occurredAt.toISOString() : input.occurredAt;
|
|
16858
16858
|
}
|
|
16859
|
+
if (input.actorType !== void 0) attrs.actor_type = input.actorType;
|
|
16860
|
+
if (input.actorId !== void 0) attrs.actor_id = input.actorId;
|
|
16861
|
+
if (input.actorLabel !== void 0) attrs.actor_label = input.actorLabel;
|
|
16859
16862
|
if (input.data !== void 0) {
|
|
16860
16863
|
attrs.data = input.data;
|
|
16861
16864
|
}
|
|
@@ -16870,9 +16873,9 @@ function _eventFromResource(resource) {
|
|
|
16870
16873
|
resourceId: String(attrs.resource_id ?? ""),
|
|
16871
16874
|
occurredAt: String(attrs.occurred_at ?? ""),
|
|
16872
16875
|
createdAt: String(attrs.created_at ?? ""),
|
|
16873
|
-
actorType:
|
|
16876
|
+
actorType: attrs.actor_type ?? null,
|
|
16874
16877
|
actorId: attrs.actor_id ?? null,
|
|
16875
|
-
actorLabel:
|
|
16878
|
+
actorLabel: attrs.actor_label ?? null,
|
|
16876
16879
|
data: attrs.data ?? {},
|
|
16877
16880
|
idempotencyKey: String(attrs.idempotency_key ?? ""),
|
|
16878
16881
|
doNotForward: Boolean(attrs.do_not_forward ?? false)
|