@smplkit/sdk 3.0.55 → 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 +49 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +43 -29
- package/dist/index.d.ts +43 -29
- package/dist/index.js +49 -24
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -304,15 +304,20 @@ declare class Forwarder {
|
|
|
304
304
|
*/
|
|
305
305
|
filter: Record<string, unknown> | null;
|
|
306
306
|
/**
|
|
307
|
-
* Optional template applied to each event before delivery.
|
|
308
|
-
*
|
|
307
|
+
* Optional template applied to each event before delivery. The wire
|
|
308
|
+
* schema widens to arbitrary JSON to leave room for future transform
|
|
309
|
+
* engines carrying structured templates; for
|
|
310
|
+
* {@link TransformType.JSONATA} the value must be a JSONata
|
|
309
311
|
* expression string. `null` delivers the event JSON as-is.
|
|
312
|
+
*
|
|
313
|
+
* {@link transform} and {@link transformType} travel as a pair —
|
|
314
|
+
* both set, or both `null`. The SDK enforces this at save time.
|
|
310
315
|
*/
|
|
311
|
-
transform:
|
|
316
|
+
transform: unknown;
|
|
312
317
|
/**
|
|
313
|
-
* Engine used to evaluate {@link transform}.
|
|
314
|
-
*
|
|
315
|
-
* {@link
|
|
318
|
+
* Engine used to evaluate {@link transform}. Required whenever
|
|
319
|
+
* {@link transform} is set, forbidden when it isn't. Today only
|
|
320
|
+
* {@link TransformType.JSONATA} is supported.
|
|
316
321
|
*/
|
|
317
322
|
transformType: TransformType | null;
|
|
318
323
|
/**
|
|
@@ -336,7 +341,7 @@ declare class Forwarder {
|
|
|
336
341
|
enabled?: boolean;
|
|
337
342
|
description?: string | null;
|
|
338
343
|
filter?: Record<string, unknown> | null;
|
|
339
|
-
transform?:
|
|
344
|
+
transform?: unknown;
|
|
340
345
|
transformType?: TransformType | null;
|
|
341
346
|
createdAt?: string | null;
|
|
342
347
|
updatedAt?: string | null;
|
|
@@ -2861,18 +2866,19 @@ declare class ManagementFlagsClient {
|
|
|
2861
2866
|
/**
|
|
2862
2867
|
* Log severity levels used by the Smpl Logging service.
|
|
2863
2868
|
*
|
|
2864
|
-
* Members are declared in
|
|
2865
|
-
*
|
|
2866
|
-
*
|
|
2869
|
+
* Members are declared in increasing order of severity per the
|
|
2870
|
+
* convention of every major JS/TS logging library (winston, bunyan,
|
|
2871
|
+
* pino, npm). `SILENT` is the all-suppressing sentinel and sits at
|
|
2872
|
+
* the end.
|
|
2867
2873
|
*/
|
|
2868
2874
|
declare enum LogLevel {
|
|
2875
|
+
TRACE = "TRACE",
|
|
2869
2876
|
DEBUG = "DEBUG",
|
|
2877
|
+
INFO = "INFO",
|
|
2878
|
+
WARN = "WARN",
|
|
2870
2879
|
ERROR = "ERROR",
|
|
2871
2880
|
FATAL = "FATAL",
|
|
2872
|
-
|
|
2873
|
-
SILENT = "SILENT",
|
|
2874
|
-
TRACE = "TRACE",
|
|
2875
|
-
WARN = "WARN"
|
|
2881
|
+
SILENT = "SILENT"
|
|
2876
2882
|
}
|
|
2877
2883
|
/**
|
|
2878
2884
|
* Describes a logger effective-level change. Frozen — fields cannot be
|
|
@@ -3192,20 +3198,27 @@ declare class ForwardersClient implements ForwarderModelClient {
|
|
|
3192
3198
|
* Construct an unsaved {@link Forwarder}. Call {@link Forwarder.save}
|
|
3193
3199
|
* to persist.
|
|
3194
3200
|
*
|
|
3195
|
-
* @param fields.name
|
|
3196
|
-
* @param fields.forwarderType
|
|
3197
|
-
* @param fields.configuration
|
|
3198
|
-
*
|
|
3199
|
-
*
|
|
3200
|
-
*
|
|
3201
|
-
* @param fields.enabled
|
|
3202
|
-
* @param fields.description
|
|
3203
|
-
* @param fields.filter
|
|
3204
|
-
*
|
|
3205
|
-
*
|
|
3206
|
-
* @param fields.
|
|
3207
|
-
*
|
|
3208
|
-
*
|
|
3201
|
+
* @param fields.name Display name. Free-form.
|
|
3202
|
+
* @param fields.forwarderType Destination type — see {@link ForwarderType}.
|
|
3203
|
+
* @param fields.configuration Destination HTTP request configuration.
|
|
3204
|
+
* Headers carry credentials and are
|
|
3205
|
+
* encrypted at rest server-side; reads
|
|
3206
|
+
* return them redacted.
|
|
3207
|
+
* @param fields.enabled Whether the forwarder is active. Defaults true.
|
|
3208
|
+
* @param fields.description Optional free-text description.
|
|
3209
|
+
* @param fields.filter Optional JSON Logic filter; events that
|
|
3210
|
+
* don't match are recorded as
|
|
3211
|
+
* `filtered_out` deliveries.
|
|
3212
|
+
* @param fields.transformType Engine used to evaluate `transform`.
|
|
3213
|
+
* Today only {@link TransformType.JSONATA}
|
|
3214
|
+
* is supported. Must be supplied together
|
|
3215
|
+
* with `transform` (both or neither).
|
|
3216
|
+
* @param fields.transform Optional template applied to each
|
|
3217
|
+
* event before delivery. The value is
|
|
3218
|
+
* arbitrary JSON — for JSONATA, it
|
|
3219
|
+
* must be a string containing a JSONata
|
|
3220
|
+
* expression. Must be supplied together
|
|
3221
|
+
* with `transformType` (both or neither).
|
|
3209
3222
|
*/
|
|
3210
3223
|
new(fields: {
|
|
3211
3224
|
name: string;
|
|
@@ -3214,7 +3227,8 @@ declare class ForwardersClient implements ForwarderModelClient {
|
|
|
3214
3227
|
enabled?: boolean;
|
|
3215
3228
|
description?: string | null;
|
|
3216
3229
|
filter?: Record<string, unknown> | null;
|
|
3217
|
-
|
|
3230
|
+
transformType?: TransformType | null;
|
|
3231
|
+
transform?: unknown;
|
|
3218
3232
|
}): Forwarder;
|
|
3219
3233
|
/**
|
|
3220
3234
|
* List forwarders for the authenticated account.
|
package/dist/index.d.ts
CHANGED
|
@@ -304,15 +304,20 @@ declare class Forwarder {
|
|
|
304
304
|
*/
|
|
305
305
|
filter: Record<string, unknown> | null;
|
|
306
306
|
/**
|
|
307
|
-
* Optional template applied to each event before delivery.
|
|
308
|
-
*
|
|
307
|
+
* Optional template applied to each event before delivery. The wire
|
|
308
|
+
* schema widens to arbitrary JSON to leave room for future transform
|
|
309
|
+
* engines carrying structured templates; for
|
|
310
|
+
* {@link TransformType.JSONATA} the value must be a JSONata
|
|
309
311
|
* expression string. `null` delivers the event JSON as-is.
|
|
312
|
+
*
|
|
313
|
+
* {@link transform} and {@link transformType} travel as a pair —
|
|
314
|
+
* both set, or both `null`. The SDK enforces this at save time.
|
|
310
315
|
*/
|
|
311
|
-
transform:
|
|
316
|
+
transform: unknown;
|
|
312
317
|
/**
|
|
313
|
-
* Engine used to evaluate {@link transform}.
|
|
314
|
-
*
|
|
315
|
-
* {@link
|
|
318
|
+
* Engine used to evaluate {@link transform}. Required whenever
|
|
319
|
+
* {@link transform} is set, forbidden when it isn't. Today only
|
|
320
|
+
* {@link TransformType.JSONATA} is supported.
|
|
316
321
|
*/
|
|
317
322
|
transformType: TransformType | null;
|
|
318
323
|
/**
|
|
@@ -336,7 +341,7 @@ declare class Forwarder {
|
|
|
336
341
|
enabled?: boolean;
|
|
337
342
|
description?: string | null;
|
|
338
343
|
filter?: Record<string, unknown> | null;
|
|
339
|
-
transform?:
|
|
344
|
+
transform?: unknown;
|
|
340
345
|
transformType?: TransformType | null;
|
|
341
346
|
createdAt?: string | null;
|
|
342
347
|
updatedAt?: string | null;
|
|
@@ -2861,18 +2866,19 @@ declare class ManagementFlagsClient {
|
|
|
2861
2866
|
/**
|
|
2862
2867
|
* Log severity levels used by the Smpl Logging service.
|
|
2863
2868
|
*
|
|
2864
|
-
* Members are declared in
|
|
2865
|
-
*
|
|
2866
|
-
*
|
|
2869
|
+
* Members are declared in increasing order of severity per the
|
|
2870
|
+
* convention of every major JS/TS logging library (winston, bunyan,
|
|
2871
|
+
* pino, npm). `SILENT` is the all-suppressing sentinel and sits at
|
|
2872
|
+
* the end.
|
|
2867
2873
|
*/
|
|
2868
2874
|
declare enum LogLevel {
|
|
2875
|
+
TRACE = "TRACE",
|
|
2869
2876
|
DEBUG = "DEBUG",
|
|
2877
|
+
INFO = "INFO",
|
|
2878
|
+
WARN = "WARN",
|
|
2870
2879
|
ERROR = "ERROR",
|
|
2871
2880
|
FATAL = "FATAL",
|
|
2872
|
-
|
|
2873
|
-
SILENT = "SILENT",
|
|
2874
|
-
TRACE = "TRACE",
|
|
2875
|
-
WARN = "WARN"
|
|
2881
|
+
SILENT = "SILENT"
|
|
2876
2882
|
}
|
|
2877
2883
|
/**
|
|
2878
2884
|
* Describes a logger effective-level change. Frozen — fields cannot be
|
|
@@ -3192,20 +3198,27 @@ declare class ForwardersClient implements ForwarderModelClient {
|
|
|
3192
3198
|
* Construct an unsaved {@link Forwarder}. Call {@link Forwarder.save}
|
|
3193
3199
|
* to persist.
|
|
3194
3200
|
*
|
|
3195
|
-
* @param fields.name
|
|
3196
|
-
* @param fields.forwarderType
|
|
3197
|
-
* @param fields.configuration
|
|
3198
|
-
*
|
|
3199
|
-
*
|
|
3200
|
-
*
|
|
3201
|
-
* @param fields.enabled
|
|
3202
|
-
* @param fields.description
|
|
3203
|
-
* @param fields.filter
|
|
3204
|
-
*
|
|
3205
|
-
*
|
|
3206
|
-
* @param fields.
|
|
3207
|
-
*
|
|
3208
|
-
*
|
|
3201
|
+
* @param fields.name Display name. Free-form.
|
|
3202
|
+
* @param fields.forwarderType Destination type — see {@link ForwarderType}.
|
|
3203
|
+
* @param fields.configuration Destination HTTP request configuration.
|
|
3204
|
+
* Headers carry credentials and are
|
|
3205
|
+
* encrypted at rest server-side; reads
|
|
3206
|
+
* return them redacted.
|
|
3207
|
+
* @param fields.enabled Whether the forwarder is active. Defaults true.
|
|
3208
|
+
* @param fields.description Optional free-text description.
|
|
3209
|
+
* @param fields.filter Optional JSON Logic filter; events that
|
|
3210
|
+
* don't match are recorded as
|
|
3211
|
+
* `filtered_out` deliveries.
|
|
3212
|
+
* @param fields.transformType Engine used to evaluate `transform`.
|
|
3213
|
+
* Today only {@link TransformType.JSONATA}
|
|
3214
|
+
* is supported. Must be supplied together
|
|
3215
|
+
* with `transform` (both or neither).
|
|
3216
|
+
* @param fields.transform Optional template applied to each
|
|
3217
|
+
* event before delivery. The value is
|
|
3218
|
+
* arbitrary JSON — for JSONATA, it
|
|
3219
|
+
* must be a string containing a JSONata
|
|
3220
|
+
* expression. Must be supplied together
|
|
3221
|
+
* with `transformType` (both or neither).
|
|
3209
3222
|
*/
|
|
3210
3223
|
new(fields: {
|
|
3211
3224
|
name: string;
|
|
@@ -3214,7 +3227,8 @@ declare class ForwardersClient implements ForwarderModelClient {
|
|
|
3214
3227
|
enabled?: boolean;
|
|
3215
3228
|
description?: string | null;
|
|
3216
3229
|
filter?: Record<string, unknown> | null;
|
|
3217
|
-
|
|
3230
|
+
transformType?: TransformType | null;
|
|
3231
|
+
transform?: unknown;
|
|
3218
3232
|
}): Forwarder;
|
|
3219
3233
|
/**
|
|
3220
3234
|
* List forwarders for the authenticated account.
|
package/dist/index.js
CHANGED
|
@@ -19211,13 +19211,13 @@ function _coerceValues(values) {
|
|
|
19211
19211
|
|
|
19212
19212
|
// src/logging/types.ts
|
|
19213
19213
|
var LogLevel = /* @__PURE__ */ ((LogLevel5) => {
|
|
19214
|
+
LogLevel5["TRACE"] = "TRACE";
|
|
19214
19215
|
LogLevel5["DEBUG"] = "DEBUG";
|
|
19216
|
+
LogLevel5["INFO"] = "INFO";
|
|
19217
|
+
LogLevel5["WARN"] = "WARN";
|
|
19215
19218
|
LogLevel5["ERROR"] = "ERROR";
|
|
19216
19219
|
LogLevel5["FATAL"] = "FATAL";
|
|
19217
|
-
LogLevel5["INFO"] = "INFO";
|
|
19218
19220
|
LogLevel5["SILENT"] = "SILENT";
|
|
19219
|
-
LogLevel5["TRACE"] = "TRACE";
|
|
19220
|
-
LogLevel5["WARN"] = "WARN";
|
|
19221
19221
|
return LogLevel5;
|
|
19222
19222
|
})(LogLevel || {});
|
|
19223
19223
|
var LoggerChangeEvent = class {
|
|
@@ -19893,15 +19893,20 @@ var Forwarder = class {
|
|
|
19893
19893
|
*/
|
|
19894
19894
|
filter;
|
|
19895
19895
|
/**
|
|
19896
|
-
* Optional template applied to each event before delivery.
|
|
19897
|
-
*
|
|
19896
|
+
* Optional template applied to each event before delivery. The wire
|
|
19897
|
+
* schema widens to arbitrary JSON to leave room for future transform
|
|
19898
|
+
* engines carrying structured templates; for
|
|
19899
|
+
* {@link TransformType.JSONATA} the value must be a JSONata
|
|
19898
19900
|
* expression string. `null` delivers the event JSON as-is.
|
|
19901
|
+
*
|
|
19902
|
+
* {@link transform} and {@link transformType} travel as a pair —
|
|
19903
|
+
* both set, or both `null`. The SDK enforces this at save time.
|
|
19899
19904
|
*/
|
|
19900
19905
|
transform;
|
|
19901
19906
|
/**
|
|
19902
|
-
* Engine used to evaluate {@link transform}.
|
|
19903
|
-
*
|
|
19904
|
-
* {@link
|
|
19907
|
+
* Engine used to evaluate {@link transform}. Required whenever
|
|
19908
|
+
* {@link transform} is set, forbidden when it isn't. Today only
|
|
19909
|
+
* {@link TransformType.JSONATA} is supported.
|
|
19905
19910
|
*/
|
|
19906
19911
|
transformType;
|
|
19907
19912
|
/**
|
|
@@ -20032,8 +20037,20 @@ function _forwarderAttrs(forwarder) {
|
|
|
20032
20037
|
if (forwarder.filter !== null) {
|
|
20033
20038
|
attrs.filter = forwarder.filter;
|
|
20034
20039
|
}
|
|
20035
|
-
|
|
20036
|
-
|
|
20040
|
+
const hasTransform = forwarder.transform !== null && forwarder.transform !== void 0;
|
|
20041
|
+
const hasTransformType = forwarder.transformType !== null && forwarder.transformType !== void 0;
|
|
20042
|
+
if (hasTransform !== hasTransformType) {
|
|
20043
|
+
throw new Error(
|
|
20044
|
+
"Forwarder.transform and Forwarder.transformType must be set together (or both unset)"
|
|
20045
|
+
);
|
|
20046
|
+
}
|
|
20047
|
+
if (hasTransform) {
|
|
20048
|
+
if (forwarder.transformType === "JSONATA" /* JSONATA */ && typeof forwarder.transform !== "string") {
|
|
20049
|
+
throw new Error(
|
|
20050
|
+
"Forwarder.transform must be a string when Forwarder.transformType is JSONATA"
|
|
20051
|
+
);
|
|
20052
|
+
}
|
|
20053
|
+
attrs.transform_type = forwarder.transformType;
|
|
20037
20054
|
attrs.transform = forwarder.transform;
|
|
20038
20055
|
}
|
|
20039
20056
|
return attrs;
|
|
@@ -20065,20 +20082,27 @@ var ForwardersClient = class {
|
|
|
20065
20082
|
* Construct an unsaved {@link Forwarder}. Call {@link Forwarder.save}
|
|
20066
20083
|
* to persist.
|
|
20067
20084
|
*
|
|
20068
|
-
* @param fields.name
|
|
20069
|
-
* @param fields.forwarderType
|
|
20070
|
-
* @param fields.configuration
|
|
20071
|
-
*
|
|
20072
|
-
*
|
|
20073
|
-
*
|
|
20074
|
-
* @param fields.enabled
|
|
20075
|
-
* @param fields.description
|
|
20076
|
-
* @param fields.filter
|
|
20077
|
-
*
|
|
20078
|
-
*
|
|
20079
|
-
* @param fields.
|
|
20080
|
-
*
|
|
20081
|
-
*
|
|
20085
|
+
* @param fields.name Display name. Free-form.
|
|
20086
|
+
* @param fields.forwarderType Destination type — see {@link ForwarderType}.
|
|
20087
|
+
* @param fields.configuration Destination HTTP request configuration.
|
|
20088
|
+
* Headers carry credentials and are
|
|
20089
|
+
* encrypted at rest server-side; reads
|
|
20090
|
+
* return them redacted.
|
|
20091
|
+
* @param fields.enabled Whether the forwarder is active. Defaults true.
|
|
20092
|
+
* @param fields.description Optional free-text description.
|
|
20093
|
+
* @param fields.filter Optional JSON Logic filter; events that
|
|
20094
|
+
* don't match are recorded as
|
|
20095
|
+
* `filtered_out` deliveries.
|
|
20096
|
+
* @param fields.transformType Engine used to evaluate `transform`.
|
|
20097
|
+
* Today only {@link TransformType.JSONATA}
|
|
20098
|
+
* is supported. Must be supplied together
|
|
20099
|
+
* with `transform` (both or neither).
|
|
20100
|
+
* @param fields.transform Optional template applied to each
|
|
20101
|
+
* event before delivery. The value is
|
|
20102
|
+
* arbitrary JSON — for JSONATA, it
|
|
20103
|
+
* must be a string containing a JSONata
|
|
20104
|
+
* expression. Must be supplied together
|
|
20105
|
+
* with `transformType` (both or neither).
|
|
20082
20106
|
*/
|
|
20083
20107
|
new(fields) {
|
|
20084
20108
|
return new Forwarder(this, {
|
|
@@ -20088,6 +20112,7 @@ var ForwardersClient = class {
|
|
|
20088
20112
|
enabled: fields.enabled,
|
|
20089
20113
|
description: fields.description,
|
|
20090
20114
|
filter: fields.filter,
|
|
20115
|
+
transformType: fields.transformType,
|
|
20091
20116
|
transform: fields.transform
|
|
20092
20117
|
});
|
|
20093
20118
|
}
|