Skip to content

Commit f8756c9

Browse files
SK-2048: Beta Release for Node SDK v2 with Detect public interfaces (#209)
* SK-2048: Implement public interface for detect
1 parent 3f1dd87 commit f8756c9

143 files changed

Lines changed: 6608 additions & 165 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

package-lock.json

Lines changed: 50 additions & 39 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "skyflow-node",
3-
"version": "2.0.0-beta.4",
3+
"version": "2.0.0-beta.4-dev.4dcca11",
44
"description": "Skyflow SDK for Node.js",
55
"main": "./lib/index.js",
66
"module": "./lib/index.js",
@@ -32,37 +32,38 @@
3232
"tokenization"
3333
],
3434
"dependencies": {
35+
"@babel/runtime": "^7.27.1",
3536
"dotenv": "^16.4.5",
36-
"jsonwebtoken": "^9.0.2",
37-
"jwt-decode": "^2.2.0",
38-
"url-join": "4.0.1",
3937
"form-data": "^4.0.0",
38+
"form-data-encoder": "^4.0.2",
4039
"formdata-node": "^6.0.3",
40+
"js-base64": "3.7.7",
41+
"jsonwebtoken": "^9.0.2",
42+
"jwt-decode": "^2.2.0",
4143
"node-fetch": "^2.7.0",
4244
"qs": "^6.13.1",
4345
"readable-stream": "^4.5.2",
44-
"js-base64": "3.7.7",
45-
"form-data-encoder": "^4.0.2"
46+
"url-join": "4.0.1"
4647
},
4748
"devDependencies": {
4849
"@babel/plugin-proposal-decorators": "^7.25.7",
4950
"@babel/plugin-transform-object-assign": "^7.25.7",
5051
"@babel/plugin-transform-runtime": "^7.25.7",
5152
"@babel/preset-env": "^7.25.8",
5253
"@babel/preset-typescript": "^7.25.7",
54+
"@types/jest": "^29.5.14",
5355
"@types/jsonwebtoken": "^9.0.6",
5456
"@types/node": "^18.19.70",
55-
"jest": "^29.7.0",
56-
"ts-jest": "^29.1.1",
57-
"typescript": "~5.7.2",
58-
"@types/url-join": "4.0.1",
59-
"@types/qs": "^6.9.17",
6057
"@types/node-fetch": "^2.6.12",
58+
"@types/qs": "^6.9.17",
6159
"@types/readable-stream": "^4.0.18",
62-
"webpack": "^5.97.1",
63-
"ts-loader": "^9.5.1",
64-
"@types/jest": "^29.5.14",
60+
"@types/url-join": "4.0.1",
61+
"jest": "^29.7.0",
6562
"jest-environment-jsdom": "^29.7.0",
66-
"prettier": "^3.4.2"
63+
"prettier": "^3.4.2",
64+
"ts-jest": "^29.1.1",
65+
"ts-loader": "^9.5.1",
66+
"typescript": "~5.7.2",
67+
"webpack": "^5.97.1"
6768
}
6869
}

src/ _generated_/rest/Client.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ import { Records } from "./api/resources/records/client/Client";
1010
import { Tokens } from "./api/resources/tokens/client/Client";
1111
import { Query } from "./api/resources/query/client/Client";
1212
import { Authentication } from "./api/resources/authentication/client/Client";
13+
import { Deprecated } from "./api/resources/deprecated/client/Client";
14+
import { Strings } from "./api/resources/strings/client/Client";
15+
import { Files } from "./api/resources/files/client/Client";
1316

1417
export declare namespace SkyflowClient {
1518
export interface Options {
@@ -39,6 +42,9 @@ export class SkyflowClient {
3942
protected _tokens: Tokens | undefined;
4043
protected _query: Query | undefined;
4144
protected _authentication: Authentication | undefined;
45+
protected _deprecated: Deprecated | undefined;
46+
protected _strings: Strings | undefined;
47+
protected _files: Files | undefined;
4248

4349
constructor(protected readonly _options: SkyflowClient.Options) {}
4450

@@ -65,4 +71,16 @@ export class SkyflowClient {
6571
public get authentication(): Authentication {
6672
return (this._authentication ??= new Authentication(this._options));
6773
}
74+
75+
public get deprecated(): Deprecated {
76+
return (this._deprecated ??= new Deprecated(this._options));
77+
}
78+
79+
public get strings(): Strings {
80+
return (this._strings ??= new Strings(this._options));
81+
}
82+
83+
public get files(): Files {
84+
return (this._files ??= new Files(this._options));
85+
}
6886
}

src/ _generated_/rest/api/errors/BadRequestError.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import * as errors from "../../errors/index";
66
import * as core from "../../core";
77

88
export class BadRequestError extends errors.SkyflowError {
9-
constructor(body: Record<string, unknown>, rawResponse?: core.RawResponse) {
9+
constructor(body?: unknown, rawResponse?: core.RawResponse) {
1010
super({
1111
message: "BadRequestError",
1212
statusCode: 400,
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* This file was auto-generated by Fern from our API Definition.
3+
*/
4+
5+
import * as errors from "../../errors/index";
6+
import * as Skyflow from "../index";
7+
import * as core from "../../core";
8+
9+
export class InternalServerError extends errors.SkyflowError {
10+
constructor(body: Skyflow.ErrorResponse, rawResponse?: core.RawResponse) {
11+
super({
12+
message: "InternalServerError",
13+
statusCode: 500,
14+
body: body,
15+
rawResponse: rawResponse,
16+
});
17+
Object.setPrototypeOf(this, InternalServerError.prototype);
18+
}
19+
}

src/ _generated_/rest/api/errors/NotFoundError.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import * as errors from "../../errors/index";
66
import * as core from "../../core";
77

88
export class NotFoundError extends errors.SkyflowError {
9-
constructor(body: Record<string, unknown>, rawResponse?: core.RawResponse) {
9+
constructor(body?: unknown, rawResponse?: core.RawResponse) {
1010
super({
1111
message: "NotFoundError",
1212
statusCode: 404,

src/ _generated_/rest/api/errors/UnauthorizedError.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import * as errors from "../../errors/index";
66
import * as core from "../../core";
77

88
export class UnauthorizedError extends errors.SkyflowError {
9-
constructor(body: Record<string, unknown>, rawResponse?: core.RawResponse) {
9+
constructor(body?: unknown, rawResponse?: core.RawResponse) {
1010
super({
1111
message: "UnauthorizedError",
1212
statusCode: 401,
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export * from "./NotFoundError";
22
export * from "./BadRequestError";
33
export * from "./UnauthorizedError";
4+
export * from "./InternalServerError";

src/ _generated_/rest/api/resources/audit/client/Client.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,7 @@ export class Audit {
253253
if (_response.error.reason === "status-code") {
254254
switch (_response.error.statusCode) {
255255
case 404:
256-
throw new Skyflow.NotFoundError(
257-
_response.error.body as Record<string, unknown>,
258-
_response.rawResponse,
259-
);
256+
throw new Skyflow.NotFoundError(_response.error.body as unknown, _response.rawResponse);
260257
default:
261258
throw new errors.SkyflowError({
262259
statusCode: _response.error.statusCode,

src/ _generated_/rest/api/resources/authentication/client/Client.ts

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -91,20 +91,11 @@ export class Authentication {
9191
if (_response.error.reason === "status-code") {
9292
switch (_response.error.statusCode) {
9393
case 400:
94-
throw new Skyflow.BadRequestError(
95-
_response.error.body as Record<string, unknown>,
96-
_response.rawResponse,
97-
);
94+
throw new Skyflow.BadRequestError(_response.error.body as unknown, _response.rawResponse);
9895
case 401:
99-
throw new Skyflow.UnauthorizedError(
100-
_response.error.body as Record<string, unknown>,
101-
_response.rawResponse,
102-
);
96+
throw new Skyflow.UnauthorizedError(_response.error.body as unknown, _response.rawResponse);
10397
case 404:
104-
throw new Skyflow.NotFoundError(
105-
_response.error.body as Record<string, unknown>,
106-
_response.rawResponse,
107-
);
98+
throw new Skyflow.NotFoundError(_response.error.body as unknown, _response.rawResponse);
10899
default:
109100
throw new errors.SkyflowError({
110101
statusCode: _response.error.statusCode,

0 commit comments

Comments
 (0)