From 3cfb4bc2bd9e490efecf7b750b435618467d7663 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 20 Aug 2024 10:21:38 -0500 Subject: [PATCH] :herb: Fern Regeneration -- August 20, 2024 (#197) * SDK regeneration * Fix --------- Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Co-authored-by: Billy Trend --- .fernignore | 5 +- package.json | 3 +- reference.md | 4 +- src/Client.ts | 35 +- src/api/resources/connectors/client/Client.ts | 18 +- src/api/resources/embedJobs/client/Client.ts | 12 +- src/api/resources/finetuning/client/Client.ts | 21 +- src/api/resources/models/client/Client.ts | 6 +- src/api/resources/v2/client/Client.ts | 8 +- .../v2/client/requests/V2ChatStreamRequest.ts | 4 +- src/api/resources/v2/types/Citation.ts | 4 +- src/api/resources/v2/types/DocumentContent.ts | 9 +- .../v2/types/DocumentContentDocument.ts | 10 + .../v2/types/StreamedChatResponse2.ts | 10 + src/api/resources/v2/types/index.ts | 1 + src/api/types/CitationEndEvent.ts | 12 + src/api/types/CitationStartEvent.ts | 13 + src/api/types/CitationStartEventDelta.ts | 9 + .../types/CitationStartEventDeltaMessage.ts | 9 + src/api/types/index.ts | 4 + .../Node18UniversalStreamWrapper.ts | 47 +- .../stream-wrappers/NodePre18StreamWrapper.ts | 16 + .../stream-wrappers/UndiciStreamWrapper.ts | 20 + .../stream-wrappers/chooseStreamWrapper.ts | 1 + src/core/form-data-utils/FormDataWrapper.ts | 73 ++-- src/core/streaming-fetcher/Stream.ts | 2 +- .../resources/v2/types/Citation.ts | 8 +- .../resources/v2/types/DocumentContent.ts | 5 +- .../v2/types/DocumentContentDocument.ts | 19 + .../v2/types/StreamedChatResponse2.ts | 14 + src/serialization/resources/v2/types/index.ts | 1 + src/serialization/types/CitationEndEvent.ts | 23 + src/serialization/types/CitationStartEvent.ts | 26 ++ .../types/CitationStartEventDelta.ts | 21 + .../types/CitationStartEventDeltaMessage.ts | 21 + src/serialization/types/index.ts | 4 + tests/unit/fetcher/Fetcher.test.ts | 36 +- .../Node18UniversalStreamWrapper.test.ts | 29 +- .../NodePre18StreamWrapper.test.ts | 36 +- .../UndiciStreamWrapper.test.ts | 27 +- .../form-data-utils/formDataWrapper.test.ts | 127 ++++++ yarn.lock | 403 +++++++++++------- 42 files changed, 872 insertions(+), 284 deletions(-) create mode 100644 src/api/resources/v2/types/DocumentContentDocument.ts create mode 100644 src/api/types/CitationEndEvent.ts create mode 100644 src/api/types/CitationStartEvent.ts create mode 100644 src/api/types/CitationStartEventDelta.ts create mode 100644 src/api/types/CitationStartEventDeltaMessage.ts create mode 100644 src/serialization/resources/v2/types/DocumentContentDocument.ts create mode 100644 src/serialization/types/CitationEndEvent.ts create mode 100644 src/serialization/types/CitationStartEvent.ts create mode 100644 src/serialization/types/CitationStartEventDelta.ts create mode 100644 src/serialization/types/CitationStartEventDeltaMessage.ts create mode 100644 tests/unit/form-data-utils/formDataWrapper.test.ts diff --git a/.fernignore b/.fernignore index 6a36b22..ea8e4e7 100644 --- a/.fernignore +++ b/.fernignore @@ -14,4 +14,7 @@ src/index.ts src/aws-utils.ts src/core/streaming-fetcher/streaming-utils.ts src/ClientV2.ts -src/api/resources/datasets/client/Client.ts \ No newline at end of file +src/api/resources/datasets/client/Client.ts +src/CustomClient.ts +src/core/form-data-utils/FormDataWrapper.ts +tests/unit/form-data-utils/formDataWrapper.test.ts \ No newline at end of file diff --git a/package.json b/package.json index 90800b1..22966ac 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cohere-ai", - "version": "7.12.0", + "version": "7.12.1", "private": false, "repository": "https://github.com/cohere-ai/cohere-typescript", "main": "./index.js", @@ -29,6 +29,7 @@ "@types/url-join": "4.0.1", "@types/qs": "6.9.8", "@types/node-fetch": "2.6.9", + "fetch-mock-jest": "^1.5.1", "jest": "^29.7.0", "@types/jest": "29.5.5", "ts-jest": "^29.1.2", diff --git a/reference.md b/reference.md index 299afd3..7f23a45 100644 --- a/reference.md +++ b/reference.md @@ -95,8 +95,8 @@ await client.v2.chatStream({ ], citations: [ { - start: "string", - end: "string", + start: 1, + end: 1, text: "string", sources: [ { diff --git a/src/Client.ts b/src/Client.ts index e7bc720..4d5ebf2 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -7,7 +7,7 @@ import * as core from "./core"; import * as Cohere from "./api/index"; import * as serializers from "./serialization/index"; import urlJoin from "url-join"; -import * as stream from "readable-stream"; +import * as stream from "stream"; import * as errors from "./errors/index"; import { V2 } from "./api/resources/v2/client/Client"; import { EmbedJobs } from "./api/resources/embedJobs/client/Client"; @@ -62,7 +62,8 @@ export class CohereClient { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.12.0", + "X-Fern-SDK-Version": "7.12.1", + "User-Agent": "cohere-ai/7.12.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -232,7 +233,8 @@ export class CohereClient { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.12.0", + "X-Fern-SDK-Version": "7.12.1", + "User-Agent": "cohere-ai/7.12.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -372,7 +374,8 @@ export class CohereClient { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.12.0", + "X-Fern-SDK-Version": "7.12.1", + "User-Agent": "cohere-ai/7.12.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -543,7 +546,8 @@ export class CohereClient { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.12.0", + "X-Fern-SDK-Version": "7.12.1", + "User-Agent": "cohere-ai/7.12.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -707,7 +711,8 @@ export class CohereClient { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.12.0", + "X-Fern-SDK-Version": "7.12.1", + "User-Agent": "cohere-ai/7.12.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -862,7 +867,8 @@ export class CohereClient { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.12.0", + "X-Fern-SDK-Version": "7.12.1", + "User-Agent": "cohere-ai/7.12.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -1047,7 +1053,8 @@ export class CohereClient { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.12.0", + "X-Fern-SDK-Version": "7.12.1", + "User-Agent": "cohere-ai/7.12.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -1204,7 +1211,8 @@ export class CohereClient { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.12.0", + "X-Fern-SDK-Version": "7.12.1", + "User-Agent": "cohere-ai/7.12.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -1358,7 +1366,8 @@ export class CohereClient { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.12.0", + "X-Fern-SDK-Version": "7.12.1", + "User-Agent": "cohere-ai/7.12.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -1512,7 +1521,8 @@ export class CohereClient { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.12.0", + "X-Fern-SDK-Version": "7.12.1", + "User-Agent": "cohere-ai/7.12.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -1659,7 +1669,8 @@ export class CohereClient { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.12.0", + "X-Fern-SDK-Version": "7.12.1", + "User-Agent": "cohere-ai/7.12.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, diff --git a/src/api/resources/connectors/client/Client.ts b/src/api/resources/connectors/client/Client.ts index 07b1341..faf7048 100644 --- a/src/api/resources/connectors/client/Client.ts +++ b/src/api/resources/connectors/client/Client.ts @@ -82,7 +82,8 @@ export class Connectors { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.12.0", + "X-Fern-SDK-Version": "7.12.1", + "User-Agent": "cohere-ai/7.12.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -232,7 +233,8 @@ export class Connectors { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.12.0", + "X-Fern-SDK-Version": "7.12.1", + "User-Agent": "cohere-ai/7.12.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -380,7 +382,8 @@ export class Connectors { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.12.0", + "X-Fern-SDK-Version": "7.12.1", + "User-Agent": "cohere-ai/7.12.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -526,7 +529,8 @@ export class Connectors { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.12.0", + "X-Fern-SDK-Version": "7.12.1", + "User-Agent": "cohere-ai/7.12.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -674,7 +678,8 @@ export class Connectors { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.12.0", + "X-Fern-SDK-Version": "7.12.1", + "User-Agent": "cohere-ai/7.12.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -833,7 +838,8 @@ export class Connectors { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.12.0", + "X-Fern-SDK-Version": "7.12.1", + "User-Agent": "cohere-ai/7.12.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, diff --git a/src/api/resources/embedJobs/client/Client.ts b/src/api/resources/embedJobs/client/Client.ts index ded2560..24694b4 100644 --- a/src/api/resources/embedJobs/client/Client.ts +++ b/src/api/resources/embedJobs/client/Client.ts @@ -68,7 +68,8 @@ export class EmbedJobs { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.12.0", + "X-Fern-SDK-Version": "7.12.1", + "User-Agent": "cohere-ai/7.12.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -218,7 +219,8 @@ export class EmbedJobs { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.12.0", + "X-Fern-SDK-Version": "7.12.1", + "User-Agent": "cohere-ai/7.12.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -366,7 +368,8 @@ export class EmbedJobs { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.12.0", + "X-Fern-SDK-Version": "7.12.1", + "User-Agent": "cohere-ai/7.12.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -509,7 +512,8 @@ export class EmbedJobs { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.12.0", + "X-Fern-SDK-Version": "7.12.1", + "User-Agent": "cohere-ai/7.12.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, diff --git a/src/api/resources/finetuning/client/Client.ts b/src/api/resources/finetuning/client/Client.ts index a8fd973..180a527 100644 --- a/src/api/resources/finetuning/client/Client.ts +++ b/src/api/resources/finetuning/client/Client.ts @@ -82,7 +82,8 @@ export class Finetuning { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.12.0", + "X-Fern-SDK-Version": "7.12.1", + "User-Agent": "cohere-ai/7.12.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -180,7 +181,8 @@ export class Finetuning { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.12.0", + "X-Fern-SDK-Version": "7.12.1", + "User-Agent": "cohere-ai/7.12.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -274,7 +276,8 @@ export class Finetuning { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.12.0", + "X-Fern-SDK-Version": "7.12.1", + "User-Agent": "cohere-ai/7.12.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -363,7 +366,8 @@ export class Finetuning { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.12.0", + "X-Fern-SDK-Version": "7.12.1", + "User-Agent": "cohere-ai/7.12.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -462,7 +466,8 @@ export class Finetuning { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.12.0", + "X-Fern-SDK-Version": "7.12.1", + "User-Agent": "cohere-ai/7.12.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -572,7 +577,8 @@ export class Finetuning { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.12.0", + "X-Fern-SDK-Version": "7.12.1", + "User-Agent": "cohere-ai/7.12.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -674,7 +680,8 @@ export class Finetuning { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.12.0", + "X-Fern-SDK-Version": "7.12.1", + "User-Agent": "cohere-ai/7.12.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, diff --git a/src/api/resources/models/client/Client.ts b/src/api/resources/models/client/Client.ts index fac284a..d2f7b40 100644 --- a/src/api/resources/models/client/Client.ts +++ b/src/api/resources/models/client/Client.ts @@ -69,7 +69,8 @@ export class Models { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.12.0", + "X-Fern-SDK-Version": "7.12.1", + "User-Agent": "cohere-ai/7.12.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -233,7 +234,8 @@ export class Models { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.12.0", + "X-Fern-SDK-Version": "7.12.1", + "User-Agent": "cohere-ai/7.12.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, diff --git a/src/api/resources/v2/client/Client.ts b/src/api/resources/v2/client/Client.ts index 01705a0..69d7f04 100644 --- a/src/api/resources/v2/client/Client.ts +++ b/src/api/resources/v2/client/Client.ts @@ -7,7 +7,7 @@ import * as core from "../../../../core"; import * as Cohere from "../../../index"; import * as serializers from "../../../../serialization/index"; import urlJoin from "url-join"; -import * as stream from "readable-stream"; +import * as stream from "stream"; import * as errors from "../../../../errors/index"; export declare namespace V2 { @@ -52,7 +52,8 @@ export class V2 { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.12.0", + "X-Fern-SDK-Version": "7.12.1", + "User-Agent": "cohere-ai/7.12.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -218,7 +219,8 @@ export class V2 { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "cohere-ai", - "X-Fern-SDK-Version": "7.12.0", + "X-Fern-SDK-Version": "7.12.1", + "User-Agent": "cohere-ai/7.12.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, diff --git a/src/api/resources/v2/client/requests/V2ChatStreamRequest.ts b/src/api/resources/v2/client/requests/V2ChatStreamRequest.ts index 0ade54b..183dd5e 100644 --- a/src/api/resources/v2/client/requests/V2ChatStreamRequest.ts +++ b/src/api/resources/v2/client/requests/V2ChatStreamRequest.ts @@ -23,8 +23,8 @@ import * as Cohere from "../../../../index"; * text: "string" * }], * citations: [{ - * start: "string", - * end: "string", + * start: 1, + * end: 1, * text: "string", * sources: [{ * type: "tool", diff --git a/src/api/resources/v2/types/Citation.ts b/src/api/resources/v2/types/Citation.ts index cbb0515..ee7307d 100644 --- a/src/api/resources/v2/types/Citation.ts +++ b/src/api/resources/v2/types/Citation.ts @@ -8,8 +8,8 @@ import * as Cohere from "../../../index"; * Citation information containing sources and the text cited. */ export interface Citation { - start?: string; - end?: string; + start?: number; + end?: number; text?: string; sources?: Cohere.Source[]; } diff --git a/src/api/resources/v2/types/DocumentContent.ts b/src/api/resources/v2/types/DocumentContent.ts index ea828c6..b329a12 100644 --- a/src/api/resources/v2/types/DocumentContent.ts +++ b/src/api/resources/v2/types/DocumentContent.ts @@ -2,10 +2,17 @@ * This file was auto-generated by Fern from our API Definition. */ +import * as Cohere from "../../../index"; + /** * Content block of the message that contains information about documents. */ export interface DocumentContent { id: string; - document: Record; + /** + * Relevant information that could be used by the model to generate a more accurate reply. + * The contents of each document are generally short (under 300 words), and are passed in the form of a + * dictionary of strings or a single string. If a single string is passed, it will be treated as the value for key "content". + */ + document: Cohere.DocumentContentDocument; } diff --git a/src/api/resources/v2/types/DocumentContentDocument.ts b/src/api/resources/v2/types/DocumentContentDocument.ts new file mode 100644 index 0000000..7a97d0f --- /dev/null +++ b/src/api/resources/v2/types/DocumentContentDocument.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Relevant information that could be used by the model to generate a more accurate reply. + * The contents of each document are generally short (under 300 words), and are passed in the form of a + * dictionary of strings or a single string. If a single string is passed, it will be treated as the value for key "content". + */ +export type DocumentContentDocument = Record | string; diff --git a/src/api/resources/v2/types/StreamedChatResponse2.ts b/src/api/resources/v2/types/StreamedChatResponse2.ts index 5577ed1..9f24a14 100644 --- a/src/api/resources/v2/types/StreamedChatResponse2.ts +++ b/src/api/resources/v2/types/StreamedChatResponse2.ts @@ -16,6 +16,8 @@ export type StreamedChatResponse2 = | Cohere.StreamedChatResponse2.ToolCallStart | Cohere.StreamedChatResponse2.ToolCallDelta | Cohere.StreamedChatResponse2.ToolCallEnd + | Cohere.StreamedChatResponse2.CitationStart + | Cohere.StreamedChatResponse2.CitationEnd | Cohere.StreamedChatResponse2.MessageEnd; export declare namespace StreamedChatResponse2 { @@ -51,6 +53,14 @@ export declare namespace StreamedChatResponse2 { type: "tool-call-end"; } + interface CitationStart extends Cohere.CitationStartEvent { + type: "citation-start"; + } + + interface CitationEnd extends Cohere.CitationEndEvent { + type: "citation-end"; + } + interface MessageEnd extends Cohere.ChatMessageEndEvent { type: "message-end"; } diff --git a/src/api/resources/v2/types/index.ts b/src/api/resources/v2/types/index.ts index 05f3552..96a08e9 100644 --- a/src/api/resources/v2/types/index.ts +++ b/src/api/resources/v2/types/index.ts @@ -17,6 +17,7 @@ export * from "./AssistantMessage"; export * from "./SystemMessageContentItem"; export * from "./SystemMessageContent"; export * from "./SystemMessage"; +export * from "./DocumentContentDocument"; export * from "./DocumentContent"; export * from "./Content"; export * from "./UserMessageContent"; diff --git a/src/api/types/CitationEndEvent.ts b/src/api/types/CitationEndEvent.ts new file mode 100644 index 0000000..7181bdc --- /dev/null +++ b/src/api/types/CitationEndEvent.ts @@ -0,0 +1,12 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Cohere from "../index"; + +/** + * A streamed event which signifies a citation has finished streaming. + */ +export interface CitationEndEvent extends Cohere.ChatStreamEventType { + index?: number; +} diff --git a/src/api/types/CitationStartEvent.ts b/src/api/types/CitationStartEvent.ts new file mode 100644 index 0000000..eda6ddd --- /dev/null +++ b/src/api/types/CitationStartEvent.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Cohere from "../index"; + +/** + * A streamed event which signifies a citation has been created. + */ +export interface CitationStartEvent extends Cohere.ChatStreamEventType { + index?: number; + delta?: Cohere.CitationStartEventDelta; +} diff --git a/src/api/types/CitationStartEventDelta.ts b/src/api/types/CitationStartEventDelta.ts new file mode 100644 index 0000000..b196763 --- /dev/null +++ b/src/api/types/CitationStartEventDelta.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Cohere from "../index"; + +export interface CitationStartEventDelta { + message?: Cohere.CitationStartEventDeltaMessage; +} diff --git a/src/api/types/CitationStartEventDeltaMessage.ts b/src/api/types/CitationStartEventDeltaMessage.ts new file mode 100644 index 0000000..1f59a7e --- /dev/null +++ b/src/api/types/CitationStartEventDeltaMessage.ts @@ -0,0 +1,9 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Cohere from "../index"; + +export interface CitationStartEventDeltaMessage { + citations?: Cohere.Citation; +} diff --git a/src/api/types/index.ts b/src/api/types/index.ts index 4f07bc2..2035942 100644 --- a/src/api/types/index.ts +++ b/src/api/types/index.ts @@ -65,6 +65,10 @@ export * from "./ChatStreamEndEvent"; export * from "./ToolCallDelta"; export * from "./ChatToolCallsChunkEvent"; export * from "./StreamedChatResponse"; +export * from "./CitationStartEventDeltaMessage"; +export * from "./CitationStartEventDelta"; +export * from "./CitationStartEvent"; +export * from "./CitationEndEvent"; export * from "./SingleGenerationTokenLikelihoodsItem"; export * from "./SingleGeneration"; export * from "./Generation"; diff --git a/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 5cc74b6..e5db873 100644 --- a/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -1,17 +1,18 @@ import type { Writable } from "stream"; import { EventCallback, StreamWrapper } from "./chooseStreamWrapper"; -export class Node18UniversalStreamWrapper - implements StreamWrapper, Uint8Array> +export class Node18UniversalStreamWrapper + implements + StreamWrapper | Writable | WritableStream, ReadFormat> { - private readableStream: ReadableStream; - private reader: ReadableStreamDefaultReader; + private readableStream: ReadableStream; + private reader: ReadableStreamDefaultReader; private events: Record; private paused: boolean; private resumeCallback: ((value?: unknown) => void) | null; private encoding: string | null; - constructor(readableStream: ReadableStream) { + constructor(readableStream: ReadableStream) { this.readableStream = readableStream; this.reader = this.readableStream.getReader(); this.events = { @@ -37,8 +38,8 @@ export class Node18UniversalStreamWrapper } public pipe( - dest: Node18UniversalStreamWrapper | Writable | WritableStream - ): Node18UniversalStreamWrapper | Writable | WritableStream { + dest: Node18UniversalStreamWrapper | Writable | WritableStream + ): Node18UniversalStreamWrapper | Writable | WritableStream { this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -78,12 +79,12 @@ export class Node18UniversalStreamWrapper } public pipeTo( - dest: Node18UniversalStreamWrapper | Writable | WritableStream - ): Node18UniversalStreamWrapper | Writable | WritableStream { + dest: Node18UniversalStreamWrapper | Writable | WritableStream + ): Node18UniversalStreamWrapper | Writable | WritableStream { return this.pipe(dest); } - public unpipe(dest: Node18UniversalStreamWrapper | Writable | WritableStream): void { + public unpipe(dest: Node18UniversalStreamWrapper | Writable | WritableStream): void { this.off("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -149,7 +150,7 @@ export class Node18UniversalStreamWrapper return this.paused; } - public async read(): Promise { + public async read(): Promise { if (this.paused) { await new Promise((resolve) => { this.resumeCallback = resolve; @@ -168,7 +169,7 @@ export class Node18UniversalStreamWrapper } public async text(): Promise { - const chunks: Uint8Array[] = []; + const chunks: ReadFormat[] = []; while (true) { const { done, value } = await this.reader.read(); @@ -185,7 +186,7 @@ export class Node18UniversalStreamWrapper return JSON.parse(text); } - private _write(chunk: Uint8Array): void { + private _write(chunk: ReadFormat): void { this._emit("data", chunk); } @@ -228,4 +229,24 @@ export class Node18UniversalStreamWrapper this._emit("error", error); } } + + [Symbol.asyncIterator](): AsyncIterableIterator { + return { + next: async () => { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + return { done: true, value: undefined }; + } + return { done: false, value }; + }, + [Symbol.asyncIterator]() { + return this; + }, + }; + } } diff --git a/src/core/fetcher/stream-wrappers/NodePre18StreamWrapper.ts b/src/core/fetcher/stream-wrappers/NodePre18StreamWrapper.ts index d73daba..f9bead2 100644 --- a/src/core/fetcher/stream-wrappers/NodePre18StreamWrapper.ts +++ b/src/core/fetcher/stream-wrappers/NodePre18StreamWrapper.ts @@ -87,4 +87,20 @@ export class NodePre18StreamWrapper implements StreamWrapper { const text = await this.text(); return JSON.parse(text); } + + public [Symbol.asyncIterator](): AsyncIterableIterator { + const readableStream = this.readableStream; + const iterator = readableStream[Symbol.asyncIterator](); + + // Create and return an async iterator that yields buffers + return { + async next(): Promise> { + const { value, done } = await iterator.next(); + return { value: value as Buffer, done }; + }, + [Symbol.asyncIterator]() { + return this; + }, + }; + } } diff --git a/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 55c0487..7a52805 100644 --- a/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -216,4 +216,24 @@ export class UndiciStreamWrapper { + return { + next: async () => { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + return { done: true, value: undefined }; + } + return { done: false, value }; + }, + [Symbol.asyncIterator]() { + return this; + }, + }; + } } diff --git a/src/core/fetcher/stream-wrappers/chooseStreamWrapper.ts b/src/core/fetcher/stream-wrappers/chooseStreamWrapper.ts index 3295582..d60991d 100644 --- a/src/core/fetcher/stream-wrappers/chooseStreamWrapper.ts +++ b/src/core/fetcher/stream-wrappers/chooseStreamWrapper.ts @@ -17,6 +17,7 @@ export interface StreamWrapper { read(): Promise; text(): Promise; json(): Promise; + [Symbol.asyncIterator](): AsyncIterableIterator; } export async function chooseStreamWrapper(responseBody: any): Promise>> { diff --git a/src/core/form-data-utils/FormDataWrapper.ts b/src/core/form-data-utils/FormDataWrapper.ts index fbec47f..5b2b1bc 100644 --- a/src/core/form-data-utils/FormDataWrapper.ts +++ b/src/core/form-data-utils/FormDataWrapper.ts @@ -8,6 +8,10 @@ type FormDataRequest = { duplex?: "half"; }; +function isNamedValue(value: unknown): value is { name: string } { + return typeof value === "object" && value != null && "name" in value; +} + export interface CrossPlatformFormData { setup(): Promise; @@ -31,15 +35,17 @@ export async function newFormData(): Promise { return formdata; } +export type Node18FormDataFd = + | { + append(name: string, value: unknown, fileName?: string): void; + } + | undefined; + /** * Form Data Implementation for Node.js 18+ */ -class Node18FormData implements CrossPlatformFormData { - private fd: - | { - append(name: string, value: unknown, fileName?: string): void; - } - | undefined; +export class Node18FormData implements CrossPlatformFormData { + private fd: Node18FormDataFd; public async setup() { this.fd = new (await import("formdata-node")).FormData(); @@ -50,6 +56,10 @@ class Node18FormData implements CrossPlatformFormData { } public async appendFile(key: string, value: unknown, fileName?: string): Promise { + if (fileName == null && isNamedValue(value)) { + fileName = value.name; + } + if (value instanceof (await import("readable-stream")).Readable) { this.fd?.append(key, { type: undefined, @@ -74,29 +84,31 @@ class Node18FormData implements CrossPlatformFormData { } } -/** - * Form Data Implementation for Node.js 16-18 - */ -class Node16FormData implements CrossPlatformFormData { - private fd: - | { - append( - name: string, - value: unknown, - options?: - | string - | { +export type Node16FormDataFd = + | { + append( + name: string, + value: unknown, + options?: + | string + | { header?: string | Headers; knownLength?: number; filename?: string; filepath?: string; contentType?: string; } - ): void; + ): void; - getHeaders(): Record; - } - | undefined; + getHeaders(): Record; + } + | undefined; + +/** + * Form Data Implementation for Node.js 16-18 + */ +export class Node16FormData implements CrossPlatformFormData { + private fd: Node16FormDataFd; public async setup(): Promise { this.fd = new (await import("form-data")).default(); @@ -107,6 +119,10 @@ class Node16FormData implements CrossPlatformFormData { } public async appendFile(key: string, value: unknown, fileName?: string): Promise { + if (fileName == null && isNamedValue(value)) { + fileName = value.name; + } + let bufferedValue; if (!(value instanceof (await import("readable-stream")).Readable)) { bufferedValue = Buffer.from(await (value as any).arrayBuffer()); @@ -121,7 +137,7 @@ class Node16FormData implements CrossPlatformFormData { } } - public getRequest(): FormDataRequest { + public getRequest(): FormDataRequest { return { body: this.fd, headers: this.fd ? this.fd.getHeaders() : {}, @@ -129,11 +145,13 @@ class Node16FormData implements CrossPlatformFormData { } } +export type WebFormDataFd = { append(name: string, value: string | Blob, fileName?: string): void } | undefined; + /** * Form Data Implementation for Web */ -class WebFormData implements CrossPlatformFormData { - private fd: { append(name: string, value: string | Blob, fileName?: string): void } | undefined; +export class WebFormData implements CrossPlatformFormData { + protected fd: WebFormDataFd; public async setup(): Promise { this.fd = new FormData(); @@ -144,10 +162,13 @@ class WebFormData implements CrossPlatformFormData { } public async appendFile(key: string, value: any, fileName?: string): Promise { + if (fileName == null && isNamedValue(value)) { + fileName = value.name; + } this.fd?.append(key, new Blob([value]), fileName); } - public getRequest(): FormDataRequest { + public getRequest(): FormDataRequest { return { body: this.fd, headers: {}, diff --git a/src/core/streaming-fetcher/Stream.ts b/src/core/streaming-fetcher/Stream.ts index d290076..dccdb79 100644 --- a/src/core/streaming-fetcher/Stream.ts +++ b/src/core/streaming-fetcher/Stream.ts @@ -1,4 +1,4 @@ -import { Readable } from "readable-stream"; +import { Readable } from "stream"; import { RUNTIME } from "../runtime"; export declare namespace Stream { diff --git a/src/serialization/resources/v2/types/Citation.ts b/src/serialization/resources/v2/types/Citation.ts index 3b91502..f09d420 100644 --- a/src/serialization/resources/v2/types/Citation.ts +++ b/src/serialization/resources/v2/types/Citation.ts @@ -9,16 +9,16 @@ import { Source } from "./Source"; export const Citation: core.serialization.ObjectSchema = core.serialization.object({ - start: core.serialization.string().optional(), - end: core.serialization.string().optional(), + start: core.serialization.number().optional(), + end: core.serialization.number().optional(), text: core.serialization.string().optional(), sources: core.serialization.list(Source).optional(), }); export declare namespace Citation { interface Raw { - start?: string | null; - end?: string | null; + start?: number | null; + end?: number | null; text?: string | null; sources?: Source.Raw[] | null; } diff --git a/src/serialization/resources/v2/types/DocumentContent.ts b/src/serialization/resources/v2/types/DocumentContent.ts index 7decbe4..e091595 100644 --- a/src/serialization/resources/v2/types/DocumentContent.ts +++ b/src/serialization/resources/v2/types/DocumentContent.ts @@ -5,16 +5,17 @@ import * as serializers from "../../../index"; import * as Cohere from "../../../../api/index"; import * as core from "../../../../core"; +import { DocumentContentDocument } from "./DocumentContentDocument"; export const DocumentContent: core.serialization.ObjectSchema = core.serialization.object({ id: core.serialization.string(), - document: core.serialization.record(core.serialization.string(), core.serialization.unknown()), + document: DocumentContentDocument, }); export declare namespace DocumentContent { interface Raw { id: string; - document: Record; + document: DocumentContentDocument.Raw; } } diff --git a/src/serialization/resources/v2/types/DocumentContentDocument.ts b/src/serialization/resources/v2/types/DocumentContentDocument.ts new file mode 100644 index 0000000..cb65fad --- /dev/null +++ b/src/serialization/resources/v2/types/DocumentContentDocument.ts @@ -0,0 +1,19 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../index"; +import * as Cohere from "../../../../api/index"; +import * as core from "../../../../core"; + +export const DocumentContentDocument: core.serialization.Schema< + serializers.DocumentContentDocument.Raw, + Cohere.DocumentContentDocument +> = core.serialization.undiscriminatedUnion([ + core.serialization.record(core.serialization.string(), core.serialization.unknown()), + core.serialization.string(), +]); + +export declare namespace DocumentContentDocument { + type Raw = Record | string; +} diff --git a/src/serialization/resources/v2/types/StreamedChatResponse2.ts b/src/serialization/resources/v2/types/StreamedChatResponse2.ts index eb2f3a4..096ee9f 100644 --- a/src/serialization/resources/v2/types/StreamedChatResponse2.ts +++ b/src/serialization/resources/v2/types/StreamedChatResponse2.ts @@ -13,6 +13,8 @@ import { ChatToolPlanDeltaEvent } from "./ChatToolPlanDeltaEvent"; import { ChatToolCallStartEvent } from "./ChatToolCallStartEvent"; import { ChatToolCallDeltaEvent } from "./ChatToolCallDeltaEvent"; import { ChatToolCallEndEvent } from "./ChatToolCallEndEvent"; +import { CitationStartEvent } from "../../../types/CitationStartEvent"; +import { CitationEndEvent } from "../../../types/CitationEndEvent"; import { ChatMessageEndEvent } from "./ChatMessageEndEvent"; export const StreamedChatResponse2: core.serialization.Schema< @@ -28,6 +30,8 @@ export const StreamedChatResponse2: core.serialization.Schema< "tool-call-start": ChatToolCallStartEvent, "tool-call-delta": ChatToolCallDeltaEvent, "tool-call-end": ChatToolCallEndEvent, + "citation-start": CitationStartEvent, + "citation-end": CitationEndEvent, "message-end": ChatMessageEndEvent, }) .transform({ @@ -45,6 +49,8 @@ export declare namespace StreamedChatResponse2 { | StreamedChatResponse2.ToolCallStart | StreamedChatResponse2.ToolCallDelta | StreamedChatResponse2.ToolCallEnd + | StreamedChatResponse2.CitationStart + | StreamedChatResponse2.CitationEnd | StreamedChatResponse2.MessageEnd; interface MessageStart extends ChatMessageStartEvent.Raw { @@ -79,6 +85,14 @@ export declare namespace StreamedChatResponse2 { type: "tool-call-end"; } + interface CitationStart extends CitationStartEvent.Raw { + type: "citation-start"; + } + + interface CitationEnd extends CitationEndEvent.Raw { + type: "citation-end"; + } + interface MessageEnd extends ChatMessageEndEvent.Raw { type: "message-end"; } diff --git a/src/serialization/resources/v2/types/index.ts b/src/serialization/resources/v2/types/index.ts index 05f3552..96a08e9 100644 --- a/src/serialization/resources/v2/types/index.ts +++ b/src/serialization/resources/v2/types/index.ts @@ -17,6 +17,7 @@ export * from "./AssistantMessage"; export * from "./SystemMessageContentItem"; export * from "./SystemMessageContent"; export * from "./SystemMessage"; +export * from "./DocumentContentDocument"; export * from "./DocumentContent"; export * from "./Content"; export * from "./UserMessageContent"; diff --git a/src/serialization/types/CitationEndEvent.ts b/src/serialization/types/CitationEndEvent.ts new file mode 100644 index 0000000..5f73b2d --- /dev/null +++ b/src/serialization/types/CitationEndEvent.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Cohere from "../../api/index"; +import * as core from "../../core"; +import { ChatStreamEventType } from "../resources/v2/types/ChatStreamEventType"; + +export const CitationEndEvent: core.serialization.ObjectSchema< + serializers.CitationEndEvent.Raw, + Cohere.CitationEndEvent +> = core.serialization + .object({ + index: core.serialization.number().optional(), + }) + .extend(ChatStreamEventType); + +export declare namespace CitationEndEvent { + interface Raw extends ChatStreamEventType.Raw { + index?: number | null; + } +} diff --git a/src/serialization/types/CitationStartEvent.ts b/src/serialization/types/CitationStartEvent.ts new file mode 100644 index 0000000..530bde4 --- /dev/null +++ b/src/serialization/types/CitationStartEvent.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Cohere from "../../api/index"; +import * as core from "../../core"; +import { CitationStartEventDelta } from "./CitationStartEventDelta"; +import { ChatStreamEventType } from "../resources/v2/types/ChatStreamEventType"; + +export const CitationStartEvent: core.serialization.ObjectSchema< + serializers.CitationStartEvent.Raw, + Cohere.CitationStartEvent +> = core.serialization + .object({ + index: core.serialization.number().optional(), + delta: CitationStartEventDelta.optional(), + }) + .extend(ChatStreamEventType); + +export declare namespace CitationStartEvent { + interface Raw extends ChatStreamEventType.Raw { + index?: number | null; + delta?: CitationStartEventDelta.Raw | null; + } +} diff --git a/src/serialization/types/CitationStartEventDelta.ts b/src/serialization/types/CitationStartEventDelta.ts new file mode 100644 index 0000000..1ca55ff --- /dev/null +++ b/src/serialization/types/CitationStartEventDelta.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Cohere from "../../api/index"; +import * as core from "../../core"; +import { CitationStartEventDeltaMessage } from "./CitationStartEventDeltaMessage"; + +export const CitationStartEventDelta: core.serialization.ObjectSchema< + serializers.CitationStartEventDelta.Raw, + Cohere.CitationStartEventDelta +> = core.serialization.object({ + message: CitationStartEventDeltaMessage.optional(), +}); + +export declare namespace CitationStartEventDelta { + interface Raw { + message?: CitationStartEventDeltaMessage.Raw | null; + } +} diff --git a/src/serialization/types/CitationStartEventDeltaMessage.ts b/src/serialization/types/CitationStartEventDeltaMessage.ts new file mode 100644 index 0000000..da9678e --- /dev/null +++ b/src/serialization/types/CitationStartEventDeltaMessage.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Cohere from "../../api/index"; +import * as core from "../../core"; +import { Citation } from "../resources/v2/types/Citation"; + +export const CitationStartEventDeltaMessage: core.serialization.ObjectSchema< + serializers.CitationStartEventDeltaMessage.Raw, + Cohere.CitationStartEventDeltaMessage +> = core.serialization.object({ + citations: Citation.optional(), +}); + +export declare namespace CitationStartEventDeltaMessage { + interface Raw { + citations?: Citation.Raw | null; + } +} diff --git a/src/serialization/types/index.ts b/src/serialization/types/index.ts index 4f07bc2..2035942 100644 --- a/src/serialization/types/index.ts +++ b/src/serialization/types/index.ts @@ -65,6 +65,10 @@ export * from "./ChatStreamEndEvent"; export * from "./ToolCallDelta"; export * from "./ChatToolCallsChunkEvent"; export * from "./StreamedChatResponse"; +export * from "./CitationStartEventDeltaMessage"; +export * from "./CitationStartEventDelta"; +export * from "./CitationStartEvent"; +export * from "./CitationEndEvent"; export * from "./SingleGenerationTokenLikelihoodsItem"; export * from "./SingleGeneration"; export * from "./Generation"; diff --git a/tests/unit/fetcher/Fetcher.test.ts b/tests/unit/fetcher/Fetcher.test.ts index db04526..0e14a8c 100644 --- a/tests/unit/fetcher/Fetcher.test.ts +++ b/tests/unit/fetcher/Fetcher.test.ts @@ -1,28 +1,7 @@ +import fetchMock from "fetch-mock-jest"; import { Fetcher, fetcherImpl } from "../../../src/core/fetcher/Fetcher"; describe("Test fetcherImpl", () => { - let mockCreateUrl: jest.Mock; - let mockGetBody: jest.Mock; - let mockGetFetchFn: jest.Mock; - let mockRequestWithRetries: jest.Mock; - let mockGetResponseBody: jest.Mock; - - beforeEach(() => { - mockCreateUrl = jest.fn(); - mockGetBody = jest.fn(); - mockGetFetchFn = jest.fn(); - mockRequestWithRetries = jest.fn(); - mockGetResponseBody = jest.fn(); - - jest.mock("../../../src/core/fetcher/Fetcher", () => ({ - createUrl: mockCreateUrl, - getBody: mockGetBody, - getFetchFn: mockGetFetchFn, - requestWithRetries: mockRequestWithRetries, - getResponseBody: mockGetResponseBody, - })); - }); - it("should handle successful request", async () => { const mockArgs: Fetcher.Args = { url: "https://httpbin.org/post", @@ -33,15 +12,14 @@ describe("Test fetcherImpl", () => { requestType: "json", }; - mockCreateUrl.mockReturnValue("https://test.com"); - mockGetBody.mockResolvedValue(JSON.stringify({ data: "test" })); - mockGetFetchFn.mockResolvedValue(() => Promise.resolve()); - mockRequestWithRetries.mockResolvedValue({ status: 200 }); - mockGetResponseBody.mockResolvedValue({ result: "success" }); + fetchMock.mock("https://httpbin.org/post", 200, { + response: JSON.stringify({ data: "test" }), + }); const result = await fetcherImpl(mockArgs); expect(result.ok).toBe(true); - // @ts-expect-error - expect(result.body.json).toEqual({ data: "test" }); + if (result.ok) { + expect(result.body).toEqual({ data: "test" }); + } }); }); diff --git a/tests/unit/fetcher/stream-wrappers/Node18UniversalStreamWrapper.test.ts b/tests/unit/fetcher/stream-wrappers/Node18UniversalStreamWrapper.test.ts index 91e0684..e307b15 100644 --- a/tests/unit/fetcher/stream-wrappers/Node18UniversalStreamWrapper.test.ts +++ b/tests/unit/fetcher/stream-wrappers/Node18UniversalStreamWrapper.test.ts @@ -36,6 +36,7 @@ describe("Node18UniversalStreamWrapper", () => { it("should write to dest when calling pipe to writable stream", async () => { const rawStream = new ReadableStream({ start(controller) { + controller.enqueue(new TextEncoder().encode("test")); controller.enqueue(new TextEncoder().encode("test")); controller.close(); }, @@ -53,6 +54,7 @@ describe("Node18UniversalStreamWrapper", () => { it("should write to dest when calling pipe to node writable stream", async () => { const rawStream = new ReadableStream({ start(controller) { + controller.enqueue(new TextEncoder().encode("test")); controller.enqueue(new TextEncoder().encode("test")); controller.close(); }, @@ -71,6 +73,7 @@ describe("Node18UniversalStreamWrapper", () => { it("should write nothing when calling pipe and unpipe", async () => { const rawStream = new ReadableStream({ start(controller) { + controller.enqueue(new TextEncoder().encode("test")); controller.enqueue(new TextEncoder().encode("test")); controller.close(); }, @@ -116,20 +119,21 @@ describe("Node18UniversalStreamWrapper", () => { it("should read the stream", async () => { const rawStream = new ReadableStream({ start(controller) { + controller.enqueue(new TextEncoder().encode("test")); controller.enqueue(new TextEncoder().encode("test")); controller.close(); }, }); const stream = new Node18UniversalStreamWrapper(rawStream); - const data = await stream.read(); - - expect(data).toEqual(new TextEncoder().encode("test")); + expect(await stream.read()).toEqual(new TextEncoder().encode("test")); + expect(await stream.read()).toEqual(new TextEncoder().encode("test")); }); it("should read the stream as text", async () => { const rawStream = new ReadableStream({ start(controller) { + controller.enqueue(new TextEncoder().encode("test")); controller.enqueue(new TextEncoder().encode("test")); controller.close(); }, @@ -138,7 +142,7 @@ describe("Node18UniversalStreamWrapper", () => { const data = await stream.text(); - expect(data).toEqual("test"); + expect(data).toEqual("testtest"); }); it("should read the stream as json", async () => { @@ -154,4 +158,21 @@ describe("Node18UniversalStreamWrapper", () => { expect(data).toEqual({ test: "test" }); }); + + it("should allow use with async iteratable stream", async () => { + const rawStream = new ReadableStream({ + start(controller) { + controller.enqueue(new TextEncoder().encode("test")); + controller.enqueue(new TextEncoder().encode("test")); + controller.close(); + }, + }); + let data = ""; + const stream = new Node18UniversalStreamWrapper(rawStream); + for await (const chunk of stream) { + data += new TextDecoder().decode(chunk); + } + + expect(data).toEqual("testtest"); + }); }); diff --git a/tests/unit/fetcher/stream-wrappers/NodePre18StreamWrapper.test.ts b/tests/unit/fetcher/stream-wrappers/NodePre18StreamWrapper.test.ts index 5f1e012..861142a 100644 --- a/tests/unit/fetcher/stream-wrappers/NodePre18StreamWrapper.test.ts +++ b/tests/unit/fetcher/stream-wrappers/NodePre18StreamWrapper.test.ts @@ -2,7 +2,7 @@ import { NodePre18StreamWrapper } from "../../../../src/core/fetcher/stream-wrap describe("NodePre18StreamWrapper", () => { it("should set encoding to utf-8", async () => { - const rawStream = (await import("stream")).Readable.from(["test"]); + const rawStream = (await import("stream")).Readable.from(["test", "test"]); const stream = new NodePre18StreamWrapper(rawStream); const setEncodingSpy = jest.spyOn(stream, "setEncoding"); @@ -12,7 +12,7 @@ describe("NodePre18StreamWrapper", () => { }); it("should register an event listener for readable", async () => { - const rawStream = (await import("stream")).Readable.from(["test"]); + const rawStream = (await import("stream")).Readable.from(["test", "test"]); const stream = new NodePre18StreamWrapper(rawStream); const onSpy = jest.spyOn(stream, "on"); @@ -22,7 +22,7 @@ describe("NodePre18StreamWrapper", () => { }); it("should remove an event listener for data", async () => { - const rawStream = (await import("stream")).Readable.from(["test"]); + const rawStream = (await import("stream")).Readable.from(["test", "test"]); const stream = new NodePre18StreamWrapper(rawStream); const offSpy = jest.spyOn(stream, "off"); @@ -34,7 +34,7 @@ describe("NodePre18StreamWrapper", () => { }); it("should write to dest when calling pipe to node writable stream", async () => { - const rawStream = (await import("stream")).Readable.from(["test"]); + const rawStream = (await import("stream")).Readable.from(["test", "test"]); const stream = new NodePre18StreamWrapper(rawStream); const dest = new (await import("stream")).Writable({ write(chunk, encoding, callback) { @@ -47,7 +47,7 @@ describe("NodePre18StreamWrapper", () => { }); it("should write nothing when calling pipe and unpipe", async () => { - const rawStream = (await import("stream")).Readable.from(["test"]); + const rawStream = (await import("stream")).Readable.from(["test", "test"]); const stream = new NodePre18StreamWrapper(rawStream); const buffer: Uint8Array[] = []; const dest = new (await import("stream")).Writable({ @@ -63,7 +63,7 @@ describe("NodePre18StreamWrapper", () => { }); it("should destroy the stream", async () => { - const rawStream = (await import("stream")).Readable.from(["test"]); + const rawStream = (await import("stream")).Readable.from(["test", "test"]); const stream = new NodePre18StreamWrapper(rawStream); const destroySpy = jest.spyOn(stream, "destroy"); @@ -73,7 +73,7 @@ describe("NodePre18StreamWrapper", () => { }); it("should pause the stream and resume", async () => { - const rawStream = (await import("stream")).Readable.from(["test"]); + const rawStream = (await import("stream")).Readable.from(["test", "test"]); const stream = new NodePre18StreamWrapper(rawStream); const pauseSpy = jest.spyOn(stream, "pause"); @@ -86,21 +86,20 @@ describe("NodePre18StreamWrapper", () => { }); it("should read the stream", async () => { - const rawStream = (await import("stream")).Readable.from(["test"]); + const rawStream = (await import("stream")).Readable.from(["test", "test"]); const stream = new NodePre18StreamWrapper(rawStream); - const data = await stream.read(); - - expect(data).toEqual("test"); + expect(await stream.read()).toEqual("test"); + expect(await stream.read()).toEqual("test"); }); it("should read the stream as text", async () => { - const rawStream = (await import("stream")).Readable.from(["test"]); + const rawStream = (await import("stream")).Readable.from(["test", "test"]); const stream = new NodePre18StreamWrapper(rawStream); const data = await stream.text(); - expect(data).toEqual("test"); + expect(data).toEqual("testtest"); }); it("should read the stream as json", async () => { @@ -111,4 +110,15 @@ describe("NodePre18StreamWrapper", () => { expect(data).toEqual({ test: "test" }); }); + + it("should allow use with async iteratable stream", async () => { + const rawStream = (await import("stream")).Readable.from(["test", "test"]); + let data = ""; + const stream = new NodePre18StreamWrapper(rawStream); + for await (const chunk of stream) { + data += chunk; + } + + expect(data).toEqual("testtest"); + }); }); diff --git a/tests/unit/fetcher/stream-wrappers/UndiciStreamWrapper.test.ts b/tests/unit/fetcher/stream-wrappers/UndiciStreamWrapper.test.ts index 3d65cfd..1d171ce 100644 --- a/tests/unit/fetcher/stream-wrappers/UndiciStreamWrapper.test.ts +++ b/tests/unit/fetcher/stream-wrappers/UndiciStreamWrapper.test.ts @@ -36,6 +36,7 @@ describe("UndiciStreamWrapper", () => { it("should write to dest when calling pipe to writable stream", async () => { const rawStream = new ReadableStream({ start(controller) { + controller.enqueue(new TextEncoder().encode("test")); controller.enqueue(new TextEncoder().encode("test")); controller.close(); }, @@ -93,20 +94,21 @@ describe("UndiciStreamWrapper", () => { it("should read the stream", async () => { const rawStream = new ReadableStream({ start(controller) { + controller.enqueue(new TextEncoder().encode("test")); controller.enqueue(new TextEncoder().encode("test")); controller.close(); }, }); const stream = new UndiciStreamWrapper(rawStream); - const data = await stream.read(); - - expect(data).toEqual(new TextEncoder().encode("test")); + expect(await stream.read()).toEqual(new TextEncoder().encode("test")); + expect(await stream.read()).toEqual(new TextEncoder().encode("test")); }); it("should read the stream as text", async () => { const rawStream = new ReadableStream({ start(controller) { + controller.enqueue(new TextEncoder().encode("test")); controller.enqueue(new TextEncoder().encode("test")); controller.close(); }, @@ -115,7 +117,7 @@ describe("UndiciStreamWrapper", () => { const data = await stream.text(); - expect(data).toEqual("test"); + expect(data).toEqual("testtest"); }); it("should read the stream as json", async () => { @@ -131,4 +133,21 @@ describe("UndiciStreamWrapper", () => { expect(data).toEqual({ test: "test" }); }); + + it("should allow use with async iteratable stream", async () => { + const rawStream = new ReadableStream({ + start(controller) { + controller.enqueue(new TextEncoder().encode("test")); + controller.enqueue(new TextEncoder().encode("test")); + controller.close(); + }, + }); + let data = ""; + const stream = new UndiciStreamWrapper(rawStream); + for await (const chunk of stream) { + data += new TextDecoder().decode(chunk); + } + + expect(data).toEqual("testtest"); + }); }); diff --git a/tests/unit/form-data-utils/formDataWrapper.test.ts b/tests/unit/form-data-utils/formDataWrapper.test.ts new file mode 100644 index 0000000..5b70813 --- /dev/null +++ b/tests/unit/form-data-utils/formDataWrapper.test.ts @@ -0,0 +1,127 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ +import { Node18FormData, WebFormData } from "../../../src/core/form-data-utils/FormDataWrapper"; + +describe("CrossPlatformFormData", () => { + describe("Node18FormData", () => { + let formData: any; + + beforeEach(async () => { + formData = new Node18FormData(); + await formData.setup(); + }); + + it("should append a Readable stream with a specified filename", async () => { + const value = (await import("readable-stream")).Readable.from(["file content"]); + const filename = "testfile.txt"; + + await formData.appendFile("file", value, filename); + + const request = await formData.getRequest(); + const decoder = new TextDecoder("utf-8"); + let data = ""; + for await (const chunk of request.body) { + data += decoder.decode(chunk); + } + expect(data).toContain(filename); + }); + + it("should append a Blob with a specified filename", async () => { + const value = new Blob(["file content"], { type: "text/plain" }); + const filename = "testfile.txt"; + + await formData.appendFile("file", value, filename); + + const request = await formData.getRequest(); + const decoder = new TextDecoder("utf-8"); + let data = ""; + for await (const chunk of request.body) { + data += decoder.decode(chunk); + } + expect(data).toContain(filename); + }); + + it("should append a File with a specified filename", async () => { + const filename = "testfile.txt"; + // @ts-expect-error + const value = new (await import("buffer")).File(["file content"], filename); + + await formData.appendFile("file", value); + + const request = await formData.getRequest(); + const decoder = new TextDecoder("utf-8"); + let data = ""; + for await (const chunk of request.body) { + data += decoder.decode(chunk); + } + expect(data).toContain("testfile.txt"); + }); + + it("should append a File with an explicit filename", async () => { + const filename = "testfile.txt"; + // @ts-expect-error + const value = new (await import("buffer")).File(["file content"], filename); + + await formData.appendFile("file", value, "test.txt"); + + const request = await formData.getRequest(); + const decoder = new TextDecoder("utf-8"); + let data = ""; + for await (const chunk of request.body) { + data += decoder.decode(chunk); + } + expect(data).toContain("test.txt"); + }); + }); + + describe("WebFormData", () => { + let formData: any; + + beforeEach(async () => { + formData = new WebFormData(); + await formData.setup(); + }); + + it("should append a Readable stream with a specified filename", async () => { + const value = (await import("stream")).Readable.from(["file content"]); + const filename = "testfile.txt"; + + await formData.appendFile("file", value, filename); + + const request = formData.getRequest(); + expect(request.body.get("file").name).toBe(filename); + }); + + it("should append a Blob with a specified filename", async () => { + const value = new Blob(["file content"], { type: "text/plain" }); + const filename = "testfile.txt"; + + await formData.appendFile("file", value, filename); + + const request = formData.getRequest(); + + expect(request.body.get("file").name).toBe(filename); + }); + + it("should append a File with a specified filename", async () => { + const filename = "testfile.txt"; + // @ts-expect-error + const value = new (await import("buffer")).File(["file content"], filename); + + await formData.appendFile("file", value); + + const request = formData.getRequest(); + expect(request.body.get("file").name).toBe(filename); + }); + + it("should append a File with an explicit filename", async () => { + const filename = "testfile.txt"; + // @ts-expect-error + const value = new (await import("buffer")).File(["file content"], filename); + + await formData.appendFile("file", value, "test.txt"); + + const request = formData.getRequest(); + expect(request.body.get("file").name).toBe("test.txt"); + }); + }); +}); diff --git a/yarn.lock b/yarn.lock index 8a97429..72bee41 100644 --- a/yarn.lock +++ b/yarn.lock @@ -66,24 +66,24 @@ "@smithy/util-utf8" "^2.0.0" tslib "^2.6.2" -"@aws-sdk/client-cognito-identity@3.624.0": - version "3.624.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/client-cognito-identity/-/client-cognito-identity-3.624.0.tgz#c5f6e29d7b4b531d25f45b255f8aebb0db8fac22" - integrity sha512-imw3bNptHdhcogU3lwSVlQJsRpTxnkT4bQbchS/qX6+fF0Pk6ERZ+Q0YjzitPqTjkeyAWecUT4riyqv2djo+5w== +"@aws-sdk/client-cognito-identity@3.632.0": + version "3.632.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/client-cognito-identity/-/client-cognito-identity-3.632.0.tgz#9b8b95885e21eecce2593f7a8f45ec5828ddf0be" + integrity sha512-ciPZZ0jxMmXuaKCVdJthWogfqJ/4nb1zCxm7D/XkKcSbANjAiJ+1l+yiu7ZPTLGKKPRQQkPsWUknw5xb/5LxeQ== dependencies: "@aws-crypto/sha256-browser" "5.2.0" "@aws-crypto/sha256-js" "5.2.0" - "@aws-sdk/client-sso-oidc" "3.624.0" - "@aws-sdk/client-sts" "3.624.0" - "@aws-sdk/core" "3.624.0" - "@aws-sdk/credential-provider-node" "3.624.0" + "@aws-sdk/client-sso-oidc" "3.632.0" + "@aws-sdk/client-sts" "3.632.0" + "@aws-sdk/core" "3.629.0" + "@aws-sdk/credential-provider-node" "3.632.0" "@aws-sdk/middleware-host-header" "3.620.0" "@aws-sdk/middleware-logger" "3.609.0" "@aws-sdk/middleware-recursion-detection" "3.620.0" - "@aws-sdk/middleware-user-agent" "3.620.0" + "@aws-sdk/middleware-user-agent" "3.632.0" "@aws-sdk/region-config-resolver" "3.614.0" "@aws-sdk/types" "3.609.0" - "@aws-sdk/util-endpoints" "3.614.0" + "@aws-sdk/util-endpoints" "3.632.0" "@aws-sdk/util-user-agent-browser" "3.609.0" "@aws-sdk/util-user-agent-node" "3.614.0" "@smithy/config-resolver" "^3.0.5" @@ -114,23 +114,23 @@ tslib "^2.6.2" "@aws-sdk/client-sagemaker@^3.583.0": - version "3.624.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/client-sagemaker/-/client-sagemaker-3.624.0.tgz#63c76175b0454abba63e4b8625c58b492ccfc816" - integrity sha512-J04HAxGhC3dQRn43aPcPL6C+uW0wd0gR/dehFqJJA+XvSNLxa9HEiTjYUHCHUY+iaLQn5QCk7ICKRosynhQkxw== + version "3.633.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/client-sagemaker/-/client-sagemaker-3.633.0.tgz#9048fe2a0a35ab5a194488507240fc70cca26871" + integrity sha512-3AJ2MMxHyXkdWftF5ppu53BGcxkB/oJRuduvjvXDTJQvTzGJCIjCfF/J/GqRSxJ9/s6XT+Oaryxa6zvW0sqkaA== dependencies: "@aws-crypto/sha256-browser" "5.2.0" "@aws-crypto/sha256-js" "5.2.0" - "@aws-sdk/client-sso-oidc" "3.624.0" - "@aws-sdk/client-sts" "3.624.0" - "@aws-sdk/core" "3.624.0" - "@aws-sdk/credential-provider-node" "3.624.0" + "@aws-sdk/client-sso-oidc" "3.632.0" + "@aws-sdk/client-sts" "3.632.0" + "@aws-sdk/core" "3.629.0" + "@aws-sdk/credential-provider-node" "3.632.0" "@aws-sdk/middleware-host-header" "3.620.0" "@aws-sdk/middleware-logger" "3.609.0" "@aws-sdk/middleware-recursion-detection" "3.620.0" - "@aws-sdk/middleware-user-agent" "3.620.0" + "@aws-sdk/middleware-user-agent" "3.632.0" "@aws-sdk/region-config-resolver" "3.614.0" "@aws-sdk/types" "3.609.0" - "@aws-sdk/util-endpoints" "3.614.0" + "@aws-sdk/util-endpoints" "3.632.0" "@aws-sdk/util-user-agent-browser" "3.609.0" "@aws-sdk/util-user-agent-node" "3.614.0" "@smithy/config-resolver" "^3.0.5" @@ -162,22 +162,22 @@ tslib "^2.6.2" uuid "^9.0.1" -"@aws-sdk/client-sso-oidc@3.624.0": - version "3.624.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/client-sso-oidc/-/client-sso-oidc-3.624.0.tgz#33d0927519de333387ee07cb7f6483b0bd4db2f2" - integrity sha512-Ki2uKYJKKtfHxxZsiMTOvJoVRP6b2pZ1u3rcUb2m/nVgBPUfLdl8ZkGpqE29I+t5/QaS/sEdbn6cgMUZwl+3Dg== +"@aws-sdk/client-sso-oidc@3.632.0": + version "3.632.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/client-sso-oidc/-/client-sso-oidc-3.632.0.tgz#38d0b11980f0716c85e63acf2bce0ac1e6ccc9b5" + integrity sha512-Oh1fIWaoZluihOCb/zDEpRTi+6an82fgJz7fyRBugyLhEtDjmvpCQ3oKjzaOhoN+4EvXAm1ZS/ZgpvXBlIRTgw== dependencies: "@aws-crypto/sha256-browser" "5.2.0" "@aws-crypto/sha256-js" "5.2.0" - "@aws-sdk/core" "3.624.0" - "@aws-sdk/credential-provider-node" "3.624.0" + "@aws-sdk/core" "3.629.0" + "@aws-sdk/credential-provider-node" "3.632.0" "@aws-sdk/middleware-host-header" "3.620.0" "@aws-sdk/middleware-logger" "3.609.0" "@aws-sdk/middleware-recursion-detection" "3.620.0" - "@aws-sdk/middleware-user-agent" "3.620.0" + "@aws-sdk/middleware-user-agent" "3.632.0" "@aws-sdk/region-config-resolver" "3.614.0" "@aws-sdk/types" "3.609.0" - "@aws-sdk/util-endpoints" "3.614.0" + "@aws-sdk/util-endpoints" "3.632.0" "@aws-sdk/util-user-agent-browser" "3.609.0" "@aws-sdk/util-user-agent-node" "3.614.0" "@smithy/config-resolver" "^3.0.5" @@ -207,21 +207,21 @@ "@smithy/util-utf8" "^3.0.0" tslib "^2.6.2" -"@aws-sdk/client-sso@3.624.0": - version "3.624.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/client-sso/-/client-sso-3.624.0.tgz#5d6bd308c1a6bb876c0bffc369c31a4916271219" - integrity sha512-EX6EF+rJzMPC5dcdsu40xSi2To7GSvdGQNIpe97pD9WvZwM9tRNQnNM4T6HA4gjV1L6Jwk8rBlG/CnveXtLEMw== +"@aws-sdk/client-sso@3.632.0": + version "3.632.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/client-sso/-/client-sso-3.632.0.tgz#cc7d7c7578ba34d3689574dc015a0a71b35872e1" + integrity sha512-iYWHiKBz44m3chCFvtvHnvCpL2rALzyr1e6tOZV3dLlOKtQtDUlPy6OtnXDu4y+wyJCniy8ivG3+LAe4klzn1Q== dependencies: "@aws-crypto/sha256-browser" "5.2.0" "@aws-crypto/sha256-js" "5.2.0" - "@aws-sdk/core" "3.624.0" + "@aws-sdk/core" "3.629.0" "@aws-sdk/middleware-host-header" "3.620.0" "@aws-sdk/middleware-logger" "3.609.0" "@aws-sdk/middleware-recursion-detection" "3.620.0" - "@aws-sdk/middleware-user-agent" "3.620.0" + "@aws-sdk/middleware-user-agent" "3.632.0" "@aws-sdk/region-config-resolver" "3.614.0" "@aws-sdk/types" "3.609.0" - "@aws-sdk/util-endpoints" "3.614.0" + "@aws-sdk/util-endpoints" "3.632.0" "@aws-sdk/util-user-agent-browser" "3.609.0" "@aws-sdk/util-user-agent-node" "3.614.0" "@smithy/config-resolver" "^3.0.5" @@ -251,23 +251,23 @@ "@smithy/util-utf8" "^3.0.0" tslib "^2.6.2" -"@aws-sdk/client-sts@3.624.0": - version "3.624.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/client-sts/-/client-sts-3.624.0.tgz#ee19e08835a04d173f4997285e26558ac431d938" - integrity sha512-k36fLZCb2nfoV/DKK3jbRgO/Yf7/R80pgYfMiotkGjnZwDmRvNN08z4l06L9C+CieazzkgRxNUzyppsYcYsQaw== +"@aws-sdk/client-sts@3.632.0": + version "3.632.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/client-sts/-/client-sts-3.632.0.tgz#dc0e9d9958752f620adbe9783fb8ba2f2f915463" + integrity sha512-Ss5cBH09icpTvT+jtGGuQlRdwtO7RyE9BF4ZV/CEPATdd9whtJt4Qxdya8BUnkWR7h5HHTrQHqai3YVYjku41A== dependencies: "@aws-crypto/sha256-browser" "5.2.0" "@aws-crypto/sha256-js" "5.2.0" - "@aws-sdk/client-sso-oidc" "3.624.0" - "@aws-sdk/core" "3.624.0" - "@aws-sdk/credential-provider-node" "3.624.0" + "@aws-sdk/client-sso-oidc" "3.632.0" + "@aws-sdk/core" "3.629.0" + "@aws-sdk/credential-provider-node" "3.632.0" "@aws-sdk/middleware-host-header" "3.620.0" "@aws-sdk/middleware-logger" "3.609.0" "@aws-sdk/middleware-recursion-detection" "3.620.0" - "@aws-sdk/middleware-user-agent" "3.620.0" + "@aws-sdk/middleware-user-agent" "3.632.0" "@aws-sdk/region-config-resolver" "3.614.0" "@aws-sdk/types" "3.609.0" - "@aws-sdk/util-endpoints" "3.614.0" + "@aws-sdk/util-endpoints" "3.632.0" "@aws-sdk/util-user-agent-browser" "3.609.0" "@aws-sdk/util-user-agent-node" "3.614.0" "@smithy/config-resolver" "^3.0.5" @@ -297,13 +297,14 @@ "@smithy/util-utf8" "^3.0.0" tslib "^2.6.2" -"@aws-sdk/core@3.624.0": - version "3.624.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/core/-/core-3.624.0.tgz#ff0d7745bd662f53d99dbb7293416a45ddde5aa6" - integrity sha512-WyFmPbhRIvtWi7hBp8uSFy+iPpj8ccNV/eX86hwF4irMjfc/FtsGVIAeBXxXM/vGCjkdfEzOnl+tJ2XACD4OXg== +"@aws-sdk/core@3.629.0": + version "3.629.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/core/-/core-3.629.0.tgz#1ed02c657edcd22ffdce9b3b5bdbd2a36fe899aa" + integrity sha512-+/ShPU/tyIBM3oY1cnjgNA/tFyHtlWq+wXF9xEKRv19NOpYbWQ+xzNwVjGq8vR07cCRqy/sDQLWPhxjtuV/FiQ== dependencies: "@smithy/core" "^2.3.2" "@smithy/node-config-provider" "^3.1.4" + "@smithy/property-provider" "^3.1.3" "@smithy/protocol-http" "^4.1.0" "@smithy/signature-v4" "^4.1.0" "@smithy/smithy-client" "^3.1.12" @@ -312,12 +313,12 @@ fast-xml-parser "4.4.1" tslib "^2.6.2" -"@aws-sdk/credential-provider-cognito-identity@3.624.0": - version "3.624.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-cognito-identity/-/credential-provider-cognito-identity-3.624.0.tgz#dbcbf6b92b7844e70c2d2999ce6da78e48f538bf" - integrity sha512-gbXaxZP29yzMmEUzsGqUrHpKBnfMBtemvrlufJbaz/MGJNIa5qtJQp7n1LMI5R49DBVUN9s/e9Rf5liyMvlHiw== +"@aws-sdk/credential-provider-cognito-identity@3.632.0": + version "3.632.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-cognito-identity/-/credential-provider-cognito-identity-3.632.0.tgz#f2db006faf4f81aed366b793845d036ac3054e09" + integrity sha512-fr+xCIqMYsUD67vwE/IpboIqHiEYMQMrpPjnvpbbvyjTKspFh0GS7Qn1LVFCd5oNeu1rzAdJei1On2HBOwIiZQ== dependencies: - "@aws-sdk/client-cognito-identity" "3.624.0" + "@aws-sdk/client-cognito-identity" "3.632.0" "@aws-sdk/types" "3.609.0" "@smithy/property-provider" "^3.1.3" "@smithy/types" "^3.3.0" @@ -348,15 +349,15 @@ "@smithy/util-stream" "^3.1.3" tslib "^2.6.2" -"@aws-sdk/credential-provider-ini@3.624.0": - version "3.624.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.624.0.tgz#af4b485e9ceeca97e1681b2402c50dc192c1dc06" - integrity sha512-mMoNIy7MO2WTBbdqMyLpbt6SZpthE6e0GkRYpsd0yozPt0RZopcBhEh+HG1U9Y1PVODo+jcMk353vAi61CfnhQ== +"@aws-sdk/credential-provider-ini@3.632.0": + version "3.632.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.632.0.tgz#55c2aa6e59fb9f19cf4e9c1e4ebf70235de32930" + integrity sha512-m6epoW41xa1ajU5OiHcmQHoGVtrbXBaRBOUhlCLZmcaqMLYsboM4iD/WZP8aatKEON5tTnVXh/4StV8D/+wemw== dependencies: "@aws-sdk/credential-provider-env" "3.620.1" "@aws-sdk/credential-provider-http" "3.622.0" "@aws-sdk/credential-provider-process" "3.620.1" - "@aws-sdk/credential-provider-sso" "3.624.0" + "@aws-sdk/credential-provider-sso" "3.632.0" "@aws-sdk/credential-provider-web-identity" "3.621.0" "@aws-sdk/types" "3.609.0" "@smithy/credential-provider-imds" "^3.2.0" @@ -365,16 +366,16 @@ "@smithy/types" "^3.3.0" tslib "^2.6.2" -"@aws-sdk/credential-provider-node@3.624.0": - version "3.624.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-node/-/credential-provider-node-3.624.0.tgz#d7ebe191194eb09764b313c1f4e259cb42795079" - integrity sha512-vYyGK7oNpd81BdbH5IlmQ6zfaQqU+rPwsKTDDBeLRjshtrGXOEpfoahVpG9PX0ibu32IOWp4ZyXBNyVrnvcMOw== +"@aws-sdk/credential-provider-node@3.632.0": + version "3.632.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-node/-/credential-provider-node-3.632.0.tgz#33a21d722b620c6a9cc43c38981cba69345e251f" + integrity sha512-cL8fuJWm/xQBO4XJPkeuZzl3XinIn9EExWgzpG48NRMKR5us1RI/ucv7xFbBBaG+r/sDR2HpYBIA3lVIpm1H3Q== dependencies: "@aws-sdk/credential-provider-env" "3.620.1" "@aws-sdk/credential-provider-http" "3.622.0" - "@aws-sdk/credential-provider-ini" "3.624.0" + "@aws-sdk/credential-provider-ini" "3.632.0" "@aws-sdk/credential-provider-process" "3.620.1" - "@aws-sdk/credential-provider-sso" "3.624.0" + "@aws-sdk/credential-provider-sso" "3.632.0" "@aws-sdk/credential-provider-web-identity" "3.621.0" "@aws-sdk/types" "3.609.0" "@smithy/credential-provider-imds" "^3.2.0" @@ -394,12 +395,12 @@ "@smithy/types" "^3.3.0" tslib "^2.6.2" -"@aws-sdk/credential-provider-sso@3.624.0": - version "3.624.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.624.0.tgz#4a617577d04b23f80e86e1f76cc15dc3e9895c21" - integrity sha512-A02bayIjU9APEPKr3HudrFHEx0WfghoSPsPopckDkW7VBqO4wizzcxr75Q9A3vNX+cwg0wCN6UitTNe6pVlRaQ== +"@aws-sdk/credential-provider-sso@3.632.0": + version "3.632.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.632.0.tgz#c217b853fd7d00511f3f14accdd3bf27ec4426a6" + integrity sha512-P/4wB6j7ym5QCPTL2xlMfvf2NcXSh+z0jmsZP4WW/tVwab4hvgabPPbLeEZDSWZ0BpgtxKGvRq0GSHuGeirQbA== dependencies: - "@aws-sdk/client-sso" "3.624.0" + "@aws-sdk/client-sso" "3.632.0" "@aws-sdk/token-providers" "3.614.0" "@aws-sdk/types" "3.609.0" "@smithy/property-provider" "^3.1.3" @@ -418,20 +419,20 @@ tslib "^2.6.2" "@aws-sdk/credential-providers@^3.583.0": - version "3.624.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/credential-providers/-/credential-providers-3.624.0.tgz#d6e23e3a535ae74c6a7138e693aa002c42680d7f" - integrity sha512-SX+F5x/w8laQkhXLd1oww2lTuBDJSxzXWyxuOi25a9s4bMDs0V/wOj885Vr6h8QEGi3F8jZ8aWLwpsm2yuk9BA== - dependencies: - "@aws-sdk/client-cognito-identity" "3.624.0" - "@aws-sdk/client-sso" "3.624.0" - "@aws-sdk/client-sts" "3.624.0" - "@aws-sdk/credential-provider-cognito-identity" "3.624.0" + version "3.632.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/credential-providers/-/credential-providers-3.632.0.tgz#5556914f3ffa6d01e312a2fc6410749bf2d50ac0" + integrity sha512-Q4x2ARdgncZKOJE/NXJHY5s8/YDRugVUR4lBEtibE764w5ezAhI1aMChzAzv4j3WMSDZ29KyxaymHHt2vJED9g== + dependencies: + "@aws-sdk/client-cognito-identity" "3.632.0" + "@aws-sdk/client-sso" "3.632.0" + "@aws-sdk/client-sts" "3.632.0" + "@aws-sdk/credential-provider-cognito-identity" "3.632.0" "@aws-sdk/credential-provider-env" "3.620.1" "@aws-sdk/credential-provider-http" "3.622.0" - "@aws-sdk/credential-provider-ini" "3.624.0" - "@aws-sdk/credential-provider-node" "3.624.0" + "@aws-sdk/credential-provider-ini" "3.632.0" + "@aws-sdk/credential-provider-node" "3.632.0" "@aws-sdk/credential-provider-process" "3.620.1" - "@aws-sdk/credential-provider-sso" "3.624.0" + "@aws-sdk/credential-provider-sso" "3.632.0" "@aws-sdk/credential-provider-web-identity" "3.621.0" "@aws-sdk/types" "3.609.0" "@smithy/credential-provider-imds" "^3.2.0" @@ -468,13 +469,13 @@ "@smithy/types" "^3.3.0" tslib "^2.6.2" -"@aws-sdk/middleware-user-agent@3.620.0": - version "3.620.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.620.0.tgz#1fe3104f04f576a942cf0469bfbd73c38eef3d9e" - integrity sha512-bvS6etn+KsuL32ubY5D3xNof1qkenpbJXf/ugGXbg0n98DvDFQ/F+SMLxHgbnER5dsKYchNnhmtI6/FC3HFu/A== +"@aws-sdk/middleware-user-agent@3.632.0": + version "3.632.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.632.0.tgz#274bbf2789268f30c1ff2ef20c395c9dc4f91c96" + integrity sha512-yY/sFsHKwG9yzSf/DTclqWJaGPI2gPBJDCGBujSqTG1zlS7Ot4fqi91DZ6088BFWzbOorDzJFcAhAEFzc6LuQg== dependencies: "@aws-sdk/types" "3.609.0" - "@aws-sdk/util-endpoints" "3.614.0" + "@aws-sdk/util-endpoints" "3.632.0" "@smithy/protocol-http" "^4.1.0" "@smithy/types" "^3.3.0" tslib "^2.6.2" @@ -526,10 +527,10 @@ "@smithy/types" "^3.3.0" tslib "^2.6.2" -"@aws-sdk/util-endpoints@3.614.0": - version "3.614.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/util-endpoints/-/util-endpoints-3.614.0.tgz#6564b0ffd7dc3728221e9f9821f5aab1cc58468e" - integrity sha512-wK2cdrXHH4oz4IomV/yrGkftU9A+ITB6nFL+rxxyO78is2ifHJpFdV4aqk4LSkXYPi6CXWNru/Dqc7yiKXgJPw== +"@aws-sdk/util-endpoints@3.632.0": + version "3.632.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/util-endpoints/-/util-endpoints-3.632.0.tgz#f8716bdc75fc322babc6a3faf943ee1d0e462124" + integrity sha512-LlYMU8pAbcEQphOpE6xaNLJ8kPGhklZZTVzZVpVW477NaaGgoGTMYNXTABYHcxeF5E2lLrxql9OmVpvr8GWN8Q== dependencies: "@aws-sdk/types" "3.609.0" "@smithy/types" "^3.3.0" @@ -583,7 +584,7 @@ resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.25.2.tgz#e41928bd33475305c586f6acbbb7e3ade7a6f7f5" integrity sha512-bYcppcpKBvX4znYaPEeFau03bp89ShqNMLs+rmdptMw+heSZh9+z84d2YG+K7cYLbWwzdjtDoW/uqZmPjulClQ== -"@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.23.9": +"@babel/core@^7.0.0", "@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.23.9": version "7.25.2" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.25.2.tgz#ed8eec275118d7613e77a352894cd12ded8eba77" integrity sha512-BBt3opiCOxUr9euZ5/ro/Xv8/V7yJ5bjYMqG/C1YAo8MIKAnumZalCN+msbci3Pigy4lIQfPUpfMM27HMGaYEA== @@ -710,14 +711,28 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-class-properties@^7.8.3": +"@babel/plugin-syntax-class-properties@^7.12.13": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz#b5c987274c4a3a82b89714796931a6b53544ae10" integrity sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA== dependencies: "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-syntax-import-meta@^7.8.3": +"@babel/plugin-syntax-class-static-block@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz#195df89b146b4b78b3bf897fd7a257c84659d406" + integrity sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw== + dependencies: + "@babel/helper-plugin-utils" "^7.14.5" + +"@babel/plugin-syntax-import-attributes@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.24.7.tgz#b4f9ea95a79e6912480c4b626739f86a076624ca" + integrity sha512-hbX+lKKeUMGihnK8nvKqmXBInriT3GVjzXKFriV3YC6APGxMbP8RZNFwy91+hocLXq90Mta+HshoB31802bb8A== + dependencies: + "@babel/helper-plugin-utils" "^7.24.7" + +"@babel/plugin-syntax-import-meta@^7.10.4": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz#ee601348c370fa334d2207be158777496521fd51" integrity sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g== @@ -738,7 +753,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.24.7" -"@babel/plugin-syntax-logical-assignment-operators@^7.8.3": +"@babel/plugin-syntax-logical-assignment-operators@^7.10.4": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz#ca91ef46303530448b906652bac2e9fe9941f699" integrity sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig== @@ -752,7 +767,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-numeric-separator@^7.8.3": +"@babel/plugin-syntax-numeric-separator@^7.10.4": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz#b9b070b3e33570cd9fd07ba7fa91c0dd37b9af97" integrity sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug== @@ -780,7 +795,14 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-top-level-await@^7.8.3": +"@babel/plugin-syntax-private-property-in-object@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz#0dc6671ec0ea22b6e94a1114f857970cd39de1ad" + integrity sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg== + dependencies: + "@babel/helper-plugin-utils" "^7.14.5" + +"@babel/plugin-syntax-top-level-await@^7.14.5": version "7.14.5" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz#c1cfdadc35a646240001f06138247b741c34d94c" integrity sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw== @@ -794,6 +816,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.24.7" +"@babel/runtime@^7.0.0": + version "7.25.0" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.25.0.tgz#3af9a91c1b739c569d5d80cc917280919c544ecb" + integrity sha512-7dRy4DwXwtzBrPbZflqxnvfxLF8kdZXPkhymtDeFoFqE6ldzjQFgYTtYIFARcLEYDrqfBfYcZt1WqFxRoyC9Rw== + dependencies: + regenerator-runtime "^0.14.0" + "@babel/template@^7.25.0", "@babel/template@^7.3.3": version "7.25.0" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.25.0.tgz#e733dc3134b4fede528c15bc95e89cb98c52592a" @@ -1117,17 +1146,19 @@ tslib "^2.6.2" "@smithy/core@^2.3.2": - version "2.3.2" - resolved "https://registry.yarnpkg.com/@smithy/core/-/core-2.3.2.tgz#4a1e3da41d2a3a494cbc6bd1fc6eeb26b2e27184" - integrity sha512-in5wwt6chDBcUv1Lw1+QzZxN9fBffi+qOixfb65yK4sDuKG7zAUO9HAFqmVzsZM3N+3tTyvZjtnDXePpvp007Q== + version "2.4.0" + resolved "https://registry.yarnpkg.com/@smithy/core/-/core-2.4.0.tgz#56e917b6ab2dffeba681a05395c40a757d681147" + integrity sha512-cHXq+FneIF/KJbt4q4pjN186+Jf4ZB0ZOqEaZMBhT79srEyGDDBV31NqBRBjazz8ppQ1bJbDJMY9ba5wKFV36w== dependencies: "@smithy/middleware-endpoint" "^3.1.0" - "@smithy/middleware-retry" "^3.0.14" + "@smithy/middleware-retry" "^3.0.15" "@smithy/middleware-serde" "^3.0.3" "@smithy/protocol-http" "^4.1.0" - "@smithy/smithy-client" "^3.1.12" + "@smithy/smithy-client" "^3.2.0" "@smithy/types" "^3.3.0" + "@smithy/util-body-length-browser" "^3.0.0" "@smithy/util-middleware" "^3.0.3" + "@smithy/util-utf8" "^3.0.0" tslib "^2.6.2" "@smithy/credential-provider-imds@^3.2.0": @@ -1223,15 +1254,15 @@ "@smithy/util-middleware" "^3.0.3" tslib "^2.6.2" -"@smithy/middleware-retry@^3.0.14": - version "3.0.14" - resolved "https://registry.yarnpkg.com/@smithy/middleware-retry/-/middleware-retry-3.0.14.tgz#739e8bac6e465e0cda26446999db614418e79da3" - integrity sha512-7ZaWZJOjUxa5hgmuMspyt8v/zVsh0GXYuF7OvCmdcbVa/xbnKQoYC+uYKunAqRGTkxjOyuOCw9rmFUFOqqC0eQ== +"@smithy/middleware-retry@^3.0.14", "@smithy/middleware-retry@^3.0.15": + version "3.0.15" + resolved "https://registry.yarnpkg.com/@smithy/middleware-retry/-/middleware-retry-3.0.15.tgz#9b96900cde70d8aafd267e13f4e79241be90e0c7" + integrity sha512-iTMedvNt1ApdvkaoE8aSDuwaoc+BhvHqttbA/FO4Ty+y/S5hW6Ci/CTScG7vam4RYJWZxdTElc3MEfHRVH6cgQ== dependencies: "@smithy/node-config-provider" "^3.1.4" "@smithy/protocol-http" "^4.1.0" "@smithy/service-error-classification" "^3.0.3" - "@smithy/smithy-client" "^3.1.12" + "@smithy/smithy-client" "^3.2.0" "@smithy/types" "^3.3.0" "@smithy/util-middleware" "^3.0.3" "@smithy/util-retry" "^3.0.3" @@ -1359,10 +1390,10 @@ "@smithy/util-utf8" "^3.0.0" tslib "^2.6.2" -"@smithy/smithy-client@^3.1.12": - version "3.1.12" - resolved "https://registry.yarnpkg.com/@smithy/smithy-client/-/smithy-client-3.1.12.tgz#fb6386816ff8a5c50eab7503d4ee3ba2e4ebac63" - integrity sha512-wtm8JtsycthkHy1YA4zjIh2thJgIQ9vGkoR639DBx5lLlLNU0v4GARpQZkr2WjXue74nZ7MiTSWfVrLkyD8RkA== +"@smithy/smithy-client@^3.1.12", "@smithy/smithy-client@^3.2.0": + version "3.2.0" + resolved "https://registry.yarnpkg.com/@smithy/smithy-client/-/smithy-client-3.2.0.tgz#6db94024e4bdaefa079ac68dbea23dafbea230c8" + integrity sha512-pDbtxs8WOhJLJSeaF/eAbPgXg4VVYFlRcL/zoNYA5WbG3wBL06CHtBSg53ppkttDpAJ/hdiede+xApip1CwSLw== dependencies: "@smithy/middleware-endpoint" "^3.1.0" "@smithy/middleware-stack" "^3.0.3" @@ -1449,26 +1480,26 @@ tslib "^2.6.2" "@smithy/util-defaults-mode-browser@^3.0.14": - version "3.0.14" - resolved "https://registry.yarnpkg.com/@smithy/util-defaults-mode-browser/-/util-defaults-mode-browser-3.0.14.tgz#21f3ebcb07b9d6ae1274b9d655c38bdac59e5c06" - integrity sha512-0iwTgKKmAIf+vFLV8fji21Jb2px11ktKVxbX6LIDPAUJyWQqGqBVfwba7xwa1f2FZUoolYQgLvxQEpJycXuQ5w== + version "3.0.15" + resolved "https://registry.yarnpkg.com/@smithy/util-defaults-mode-browser/-/util-defaults-mode-browser-3.0.15.tgz#df73b9ae3dddc9126e0bb93ebc720b09d7163858" + integrity sha512-FZ4Psa3vjp8kOXcd3HJOiDPBCWtiilLl57r0cnNtq/Ga9RSDrM5ERL6xt+tO43+2af6Pn5Yp92x2n5vPuduNfg== dependencies: "@smithy/property-provider" "^3.1.3" - "@smithy/smithy-client" "^3.1.12" + "@smithy/smithy-client" "^3.2.0" "@smithy/types" "^3.3.0" bowser "^2.11.0" tslib "^2.6.2" "@smithy/util-defaults-mode-node@^3.0.14": - version "3.0.14" - resolved "https://registry.yarnpkg.com/@smithy/util-defaults-mode-node/-/util-defaults-mode-node-3.0.14.tgz#6bb9e837282e84bbf5093dbcd120fcd296593f7a" - integrity sha512-e9uQarJKfXApkTMMruIdxHprhcXivH1flYCe8JRDTzkkLx8dA3V5J8GZlST9yfDiRWkJpZJlUXGN9Rc9Ade3OQ== + version "3.0.15" + resolved "https://registry.yarnpkg.com/@smithy/util-defaults-mode-node/-/util-defaults-mode-node-3.0.15.tgz#d52476e1f2e66525d918b51f8d5a9b0972bf518e" + integrity sha512-KSyAAx2q6d0t6f/S4XB2+3+6aQacm3aLMhs9aLMqn18uYGUepbdssfogW5JQZpc6lXNBnp0tEnR5e9CEKmEd7A== dependencies: "@smithy/config-resolver" "^3.0.5" "@smithy/credential-provider-imds" "^3.2.0" "@smithy/node-config-provider" "^3.1.4" "@smithy/property-provider" "^3.1.3" - "@smithy/smithy-client" "^3.1.12" + "@smithy/smithy-client" "^3.2.0" "@smithy/types" "^3.3.0" tslib "^2.6.2" @@ -1696,11 +1727,11 @@ form-data "^4.0.0" "@types/node@*": - version "22.1.0" - resolved "https://registry.yarnpkg.com/@types/node/-/node-22.1.0.tgz#6d6adc648b5e03f0e83c78dc788c2b037d0ad94b" - integrity sha512-AOmuRF0R2/5j1knA3c6G3HOk523Ga+l+ZXltX8SF1+5oqcXijjfTd8fY3XRZqSihEu9XhtQnKYLmkFaoxgsJHw== + version "22.4.1" + resolved "https://registry.yarnpkg.com/@types/node/-/node-22.4.1.tgz#9b595d292c65b94c20923159e2ce947731b6fdce" + integrity sha512-1tbpb9325+gPnKK0dMm+/LMriX0vKxf6RnB0SZUqfyVkQ4fMgUSySqhxE/y8Jvs4NyF1yHzTfG9KlnkIODxPKg== dependencies: - undici-types "~6.13.0" + undici-types "~6.19.2" "@types/node@17.0.33": version "17.0.33" @@ -1984,9 +2015,9 @@ argparse@^1.0.7: sprintf-js "~1.0.2" async@^3.2.3: - version "3.2.5" - resolved "https://registry.yarnpkg.com/async/-/async-3.2.5.tgz#ebd52a8fdaf7a2289a24df399f8d8485c8a46b66" - integrity sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg== + version "3.2.6" + resolved "https://registry.yarnpkg.com/async/-/async-3.2.6.tgz#1b0728e14929d51b85b449b7f06e27c1145e38ce" + integrity sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA== asynckit@^0.4.0: version "0.4.0" @@ -2028,22 +2059,25 @@ babel-plugin-jest-hoist@^29.6.3: "@types/babel__traverse" "^7.0.6" babel-preset-current-node-syntax@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz#b4399239b89b2a011f9ddbe3e4f401fc40cff73b" - integrity sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ== + version "1.1.0" + resolved "https://registry.yarnpkg.com/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.1.0.tgz#9a929eafece419612ef4ae4f60b1862ebad8ef30" + integrity sha512-ldYss8SbBlWva1bs28q78Ju5Zq1F+8BrqBZZ0VFhLBvhh6lCpC2o3gDJi/5DRLs9FgYZCnmPYIVFU4lRXCkyUw== dependencies: "@babel/plugin-syntax-async-generators" "^7.8.4" "@babel/plugin-syntax-bigint" "^7.8.3" - "@babel/plugin-syntax-class-properties" "^7.8.3" - "@babel/plugin-syntax-import-meta" "^7.8.3" + "@babel/plugin-syntax-class-properties" "^7.12.13" + "@babel/plugin-syntax-class-static-block" "^7.14.5" + "@babel/plugin-syntax-import-attributes" "^7.24.7" + "@babel/plugin-syntax-import-meta" "^7.10.4" "@babel/plugin-syntax-json-strings" "^7.8.3" - "@babel/plugin-syntax-logical-assignment-operators" "^7.8.3" + "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" - "@babel/plugin-syntax-numeric-separator" "^7.8.3" + "@babel/plugin-syntax-numeric-separator" "^7.10.4" "@babel/plugin-syntax-object-rest-spread" "^7.8.3" "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" "@babel/plugin-syntax-optional-chaining" "^7.8.3" - "@babel/plugin-syntax-top-level-await" "^7.8.3" + "@babel/plugin-syntax-private-property-in-object" "^7.14.5" + "@babel/plugin-syntax-top-level-await" "^7.14.5" babel-preset-jest@^29.6.3: version "29.6.3" @@ -2260,6 +2294,11 @@ convert-source-map@^2.0.0: resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== +core-js@^3.0.0: + version "3.38.1" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.38.1.tgz#aa375b79a286a670388a1a363363d53677c0383e" + integrity sha512-OP35aUorbU3Zvlx7pjsFdu1rGNnD4pgw/CWoYzRY3t2EzoVT7shKHY1dlAy3f41cGIO7ZDPQimhGFTlEYkG/Hw== + create-jest@^29.7.0: version "29.7.0" resolved "https://registry.yarnpkg.com/create-jest/-/create-jest-29.7.0.tgz#a355c5b3cb1e1af02ba177fe7afd7feee49a5320" @@ -2369,9 +2408,9 @@ ejs@^3.1.10: jake "^10.8.5" electron-to-chromium@^1.5.4: - version "1.5.5" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.5.tgz#03bfdf422bdd2c05ee2657efedde21264a1a566b" - integrity sha512-QR7/A7ZkMS8tZuoftC/jfqNkZLQO779SSW3YuZHP4eXpj3EffGLFcB/Xu9AAZQzLccTiCV+EmUo3ha4mQ9wnlA== + version "1.5.12" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.12.tgz#ee31756eaa2e06f2aa606f170b7ad06dd402b4e4" + integrity sha512-tIhPkdlEoCL1Y+PToq3zRNehUaKp3wBX/sr7aclAWdIWjvqAe/Im/H0SiCM4c1Q8BLPHCdoJTol+ZblflydehA== emittery@^0.13.1: version "0.13.1" @@ -2546,6 +2585,29 @@ fb-watchman@^2.0.0: dependencies: bser "2.1.1" +fetch-mock-jest@^1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/fetch-mock-jest/-/fetch-mock-jest-1.5.1.tgz#0e13df990d286d9239e284f12b279ed509bf53cd" + integrity sha512-+utwzP8C+Pax1GSka3nFXILWMY3Er2L+s090FOgqVNrNCPp0fDqgXnAHAJf12PLHi0z4PhcTaZNTz8e7K3fjqQ== + dependencies: + fetch-mock "^9.11.0" + +fetch-mock@^9.11.0: + version "9.11.0" + resolved "https://registry.yarnpkg.com/fetch-mock/-/fetch-mock-9.11.0.tgz#371c6fb7d45584d2ae4a18ee6824e7ad4b637a3f" + integrity sha512-PG1XUv+x7iag5p/iNHD4/jdpxL9FtVSqRMUQhPab4hVDt80T1MH5ehzVrL2IdXO9Q2iBggArFvPqjUbHFuI58Q== + dependencies: + "@babel/core" "^7.0.0" + "@babel/runtime" "^7.0.0" + core-js "^3.0.0" + debug "^4.1.1" + glob-to-regexp "^0.4.0" + is-subset "^0.1.1" + lodash.isequal "^4.5.0" + path-to-regexp "^2.2.1" + querystring "^0.2.0" + whatwg-url "^6.5.0" + filelist@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/filelist/-/filelist-1.0.4.tgz#f78978a1e944775ff9e62e744424f215e58352b5" @@ -2633,7 +2695,7 @@ get-stream@^6.0.0: resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== -glob-to-regexp@^0.4.1: +glob-to-regexp@^0.4.0, glob-to-regexp@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e" integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw== @@ -2810,6 +2872,11 @@ is-stream@^2.0.0: resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== +is-subset@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-subset/-/is-subset-0.1.1.tgz#8a59117d932de1de00f245fcdd39ce43f1e939a6" + integrity sha512-6Ybun0IkarhmEqxXCNw/C0bna6Zb/TkfUX9UbwJtK6ObwAVCxmAP308WWTHviM/zAqXk05cdhYsUsZeGQh99iw== + isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" @@ -3356,11 +3423,21 @@ locate-path@^5.0.0: dependencies: p-locate "^4.1.0" +lodash.isequal@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" + integrity sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ== + lodash.memoize@4.x: version "4.1.2" resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" integrity sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag== +lodash.sortby@^4.7.0: + version "4.7.0" + resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" + integrity sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA== + lru-cache@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" @@ -3562,6 +3639,11 @@ path-parse@^1.0.7: resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== +path-to-regexp@^2.2.1: + version "2.4.0" + resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-2.4.0.tgz#35ce7f333d5616f1c1e1bfe266c3aba2e5b2e704" + integrity sha512-G6zHoVqC6GGTQkZwF4lkuEyMbVOjoBKAEybQUypI1WTkqinCOrq2x6U2+phkJ1XsEMTy4LjtwPI7HW+NVrRR2w== + picocolors@^1.0.0, picocolors@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.1.tgz#a8ad579b571952f0e5d25892de5445bcfe25aaa1" @@ -3633,6 +3715,11 @@ qs@6.11.2: dependencies: side-channel "^1.0.4" +querystring@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.1.tgz#40d77615bb09d16902a85c3e38aa8b5ed761c2dd" + integrity sha512-wkvS7mL/JMugcup3/rMitHmd9ecIGd2lhFhK9N3UUQ450h66d1r3Y9nvXzQAW1Lq+wyx61k/1pfKS5KuKiyEbg== + querystringify@^2.1.1: version "2.2.0" resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6" @@ -3661,6 +3748,11 @@ readable-stream@^4.5.2: process "^0.11.10" string_decoder "^1.3.0" +regenerator-runtime@^0.14.0: + version "0.14.1" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f" + integrity sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw== + require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" @@ -3931,9 +4023,9 @@ terser-webpack-plugin@^5.3.10: terser "^5.26.0" terser@^5.26.0: - version "5.31.5" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.31.5.tgz#e48b7c65f32d2808e7dad803e4586a0bc3829b87" - integrity sha512-YPmas0L0rE1UyLL/llTWA0SiDOqIcAQYLeUj7cJYzXHlRTAnMSg9pPe4VJ5PlKvTrPQsdVFuiRiwyeNlYgwh2Q== + version "5.31.6" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.31.6.tgz#c63858a0f0703988d0266a82fcbf2d7ba76422b1" + integrity sha512-PQ4DAriWzKj+qgehQ7LK5bQqCFNMmlhjR2PFFLuqGCpuCAauxemVBWwWOxo3UIwWQx8+Pr61Df++r76wDmkQBg== dependencies: "@jridgewell/source-map" "^0.3.3" acorn "^8.8.2" @@ -3976,6 +4068,13 @@ tough-cookie@^4.1.2: universalify "^0.2.0" url-parse "^1.5.3" +tr46@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09" + integrity sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA== + dependencies: + punycode "^2.1.0" + tr46@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/tr46/-/tr46-3.0.0.tgz#555c4e297a950617e8eeddef633c87d4d9d6cbf9" @@ -4039,10 +4138,10 @@ typescript@4.6.4: resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.6.4.tgz#caa78bbc3a59e6a5c510d35703f6a09877ce45e9" integrity sha512-9ia/jWHIEbo49HfjrLGfKbZSuWo9iTMwXO+Ca3pRsSpbsMbc7/IU8NKdCZVRRBafVPGnoJeFL76ZOAA84I9fEg== -undici-types@~6.13.0: - version "6.13.0" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.13.0.tgz#e3e79220ab8c81ed1496b5812471afd7cf075ea5" - integrity sha512-xtFJHudx8S2DSoujjMd1WeWvn7KKWFRESZTMeL1RptAYERu29D6jphMjjY+vn96jvN3kVPDNxU/E13VTaXj6jg== +undici-types@~6.19.2: + version "6.19.8" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.19.8.tgz#35111c9d1437ab83a7cdc0abae2f26d88eda0a02" + integrity sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw== universalify@^0.2.0: version "0.2.0" @@ -4106,9 +4205,9 @@ walker@^1.0.8: makeerror "1.0.12" watchpack@^2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.4.1.tgz#29308f2cac150fa8e4c92f90e0ec954a9fed7fff" - integrity sha512-8wrBCMtVhqcXP2Sup1ctSkga6uc2Bx0IIvKyT7yTFier5AXHooSI+QyQQAtTb7+E0IUCCKyTFmXqdqgum2XWGg== + version "2.4.2" + resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.4.2.tgz#2feeaed67412e7c33184e5a79ca738fbd38564da" + integrity sha512-TnbFSbcOCcDgjZ4piURLCbJ3nJhznVh9kw6F6iokjiFPl8ONxe9A6nMDVXDiNbrSfLILs6vB07F7wLBrwPYzJw== dependencies: glob-to-regexp "^0.4.1" graceful-fs "^4.1.2" @@ -4118,6 +4217,11 @@ webidl-conversions@^3.0.0: resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== +webidl-conversions@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" + integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg== + webidl-conversions@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-7.0.0.tgz#256b4e1882be7debbf01d05f0aa2039778ea080a" @@ -4186,6 +4290,15 @@ whatwg-url@^5.0.0: tr46 "~0.0.3" webidl-conversions "^3.0.0" +whatwg-url@^6.5.0: + version "6.5.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-6.5.0.tgz#f2df02bff176fd65070df74ad5ccbb5a199965a8" + integrity sha512-rhRZRqx/TLJQWUpQ6bmrt2UV4f0HCQ463yQuONJqC6fO2VoEb1pTYddbe59SkYq87aoM5A3bdhMZiUiVws+fzQ== + dependencies: + lodash.sortby "^4.7.0" + tr46 "^1.0.1" + webidl-conversions "^4.0.2" + which@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1"