@smplkit/sdk 3.0.56 → 3.0.57
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 +26 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +16 -16
- package/dist/index.d.ts +16 -16
- package/dist/index.js +26 -18
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -19963,20 +19963,20 @@ var Forwarder = class {
|
|
|
19963
19963
|
*/
|
|
19964
19964
|
filter;
|
|
19965
19965
|
/**
|
|
19966
|
-
* Optional template applied to each event before delivery.
|
|
19967
|
-
*
|
|
19968
|
-
*
|
|
19969
|
-
*
|
|
19970
|
-
*
|
|
19966
|
+
* Optional template applied to each event before delivery. The wire
|
|
19967
|
+
* schema widens to arbitrary JSON to leave room for future transform
|
|
19968
|
+
* engines carrying structured templates; for
|
|
19969
|
+
* {@link TransformType.JSONATA} the value must be a JSONata
|
|
19970
|
+
* expression string. `null` delivers the event JSON as-is.
|
|
19971
19971
|
*
|
|
19972
|
-
*
|
|
19973
|
-
*
|
|
19972
|
+
* {@link transform} and {@link transformType} travel as a pair —
|
|
19973
|
+
* both set, or both `null`. The SDK enforces this at save time.
|
|
19974
19974
|
*/
|
|
19975
19975
|
transform;
|
|
19976
19976
|
/**
|
|
19977
19977
|
* Engine used to evaluate {@link transform}. Required whenever
|
|
19978
|
-
* {@link transform} is set. Today only
|
|
19979
|
-
* is supported.
|
|
19978
|
+
* {@link transform} is set, forbidden when it isn't. Today only
|
|
19979
|
+
* {@link TransformType.JSONATA} is supported.
|
|
19980
19980
|
*/
|
|
19981
19981
|
transformType;
|
|
19982
19982
|
/**
|
|
@@ -20108,10 +20108,18 @@ function _forwarderAttrs(forwarder) {
|
|
|
20108
20108
|
attrs.filter = forwarder.filter;
|
|
20109
20109
|
}
|
|
20110
20110
|
const hasTransform = forwarder.transform !== null && forwarder.transform !== void 0;
|
|
20111
|
-
|
|
20112
|
-
|
|
20111
|
+
const hasTransformType = forwarder.transformType !== null && forwarder.transformType !== void 0;
|
|
20112
|
+
if (hasTransform !== hasTransformType) {
|
|
20113
|
+
throw new Error(
|
|
20114
|
+
"Forwarder.transform and Forwarder.transformType must be set together (or both unset)"
|
|
20115
|
+
);
|
|
20113
20116
|
}
|
|
20114
20117
|
if (hasTransform) {
|
|
20118
|
+
if (forwarder.transformType === "JSONATA" /* JSONATA */ && typeof forwarder.transform !== "string") {
|
|
20119
|
+
throw new Error(
|
|
20120
|
+
"Forwarder.transform must be a string when Forwarder.transformType is JSONATA"
|
|
20121
|
+
);
|
|
20122
|
+
}
|
|
20115
20123
|
attrs.transform_type = forwarder.transformType;
|
|
20116
20124
|
attrs.transform = forwarder.transform;
|
|
20117
20125
|
}
|
|
@@ -20156,15 +20164,15 @@ var ForwardersClient = class {
|
|
|
20156
20164
|
* don't match are recorded as
|
|
20157
20165
|
* `filtered_out` deliveries.
|
|
20158
20166
|
* @param fields.transformType Engine used to evaluate `transform`.
|
|
20159
|
-
*
|
|
20160
|
-
*
|
|
20161
|
-
*
|
|
20167
|
+
* Today only {@link TransformType.JSONATA}
|
|
20168
|
+
* is supported. Must be supplied together
|
|
20169
|
+
* with `transform` (both or neither).
|
|
20162
20170
|
* @param fields.transform Optional template applied to each
|
|
20163
20171
|
* event before delivery. The value is
|
|
20164
|
-
* arbitrary JSON — for JSONATA,
|
|
20165
|
-
*
|
|
20166
|
-
*
|
|
20167
|
-
* `
|
|
20172
|
+
* arbitrary JSON — for JSONATA, it
|
|
20173
|
+
* must be a string containing a JSONata
|
|
20174
|
+
* expression. Must be supplied together
|
|
20175
|
+
* with `transformType` (both or neither).
|
|
20168
20176
|
*/
|
|
20169
20177
|
new(fields) {
|
|
20170
20178
|
return new Forwarder(this, {
|