@smplkit/sdk 3.0.54 → 3.0.56
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 +46 -26
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +63 -37
- package/dist/index.d.ts +63 -37
- package/dist/index.js +46 -26
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -16926,6 +16926,9 @@ function _eventBodyFromInput(input) {
|
|
|
16926
16926
|
if (input.occurredAt !== void 0) {
|
|
16927
16927
|
attrs.occurred_at = input.occurredAt instanceof Date ? input.occurredAt.toISOString() : input.occurredAt;
|
|
16928
16928
|
}
|
|
16929
|
+
if (input.actorType !== void 0) attrs.actor_type = input.actorType;
|
|
16930
|
+
if (input.actorId !== void 0) attrs.actor_id = input.actorId;
|
|
16931
|
+
if (input.actorLabel !== void 0) attrs.actor_label = input.actorLabel;
|
|
16929
16932
|
if (input.data !== void 0) {
|
|
16930
16933
|
attrs.data = input.data;
|
|
16931
16934
|
}
|
|
@@ -16940,9 +16943,9 @@ function _eventFromResource(resource) {
|
|
|
16940
16943
|
resourceId: String(attrs.resource_id ?? ""),
|
|
16941
16944
|
occurredAt: String(attrs.occurred_at ?? ""),
|
|
16942
16945
|
createdAt: String(attrs.created_at ?? ""),
|
|
16943
|
-
actorType:
|
|
16946
|
+
actorType: attrs.actor_type ?? null,
|
|
16944
16947
|
actorId: attrs.actor_id ?? null,
|
|
16945
|
-
actorLabel:
|
|
16948
|
+
actorLabel: attrs.actor_label ?? null,
|
|
16946
16949
|
data: attrs.data ?? {},
|
|
16947
16950
|
idempotencyKey: String(attrs.idempotency_key ?? ""),
|
|
16948
16951
|
doNotForward: Boolean(attrs.do_not_forward ?? false)
|
|
@@ -19278,13 +19281,13 @@ function _coerceValues(values) {
|
|
|
19278
19281
|
|
|
19279
19282
|
// src/logging/types.ts
|
|
19280
19283
|
var LogLevel = /* @__PURE__ */ ((LogLevel5) => {
|
|
19284
|
+
LogLevel5["TRACE"] = "TRACE";
|
|
19281
19285
|
LogLevel5["DEBUG"] = "DEBUG";
|
|
19286
|
+
LogLevel5["INFO"] = "INFO";
|
|
19287
|
+
LogLevel5["WARN"] = "WARN";
|
|
19282
19288
|
LogLevel5["ERROR"] = "ERROR";
|
|
19283
19289
|
LogLevel5["FATAL"] = "FATAL";
|
|
19284
|
-
LogLevel5["INFO"] = "INFO";
|
|
19285
19290
|
LogLevel5["SILENT"] = "SILENT";
|
|
19286
|
-
LogLevel5["TRACE"] = "TRACE";
|
|
19287
|
-
LogLevel5["WARN"] = "WARN";
|
|
19288
19291
|
return LogLevel5;
|
|
19289
19292
|
})(LogLevel || {});
|
|
19290
19293
|
var LoggerChangeEvent = class {
|
|
@@ -19961,14 +19964,19 @@ var Forwarder = class {
|
|
|
19961
19964
|
filter;
|
|
19962
19965
|
/**
|
|
19963
19966
|
* Optional template applied to each event before delivery. Shape
|
|
19964
|
-
* depends on {@link transformType}; for
|
|
19965
|
-
* expression string
|
|
19967
|
+
* depends on {@link transformType}; for {@link TransformType.JSONATA}
|
|
19968
|
+
* the value is a JSONata expression string, but the wire schema
|
|
19969
|
+
* widens to arbitrary JSON to leave room for future transform engines
|
|
19970
|
+
* carrying structured templates. `null` delivers the event JSON as-is.
|
|
19971
|
+
*
|
|
19972
|
+
* Whenever {@link transform} is set, {@link transformType} must also
|
|
19973
|
+
* be set; the SDK enforces this at save time.
|
|
19966
19974
|
*/
|
|
19967
19975
|
transform;
|
|
19968
19976
|
/**
|
|
19969
|
-
* Engine used to evaluate {@link transform}.
|
|
19970
|
-
*
|
|
19971
|
-
*
|
|
19977
|
+
* Engine used to evaluate {@link transform}. Required whenever
|
|
19978
|
+
* {@link transform} is set. Today only {@link TransformType.JSONATA}
|
|
19979
|
+
* is supported.
|
|
19972
19980
|
*/
|
|
19973
19981
|
transformType;
|
|
19974
19982
|
/**
|
|
@@ -20099,8 +20107,12 @@ function _forwarderAttrs(forwarder) {
|
|
|
20099
20107
|
if (forwarder.filter !== null) {
|
|
20100
20108
|
attrs.filter = forwarder.filter;
|
|
20101
20109
|
}
|
|
20102
|
-
|
|
20103
|
-
|
|
20110
|
+
const hasTransform = forwarder.transform !== null && forwarder.transform !== void 0;
|
|
20111
|
+
if (hasTransform && forwarder.transformType === null) {
|
|
20112
|
+
throw new Error("Forwarder.transform requires Forwarder.transformType to be set");
|
|
20113
|
+
}
|
|
20114
|
+
if (hasTransform) {
|
|
20115
|
+
attrs.transform_type = forwarder.transformType;
|
|
20104
20116
|
attrs.transform = forwarder.transform;
|
|
20105
20117
|
}
|
|
20106
20118
|
return attrs;
|
|
@@ -20132,20 +20144,27 @@ var ForwardersClient = class {
|
|
|
20132
20144
|
* Construct an unsaved {@link Forwarder}. Call {@link Forwarder.save}
|
|
20133
20145
|
* to persist.
|
|
20134
20146
|
*
|
|
20135
|
-
* @param fields.name
|
|
20136
|
-
* @param fields.forwarderType
|
|
20137
|
-
* @param fields.configuration
|
|
20138
|
-
*
|
|
20139
|
-
*
|
|
20140
|
-
*
|
|
20141
|
-
* @param fields.enabled
|
|
20142
|
-
* @param fields.description
|
|
20143
|
-
* @param fields.filter
|
|
20144
|
-
*
|
|
20145
|
-
*
|
|
20146
|
-
* @param fields.
|
|
20147
|
-
*
|
|
20148
|
-
*
|
|
20147
|
+
* @param fields.name Display name. Free-form.
|
|
20148
|
+
* @param fields.forwarderType Destination type — see {@link ForwarderType}.
|
|
20149
|
+
* @param fields.configuration Destination HTTP request configuration.
|
|
20150
|
+
* Headers carry credentials and are
|
|
20151
|
+
* encrypted at rest server-side; reads
|
|
20152
|
+
* return them redacted.
|
|
20153
|
+
* @param fields.enabled Whether the forwarder is active. Defaults true.
|
|
20154
|
+
* @param fields.description Optional free-text description.
|
|
20155
|
+
* @param fields.filter Optional JSON Logic filter; events that
|
|
20156
|
+
* don't match are recorded as
|
|
20157
|
+
* `filtered_out` deliveries.
|
|
20158
|
+
* @param fields.transformType Engine used to evaluate `transform`.
|
|
20159
|
+
* Required whenever `transform` is set;
|
|
20160
|
+
* today only {@link TransformType.JSONATA}
|
|
20161
|
+
* is supported.
|
|
20162
|
+
* @param fields.transform Optional template applied to each
|
|
20163
|
+
* event before delivery. The value is
|
|
20164
|
+
* arbitrary JSON — for JSONATA, supply
|
|
20165
|
+
* an expression string; future engines
|
|
20166
|
+
* may accept other shapes. Omit (or pass
|
|
20167
|
+
* `null`) to deliver events unchanged.
|
|
20149
20168
|
*/
|
|
20150
20169
|
new(fields) {
|
|
20151
20170
|
return new Forwarder(this, {
|
|
@@ -20155,6 +20174,7 @@ var ForwardersClient = class {
|
|
|
20155
20174
|
enabled: fields.enabled,
|
|
20156
20175
|
description: fields.description,
|
|
20157
20176
|
filter: fields.filter,
|
|
20177
|
+
transformType: fields.transformType,
|
|
20158
20178
|
transform: fields.transform
|
|
20159
20179
|
});
|
|
20160
20180
|
}
|