Skip to content

Commit

Permalink
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.326.3
Browse files Browse the repository at this point in the history
  • Loading branch information
speakeasybot committed Jul 7, 2024
1 parent f8d9a23 commit af433fa
Show file tree
Hide file tree
Showing 18 changed files with 339 additions and 375 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/esm
/dist
/.tshy
/.tshy-*
/models
/models/errors
/types
Expand Down
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@

/.eslintrc.js
/cjs
/.tshy
/.tshy-*
10 changes: 5 additions & 5 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ id: 0115721b-c5d5-4598-9754-02eb24f100a8
management:
docChecksum: 108d5939aa1f55ecaef7b1e04e7745b6
docVersion: 1.0.0
speakeasyVersion: 1.309.1
generationVersion: 2.347.4
releaseVersion: 0.9.1
configChecksum: 3144aadae02ffcdbc2bcf9d1a9c2c8c7
speakeasyVersion: 1.326.3
generationVersion: 2.359.6
releaseVersion: 0.10.0
configChecksum: df1796ba257da0b8304dc3fd01342587
repoURL: https://github.com/speakeasy-sdks/nango-typescript-sdk.git
repoSubDirectory: .
installationURL: https://github.com/speakeasy-sdks/nango-typescript-sdk
published: true
features:
typescript:
additionalDependencies: 0.1.0
core: 3.10.0
core: 3.11.3
flattening: 2.81.1
globalSecurityCallbacks: 0.1.0
globalServerURLs: 2.82.4
Expand Down
13 changes: 7 additions & 6 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
speakeasyVersion: 1.309.1
speakeasyVersion: 1.326.3
sources:
my-source:
sourceNamespace: my-source
sourceRevisionDigest: sha256:28f8ad416a8c616c03f380901b4f45883c023ec04e4d65ae5a811a8168c45108
sourceBlobDigest: sha256:efa987571d8346ba36b22ab4746cdde4b9470314c134765f1b925c8d4bf07dae
sourceRevisionDigest: sha256:df54796f529635fb568ba72c74aaaef6cd6648b26e220d76c073c0fa406f7720
sourceBlobDigest: sha256:ee8fa2cba530915e9b36f27a1b286a0b32b485e920a549ca7a809b1fb5fe68a5
tags:
- latest
- main
targets:
nango-ts:
source: my-source
sourceNamespace: my-source
sourceRevisionDigest: sha256:28f8ad416a8c616c03f380901b4f45883c023ec04e4d65ae5a811a8168c45108
sourceBlobDigest: sha256:efa987571d8346ba36b22ab4746cdde4b9470314c134765f1b925c8d4bf07dae
outLocation: /Users/sagar/go/src/Nango-sample-sdk
sourceRevisionDigest: sha256:df54796f529635fb568ba72c74aaaef6cd6648b26e220d76c073c0fa406f7720
sourceBlobDigest: sha256:ee8fa2cba530915e9b36f27a1b286a0b32b485e920a549ca7a809b1fb5fe68a5
outLocation: /github/workspace/repo
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
Expand Down
10 changes: 9 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,12 @@ Based on:
### Generated
- [typescript v0.6.0] .
### Releases
- [NPM v0.6.0] https://www.npmjs.com/package/@simplesagar92/nango/v/0.6.0 - .
- [NPM v0.6.0] https://www.npmjs.com/package/@simplesagar92/nango/v/0.6.0 - .

## 2024-07-07 00:25:16
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.326.3 (2.359.6) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v0.10.0] .
3 changes: 2 additions & 1 deletion gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ generation:
auth:
oAuth2ClientCredentialsEnabled: false
typescript:
version: 0.9.1
version: 0.10.0
additionalDependencies:
dependencies: {}
devDependencies: {}
Expand All @@ -33,6 +33,7 @@ typescript:
inputModelSuffix: input
maxMethodParams: 4
methodArguments: require-security-and-request
moduleFormat: commonjs
outputModelSuffix: output
packageName: '@speakeasy-sdks/nango'
responseFormat: flat
Expand Down
2 changes: 1 addition & 1 deletion jsr.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{
"name": "@speakeasy-sdks/nango",
"version": "0.9.1",
"version": "0.10.0",
"exports": {
".": "./src/index.ts",
"./models/errors": "./src/models/errors/index.ts",
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@speakeasy-sdks/nango",
"version": "0.9.1",
"author": "Speakeasy",
"version": "0.10.0",
"author": "Speakeasy",
"main": "./index.js",
"sideEffects": false,
"repository": {
Expand Down
6 changes: 3 additions & 3 deletions src/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
export const SDK_METADATA = {
language: "typescript",
openapiDocVersion: "1.0.0",
sdkVersion: "0.9.1",
genVersion: "2.347.4",
userAgent: "speakeasy-sdk/typescript 0.9.1 2.347.4 1.0.0 @speakeasy-sdks/nango",
sdkVersion: "0.10.0",
genVersion: "2.359.6",
userAgent: "speakeasy-sdk/typescript 0.10.0 2.359.6 1.0.0 @speakeasy-sdks/nango",
} as const;
19 changes: 19 additions & 0 deletions src/lib/sdks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { SecurityState, resolveSecurity } from "./security.js";
import { pathToFunc } from "./url.js";
import { encodeForm } from "./encodings.js";
import { stringToBase64 } from "./base64.js";
import { SDK_METADATA } from "./config.js";
import { SDKHooks } from "../hooks/hooks.js";
import { HookContext } from "../hooks/types.js";

Expand All @@ -22,8 +23,20 @@ type RequestConfig = {
body?: RequestInit["body"];
headers?: HeadersInit;
security?: SecurityState | null;
uaHeader?: string;
};

const gt: unknown = typeof globalThis === "undefined" ? null : globalThis;
const webWorkerLike =
typeof gt === "object" &&
gt != null &&
"importScripts" in gt &&
typeof gt["importScripts"] === "function";
const isBrowserLike =
webWorkerLike ||
(typeof navigator !== "undefined" && "serviceWorker" in navigator) ||
typeof window === "object";

export class ClientSDK {
private readonly client: HTTPClient;
protected readonly baseURL: URL | null;
Expand Down Expand Up @@ -100,6 +113,12 @@ export class ClientSDK {
headers.set(k, v);
}

// Only set user agent header in non-browser-like environments since CORS
// policy disallows setting it in browsers e.g. Chrome throws an error.
if (!isBrowserLike) {
headers.set(conf.uaHeader ?? "user-agent", SDK_METADATA.userAgent);
}

const input = this.hooks$.beforeCreateRequest(context, {
url: reqURL,
options: {
Expand Down
33 changes: 14 additions & 19 deletions src/sdk/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

import { SDKHooks } from "../hooks/hooks.js";
import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js";
import { SDKOptions, serverURLFromOptions } from "../lib/config.js";
import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js";
import { HTTPClient } from "../lib/http.js";
import * as schemas$ from "../lib/schemas.js";
Expand Down Expand Up @@ -56,10 +56,6 @@ export class Actions extends ClientSDK {
providerConfigKey: providerConfigKey,
createActionTriggerRequest: createActionTriggerRequest,
};
const headers$ = new Headers();
headers$.set("user-agent", SDK_METADATA.userAgent);
headers$.set("Content-Type", "application/json");
headers$.set("Accept", "application/json");

const payload$ = schemas$.parse(
input$,
Expand All @@ -72,34 +68,33 @@ export class Actions extends ClientSDK {

const query$ = "";

headers$.set(
"Connection-Id",
encodeSimple$("Connection-Id", payload$["Connection-Id"], {
const headers$ = new Headers({
"Content-Type": "application/json",
Accept: "application/json",
"Connection-Id": encodeSimple$("Connection-Id", payload$["Connection-Id"], {
explode: false,
charEncoding: "none",
})
);
headers$.set(
"Provider-Config-Key",
encodeSimple$("Provider-Config-Key", payload$["Provider-Config-Key"], {
explode: false,
charEncoding: "none",
})
);
}),
"Provider-Config-Key": encodeSimple$(
"Provider-Config-Key",
payload$["Provider-Config-Key"],
{ explode: false, charEncoding: "none" }
),
});

const context = {
operationID: "createActionTrigger",
oAuth2Scopes: [],
securitySource: null,
};

const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] };
const request$ = this.createRequest$(
context,
{ method: "POST", path: path$, headers: headers$, query: query$, body: body$ },
options
);

const response = await this.do$(request$, doOptions);
const response = await this.do$(request$, { context, errorCodes: ["400", "4XX", "5XX"] });

const responseFields$ = {
HttpMeta: { Response: response, Request: request$ },
Expand Down
Loading

0 comments on commit af433fa

Please sign in to comment.