@strimz/sdk 0.1.0
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/LICENSE +21 -0
- package/README.md +111 -0
- package/dist/browser-client-DlZg0Aae.d.cts +223 -0
- package/dist/browser-client-DlZg0Aae.d.ts +223 -0
- package/dist/browser-client.cjs +443 -0
- package/dist/browser-client.cjs.map +1 -0
- package/dist/browser-client.d.cts +4 -0
- package/dist/browser-client.d.ts +4 -0
- package/dist/browser-client.js +439 -0
- package/dist/browser-client.js.map +1 -0
- package/dist/eip712.cjs +70 -0
- package/dist/eip712.cjs.map +1 -0
- package/dist/eip712.d.cts +181 -0
- package/dist/eip712.d.ts +181 -0
- package/dist/eip712.js +65 -0
- package/dist/eip712.js.map +1 -0
- package/dist/errors.cjs +102 -0
- package/dist/errors.cjs.map +1 -0
- package/dist/errors.d.cts +56 -0
- package/dist/errors.d.ts +56 -0
- package/dist/errors.js +90 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.cjs +831 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +193 -0
- package/dist/index.d.ts +193 -0
- package/dist/index.js +806 -0
- package/dist/index.js.map +1 -0
- package/dist/webhooks.cjs +54 -0
- package/dist/webhooks.cjs.map +1 -0
- package/dist/webhooks.d.cts +19 -0
- package/dist/webhooks.d.ts +19 -0
- package/dist/webhooks.js +13 -0
- package/dist/webhooks.js.map +1 -0
- package/package.json +94 -0
- package/src/browser-client.ts +97 -0
- package/src/client.ts +122 -0
- package/src/eip712/index.ts +25 -0
- package/src/eip712/permit.ts +74 -0
- package/src/eip712/receive-with-authorization.ts +88 -0
- package/src/eip712/types.ts +46 -0
- package/src/errors.ts +138 -0
- package/src/http/fetcher.ts +226 -0
- package/src/http/headers.ts +32 -0
- package/src/idempotency.ts +20 -0
- package/src/index.ts +77 -0
- package/src/pagination.ts +48 -0
- package/src/resources/agents.ts +64 -0
- package/src/resources/api-keys.ts +29 -0
- package/src/resources/base-resource.ts +116 -0
- package/src/resources/checkout.ts +32 -0
- package/src/resources/customers.ts +25 -0
- package/src/resources/invoices.ts +31 -0
- package/src/resources/merchants.ts +26 -0
- package/src/resources/payment-sessions.ts +41 -0
- package/src/resources/refunds.ts +36 -0
- package/src/resources/storefronts.ts +62 -0
- package/src/resources/subscription-plans.ts +32 -0
- package/src/resources/subscriptions.ts +37 -0
- package/src/resources/tokens.ts +70 -0
- package/src/resources/transactions.ts +20 -0
- package/src/resources/webhook-deliveries.ts +29 -0
- package/src/resources/webhook-endpoints.ts +56 -0
- package/src/webhooks.ts +64 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,831 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var sharedConfig = require('@strimz/shared-config');
|
|
4
|
+
var sharedTypes = require('@strimz/shared-types');
|
|
5
|
+
var sharedCrypto = require('@strimz/shared-crypto');
|
|
6
|
+
|
|
7
|
+
// src/client.ts
|
|
8
|
+
|
|
9
|
+
// src/errors.ts
|
|
10
|
+
var StrimzError = class extends Error {
|
|
11
|
+
code;
|
|
12
|
+
httpStatus;
|
|
13
|
+
requestId;
|
|
14
|
+
param;
|
|
15
|
+
details;
|
|
16
|
+
constructor(body, httpStatus) {
|
|
17
|
+
super(body.message);
|
|
18
|
+
this.name = "StrimzError";
|
|
19
|
+
this.code = body.code;
|
|
20
|
+
this.httpStatus = httpStatus;
|
|
21
|
+
this.requestId = body.requestId;
|
|
22
|
+
this.param = body.param;
|
|
23
|
+
this.details = body.details;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
var StrimzAuthenticationError = class extends StrimzError {
|
|
27
|
+
constructor(body, httpStatus) {
|
|
28
|
+
super(body, httpStatus);
|
|
29
|
+
this.name = "StrimzAuthenticationError";
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
var StrimzPermissionError = class extends StrimzError {
|
|
33
|
+
constructor(body, httpStatus) {
|
|
34
|
+
super(body, httpStatus);
|
|
35
|
+
this.name = "StrimzPermissionError";
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var StrimzValidationError = class extends StrimzError {
|
|
39
|
+
constructor(body, httpStatus) {
|
|
40
|
+
super(body, httpStatus);
|
|
41
|
+
this.name = "StrimzValidationError";
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
var StrimzNotFoundError = class extends StrimzError {
|
|
45
|
+
constructor(body, httpStatus) {
|
|
46
|
+
super(body, httpStatus);
|
|
47
|
+
this.name = "StrimzNotFoundError";
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
var StrimzIdempotencyError = class extends StrimzError {
|
|
51
|
+
constructor(body, httpStatus) {
|
|
52
|
+
super(body, httpStatus);
|
|
53
|
+
this.name = "StrimzIdempotencyError";
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
var StrimzRateLimitError = class extends StrimzError {
|
|
57
|
+
retryAfterMs;
|
|
58
|
+
constructor(body, httpStatus, retryAfterMs) {
|
|
59
|
+
super(body, httpStatus);
|
|
60
|
+
this.name = "StrimzRateLimitError";
|
|
61
|
+
this.retryAfterMs = retryAfterMs;
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
var StrimzNetworkError = class extends StrimzError {
|
|
65
|
+
cause;
|
|
66
|
+
constructor(message, cause) {
|
|
67
|
+
super({ code: "network_error", message });
|
|
68
|
+
this.name = "StrimzNetworkError";
|
|
69
|
+
this.cause = cause;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
var StrimzTimeoutError = class extends StrimzError {
|
|
73
|
+
constructor(message) {
|
|
74
|
+
super({ code: "timeout", message });
|
|
75
|
+
this.name = "StrimzTimeoutError";
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
var StrimzModeMismatchError = class extends StrimzError {
|
|
79
|
+
constructor(message) {
|
|
80
|
+
super({ code: "mode_mismatch", message });
|
|
81
|
+
this.name = "StrimzModeMismatchError";
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
function classifyError(httpStatus, body, retryAfterMs) {
|
|
85
|
+
if (httpStatus === 401) return new StrimzAuthenticationError(body, httpStatus);
|
|
86
|
+
if (httpStatus === 403) return new StrimzPermissionError(body, httpStatus);
|
|
87
|
+
if (httpStatus === 404) return new StrimzNotFoundError(body, httpStatus);
|
|
88
|
+
if (httpStatus === 409 && body.code === "idempotency_error") {
|
|
89
|
+
return new StrimzIdempotencyError(body, httpStatus);
|
|
90
|
+
}
|
|
91
|
+
if (httpStatus === 422) return new StrimzValidationError(body, httpStatus);
|
|
92
|
+
if (httpStatus === 429) return new StrimzRateLimitError(body, httpStatus, retryAfterMs);
|
|
93
|
+
return new StrimzError(body, httpStatus);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// src/http/headers.ts
|
|
97
|
+
var HEADERS = {
|
|
98
|
+
authorization: "Authorization",
|
|
99
|
+
idempotencyKey: "X-Strimz-Idempotency-Key",
|
|
100
|
+
sdkName: "X-Strimz-Sdk",
|
|
101
|
+
sdkVersion: "X-Strimz-Sdk-Version",
|
|
102
|
+
sdkRuntime: "X-Strimz-Sdk-Runtime"
|
|
103
|
+
};
|
|
104
|
+
var SDK_NAME = "@strimz/sdk";
|
|
105
|
+
var SDK_VERSION = "0.0.0";
|
|
106
|
+
function buildBaseHeaders(apiKey, runtime) {
|
|
107
|
+
return {
|
|
108
|
+
[HEADERS.authorization]: `Bearer ${apiKey}`,
|
|
109
|
+
[HEADERS.sdkName]: SDK_NAME,
|
|
110
|
+
[HEADERS.sdkVersion]: SDK_VERSION,
|
|
111
|
+
[HEADERS.sdkRuntime]: runtime,
|
|
112
|
+
Accept: "application/json"
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// src/http/fetcher.ts
|
|
117
|
+
var DEFAULT_TIMEOUT_MS = 3e4;
|
|
118
|
+
var DEFAULT_MAX_RETRIES = 3;
|
|
119
|
+
var DEFAULT_INITIAL_BACKOFF_MS = 250;
|
|
120
|
+
var Fetcher = class {
|
|
121
|
+
baseUrl;
|
|
122
|
+
baseHeaders;
|
|
123
|
+
timeoutMs;
|
|
124
|
+
maxRetries;
|
|
125
|
+
initialBackoffMs;
|
|
126
|
+
onRequest;
|
|
127
|
+
onResponse;
|
|
128
|
+
fetchImpl;
|
|
129
|
+
constructor(opts) {
|
|
130
|
+
this.baseUrl = opts.baseUrl.replace(/\/$/, "");
|
|
131
|
+
this.baseHeaders = opts.baseHeaders;
|
|
132
|
+
this.timeoutMs = opts.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
133
|
+
this.maxRetries = opts.maxRetries ?? DEFAULT_MAX_RETRIES;
|
|
134
|
+
this.initialBackoffMs = opts.initialBackoffMs ?? DEFAULT_INITIAL_BACKOFF_MS;
|
|
135
|
+
this.onRequest = opts.onRequest;
|
|
136
|
+
this.onResponse = opts.onResponse;
|
|
137
|
+
this.fetchImpl = opts.fetch ?? globalThis.fetch.bind(globalThis);
|
|
138
|
+
}
|
|
139
|
+
async request(spec) {
|
|
140
|
+
const url = this.buildUrl(spec.path, spec.query);
|
|
141
|
+
const idempotent = isIdempotent(spec);
|
|
142
|
+
const headers = { ...this.baseHeaders };
|
|
143
|
+
if (spec.body != null) headers["Content-Type"] = "application/json";
|
|
144
|
+
if (spec.idempotencyKey) headers[HEADERS.idempotencyKey] = spec.idempotencyKey;
|
|
145
|
+
let attempt = 0;
|
|
146
|
+
let lastErr;
|
|
147
|
+
while (attempt <= this.maxRetries) {
|
|
148
|
+
try {
|
|
149
|
+
this.onRequest?.({ method: spec.method, url, attempt });
|
|
150
|
+
const start = Date.now();
|
|
151
|
+
const res = await this.fetchWithTimeout(
|
|
152
|
+
url,
|
|
153
|
+
{
|
|
154
|
+
method: spec.method,
|
|
155
|
+
headers,
|
|
156
|
+
body: spec.body == null ? void 0 : JSON.stringify(spec.body)
|
|
157
|
+
},
|
|
158
|
+
spec.timeoutMs ?? this.timeoutMs
|
|
159
|
+
);
|
|
160
|
+
const ms = Date.now() - start;
|
|
161
|
+
this.onResponse?.({ method: spec.method, url, status: res.status, ms, attempt });
|
|
162
|
+
if (res.ok) {
|
|
163
|
+
if (res.status === 204) return void 0;
|
|
164
|
+
return await res.json();
|
|
165
|
+
}
|
|
166
|
+
const errorBody = await parseErrorBody(res);
|
|
167
|
+
const retryAfterMs = parseRetryAfter(res);
|
|
168
|
+
if (res.status === 429 && attempt < this.maxRetries) {
|
|
169
|
+
await delay(retryAfterMs ?? this.backoffFor(attempt));
|
|
170
|
+
attempt++;
|
|
171
|
+
continue;
|
|
172
|
+
}
|
|
173
|
+
if (res.status >= 500 && idempotent && attempt < this.maxRetries) {
|
|
174
|
+
await delay(this.backoffFor(attempt));
|
|
175
|
+
attempt++;
|
|
176
|
+
continue;
|
|
177
|
+
}
|
|
178
|
+
throw classifyError(res.status, errorBody, retryAfterMs);
|
|
179
|
+
} catch (err) {
|
|
180
|
+
if (err instanceof StrimzError) throw err;
|
|
181
|
+
lastErr = err;
|
|
182
|
+
if (!isNetworkLike(err) || attempt >= this.maxRetries) {
|
|
183
|
+
if (err instanceof StrimzTimeoutError) throw err;
|
|
184
|
+
throw new StrimzNetworkError(`Network error: ${describe(err)}`, err);
|
|
185
|
+
}
|
|
186
|
+
await delay(this.backoffFor(attempt));
|
|
187
|
+
attempt++;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
throw new StrimzNetworkError(`Network error after ${this.maxRetries} retries`, lastErr);
|
|
191
|
+
}
|
|
192
|
+
async fetchWithTimeout(url, init, timeoutMs) {
|
|
193
|
+
const controller = new AbortController();
|
|
194
|
+
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
195
|
+
try {
|
|
196
|
+
return await this.fetchImpl(url, { ...init, signal: controller.signal });
|
|
197
|
+
} catch (err) {
|
|
198
|
+
if (isAbortError(err)) {
|
|
199
|
+
throw new StrimzTimeoutError(`Request timed out after ${timeoutMs}ms`);
|
|
200
|
+
}
|
|
201
|
+
throw err;
|
|
202
|
+
} finally {
|
|
203
|
+
clearTimeout(timer);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
buildUrl(path, query) {
|
|
207
|
+
const base = `${this.baseUrl}${path.startsWith("/") ? path : `/${path}`}`;
|
|
208
|
+
if (!query) return base;
|
|
209
|
+
const usp = new URLSearchParams();
|
|
210
|
+
for (const [k, v] of Object.entries(query)) {
|
|
211
|
+
if (v == null) continue;
|
|
212
|
+
usp.append(k, String(v));
|
|
213
|
+
}
|
|
214
|
+
const qs = usp.toString();
|
|
215
|
+
return qs ? `${base}?${qs}` : base;
|
|
216
|
+
}
|
|
217
|
+
backoffFor(attempt) {
|
|
218
|
+
const expo = this.initialBackoffMs * Math.pow(2, attempt);
|
|
219
|
+
const jitter = Math.random() * this.initialBackoffMs;
|
|
220
|
+
return Math.min(expo + jitter, 8e3);
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
function isIdempotent(spec) {
|
|
224
|
+
if (spec.method === "GET" || spec.method === "DELETE") return true;
|
|
225
|
+
return spec.idempotencyKey != null;
|
|
226
|
+
}
|
|
227
|
+
async function parseErrorBody(res) {
|
|
228
|
+
try {
|
|
229
|
+
const json = await res.json();
|
|
230
|
+
if (typeof json === "object" && json !== null && "error" in json && json.error) {
|
|
231
|
+
return json.error;
|
|
232
|
+
}
|
|
233
|
+
if (typeof json === "object" && json !== null && "code" in json && "message" in json) {
|
|
234
|
+
return json;
|
|
235
|
+
}
|
|
236
|
+
} catch {
|
|
237
|
+
}
|
|
238
|
+
return { code: "api_error", message: `HTTP ${res.status}` };
|
|
239
|
+
}
|
|
240
|
+
function parseRetryAfter(res) {
|
|
241
|
+
const v = res.headers.get("Retry-After");
|
|
242
|
+
if (!v) return void 0;
|
|
243
|
+
const n = Number(v);
|
|
244
|
+
if (Number.isFinite(n)) return Math.max(0, n) * 1e3;
|
|
245
|
+
const date = Date.parse(v);
|
|
246
|
+
if (Number.isFinite(date)) return Math.max(0, date - Date.now());
|
|
247
|
+
return void 0;
|
|
248
|
+
}
|
|
249
|
+
function delay(ms) {
|
|
250
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
251
|
+
}
|
|
252
|
+
function isAbortError(err) {
|
|
253
|
+
return err instanceof Error && err.name === "AbortError";
|
|
254
|
+
}
|
|
255
|
+
function isNetworkLike(err) {
|
|
256
|
+
if (err instanceof TypeError) return true;
|
|
257
|
+
if (err instanceof Error && /fetch|network|econn/i.test(err.message)) return true;
|
|
258
|
+
return false;
|
|
259
|
+
}
|
|
260
|
+
function describe(err) {
|
|
261
|
+
if (err instanceof Error) return err.message;
|
|
262
|
+
return String(err);
|
|
263
|
+
}
|
|
264
|
+
function generateIdempotencyKey() {
|
|
265
|
+
return `strimz_${sharedCrypto.uuid()}`;
|
|
266
|
+
}
|
|
267
|
+
var IDEMPOTENCY_KEY_PATTERN = /^(strimz_)?[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;
|
|
268
|
+
function isValidIdempotencyKey(key) {
|
|
269
|
+
if (typeof key !== "string") return false;
|
|
270
|
+
if (key.length > 255) return false;
|
|
271
|
+
return IDEMPOTENCY_KEY_PATTERN.test(key);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
// src/pagination.ts
|
|
275
|
+
var AutoPagingIterator = class {
|
|
276
|
+
constructor(fetchPage) {
|
|
277
|
+
this.fetchPage = fetchPage;
|
|
278
|
+
}
|
|
279
|
+
fetchPage;
|
|
280
|
+
async *[Symbol.asyncIterator]() {
|
|
281
|
+
let cursor = null;
|
|
282
|
+
let first = true;
|
|
283
|
+
while (first || cursor !== null) {
|
|
284
|
+
first = false;
|
|
285
|
+
const page = await this.fetchPage(cursor);
|
|
286
|
+
for (const item of page.data) {
|
|
287
|
+
yield item;
|
|
288
|
+
}
|
|
289
|
+
cursor = page.hasMore ? page.nextCursor : null;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
async forEach(handler) {
|
|
293
|
+
for await (const item of this) {
|
|
294
|
+
await handler(item);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
async toArray() {
|
|
298
|
+
const out = [];
|
|
299
|
+
for await (const item of this) out.push(item);
|
|
300
|
+
return out;
|
|
301
|
+
}
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
// src/resources/base-resource.ts
|
|
305
|
+
var BaseResource = class {
|
|
306
|
+
constructor(ctx) {
|
|
307
|
+
this.ctx = ctx;
|
|
308
|
+
}
|
|
309
|
+
ctx;
|
|
310
|
+
async get(path, schema, query) {
|
|
311
|
+
const data = await this.ctx.fetcher.request({ method: "GET", path, query });
|
|
312
|
+
return parse(data, schema);
|
|
313
|
+
}
|
|
314
|
+
async post(path, body, schema, options) {
|
|
315
|
+
const data = await this.ctx.fetcher.request({
|
|
316
|
+
method: "POST",
|
|
317
|
+
path,
|
|
318
|
+
body,
|
|
319
|
+
idempotencyKey: options?.idempotencyKey ?? generateIdempotencyKey(),
|
|
320
|
+
timeoutMs: options?.timeoutMs
|
|
321
|
+
});
|
|
322
|
+
return parse(data, schema);
|
|
323
|
+
}
|
|
324
|
+
async patch(path, body, schema, options) {
|
|
325
|
+
const data = await this.ctx.fetcher.request({
|
|
326
|
+
method: "PATCH",
|
|
327
|
+
path,
|
|
328
|
+
body,
|
|
329
|
+
idempotencyKey: options?.idempotencyKey ?? generateIdempotencyKey(),
|
|
330
|
+
timeoutMs: options?.timeoutMs
|
|
331
|
+
});
|
|
332
|
+
return parse(data, schema);
|
|
333
|
+
}
|
|
334
|
+
async delete(path, schema) {
|
|
335
|
+
const data = await this.ctx.fetcher.request({ method: "DELETE", path });
|
|
336
|
+
return parse(data, schema);
|
|
337
|
+
}
|
|
338
|
+
listPage(path, itemSchema, params) {
|
|
339
|
+
return this.ctx.fetcher.request({ method: "GET", path, query: toQuery(params) }).then((raw) => parsePage(raw, itemSchema));
|
|
340
|
+
}
|
|
341
|
+
listAuto(path, itemSchema, params) {
|
|
342
|
+
return new AutoPagingIterator(
|
|
343
|
+
(cursor) => this.listPage(path, itemSchema, { ...params, cursor })
|
|
344
|
+
);
|
|
345
|
+
}
|
|
346
|
+
};
|
|
347
|
+
function toQuery(params) {
|
|
348
|
+
if (!params) return {};
|
|
349
|
+
return params;
|
|
350
|
+
}
|
|
351
|
+
function parse(data, schema) {
|
|
352
|
+
return schema ? schema.parse(data) : data;
|
|
353
|
+
}
|
|
354
|
+
function parsePage(raw, itemSchema) {
|
|
355
|
+
const obj = raw;
|
|
356
|
+
const items = (obj?.data ?? []).map((d) => itemSchema.parse(d));
|
|
357
|
+
return {
|
|
358
|
+
data: items,
|
|
359
|
+
nextCursor: obj?.nextCursor ?? null,
|
|
360
|
+
hasMore: obj?.hasMore === true
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
// src/resources/merchants.ts
|
|
365
|
+
var MerchantsResource = class extends BaseResource {
|
|
366
|
+
/** The merchant the API key belongs to. */
|
|
367
|
+
me() {
|
|
368
|
+
return this.get("/v1/merchants/me", sharedTypes.merchantSchema);
|
|
369
|
+
}
|
|
370
|
+
update(input, options) {
|
|
371
|
+
sharedTypes.updateMerchantInputSchema.parse(input);
|
|
372
|
+
return this.patch("/v1/merchants/me", input, sharedTypes.merchantSchema, options);
|
|
373
|
+
}
|
|
374
|
+
changeTier(input, options) {
|
|
375
|
+
sharedTypes.changeTierInputSchema.parse(input);
|
|
376
|
+
return this.post("/v1/merchants/me/tier", input, sharedTypes.merchantSchema, options);
|
|
377
|
+
}
|
|
378
|
+
};
|
|
379
|
+
var ApiKeysResource = class extends BaseResource {
|
|
380
|
+
list(params) {
|
|
381
|
+
return this.listPage("/v1/api-keys", sharedTypes.apiKeySchema, params);
|
|
382
|
+
}
|
|
383
|
+
retrieve(id) {
|
|
384
|
+
return this.get(`/v1/api-keys/${encodeURIComponent(id)}`, sharedTypes.apiKeySchema);
|
|
385
|
+
}
|
|
386
|
+
create(input, options) {
|
|
387
|
+
sharedTypes.createApiKeyInputSchema.parse(input);
|
|
388
|
+
return this.post("/v1/api-keys", input, sharedTypes.createApiKeyOutputSchema, options);
|
|
389
|
+
}
|
|
390
|
+
revoke(id, options) {
|
|
391
|
+
return this.post(`/v1/api-keys/${encodeURIComponent(id)}/revoke`, {}, sharedTypes.apiKeySchema, options);
|
|
392
|
+
}
|
|
393
|
+
};
|
|
394
|
+
var CustomersResource = class extends BaseResource {
|
|
395
|
+
retrieve(id) {
|
|
396
|
+
return this.get(`/v1/customers/${encodeURIComponent(id)}`, sharedTypes.customerSchema);
|
|
397
|
+
}
|
|
398
|
+
list(params) {
|
|
399
|
+
return this.listPage("/v1/customers", sharedTypes.customerSchema, params);
|
|
400
|
+
}
|
|
401
|
+
upsert(input, options) {
|
|
402
|
+
sharedTypes.upsertCustomerInputSchema.parse(input);
|
|
403
|
+
return this.post("/v1/customers", input, sharedTypes.customerSchema, options);
|
|
404
|
+
}
|
|
405
|
+
};
|
|
406
|
+
var PaymentSessionsResource = class extends BaseResource {
|
|
407
|
+
create(input, options) {
|
|
408
|
+
sharedTypes.createPaymentSessionInputSchema.parse(input);
|
|
409
|
+
return this.post("/v1/payment-sessions", input, sharedTypes.paymentSessionSchema, options);
|
|
410
|
+
}
|
|
411
|
+
retrieve(id) {
|
|
412
|
+
return this.get(`/v1/payment-sessions/${encodeURIComponent(id)}`, sharedTypes.paymentSessionSchema);
|
|
413
|
+
}
|
|
414
|
+
list(params) {
|
|
415
|
+
return this.listPage("/v1/payment-sessions", sharedTypes.paymentSessionSchema, params);
|
|
416
|
+
}
|
|
417
|
+
cancel(id, options) {
|
|
418
|
+
return this.post(
|
|
419
|
+
`/v1/payment-sessions/${encodeURIComponent(id)}/cancel`,
|
|
420
|
+
{},
|
|
421
|
+
sharedTypes.paymentSessionSchema,
|
|
422
|
+
options
|
|
423
|
+
);
|
|
424
|
+
}
|
|
425
|
+
expire(id, options) {
|
|
426
|
+
return this.post(
|
|
427
|
+
`/v1/payment-sessions/${encodeURIComponent(id)}/expire`,
|
|
428
|
+
{},
|
|
429
|
+
sharedTypes.paymentSessionSchema,
|
|
430
|
+
options
|
|
431
|
+
);
|
|
432
|
+
}
|
|
433
|
+
};
|
|
434
|
+
var TransactionsResource = class extends BaseResource {
|
|
435
|
+
retrieve(id) {
|
|
436
|
+
return this.get(`/v1/transactions/${encodeURIComponent(id)}`, sharedTypes.transactionSchema);
|
|
437
|
+
}
|
|
438
|
+
list(params) {
|
|
439
|
+
return this.listPage("/v1/transactions", sharedTypes.transactionSchema, params);
|
|
440
|
+
}
|
|
441
|
+
};
|
|
442
|
+
var SubscriptionPlansResource = class extends BaseResource {
|
|
443
|
+
create(input, options) {
|
|
444
|
+
sharedTypes.createSubscriptionPlanInputSchema.parse(input);
|
|
445
|
+
return this.post("/v1/subscription-plans", input, sharedTypes.subscriptionPlanSchema, options);
|
|
446
|
+
}
|
|
447
|
+
retrieve(id) {
|
|
448
|
+
return this.get(`/v1/subscription-plans/${encodeURIComponent(id)}`, sharedTypes.subscriptionPlanSchema);
|
|
449
|
+
}
|
|
450
|
+
list(params) {
|
|
451
|
+
return this.listPage("/v1/subscription-plans", sharedTypes.subscriptionPlanSchema, params);
|
|
452
|
+
}
|
|
453
|
+
archive(id, options) {
|
|
454
|
+
return this.post(
|
|
455
|
+
`/v1/subscription-plans/${encodeURIComponent(id)}/archive`,
|
|
456
|
+
{},
|
|
457
|
+
sharedTypes.subscriptionPlanSchema,
|
|
458
|
+
options
|
|
459
|
+
);
|
|
460
|
+
}
|
|
461
|
+
};
|
|
462
|
+
var SubscriptionsResource = class extends BaseResource {
|
|
463
|
+
create(input, options) {
|
|
464
|
+
sharedTypes.createSubscriptionInputSchema.parse(input);
|
|
465
|
+
return this.post("/v1/subscriptions", input, sharedTypes.subscriptionSchema, options);
|
|
466
|
+
}
|
|
467
|
+
retrieve(id) {
|
|
468
|
+
return this.get(`/v1/subscriptions/${encodeURIComponent(id)}`, sharedTypes.subscriptionSchema);
|
|
469
|
+
}
|
|
470
|
+
list(params) {
|
|
471
|
+
return this.listPage("/v1/subscriptions", sharedTypes.subscriptionSchema, params);
|
|
472
|
+
}
|
|
473
|
+
cancel(input, options) {
|
|
474
|
+
sharedTypes.cancelSubscriptionInputSchema.parse(input);
|
|
475
|
+
return this.post(
|
|
476
|
+
`/v1/subscriptions/${encodeURIComponent(input.id)}/cancel`,
|
|
477
|
+
input,
|
|
478
|
+
sharedTypes.subscriptionSchema,
|
|
479
|
+
options
|
|
480
|
+
);
|
|
481
|
+
}
|
|
482
|
+
};
|
|
483
|
+
var RefundsResource = class extends BaseResource {
|
|
484
|
+
create(input, options) {
|
|
485
|
+
sharedTypes.createRefundInputSchema.parse(input);
|
|
486
|
+
return this.post("/v1/refunds", input, sharedTypes.refundSchema, options);
|
|
487
|
+
}
|
|
488
|
+
retrieve(id) {
|
|
489
|
+
return this.get(`/v1/refunds/${encodeURIComponent(id)}`, sharedTypes.refundSchema);
|
|
490
|
+
}
|
|
491
|
+
list(params) {
|
|
492
|
+
return this.listPage("/v1/refunds", sharedTypes.refundSchema, params);
|
|
493
|
+
}
|
|
494
|
+
/** Record the on-chain refund tx after the merchant signs from their wallet. */
|
|
495
|
+
submitSignature(input, options) {
|
|
496
|
+
sharedTypes.submitRefundSignatureInputSchema.parse(input);
|
|
497
|
+
return this.post(
|
|
498
|
+
`/v1/refunds/${encodeURIComponent(input.id)}/signature`,
|
|
499
|
+
input,
|
|
500
|
+
sharedTypes.refundSchema,
|
|
501
|
+
options
|
|
502
|
+
);
|
|
503
|
+
}
|
|
504
|
+
};
|
|
505
|
+
var WebhookEndpointsResource = class extends BaseResource {
|
|
506
|
+
create(input, options) {
|
|
507
|
+
sharedTypes.createWebhookEndpointInputSchema.parse(input);
|
|
508
|
+
return this.post("/v1/webhook-endpoints", input, sharedTypes.createWebhookEndpointOutputSchema, options);
|
|
509
|
+
}
|
|
510
|
+
retrieve(id) {
|
|
511
|
+
return this.get(`/v1/webhook-endpoints/${encodeURIComponent(id)}`, sharedTypes.webhookEndpointSchema);
|
|
512
|
+
}
|
|
513
|
+
list(params) {
|
|
514
|
+
return this.listPage("/v1/webhook-endpoints", sharedTypes.webhookEndpointSchema, params);
|
|
515
|
+
}
|
|
516
|
+
disable(id, options) {
|
|
517
|
+
return this.post(
|
|
518
|
+
`/v1/webhook-endpoints/${encodeURIComponent(id)}/disable`,
|
|
519
|
+
{},
|
|
520
|
+
sharedTypes.webhookEndpointSchema,
|
|
521
|
+
options
|
|
522
|
+
);
|
|
523
|
+
}
|
|
524
|
+
enable(id, options) {
|
|
525
|
+
return this.post(
|
|
526
|
+
`/v1/webhook-endpoints/${encodeURIComponent(id)}/enable`,
|
|
527
|
+
{},
|
|
528
|
+
sharedTypes.webhookEndpointSchema,
|
|
529
|
+
options
|
|
530
|
+
);
|
|
531
|
+
}
|
|
532
|
+
/** Rotates the signing secret. Returns the new full secret exactly once. */
|
|
533
|
+
rotateSecret(id, options) {
|
|
534
|
+
return this.post(
|
|
535
|
+
`/v1/webhook-endpoints/${encodeURIComponent(id)}/rotate-secret`,
|
|
536
|
+
{},
|
|
537
|
+
sharedTypes.createWebhookEndpointOutputSchema,
|
|
538
|
+
options
|
|
539
|
+
);
|
|
540
|
+
}
|
|
541
|
+
};
|
|
542
|
+
var WebhookDeliveriesResource = class extends BaseResource {
|
|
543
|
+
retrieve(id) {
|
|
544
|
+
return this.get(`/v1/webhook-deliveries/${encodeURIComponent(id)}`, sharedTypes.webhookDeliverySchema);
|
|
545
|
+
}
|
|
546
|
+
list(params) {
|
|
547
|
+
return this.listPage("/v1/webhook-deliveries", sharedTypes.webhookDeliverySchema, params);
|
|
548
|
+
}
|
|
549
|
+
/** Manually replay a permanently-failed delivery. */
|
|
550
|
+
replay(id, options) {
|
|
551
|
+
return this.post(
|
|
552
|
+
`/v1/webhook-deliveries/${encodeURIComponent(id)}/replay`,
|
|
553
|
+
{},
|
|
554
|
+
sharedTypes.webhookDeliverySchema,
|
|
555
|
+
options
|
|
556
|
+
);
|
|
557
|
+
}
|
|
558
|
+
};
|
|
559
|
+
var InvoicesResource = class extends BaseResource {
|
|
560
|
+
create(input, options) {
|
|
561
|
+
sharedTypes.createInvoiceInputSchema.parse(input);
|
|
562
|
+
return this.post("/v1/invoices", input, sharedTypes.invoiceSchema, options);
|
|
563
|
+
}
|
|
564
|
+
retrieve(id) {
|
|
565
|
+
return this.get(`/v1/invoices/${encodeURIComponent(id)}`, sharedTypes.invoiceSchema);
|
|
566
|
+
}
|
|
567
|
+
list(params) {
|
|
568
|
+
return this.listPage("/v1/invoices", sharedTypes.invoiceSchema, params);
|
|
569
|
+
}
|
|
570
|
+
send(id, options) {
|
|
571
|
+
return this.post(`/v1/invoices/${encodeURIComponent(id)}/send`, {}, sharedTypes.invoiceSchema, options);
|
|
572
|
+
}
|
|
573
|
+
void(id, options) {
|
|
574
|
+
return this.post(`/v1/invoices/${encodeURIComponent(id)}/void`, {}, sharedTypes.invoiceSchema, options);
|
|
575
|
+
}
|
|
576
|
+
};
|
|
577
|
+
var StorefrontsResource = class extends BaseResource {
|
|
578
|
+
/** Retrieve the merchant's own storefront. */
|
|
579
|
+
retrieve() {
|
|
580
|
+
return this.get("/v1/storefront", sharedTypes.storefrontSchema);
|
|
581
|
+
}
|
|
582
|
+
upsert(input, options) {
|
|
583
|
+
sharedTypes.createStorefrontInputSchema.parse(input);
|
|
584
|
+
return this.post("/v1/storefront", input, sharedTypes.storefrontSchema, options);
|
|
585
|
+
}
|
|
586
|
+
publish(options) {
|
|
587
|
+
return this.post("/v1/storefront/publish", {}, sharedTypes.storefrontSchema, options);
|
|
588
|
+
}
|
|
589
|
+
archive(options) {
|
|
590
|
+
return this.post("/v1/storefront/archive", {}, sharedTypes.storefrontSchema, options);
|
|
591
|
+
}
|
|
592
|
+
// ----- Products -----
|
|
593
|
+
listProducts(params) {
|
|
594
|
+
return this.listPage("/v1/storefront/products", sharedTypes.storefrontProductSchema, params);
|
|
595
|
+
}
|
|
596
|
+
createProduct(input, options) {
|
|
597
|
+
sharedTypes.createStorefrontProductInputSchema.parse(input);
|
|
598
|
+
return this.post("/v1/storefront/products", input, sharedTypes.storefrontProductSchema, options);
|
|
599
|
+
}
|
|
600
|
+
retrieveProduct(productId) {
|
|
601
|
+
return this.get(
|
|
602
|
+
`/v1/storefront/products/${encodeURIComponent(productId)}`,
|
|
603
|
+
sharedTypes.storefrontProductSchema
|
|
604
|
+
);
|
|
605
|
+
}
|
|
606
|
+
archiveProduct(productId, options) {
|
|
607
|
+
return this.post(
|
|
608
|
+
`/v1/storefront/products/${encodeURIComponent(productId)}/archive`,
|
|
609
|
+
{},
|
|
610
|
+
sharedTypes.storefrontProductSchema,
|
|
611
|
+
options
|
|
612
|
+
);
|
|
613
|
+
}
|
|
614
|
+
};
|
|
615
|
+
var AgentsResource = class extends BaseResource {
|
|
616
|
+
/** Retrieve the merchant's AutoPay Agent config. */
|
|
617
|
+
retrieveConfig() {
|
|
618
|
+
return this.get("/v1/agents/config", sharedTypes.agentMerchantConfigSchema);
|
|
619
|
+
}
|
|
620
|
+
updateConfig(input, options) {
|
|
621
|
+
sharedTypes.updateAgentConfigInputSchema.parse(input);
|
|
622
|
+
return this.patch("/v1/agents/config", input, sharedTypes.agentMerchantConfigSchema, options);
|
|
623
|
+
}
|
|
624
|
+
listActivity(params) {
|
|
625
|
+
return this.listPage("/v1/agents/activity", sharedTypes.agentActivityLogSchema, params);
|
|
626
|
+
}
|
|
627
|
+
// ----- ERC-8183 jobs -----
|
|
628
|
+
listJobs(params) {
|
|
629
|
+
return this.listPage("/v1/agents/jobs", sharedTypes.agentJobSchema, params);
|
|
630
|
+
}
|
|
631
|
+
retrieveJob(id) {
|
|
632
|
+
return this.get(`/v1/agents/jobs/${encodeURIComponent(id)}`, sharedTypes.agentJobSchema);
|
|
633
|
+
}
|
|
634
|
+
createJob(input, options) {
|
|
635
|
+
sharedTypes.createAgentJobInputSchema.parse(input);
|
|
636
|
+
return this.post("/v1/agents/jobs", input, sharedTypes.agentJobSchema, options);
|
|
637
|
+
}
|
|
638
|
+
approveJob(id, options) {
|
|
639
|
+
return this.post(
|
|
640
|
+
`/v1/agents/jobs/${encodeURIComponent(id)}/approve`,
|
|
641
|
+
{},
|
|
642
|
+
sharedTypes.agentJobSchema,
|
|
643
|
+
options
|
|
644
|
+
);
|
|
645
|
+
}
|
|
646
|
+
};
|
|
647
|
+
|
|
648
|
+
// src/client.ts
|
|
649
|
+
var DEFAULT_BASE_URL = "https://api.strimz.io";
|
|
650
|
+
var StrimzClient = class {
|
|
651
|
+
/** Resolved mode — `test` or `live`. Derived from the API key prefix. */
|
|
652
|
+
mode;
|
|
653
|
+
merchants;
|
|
654
|
+
apiKeys;
|
|
655
|
+
customers;
|
|
656
|
+
paymentSessions;
|
|
657
|
+
transactions;
|
|
658
|
+
subscriptionPlans;
|
|
659
|
+
subscriptions;
|
|
660
|
+
refunds;
|
|
661
|
+
webhookEndpoints;
|
|
662
|
+
webhookDeliveries;
|
|
663
|
+
invoices;
|
|
664
|
+
storefronts;
|
|
665
|
+
agents;
|
|
666
|
+
constructor(options) {
|
|
667
|
+
if (!options.apiKey || typeof options.apiKey !== "string") {
|
|
668
|
+
throw new StrimzAuthenticationError(
|
|
669
|
+
{ code: "authentication_error", message: "apiKey is required" },
|
|
670
|
+
401
|
|
671
|
+
);
|
|
672
|
+
}
|
|
673
|
+
if (sharedConfig.kindFromKey(options.apiKey) !== "secret") {
|
|
674
|
+
throw new StrimzAuthenticationError(
|
|
675
|
+
{
|
|
676
|
+
code: "authentication_error",
|
|
677
|
+
message: "StrimzClient requires a secret key (sk_test_... or sk_live_...). Use StrimzBrowserClient for publishable keys."
|
|
678
|
+
},
|
|
679
|
+
401
|
|
680
|
+
);
|
|
681
|
+
}
|
|
682
|
+
const mode = sharedConfig.modeFromKey(options.apiKey);
|
|
683
|
+
if (mode == null) {
|
|
684
|
+
throw new StrimzAuthenticationError(
|
|
685
|
+
{ code: "authentication_error", message: "Unrecognised API key prefix" },
|
|
686
|
+
401
|
|
687
|
+
);
|
|
688
|
+
}
|
|
689
|
+
this.mode = mode;
|
|
690
|
+
const fetcher = new Fetcher({
|
|
691
|
+
baseUrl: options.baseUrl ?? DEFAULT_BASE_URL,
|
|
692
|
+
baseHeaders: buildBaseHeaders(options.apiKey, detectRuntime()),
|
|
693
|
+
timeoutMs: options.timeoutMs,
|
|
694
|
+
maxRetries: options.maxRetries,
|
|
695
|
+
onRequest: options.onRequest,
|
|
696
|
+
onResponse: options.onResponse,
|
|
697
|
+
fetch: options.fetch
|
|
698
|
+
});
|
|
699
|
+
const ctx = { fetcher };
|
|
700
|
+
this.merchants = new MerchantsResource(ctx);
|
|
701
|
+
this.apiKeys = new ApiKeysResource(ctx);
|
|
702
|
+
this.customers = new CustomersResource(ctx);
|
|
703
|
+
this.paymentSessions = new PaymentSessionsResource(ctx);
|
|
704
|
+
this.transactions = new TransactionsResource(ctx);
|
|
705
|
+
this.subscriptionPlans = new SubscriptionPlansResource(ctx);
|
|
706
|
+
this.subscriptions = new SubscriptionsResource(ctx);
|
|
707
|
+
this.refunds = new RefundsResource(ctx);
|
|
708
|
+
this.webhookEndpoints = new WebhookEndpointsResource(ctx);
|
|
709
|
+
this.webhookDeliveries = new WebhookDeliveriesResource(ctx);
|
|
710
|
+
this.invoices = new InvoicesResource(ctx);
|
|
711
|
+
this.storefronts = new StorefrontsResource(ctx);
|
|
712
|
+
this.agents = new AgentsResource(ctx);
|
|
713
|
+
}
|
|
714
|
+
};
|
|
715
|
+
function detectRuntime() {
|
|
716
|
+
if (typeof EdgeRuntime !== "undefined") return "edge";
|
|
717
|
+
if (typeof process !== "undefined" && process.versions?.node)
|
|
718
|
+
return `node-${process.versions.node}`;
|
|
719
|
+
if (typeof navigator !== "undefined" && navigator.userAgent) return "browser";
|
|
720
|
+
return "unknown";
|
|
721
|
+
}
|
|
722
|
+
var CheckoutResource = class extends BaseResource {
|
|
723
|
+
/** Load a payment session by id (public — no merchant scoping). */
|
|
724
|
+
session(id) {
|
|
725
|
+
return this.get(`/v1/checkout/sessions/${encodeURIComponent(id)}`, sharedTypes.paymentSessionSchema);
|
|
726
|
+
}
|
|
727
|
+
/** Load a subscription plan by id (public — no merchant scoping). */
|
|
728
|
+
plan(id) {
|
|
729
|
+
return this.get(`/v1/checkout/plans/${encodeURIComponent(id)}`, sharedTypes.subscriptionPlanSchema);
|
|
730
|
+
}
|
|
731
|
+
};
|
|
732
|
+
var TokensResource = class extends BaseResource {
|
|
733
|
+
/**
|
|
734
|
+
* Fetch full metadata for a token. Throws via the underlying fetcher
|
|
735
|
+
* (404 → `StrimzNotFoundError`) if the token isn't whitelisted.
|
|
736
|
+
*/
|
|
737
|
+
retrieve(address) {
|
|
738
|
+
return this.get(`/v1/tokens/${encodeURIComponent(address.toLowerCase())}`, sharedTypes.tokenMetadataSchema);
|
|
739
|
+
}
|
|
740
|
+
/**
|
|
741
|
+
* Read an owner's current EIP-2612 permit nonce. Call this
|
|
742
|
+
* immediately before signing a Permit — the token contract rejects
|
|
743
|
+
* stale nonces, and the value advances on every successful permit.
|
|
744
|
+
*/
|
|
745
|
+
permitNonce(address, owner) {
|
|
746
|
+
return this.get(
|
|
747
|
+
`/v1/tokens/${encodeURIComponent(address.toLowerCase())}/permit-nonce`,
|
|
748
|
+
sharedTypes.tokenPermitNonceSchema,
|
|
749
|
+
{ owner: owner.toLowerCase() }
|
|
750
|
+
);
|
|
751
|
+
}
|
|
752
|
+
};
|
|
753
|
+
|
|
754
|
+
// src/browser-client.ts
|
|
755
|
+
var DEFAULT_BASE_URL2 = "https://api.strimz.io";
|
|
756
|
+
var StrimzBrowserClient = class {
|
|
757
|
+
mode;
|
|
758
|
+
/**
|
|
759
|
+
* Public hosted-checkout reads — payment sessions and subscription
|
|
760
|
+
* plans by id. Backed by the `/v1/checkout/*` namespace on the API,
|
|
761
|
+
* which is intentionally unauthenticated.
|
|
762
|
+
*/
|
|
763
|
+
checkout;
|
|
764
|
+
/** Token metadata + EIP-2612 permit nonce lookup. */
|
|
765
|
+
tokens;
|
|
766
|
+
constructor(options) {
|
|
767
|
+
const key = options.publishableKey;
|
|
768
|
+
if (!key || typeof key !== "string") {
|
|
769
|
+
throw new StrimzAuthenticationError(
|
|
770
|
+
{ code: "authentication_error", message: "publishableKey is required" },
|
|
771
|
+
401
|
|
772
|
+
);
|
|
773
|
+
}
|
|
774
|
+
if (sharedConfig.kindFromKey(key) !== "publishable") {
|
|
775
|
+
throw new StrimzAuthenticationError(
|
|
776
|
+
{
|
|
777
|
+
code: "authentication_error",
|
|
778
|
+
message: "StrimzBrowserClient must be initialised with a publishable key (pk_test_... / pk_live_...). Never expose secret keys to a browser."
|
|
779
|
+
},
|
|
780
|
+
401
|
|
781
|
+
);
|
|
782
|
+
}
|
|
783
|
+
const mode = sharedConfig.modeFromKey(key);
|
|
784
|
+
if (mode == null) {
|
|
785
|
+
throw new StrimzAuthenticationError(
|
|
786
|
+
{ code: "authentication_error", message: "Unrecognised API key prefix" },
|
|
787
|
+
401
|
|
788
|
+
);
|
|
789
|
+
}
|
|
790
|
+
this.mode = mode;
|
|
791
|
+
const fetcher = new Fetcher({
|
|
792
|
+
baseUrl: options.baseUrl ?? DEFAULT_BASE_URL2,
|
|
793
|
+
baseHeaders: buildBaseHeaders(key, "browser"),
|
|
794
|
+
timeoutMs: options.timeoutMs,
|
|
795
|
+
maxRetries: 2
|
|
796
|
+
});
|
|
797
|
+
this.checkout = new CheckoutResource({ fetcher });
|
|
798
|
+
this.tokens = new TokensResource({ fetcher });
|
|
799
|
+
}
|
|
800
|
+
};
|
|
801
|
+
function parseWebhookEvent(rawJson) {
|
|
802
|
+
return sharedTypes.webhookEventSchema.parse(JSON.parse(rawJson));
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
Object.defineProperty(exports, "signWebhookPayload", {
|
|
806
|
+
enumerable: true,
|
|
807
|
+
get: function () { return sharedCrypto.signWebhookPayload; }
|
|
808
|
+
});
|
|
809
|
+
Object.defineProperty(exports, "verifyWebhookSignature", {
|
|
810
|
+
enumerable: true,
|
|
811
|
+
get: function () { return sharedCrypto.verifyWebhookSignature; }
|
|
812
|
+
});
|
|
813
|
+
exports.AutoPagingIterator = AutoPagingIterator;
|
|
814
|
+
exports.StrimzAuthenticationError = StrimzAuthenticationError;
|
|
815
|
+
exports.StrimzBrowserClient = StrimzBrowserClient;
|
|
816
|
+
exports.StrimzClient = StrimzClient;
|
|
817
|
+
exports.StrimzError = StrimzError;
|
|
818
|
+
exports.StrimzIdempotencyError = StrimzIdempotencyError;
|
|
819
|
+
exports.StrimzModeMismatchError = StrimzModeMismatchError;
|
|
820
|
+
exports.StrimzNetworkError = StrimzNetworkError;
|
|
821
|
+
exports.StrimzNotFoundError = StrimzNotFoundError;
|
|
822
|
+
exports.StrimzPermissionError = StrimzPermissionError;
|
|
823
|
+
exports.StrimzRateLimitError = StrimzRateLimitError;
|
|
824
|
+
exports.StrimzTimeoutError = StrimzTimeoutError;
|
|
825
|
+
exports.StrimzValidationError = StrimzValidationError;
|
|
826
|
+
exports.classifyError = classifyError;
|
|
827
|
+
exports.generateIdempotencyKey = generateIdempotencyKey;
|
|
828
|
+
exports.isValidIdempotencyKey = isValidIdempotencyKey;
|
|
829
|
+
exports.parseWebhookEvent = parseWebhookEvent;
|
|
830
|
+
//# sourceMappingURL=index.cjs.map
|
|
831
|
+
//# sourceMappingURL=index.cjs.map
|