@smplkit/sdk 3.0.55 → 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.d.cts CHANGED
@@ -305,14 +305,19 @@ declare class Forwarder {
305
305
  filter: Record<string, unknown> | null;
306
306
  /**
307
307
  * Optional template applied to each event before delivery. Shape
308
- * depends on {@link transformType}; for `"JSONATA"`, a JSONata
309
- * expression string. `null` delivers the event JSON as-is.
308
+ * depends on {@link transformType}; for {@link TransformType.JSONATA}
309
+ * the value is a JSONata expression string, but the wire schema
310
+ * widens to arbitrary JSON to leave room for future transform engines
311
+ * carrying structured templates. `null` delivers the event JSON as-is.
312
+ *
313
+ * Whenever {@link transform} is set, {@link transformType} must also
314
+ * be set; the SDK enforces this at save time.
310
315
  */
311
- transform: string | null;
316
+ transform: unknown;
312
317
  /**
313
- * Engine used to evaluate {@link transform}. Currently only
314
- * `"JSONATA"` is supported. Auto-filled by the SDK whenever
315
- * {@link transform} is set on save.
318
+ * Engine used to evaluate {@link transform}. Required whenever
319
+ * {@link transform} is set. Today only {@link TransformType.JSONATA}
320
+ * 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?: string | null;
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 alphabetical order. Severity ordering is not
2865
- * derived from declaration order it lives in the framework adapter
2866
- * code that maps these to each framework's native numeric level.
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
- INFO = "INFO",
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 Display name. Free-form.
3196
- * @param fields.forwarderType Destination type — see {@link ForwarderType}.
3197
- * @param fields.configuration Destination HTTP request configuration.
3198
- * Headers carry credentials and are
3199
- * encrypted at rest server-side; reads
3200
- * return them redacted.
3201
- * @param fields.enabled Whether the forwarder is active. Defaults true.
3202
- * @param fields.description Optional free-text description.
3203
- * @param fields.filter Optional JSON Logic filter; events that
3204
- * don't match are recorded as
3205
- * `filtered_out` deliveries.
3206
- * @param fields.transform Optional JSONata template applied to
3207
- * the event payload before POST. `null`
3208
- * delivers the event as-is.
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
+ * Required whenever `transform` is set;
3214
+ * today only {@link TransformType.JSONATA}
3215
+ * is supported.
3216
+ * @param fields.transform Optional template applied to each
3217
+ * event before delivery. The value is
3218
+ * arbitrary JSON — for JSONATA, supply
3219
+ * an expression string; future engines
3220
+ * may accept other shapes. Omit (or pass
3221
+ * `null`) to deliver events unchanged.
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
- transform?: string | null;
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
@@ -305,14 +305,19 @@ declare class Forwarder {
305
305
  filter: Record<string, unknown> | null;
306
306
  /**
307
307
  * Optional template applied to each event before delivery. Shape
308
- * depends on {@link transformType}; for `"JSONATA"`, a JSONata
309
- * expression string. `null` delivers the event JSON as-is.
308
+ * depends on {@link transformType}; for {@link TransformType.JSONATA}
309
+ * the value is a JSONata expression string, but the wire schema
310
+ * widens to arbitrary JSON to leave room for future transform engines
311
+ * carrying structured templates. `null` delivers the event JSON as-is.
312
+ *
313
+ * Whenever {@link transform} is set, {@link transformType} must also
314
+ * be set; the SDK enforces this at save time.
310
315
  */
311
- transform: string | null;
316
+ transform: unknown;
312
317
  /**
313
- * Engine used to evaluate {@link transform}. Currently only
314
- * `"JSONATA"` is supported. Auto-filled by the SDK whenever
315
- * {@link transform} is set on save.
318
+ * Engine used to evaluate {@link transform}. Required whenever
319
+ * {@link transform} is set. Today only {@link TransformType.JSONATA}
320
+ * 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?: string | null;
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 alphabetical order. Severity ordering is not
2865
- * derived from declaration order it lives in the framework adapter
2866
- * code that maps these to each framework's native numeric level.
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
- INFO = "INFO",
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 Display name. Free-form.
3196
- * @param fields.forwarderType Destination type — see {@link ForwarderType}.
3197
- * @param fields.configuration Destination HTTP request configuration.
3198
- * Headers carry credentials and are
3199
- * encrypted at rest server-side; reads
3200
- * return them redacted.
3201
- * @param fields.enabled Whether the forwarder is active. Defaults true.
3202
- * @param fields.description Optional free-text description.
3203
- * @param fields.filter Optional JSON Logic filter; events that
3204
- * don't match are recorded as
3205
- * `filtered_out` deliveries.
3206
- * @param fields.transform Optional JSONata template applied to
3207
- * the event payload before POST. `null`
3208
- * delivers the event as-is.
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
+ * Required whenever `transform` is set;
3214
+ * today only {@link TransformType.JSONATA}
3215
+ * is supported.
3216
+ * @param fields.transform Optional template applied to each
3217
+ * event before delivery. The value is
3218
+ * arbitrary JSON — for JSONATA, supply
3219
+ * an expression string; future engines
3220
+ * may accept other shapes. Omit (or pass
3221
+ * `null`) to deliver events unchanged.
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
- transform?: string | null;
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 {
@@ -19894,14 +19894,19 @@ var Forwarder = class {
19894
19894
  filter;
19895
19895
  /**
19896
19896
  * Optional template applied to each event before delivery. Shape
19897
- * depends on {@link transformType}; for `"JSONATA"`, a JSONata
19898
- * expression string. `null` delivers the event JSON as-is.
19897
+ * depends on {@link transformType}; for {@link TransformType.JSONATA}
19898
+ * the value is a JSONata expression string, but the wire schema
19899
+ * widens to arbitrary JSON to leave room for future transform engines
19900
+ * carrying structured templates. `null` delivers the event JSON as-is.
19901
+ *
19902
+ * Whenever {@link transform} is set, {@link transformType} must also
19903
+ * be set; the SDK enforces this at save time.
19899
19904
  */
19900
19905
  transform;
19901
19906
  /**
19902
- * Engine used to evaluate {@link transform}. Currently only
19903
- * `"JSONATA"` is supported. Auto-filled by the SDK whenever
19904
- * {@link transform} is set on save.
19907
+ * Engine used to evaluate {@link transform}. Required whenever
19908
+ * {@link transform} is set. Today only {@link TransformType.JSONATA}
19909
+ * is supported.
19905
19910
  */
19906
19911
  transformType;
19907
19912
  /**
@@ -20032,8 +20037,12 @@ function _forwarderAttrs(forwarder) {
20032
20037
  if (forwarder.filter !== null) {
20033
20038
  attrs.filter = forwarder.filter;
20034
20039
  }
20035
- if (forwarder.transform !== null) {
20036
- attrs.transform_type = "JSONATA" /* JSONATA */;
20040
+ const hasTransform = forwarder.transform !== null && forwarder.transform !== void 0;
20041
+ if (hasTransform && forwarder.transformType === null) {
20042
+ throw new Error("Forwarder.transform requires Forwarder.transformType to be set");
20043
+ }
20044
+ if (hasTransform) {
20045
+ attrs.transform_type = forwarder.transformType;
20037
20046
  attrs.transform = forwarder.transform;
20038
20047
  }
20039
20048
  return attrs;
@@ -20065,20 +20074,27 @@ var ForwardersClient = class {
20065
20074
  * Construct an unsaved {@link Forwarder}. Call {@link Forwarder.save}
20066
20075
  * to persist.
20067
20076
  *
20068
- * @param fields.name Display name. Free-form.
20069
- * @param fields.forwarderType Destination type — see {@link ForwarderType}.
20070
- * @param fields.configuration Destination HTTP request configuration.
20071
- * Headers carry credentials and are
20072
- * encrypted at rest server-side; reads
20073
- * return them redacted.
20074
- * @param fields.enabled Whether the forwarder is active. Defaults true.
20075
- * @param fields.description Optional free-text description.
20076
- * @param fields.filter Optional JSON Logic filter; events that
20077
- * don't match are recorded as
20078
- * `filtered_out` deliveries.
20079
- * @param fields.transform Optional JSONata template applied to
20080
- * the event payload before POST. `null`
20081
- * delivers the event as-is.
20077
+ * @param fields.name Display name. Free-form.
20078
+ * @param fields.forwarderType Destination type — see {@link ForwarderType}.
20079
+ * @param fields.configuration Destination HTTP request configuration.
20080
+ * Headers carry credentials and are
20081
+ * encrypted at rest server-side; reads
20082
+ * return them redacted.
20083
+ * @param fields.enabled Whether the forwarder is active. Defaults true.
20084
+ * @param fields.description Optional free-text description.
20085
+ * @param fields.filter Optional JSON Logic filter; events that
20086
+ * don't match are recorded as
20087
+ * `filtered_out` deliveries.
20088
+ * @param fields.transformType Engine used to evaluate `transform`.
20089
+ * Required whenever `transform` is set;
20090
+ * today only {@link TransformType.JSONATA}
20091
+ * is supported.
20092
+ * @param fields.transform Optional template applied to each
20093
+ * event before delivery. The value is
20094
+ * arbitrary JSON — for JSONATA, supply
20095
+ * an expression string; future engines
20096
+ * may accept other shapes. Omit (or pass
20097
+ * `null`) to deliver events unchanged.
20082
20098
  */
20083
20099
  new(fields) {
20084
20100
  return new Forwarder(this, {
@@ -20088,6 +20104,7 @@ var ForwardersClient = class {
20088
20104
  enabled: fields.enabled,
20089
20105
  description: fields.description,
20090
20106
  filter: fields.filter,
20107
+ transformType: fields.transformType,
20091
20108
  transform: fields.transform
20092
20109
  });
20093
20110
  }