@smplkit/sdk 3.0.51 → 3.0.52
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 +12 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +40 -10
- package/dist/index.d.ts +40 -10
- package/dist/index.js +12 -11
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -106,27 +106,54 @@ interface HttpHeader {
|
|
|
106
106
|
* {@link FORWARDER_TYPES} for callers that need to iterate.
|
|
107
107
|
*/
|
|
108
108
|
type ForwarderType = "HTTP" | "DATADOG" | "SPLUNK_HEC" | "SUMO_LOGIC" | "NEW_RELIC" | "HONEYCOMB" | "ELASTIC";
|
|
109
|
-
|
|
109
|
+
/**
|
|
110
|
+
* Transport-specific delivery configuration. Today every destination
|
|
111
|
+
* type uses HTTP; future transports (FTP, SQS, ...) will join this as
|
|
112
|
+
* members of a discriminated union under {@link Forwarder.configuration}.
|
|
113
|
+
*/
|
|
114
|
+
interface HttpConfiguration {
|
|
115
|
+
/** HTTP method: GET, POST, PUT, PATCH, or DELETE. */
|
|
110
116
|
method: string;
|
|
117
|
+
/** Destination URL. */
|
|
111
118
|
url: string;
|
|
119
|
+
/** HTTP headers attached to each delivery request. */
|
|
112
120
|
headers: HttpHeader[];
|
|
113
|
-
body: string | null;
|
|
114
121
|
/**
|
|
115
|
-
*
|
|
116
|
-
*
|
|
122
|
+
* Either an exact HTTP code (e.g. `"200"`, `"204"`) or a status class
|
|
123
|
+
* (`"1xx"`, `"2xx"`, `"3xx"`, `"4xx"`, `"5xx"`).
|
|
117
124
|
*/
|
|
118
125
|
successStatus: string;
|
|
119
126
|
}
|
|
127
|
+
/**
|
|
128
|
+
* Engine used to evaluate {@link Forwarder.transform}. Must be set
|
|
129
|
+
* whenever `transform` is set. Today only `JSONATA` is supported.
|
|
130
|
+
*/
|
|
131
|
+
type TransformType = "JSONATA";
|
|
120
132
|
interface Forwarder {
|
|
133
|
+
/** UUID assigned by the server at creation time. */
|
|
121
134
|
id: string;
|
|
122
135
|
name: string;
|
|
123
|
-
|
|
136
|
+
/** Free-text description for the forwarder. */
|
|
137
|
+
description: string | null;
|
|
124
138
|
forwarderType: ForwarderType;
|
|
125
139
|
enabled: boolean;
|
|
126
140
|
filter: Record<string, unknown> | null;
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
141
|
+
/**
|
|
142
|
+
* Engine used to evaluate {@link transform}. Paired 1:1 with
|
|
143
|
+
* `transform` — both set, or both `null`.
|
|
144
|
+
*/
|
|
145
|
+
transformType: TransformType | null;
|
|
146
|
+
/**
|
|
147
|
+
* Template applied to each event before delivery. Shape depends on
|
|
148
|
+
* {@link transformType}; for `JSONATA`, a string containing a JSONata
|
|
149
|
+
* expression. `null` when no transform is configured.
|
|
150
|
+
*/
|
|
151
|
+
transform: unknown | null;
|
|
152
|
+
/**
|
|
153
|
+
* Transport-specific delivery configuration. Header values are
|
|
154
|
+
* returned redacted on reads.
|
|
155
|
+
*/
|
|
156
|
+
configuration: HttpConfiguration;
|
|
130
157
|
createdAt: string | null;
|
|
131
158
|
updatedAt: string | null;
|
|
132
159
|
deletedAt: string | null;
|
|
@@ -135,10 +162,13 @@ interface Forwarder {
|
|
|
135
162
|
interface CreateForwarderInput {
|
|
136
163
|
name: string;
|
|
137
164
|
forwarderType: ForwarderType;
|
|
138
|
-
|
|
165
|
+
configuration: HttpConfiguration;
|
|
139
166
|
enabled?: boolean;
|
|
167
|
+
description?: string;
|
|
140
168
|
filter?: Record<string, unknown>;
|
|
141
|
-
transform
|
|
169
|
+
/** Required when {@link transform} is set; today must be `"JSONATA"`. */
|
|
170
|
+
transformType?: TransformType;
|
|
171
|
+
transform?: unknown;
|
|
142
172
|
}
|
|
143
173
|
interface UpdateForwarderInput extends CreateForwarderInput {
|
|
144
174
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -106,27 +106,54 @@ interface HttpHeader {
|
|
|
106
106
|
* {@link FORWARDER_TYPES} for callers that need to iterate.
|
|
107
107
|
*/
|
|
108
108
|
type ForwarderType = "HTTP" | "DATADOG" | "SPLUNK_HEC" | "SUMO_LOGIC" | "NEW_RELIC" | "HONEYCOMB" | "ELASTIC";
|
|
109
|
-
|
|
109
|
+
/**
|
|
110
|
+
* Transport-specific delivery configuration. Today every destination
|
|
111
|
+
* type uses HTTP; future transports (FTP, SQS, ...) will join this as
|
|
112
|
+
* members of a discriminated union under {@link Forwarder.configuration}.
|
|
113
|
+
*/
|
|
114
|
+
interface HttpConfiguration {
|
|
115
|
+
/** HTTP method: GET, POST, PUT, PATCH, or DELETE. */
|
|
110
116
|
method: string;
|
|
117
|
+
/** Destination URL. */
|
|
111
118
|
url: string;
|
|
119
|
+
/** HTTP headers attached to each delivery request. */
|
|
112
120
|
headers: HttpHeader[];
|
|
113
|
-
body: string | null;
|
|
114
121
|
/**
|
|
115
|
-
*
|
|
116
|
-
*
|
|
122
|
+
* Either an exact HTTP code (e.g. `"200"`, `"204"`) or a status class
|
|
123
|
+
* (`"1xx"`, `"2xx"`, `"3xx"`, `"4xx"`, `"5xx"`).
|
|
117
124
|
*/
|
|
118
125
|
successStatus: string;
|
|
119
126
|
}
|
|
127
|
+
/**
|
|
128
|
+
* Engine used to evaluate {@link Forwarder.transform}. Must be set
|
|
129
|
+
* whenever `transform` is set. Today only `JSONATA` is supported.
|
|
130
|
+
*/
|
|
131
|
+
type TransformType = "JSONATA";
|
|
120
132
|
interface Forwarder {
|
|
133
|
+
/** UUID assigned by the server at creation time. */
|
|
121
134
|
id: string;
|
|
122
135
|
name: string;
|
|
123
|
-
|
|
136
|
+
/** Free-text description for the forwarder. */
|
|
137
|
+
description: string | null;
|
|
124
138
|
forwarderType: ForwarderType;
|
|
125
139
|
enabled: boolean;
|
|
126
140
|
filter: Record<string, unknown> | null;
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
141
|
+
/**
|
|
142
|
+
* Engine used to evaluate {@link transform}. Paired 1:1 with
|
|
143
|
+
* `transform` — both set, or both `null`.
|
|
144
|
+
*/
|
|
145
|
+
transformType: TransformType | null;
|
|
146
|
+
/**
|
|
147
|
+
* Template applied to each event before delivery. Shape depends on
|
|
148
|
+
* {@link transformType}; for `JSONATA`, a string containing a JSONata
|
|
149
|
+
* expression. `null` when no transform is configured.
|
|
150
|
+
*/
|
|
151
|
+
transform: unknown | null;
|
|
152
|
+
/**
|
|
153
|
+
* Transport-specific delivery configuration. Header values are
|
|
154
|
+
* returned redacted on reads.
|
|
155
|
+
*/
|
|
156
|
+
configuration: HttpConfiguration;
|
|
130
157
|
createdAt: string | null;
|
|
131
158
|
updatedAt: string | null;
|
|
132
159
|
deletedAt: string | null;
|
|
@@ -135,10 +162,13 @@ interface Forwarder {
|
|
|
135
162
|
interface CreateForwarderInput {
|
|
136
163
|
name: string;
|
|
137
164
|
forwarderType: ForwarderType;
|
|
138
|
-
|
|
165
|
+
configuration: HttpConfiguration;
|
|
139
166
|
enabled?: boolean;
|
|
167
|
+
description?: string;
|
|
140
168
|
filter?: Record<string, unknown>;
|
|
141
|
-
transform
|
|
169
|
+
/** Required when {@link transform} is set; today must be `"JSONATA"`. */
|
|
170
|
+
transformType?: TransformType;
|
|
171
|
+
transform?: unknown;
|
|
142
172
|
}
|
|
143
173
|
interface UpdateForwarderInput extends CreateForwarderInput {
|
|
144
174
|
}
|
package/dist/index.js
CHANGED
|
@@ -19866,16 +19866,15 @@ function _paginationFromBody2(body) {
|
|
|
19866
19866
|
}
|
|
19867
19867
|
return out;
|
|
19868
19868
|
}
|
|
19869
|
-
function
|
|
19869
|
+
function _configurationToWire(config) {
|
|
19870
19870
|
return {
|
|
19871
|
-
method:
|
|
19872
|
-
url:
|
|
19873
|
-
headers:
|
|
19874
|
-
|
|
19875
|
-
success_status: http.successStatus
|
|
19871
|
+
method: config.method,
|
|
19872
|
+
url: config.url,
|
|
19873
|
+
headers: config.headers.map((h) => ({ name: h.name, value: h.value })),
|
|
19874
|
+
success_status: config.successStatus
|
|
19876
19875
|
};
|
|
19877
19876
|
}
|
|
19878
|
-
function
|
|
19877
|
+
function _configurationFromWire(raw) {
|
|
19879
19878
|
const r = raw ?? {};
|
|
19880
19879
|
const headers = (r.headers ?? []).map((h) => ({
|
|
19881
19880
|
name: String(h.name ?? ""),
|
|
@@ -19885,7 +19884,6 @@ function _httpFromWire(raw) {
|
|
|
19885
19884
|
method: String(r.method ?? "POST"),
|
|
19886
19885
|
url: String(r.url ?? ""),
|
|
19887
19886
|
headers,
|
|
19888
|
-
body: r.body ?? null,
|
|
19889
19887
|
successStatus: String(r.success_status ?? "2xx")
|
|
19890
19888
|
};
|
|
19891
19889
|
}
|
|
@@ -19894,11 +19892,13 @@ function _forwarderAttributes(input) {
|
|
|
19894
19892
|
name: input.name,
|
|
19895
19893
|
forwarder_type: input.forwarderType,
|
|
19896
19894
|
enabled: input.enabled ?? true,
|
|
19897
|
-
|
|
19895
|
+
configuration: _configurationToWire(input.configuration)
|
|
19898
19896
|
};
|
|
19897
|
+
if (input.description !== void 0) attrs.description = input.description;
|
|
19899
19898
|
if (input.filter !== void 0) {
|
|
19900
19899
|
attrs.filter = input.filter;
|
|
19901
19900
|
}
|
|
19901
|
+
if (input.transformType !== void 0) attrs.transform_type = input.transformType;
|
|
19902
19902
|
if (input.transform !== void 0) attrs.transform = input.transform;
|
|
19903
19903
|
return attrs;
|
|
19904
19904
|
}
|
|
@@ -19907,12 +19907,13 @@ function _forwarderFromResource(resource) {
|
|
|
19907
19907
|
return {
|
|
19908
19908
|
id: resource.id,
|
|
19909
19909
|
name: String(a.name ?? ""),
|
|
19910
|
-
|
|
19910
|
+
description: a.description ?? null,
|
|
19911
19911
|
forwarderType: a.forwarder_type,
|
|
19912
19912
|
enabled: Boolean(a.enabled ?? true),
|
|
19913
19913
|
filter: a.filter ?? null,
|
|
19914
|
+
transformType: a.transform_type ?? null,
|
|
19914
19915
|
transform: a.transform ?? null,
|
|
19915
|
-
|
|
19916
|
+
configuration: _configurationFromWire(a.configuration),
|
|
19916
19917
|
createdAt: a.created_at ?? null,
|
|
19917
19918
|
updatedAt: a.updated_at ?? null,
|
|
19918
19919
|
deletedAt: a.deleted_at ?? null,
|