diff --git a/package.json b/package.json index 3aff745..613def2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@fern-api/sdk", - "version": "0.11.2", + "version": "0.12.0", "private": false, "repository": "https://github.com/fern-api/fern-typescript", "license": "MIT", diff --git a/src/api/resources/snippets/client/Client.ts b/src/api/resources/snippets/client/Client.ts index 0031f4a..60fcd5a 100644 --- a/src/api/resources/snippets/client/Client.ts +++ b/src/api/resources/snippets/client/Client.ts @@ -62,7 +62,7 @@ export class Snippets { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@fern-api/sdk", - "X-Fern-SDK-Version": "0.8.0", + "X-Fern-SDK-Version": "0.12.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -164,7 +164,7 @@ export class Snippets { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@fern-api/sdk", - "X-Fern-SDK-Version": "0.8.0", + "X-Fern-SDK-Version": "0.12.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, diff --git a/src/api/resources/snippets/types/AuthPayload.ts b/src/api/resources/snippets/types/AuthPayload.ts new file mode 100644 index 0000000..7c3b164 --- /dev/null +++ b/src/api/resources/snippets/types/AuthPayload.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Fern from "../../../index"; + +export type AuthPayload = Fern.AuthPayload.Bearer | Fern.AuthPayload.Basic; + +export declare namespace AuthPayload { + interface Bearer extends Fern.BearerTokenAuthPayload { + type: "bearer"; + } + + interface Basic extends Fern.BasicAuthPayload { + type: "basic"; + } +} diff --git a/src/api/resources/snippets/types/BasicAuthPayload.ts b/src/api/resources/snippets/types/BasicAuthPayload.ts new file mode 100644 index 0000000..f92466c --- /dev/null +++ b/src/api/resources/snippets/types/BasicAuthPayload.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface BasicAuthPayload { + username: string; + password: string; +} diff --git a/src/api/resources/snippets/types/BearerTokenAuthPayload.ts b/src/api/resources/snippets/types/BearerTokenAuthPayload.ts new file mode 100644 index 0000000..f6c582a --- /dev/null +++ b/src/api/resources/snippets/types/BearerTokenAuthPayload.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface BearerTokenAuthPayload { + token: string; +} diff --git a/src/api/resources/snippets/types/CustomSnippetPayload.ts b/src/api/resources/snippets/types/CustomSnippetPayload.ts index 3dd96c8..d6a0584 100644 --- a/src/api/resources/snippets/types/CustomSnippetPayload.ts +++ b/src/api/resources/snippets/types/CustomSnippetPayload.ts @@ -9,4 +9,5 @@ export interface CustomSnippetPayload { pathParameters?: Fern.ParameterPayload[]; queryParameters?: Fern.ParameterPayload[]; requestBody?: unknown; + auth?: Fern.AuthPayload; } diff --git a/src/api/resources/snippets/types/index.ts b/src/api/resources/snippets/types/index.ts index 11c9cee..a327f87 100644 --- a/src/api/resources/snippets/types/index.ts +++ b/src/api/resources/snippets/types/index.ts @@ -12,6 +12,9 @@ export * from "./RubySdk"; export * from "./JavaSdk"; export * from "./ParameterPayload"; export * from "./CustomSnippetPayload"; +export * from "./AuthPayload"; +export * from "./BearerTokenAuthPayload"; +export * from "./BasicAuthPayload"; export * from "./SnippetsPage"; export * from "./SnippetsByEndpointMethod"; export * from "./Snippet"; diff --git a/src/api/resources/templates/client/Client.ts b/src/api/resources/templates/client/Client.ts index 12d8856..f47a799 100644 --- a/src/api/resources/templates/client/Client.ts +++ b/src/api/resources/templates/client/Client.ts @@ -99,7 +99,7 @@ export class Templates { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@fern-api/sdk", - "X-Fern-SDK-Version": "0.8.0", + "X-Fern-SDK-Version": "0.12.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -210,7 +210,7 @@ export class Templates { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@fern-api/sdk", - "X-Fern-SDK-Version": "0.8.0", + "X-Fern-SDK-Version": "0.12.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -285,7 +285,7 @@ export class Templates { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@fern-api/sdk", - "X-Fern-SDK-Version": "0.8.0", + "X-Fern-SDK-Version": "0.12.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, diff --git a/src/api/resources/templates/types/ClientInstantiation.ts b/src/api/resources/templates/types/ClientInstantiation.ts new file mode 100644 index 0000000..d6573d2 --- /dev/null +++ b/src/api/resources/templates/types/ClientInstantiation.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Fern from "../../../index"; + +export type ClientInstantiation = string | Fern.Template; diff --git a/src/api/resources/templates/types/PayloadLocation.ts b/src/api/resources/templates/types/PayloadLocation.ts index f9f8a4a..15b2586 100644 --- a/src/api/resources/templates/types/PayloadLocation.ts +++ b/src/api/resources/templates/types/PayloadLocation.ts @@ -7,7 +7,7 @@ * Note that RELATIVE should be used for iterables primarily, so be * able to specify the path to the field relative to the iterated on object */ -export type PayloadLocation = "BODY" | "QUERY" | "PATH" | "HEADERS" | "RELATIVE"; +export type PayloadLocation = "BODY" | "QUERY" | "PATH" | "HEADERS" | "RELATIVE" | "AUTH"; export const PayloadLocation = { Body: "BODY", @@ -15,4 +15,5 @@ export const PayloadLocation = { Path: "PATH", Headers: "HEADERS", Relative: "RELATIVE", + Auth: "AUTH", } as const; diff --git a/src/api/resources/templates/types/SnippetTemplate.ts b/src/api/resources/templates/types/SnippetTemplate.ts index 8c6778d..f256b07 100644 --- a/src/api/resources/templates/types/SnippetTemplate.ts +++ b/src/api/resources/templates/types/SnippetTemplate.ts @@ -5,6 +5,6 @@ import * as Fern from "../../../index"; export interface SnippetTemplate { - clientInstantiation: string; + clientInstantiation: Fern.ClientInstantiation; functionInvocation: Fern.Template; } diff --git a/src/api/resources/templates/types/index.ts b/src/api/resources/templates/types/index.ts index 16b6891..ed6184b 100644 --- a/src/api/resources/templates/types/index.ts +++ b/src/api/resources/templates/types/index.ts @@ -9,6 +9,7 @@ export * from "./TemplateInput"; export * from "./PayloadLocation"; export * from "./PayloadInput"; export * from "./SnippetTemplate"; +export * from "./ClientInstantiation"; export * from "./VersionedSnippetTemplate"; export * from "./SnippetRegistryEntry"; export * from "./EndpointSnippetTemplate"; diff --git a/yarn.lock b/yarn.lock index ed6d4c5..d26fae1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -657,9 +657,9 @@ form-data "^4.0.0" "@types/node@*": - version "20.14.2" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.14.2.tgz#a5f4d2bcb4b6a87bffcaa717718c5a0f208f4a18" - integrity sha512-xyu6WAMVwv6AKFLB+e/7ySZVr/0zLCzOa7rSpq6jNwpqOrUbcACDWC+53d4n2QHOnDou0fbIsg8wZu/sxrnI4Q== + version "20.14.5" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.14.5.tgz#fe35e3022ebe58b8f201580eb24e1fcfc0f2487d" + integrity sha512-aoRR+fJkZT2l0aGOJhuA8frnCSoNX6W7U2mpNq63+BxBIj5BQFt8rHy627kijCmm63ijdSdwvGgpUsU6MBsZZA== dependencies: undici-types "~5.26.4" @@ -714,14 +714,16 @@ acorn-globals@^7.0.0: acorn-walk "^8.0.2" acorn-walk@^8.0.2: - version "8.3.2" - resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.3.2.tgz#7703af9415f1b6db9315d6895503862e231d34aa" - integrity sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A== + version "8.3.3" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.3.3.tgz#9caeac29eefaa0c41e3d4c65137de4d6f34df43e" + integrity sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw== + dependencies: + acorn "^8.11.0" -acorn@^8.1.0, acorn@^8.8.1: - version "8.11.3" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.3.tgz#71e0b14e13a4ec160724b38fb7b0f233b1b81d7a" - integrity sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg== +acorn@^8.1.0, acorn@^8.11.0, acorn@^8.8.1: + version "8.12.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.12.0.tgz#1627bfa2e058148036133b8d9b51a700663c294c" + integrity sha512-RTvkC4w+KNXrM39/lWCUaG0IbRkWdCv7W/IOW9oU6SawyxulvkQy5HQPVTKxEjczcUvapcrw3cFx/60VN/NRNw== agent-base@6: version "6.0.2" @@ -862,14 +864,14 @@ braces@^3.0.3: fill-range "^7.1.1" browserslist@^4.22.2: - version "4.23.0" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.23.0.tgz#8f3acc2bbe73af7213399430890f86c63a5674ab" - integrity sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ== + version "4.23.1" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.23.1.tgz#ce4af0534b3d37db5c1a4ca98b9080f985041e96" + integrity sha512-TUfofFo/KsK/bWZ9TWQ5O26tsWW4Uhmt8IYklbnUa70udB6P2wA7w7o4PY4muaEPBQaAX+CEnmmIA41NVHtPVw== dependencies: - caniuse-lite "^1.0.30001587" - electron-to-chromium "^1.4.668" + caniuse-lite "^1.0.30001629" + electron-to-chromium "^1.4.796" node-releases "^2.0.14" - update-browserslist-db "^1.0.13" + update-browserslist-db "^1.0.16" bs-logger@0.x: version "0.2.6" @@ -916,10 +918,10 @@ camelcase@^6.2.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== -caniuse-lite@^1.0.30001587: - version "1.0.30001628" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001628.tgz#90b6cd85ddc2e9f831de0225f4ca5a130c8d8222" - integrity sha512-S3BnR4Kh26TBxbi5t5kpbcUlLJb9lhtDXISDPwOfI+JoC+ik0QksvkZtUVyikw3hjnkgkMPSJ8oIM9yMm9vflA== +caniuse-lite@^1.0.30001629: + version "1.0.30001636" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001636.tgz#b15f52d2bdb95fad32c2f53c0b68032b85188a78" + integrity sha512-bMg2vmr8XBsbL6Lr0UHXy/21m84FTxDLWn2FSqMd5PrlbMxwJlQnC2YWYxVgp66PZE+BBNF2jYQUBKCo1FDeZg== chalk@^2.4.2: version "2.4.2" @@ -1114,10 +1116,10 @@ domexception@^4.0.0: dependencies: webidl-conversions "^7.0.0" -electron-to-chromium@^1.4.668: - version "1.4.790" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.790.tgz#2a3a5509593745c5d65d8acd66b308f2a25da041" - integrity sha512-eVGeQxpaBYbomDBa/Mehrs28MdvCXfJmEFzaMFsv8jH/MJDLIylJN81eTJ5kvx7B7p18OiPK0BkC06lydEy63A== +electron-to-chromium@^1.4.796: + version "1.4.806" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.806.tgz#2cb046631cbabceb26fc72be68d273fa183e36bc" + integrity sha512-nkoEX2QIB8kwCOtvtgwhXWy2IHVcOLQZu9Qo36uaGB835mdX/h8uLRlosL6QIhLVUnAiicXRW00PwaPZC74Nrg== emittery@^0.13.1: version "0.13.1" @@ -2560,7 +2562,7 @@ universalify@^0.2.0: resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.2.0.tgz#6451760566fa857534745ab1dde952d1b1761be0" integrity sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg== -update-browserslist-db@^1.0.13: +update-browserslist-db@^1.0.16: version "1.0.16" resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.16.tgz#f6d489ed90fb2f07d67784eb3f53d7891f736356" integrity sha512-KVbTxlBYlckhF5wgfyZXTWnMn7MMZjMu9XG8bPlliUOP9ThaF4QnhP8qrjrH7DRzHfSk0oQv1wToW+iA5GajEQ== @@ -2672,9 +2674,9 @@ write-file-atomic@^4.0.2: signal-exit "^3.0.7" ws@^8.11.0: - version "8.17.0" - resolved "https://registry.yarnpkg.com/ws/-/ws-8.17.0.tgz#d145d18eca2ed25aaf791a183903f7be5e295fea" - integrity sha512-uJq6108EgZMAl20KagGkzCKfMEjxmKvZHG7Tlq0Z6nOky7YF7aq4mOx6xK8TJ/i1LeK4Qus7INktacctDgY8Ow== + version "8.17.1" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.17.1.tgz#9293da530bb548febc95371d90f9c878727d919b" + integrity sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ== xml-name-validator@^4.0.0: version "4.0.0"