@timbro/invoices 0.7.0-next.30
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/README.md +308 -0
- package/dist/artifact-headers.d.ts +9 -0
- package/dist/artifact-headers.d.ts.map +1 -0
- package/dist/artifact-headers.js +43 -0
- package/dist/certificate-custody-import.d.ts +13 -0
- package/dist/certificate-custody-import.d.ts.map +1 -0
- package/dist/certificate-custody-import.js +30 -0
- package/dist/certificate-custody-readiness.d.ts +6 -0
- package/dist/certificate-custody-readiness.d.ts.map +1 -0
- package/dist/certificate-custody-readiness.js +13 -0
- package/dist/collection.d.ts +13 -0
- package/dist/collection.d.ts.map +1 -0
- package/dist/collection.js +21 -0
- package/dist/direct-connection.d.ts +74 -0
- package/dist/direct-connection.d.ts.map +1 -0
- package/dist/direct-connection.js +192 -0
- package/dist/document-node.d.ts +15 -0
- package/dist/document-node.d.ts.map +1 -0
- package/dist/document-node.js +67 -0
- package/dist/document-worker-protocol.d.ts +30 -0
- package/dist/document-worker-protocol.d.ts.map +1 -0
- package/dist/document-worker-protocol.js +103 -0
- package/dist/document-worker.d.ts +2 -0
- package/dist/document-worker.d.ts.map +1 -0
- package/dist/document-worker.js +71 -0
- package/dist/document.d.ts +38 -0
- package/dist/document.d.ts.map +1 -0
- package/dist/document.js +204 -0
- package/dist/fiscal-delivery.d.ts +12 -0
- package/dist/fiscal-delivery.d.ts.map +1 -0
- package/dist/fiscal-delivery.js +45 -0
- package/dist/fiscal-engine-runtime.manifest.json +637 -0
- package/dist/fiscal-engine-runtime.provenance.json +1010 -0
- package/dist/fiscal-error.d.ts +23 -0
- package/dist/fiscal-error.d.ts.map +1 -0
- package/dist/fiscal-error.js +36 -0
- package/dist/fiscal-numbering-readiness.d.ts +6 -0
- package/dist/fiscal-numbering-readiness.d.ts.map +1 -0
- package/dist/fiscal-numbering-readiness.js +13 -0
- package/dist/fiscal-operation-timing.d.ts +9 -0
- package/dist/fiscal-operation-timing.d.ts.map +1 -0
- package/dist/fiscal-operation-timing.js +22 -0
- package/dist/fiscal-operation.d.ts +112 -0
- package/dist/fiscal-operation.d.ts.map +1 -0
- package/dist/fiscal-operation.js +193 -0
- package/dist/fiscal-receipt.d.ts +19 -0
- package/dist/fiscal-receipt.d.ts.map +1 -0
- package/dist/fiscal-receipt.js +66 -0
- package/dist/generated/index.d.ts +5 -0
- package/dist/generated/index.d.ts.map +1 -0
- package/dist/generated/index.js +4 -0
- package/dist/generated/problem-catalog.d.ts +7 -0
- package/dist/generated/problem-catalog.d.ts.map +1 -0
- package/dist/generated/problem-catalog.js +198 -0
- package/dist/generated/sdk.gen.d.ts +240 -0
- package/dist/generated/sdk.gen.d.ts.map +1 -0
- package/dist/generated/sdk.gen.js +4486 -0
- package/dist/generated/types.gen.d.ts +6906 -0
- package/dist/generated/types.gen.d.ts.map +1 -0
- package/dist/generated/types.gen.js +2 -0
- package/dist/generated/zod.gen.d.ts +146666 -0
- package/dist/generated/zod.gen.d.ts.map +1 -0
- package/dist/generated/zod.gen.js +25077 -0
- package/dist/generated-operation-client.d.ts +47 -0
- package/dist/generated-operation-client.d.ts.map +1 -0
- package/dist/generated-operation-client.js +112 -0
- package/dist/generated-problem.d.ts +12 -0
- package/dist/generated-problem.d.ts.map +1 -0
- package/dist/generated-problem.js +37 -0
- package/dist/hosted-tenant.d.ts +38 -0
- package/dist/hosted-tenant.d.ts.map +1 -0
- package/dist/hosted-tenant.js +67 -0
- package/dist/hosted-workspace-transport.d.ts +15 -0
- package/dist/hosted-workspace-transport.d.ts.map +1 -0
- package/dist/hosted-workspace-transport.js +15 -0
- package/dist/idempotency-key.d.ts +3 -0
- package/dist/idempotency-key.d.ts.map +1 -0
- package/dist/idempotency-key.js +11 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/printed-representation.d.ts +23 -0
- package/dist/printed-representation.d.ts.map +1 -0
- package/dist/printed-representation.js +135 -0
- package/dist/problem-contract.d.ts +265 -0
- package/dist/problem-contract.d.ts.map +1 -0
- package/dist/problem-contract.js +25 -0
- package/dist/public-case.d.ts +15 -0
- package/dist/public-case.d.ts.map +1 -0
- package/dist/public-case.js +26 -0
- package/dist/received-documents.d.ts +35 -0
- package/dist/received-documents.d.ts.map +1 -0
- package/dist/received-documents.js +83 -0
- package/dist/sha256.d.ts +2 -0
- package/dist/sha256.d.ts.map +1 -0
- package/dist/sha256.js +6 -0
- package/dist/signed-document.d.ts +15 -0
- package/dist/signed-document.d.ts.map +1 -0
- package/dist/signed-document.js +57 -0
- package/dist/source-command-validation.d.ts +3 -0
- package/dist/source-command-validation.d.ts.map +1 -0
- package/dist/source-command-validation.js +14 -0
- package/dist/source-connection-activation.d.ts +18 -0
- package/dist/source-connection-activation.d.ts.map +1 -0
- package/dist/source-connection-activation.js +41 -0
- package/dist/source-connection-transport.d.ts +8 -0
- package/dist/source-connection-transport.d.ts.map +1 -0
- package/dist/source-connection-transport.js +8 -0
- package/dist/source-connection.d.ts +18 -0
- package/dist/source-connection.d.ts.map +1 -0
- package/dist/source-connection.js +35 -0
- package/dist/stamp-server-http-transport.d.ts +23 -0
- package/dist/stamp-server-http-transport.d.ts.map +1 -0
- package/dist/stamp-server-http-transport.js +179 -0
- package/dist/timbro-client.d.ts +124 -0
- package/dist/timbro-client.d.ts.map +1 -0
- package/dist/timbro-client.js +72 -0
- package/dist/timbro_fiscal_engine.js +239 -0
- package/dist/timbro_fiscal_engine_bg.wasm +0 -0
- package/dist/transport-contract.d.ts +16 -0
- package/dist/transport-contract.d.ts.map +1 -0
- package/dist/transport-contract.js +1 -0
- package/dist/webhook-delivery.d.ts +14 -0
- package/dist/webhook-delivery.d.ts.map +1 -0
- package/dist/webhook-delivery.js +32 -0
- package/dist/webhook-event.d.ts +2711 -0
- package/dist/webhook-event.d.ts.map +1 -0
- package/dist/webhook-event.js +15 -0
- package/dist/webhook-registration.d.ts +12 -0
- package/dist/webhook-registration.d.ts.map +1 -0
- package/dist/webhook-registration.js +37 -0
- package/dist/webhook-replay.d.ts +12 -0
- package/dist/webhook-replay.d.ts.map +1 -0
- package/dist/webhook-replay.js +27 -0
- package/dist/webhook-verification.d.ts +25 -0
- package/dist/webhook-verification.d.ts.map +1 -0
- package/dist/webhook-verification.js +53 -0
- package/dist/workspace-session-transport.d.ts +8 -0
- package/dist/workspace-session-transport.d.ts.map +1 -0
- package/dist/workspace-session-transport.js +11 -0
- package/dist/workspace.d.ts +74 -0
- package/dist/workspace.d.ts.map +1 -0
- package/dist/workspace.js +278 -0
- package/package.json +73 -0
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
/* @ts-self-types="./timbro_fiscal_engine.d.ts" */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Evaluates one Source sales document's fiscal totals without numbering or issuance authority.
|
|
5
|
+
* @param {string} request_json
|
|
6
|
+
* @returns {string}
|
|
7
|
+
*/
|
|
8
|
+
export function evaluateFiscalDocument(request_json) {
|
|
9
|
+
let deferred2_0;
|
|
10
|
+
let deferred2_1;
|
|
11
|
+
try {
|
|
12
|
+
const ptr0 = passStringToWasm0(request_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
13
|
+
const len0 = WASM_VECTOR_LEN;
|
|
14
|
+
const ret = wasm.evaluateFiscalDocument(ptr0, len0);
|
|
15
|
+
deferred2_0 = ret[0];
|
|
16
|
+
deferred2_1 = ret[1];
|
|
17
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
18
|
+
} finally {
|
|
19
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Evaluates one versioned fiscal intent through the browser WebAssembly boundary.
|
|
25
|
+
* @param {string} request_json
|
|
26
|
+
* @returns {string}
|
|
27
|
+
*/
|
|
28
|
+
export function evaluateFiscalIntent(request_json) {
|
|
29
|
+
let deferred2_0;
|
|
30
|
+
let deferred2_1;
|
|
31
|
+
try {
|
|
32
|
+
const ptr0 = passStringToWasm0(request_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
33
|
+
const len0 = WASM_VECTOR_LEN;
|
|
34
|
+
const ret = wasm.evaluateFiscalIntent(ptr0, len0);
|
|
35
|
+
deferred2_0 = ret[0];
|
|
36
|
+
deferred2_1 = ret[1];
|
|
37
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
38
|
+
} finally {
|
|
39
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Returns the raw UTF-8 request ceiling enforced by the public document evaluator.
|
|
45
|
+
* @returns {number}
|
|
46
|
+
*/
|
|
47
|
+
export function maximumFiscalIntentRequestBytes() {
|
|
48
|
+
const ret = wasm.maximumFiscalIntentRequestBytes();
|
|
49
|
+
return ret >>> 0;
|
|
50
|
+
}
|
|
51
|
+
function __wbg_get_imports() {
|
|
52
|
+
const import0 = {
|
|
53
|
+
__proto__: null,
|
|
54
|
+
__wbindgen_init_externref_table: function() {
|
|
55
|
+
const table = wasm.__wbindgen_externrefs;
|
|
56
|
+
const offset = table.grow(4);
|
|
57
|
+
table.set(0, undefined);
|
|
58
|
+
table.set(offset + 0, undefined);
|
|
59
|
+
table.set(offset + 1, null);
|
|
60
|
+
table.set(offset + 2, true);
|
|
61
|
+
table.set(offset + 3, false);
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
return {
|
|
65
|
+
__proto__: null,
|
|
66
|
+
"./timbro_fiscal_engine_bg.js": import0,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function getStringFromWasm0(ptr, len) {
|
|
71
|
+
return decodeText(ptr >>> 0, len);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
let cachedUint8ArrayMemory0 = null;
|
|
75
|
+
function getUint8ArrayMemory0() {
|
|
76
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
77
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
78
|
+
}
|
|
79
|
+
return cachedUint8ArrayMemory0;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
83
|
+
if (realloc === undefined) {
|
|
84
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
85
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
86
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
87
|
+
WASM_VECTOR_LEN = buf.length;
|
|
88
|
+
return ptr;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
let len = arg.length;
|
|
92
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
93
|
+
|
|
94
|
+
const mem = getUint8ArrayMemory0();
|
|
95
|
+
|
|
96
|
+
let offset = 0;
|
|
97
|
+
|
|
98
|
+
for (; offset < len; offset++) {
|
|
99
|
+
const code = arg.charCodeAt(offset);
|
|
100
|
+
if (code > 0x7F) break;
|
|
101
|
+
mem[ptr + offset] = code;
|
|
102
|
+
}
|
|
103
|
+
if (offset !== len) {
|
|
104
|
+
if (offset !== 0) {
|
|
105
|
+
arg = arg.slice(offset);
|
|
106
|
+
}
|
|
107
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
108
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
109
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
110
|
+
|
|
111
|
+
offset += ret.written;
|
|
112
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
WASM_VECTOR_LEN = offset;
|
|
116
|
+
return ptr;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
120
|
+
cachedTextDecoder.decode();
|
|
121
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
122
|
+
let numBytesDecoded = 0;
|
|
123
|
+
function decodeText(ptr, len) {
|
|
124
|
+
numBytesDecoded += len;
|
|
125
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
126
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
127
|
+
cachedTextDecoder.decode();
|
|
128
|
+
numBytesDecoded = len;
|
|
129
|
+
}
|
|
130
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
const cachedTextEncoder = new TextEncoder();
|
|
134
|
+
|
|
135
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
136
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
137
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
138
|
+
view.set(buf);
|
|
139
|
+
return {
|
|
140
|
+
read: arg.length,
|
|
141
|
+
written: buf.length
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
let WASM_VECTOR_LEN = 0;
|
|
147
|
+
|
|
148
|
+
let wasmModule, wasmInstance, wasm;
|
|
149
|
+
function __wbg_finalize_init(instance, module) {
|
|
150
|
+
wasmInstance = instance;
|
|
151
|
+
wasm = instance.exports;
|
|
152
|
+
wasmModule = module;
|
|
153
|
+
cachedUint8ArrayMemory0 = null;
|
|
154
|
+
wasm.__wbindgen_start();
|
|
155
|
+
return wasm;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
async function __wbg_load(module, imports) {
|
|
159
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
160
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
161
|
+
try {
|
|
162
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
163
|
+
} catch (e) {
|
|
164
|
+
const validResponse = module.ok && expectedResponseType(module.type);
|
|
165
|
+
|
|
166
|
+
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
167
|
+
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
168
|
+
|
|
169
|
+
} else { throw e; }
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
const bytes = await module.arrayBuffer();
|
|
174
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
175
|
+
} else {
|
|
176
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
177
|
+
|
|
178
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
179
|
+
return { instance, module };
|
|
180
|
+
} else {
|
|
181
|
+
return instance;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
function expectedResponseType(type) {
|
|
186
|
+
switch (type) {
|
|
187
|
+
case 'basic': case 'cors': case 'default': return true;
|
|
188
|
+
}
|
|
189
|
+
return false;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
function initSync(module) {
|
|
194
|
+
if (wasm !== undefined) return wasm;
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
if (module !== undefined) {
|
|
198
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
199
|
+
({module} = module)
|
|
200
|
+
} else {
|
|
201
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
const imports = __wbg_get_imports();
|
|
206
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
207
|
+
module = new WebAssembly.Module(module);
|
|
208
|
+
}
|
|
209
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
210
|
+
return __wbg_finalize_init(instance, module);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
async function __wbg_init(module_or_path) {
|
|
214
|
+
if (wasm !== undefined) return wasm;
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
if (module_or_path !== undefined) {
|
|
218
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
219
|
+
({module_or_path} = module_or_path)
|
|
220
|
+
} else {
|
|
221
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
if (module_or_path === undefined) {
|
|
226
|
+
module_or_path = new URL('timbro_fiscal_engine_bg.wasm', import.meta.url);
|
|
227
|
+
}
|
|
228
|
+
const imports = __wbg_get_imports();
|
|
229
|
+
|
|
230
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
231
|
+
module_or_path = fetch(module_or_path);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
235
|
+
|
|
236
|
+
return __wbg_finalize_init(instance, module);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export { initSync, __wbg_init as default };
|
|
Binary file
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type TimbroTransportRequest = {
|
|
2
|
+
readonly method: "DELETE" | "GET" | "POST" | "PUT";
|
|
3
|
+
readonly path: string;
|
|
4
|
+
readonly headers: Readonly<Record<string, string>>;
|
|
5
|
+
readonly body: string | undefined;
|
|
6
|
+
readonly signal: AbortSignal | undefined;
|
|
7
|
+
};
|
|
8
|
+
export type TimbroTransportResponse = {
|
|
9
|
+
readonly status: number;
|
|
10
|
+
readonly headers: ReadonlyMap<string, string>;
|
|
11
|
+
readonly body: unknown;
|
|
12
|
+
};
|
|
13
|
+
export type TimbroTransport = {
|
|
14
|
+
readonly send: (request: TimbroTransportRequest) => Promise<TimbroTransportResponse>;
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=transport-contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transport-contract.d.ts","sourceRoot":"","sources":["../src/transport-contract.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,CAAC,MAAM,EAAE,QAAQ,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,CAAC;IACnD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACnD,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,SAAS,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,sBAAsB,KAAK,OAAO,CAAC,uBAAuB,CAAC,CAAC;CACtF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type WebhookDelivery, type WebhookDeliveryPage, type WebhookDeliveryState } from "./generated/index.ts";
|
|
2
|
+
import type { Client } from "./generated-operation-client.ts";
|
|
3
|
+
export type WebhookDeliveryListCommand = {
|
|
4
|
+
readonly webhookEndpointId: string;
|
|
5
|
+
readonly states?: readonly WebhookDeliveryState[];
|
|
6
|
+
readonly limit?: number;
|
|
7
|
+
readonly cursor?: string;
|
|
8
|
+
readonly signal?: AbortSignal;
|
|
9
|
+
/** Maximum number of pages read by listAll; list ignores this traversal-only option. */
|
|
10
|
+
readonly maxPages?: number;
|
|
11
|
+
};
|
|
12
|
+
export declare function readWebhookDeliveryPage(client: Client, command: WebhookDeliveryListCommand): Promise<WebhookDeliveryPage>;
|
|
13
|
+
export declare function readEveryWebhookDelivery(client: Client, command: WebhookDeliveryListCommand): AsyncIterable<WebhookDelivery>;
|
|
14
|
+
//# sourceMappingURL=webhook-delivery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhook-delivery.d.ts","sourceRoot":"","sources":["../src/webhook-delivery.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EAC1B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AAG9D,MAAM,MAAM,0BAA0B,GAAG;IACvC,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,oBAAoB,EAAE,CAAC;IAClD,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;IAC9B,wFAAwF;IACxF,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,mBAAmB,CAAC,CAkB9B;AAED,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,0BAA0B,GAClC,aAAa,CAAC,eAAe,CAAC,CAahC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { walkCollectionPages } from "./collection.js";
|
|
2
|
+
import { listWebhookDeliveries, } from "./generated/index.js";
|
|
3
|
+
import { throwGeneratedProblem } from "./generated-problem.js";
|
|
4
|
+
export async function readWebhookDeliveryPage(client, command) {
|
|
5
|
+
if (command.webhookEndpointId.trim() === "") {
|
|
6
|
+
throw new TypeError("webhookEndpointId must not be blank");
|
|
7
|
+
}
|
|
8
|
+
const response = await listWebhookDeliveries({
|
|
9
|
+
client,
|
|
10
|
+
path: { webhook_endpoint_id: command.webhookEndpointId },
|
|
11
|
+
query: {
|
|
12
|
+
...(command.cursor === undefined ? {} : { cursor: command.cursor }),
|
|
13
|
+
...(command.limit === undefined ? {} : { limit: command.limit }),
|
|
14
|
+
...(command.states === undefined ? {} : { state: [...command.states] }),
|
|
15
|
+
},
|
|
16
|
+
...(command.signal === undefined ? {} : { signal: command.signal }),
|
|
17
|
+
});
|
|
18
|
+
if (response.status !== 200) {
|
|
19
|
+
throwGeneratedProblem(response, "Webhook delivery listing failed");
|
|
20
|
+
}
|
|
21
|
+
return response.body;
|
|
22
|
+
}
|
|
23
|
+
export function readEveryWebhookDelivery(client, command) {
|
|
24
|
+
return walkCollectionPages((cursor, signal) => readWebhookDeliveryPage(client, {
|
|
25
|
+
...command,
|
|
26
|
+
...(cursor === undefined ? {} : { cursor }),
|
|
27
|
+
...(signal === undefined ? {} : { signal }),
|
|
28
|
+
}), {
|
|
29
|
+
...(command.maxPages === undefined ? {} : { maxPages: command.maxPages }),
|
|
30
|
+
...(command.signal === undefined ? {} : { signal: command.signal }),
|
|
31
|
+
});
|
|
32
|
+
}
|