@andesine/sdk 0.1.0 → 0.4.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/CHANGELOG.md +31 -0
- package/README.md +263 -29
- package/WEBHOOKS.md +317 -0
- package/dist/THIRD_PARTY_LICENSES.txt +49 -0
- package/dist/content-slug-C7CgtHmp.d.ts +13 -0
- package/dist/content-slug.d.ts +2 -0
- package/dist/content-slug.js +19 -0
- package/dist/content-slug.js.map +1 -0
- package/dist/index-moj3WP71.d.ts +1982 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.js +240 -14
- package/dist/index.js.map +1 -1
- package/dist/rolldown-runtime-EAsCxrDo.js +14 -0
- package/dist/{index-DFEcYmbh.d.ts → schema-BcVop8NH.d.ts} +10489 -6241
- package/dist/streaming.d.ts +1 -1
- package/dist/webhooks.d.ts +26 -0
- package/dist/webhooks.js +7429 -0
- package/dist/webhooks.js.map +1 -0
- package/openapi.json +13163 -4665
- package/package.json +14 -3
package/dist/streaming.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { gn as components, n as AnswerEvent } from "./schema-BcVop8NH.js";
|
|
2
2
|
//#region src/streaming.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* Read typed answer events from an Andesine SSE response or a forwarded toAnswerResponse().
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { fn as WebhookEvent, pn as WebhookEventName } from "./schema-BcVop8NH.js";
|
|
2
|
+
//#region src/webhooks/error.d.ts
|
|
3
|
+
type WebhookVerificationErrorCode = "INVALID_HEADERS" | "INVALID_SIGNATURE" | "TIMESTAMP_TOO_OLD" | "TIMESTAMP_TOO_NEW" | "INVALID_PAYLOAD" | "PAYLOAD_TOO_LARGE" | "UNSUPPORTED_EVENT" | "UNSUPPORTED_SCHEMA" | "EVENT_ID_MISMATCH";
|
|
4
|
+
declare class WebhookVerificationError extends Error {
|
|
5
|
+
readonly code: WebhookVerificationErrorCode;
|
|
6
|
+
constructor(code: WebhookVerificationErrorCode);
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region src/webhooks/signature.d.ts
|
|
10
|
+
interface WebhookVerificationOptions {
|
|
11
|
+
/** The endpoint's whsec_ secret, or up to two secrets during rotation. */
|
|
12
|
+
secret: string | readonly string[];
|
|
13
|
+
}
|
|
14
|
+
interface VerifyWebhookInput extends WebhookVerificationOptions {
|
|
15
|
+
/** Unchanged UTF-8 text or raw bytes, before any JSON middleware. */
|
|
16
|
+
body: string | Uint8Array;
|
|
17
|
+
headers: Headers | Record<string, string | string[] | undefined>;
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/webhooks.d.ts
|
|
21
|
+
declare const verifyWebhook: (input: VerifyWebhookInput) => Promise<WebhookEvent>;
|
|
22
|
+
/** Consumes the request body once. Configure a body-read deadline in the receiving server. */
|
|
23
|
+
declare const verifyWebhookRequest: (request: Request, options: WebhookVerificationOptions) => Promise<WebhookEvent>;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { type VerifyWebhookInput, type WebhookEvent, type WebhookEventName, WebhookVerificationError, type WebhookVerificationErrorCode, type WebhookVerificationOptions, verifyWebhook, verifyWebhookRequest };
|
|
26
|
+
//# sourceMappingURL=webhooks.d.ts.map
|