diffio 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +204 -0
  3. package/dist/BaseClient.d.ts +26 -0
  4. package/dist/BaseClient.js +17 -0
  5. package/dist/Client.d.ts +109 -0
  6. package/dist/Client.js +689 -0
  7. package/dist/api/index.d.ts +2 -0
  8. package/dist/api/index.js +18 -0
  9. package/dist/api/resources/audioIsolation/client/Client.d.ts +41 -0
  10. package/dist/api/resources/audioIsolation/client/Client.js +32 -0
  11. package/dist/api/resources/generations/client/Client.d.ts +47 -0
  12. package/dist/api/resources/generations/client/Client.js +36 -0
  13. package/dist/api/resources/index.d.ts +4 -0
  14. package/dist/api/resources/index.js +11 -0
  15. package/dist/api/resources/projects/client/Client.d.ts +15 -0
  16. package/dist/api/resources/projects/client/Client.js +15 -0
  17. package/dist/api/resources/webhooks/client/Client.d.ts +20 -0
  18. package/dist/api/resources/webhooks/client/Client.js +15 -0
  19. package/dist/api/serialization.d.ts +14 -0
  20. package/dist/api/serialization.js +138 -0
  21. package/dist/api/types.d.ts +122 -0
  22. package/dist/api/types.js +2 -0
  23. package/dist/core/headers.d.ts +6 -0
  24. package/dist/core/headers.js +44 -0
  25. package/dist/core/retry.d.ts +7 -0
  26. package/dist/core/retry.js +31 -0
  27. package/dist/core/supplier.d.ts +4 -0
  28. package/dist/core/supplier.js +14 -0
  29. package/dist/core/url.d.ts +1 -0
  30. package/dist/core/url.js +14 -0
  31. package/dist/errors/index.d.ts +14 -0
  32. package/dist/errors/index.js +26 -0
  33. package/dist/index.d.ts +4 -0
  34. package/dist/index.js +45 -0
  35. package/dist/version.d.ts +1 -0
  36. package/dist/version.js +4 -0
  37. package/package.json +36 -0
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.join = join;
4
+ function join(base, ...paths) {
5
+ const trimmedBase = base.replace(/\/+$/, "");
6
+ const trimmedPaths = paths
7
+ .filter(Boolean)
8
+ .map((part) => part.replace(/^\/+/, ""))
9
+ .filter((part) => part.length > 0);
10
+ if (trimmedPaths.length === 0) {
11
+ return trimmedBase;
12
+ }
13
+ return [trimmedBase, ...trimmedPaths].join("/");
14
+ }
@@ -0,0 +1,14 @@
1
+ export declare class DiffioError extends Error {
2
+ constructor(message: string);
3
+ }
4
+ export declare class DiffioApiError extends DiffioError {
5
+ statusCode?: number;
6
+ responseBody?: unknown;
7
+ constructor(message: string, options?: {
8
+ statusCode?: number;
9
+ responseBody?: unknown;
10
+ });
11
+ }
12
+ export declare class DiffioTimeoutError extends DiffioError {
13
+ constructor(message: string);
14
+ }
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DiffioTimeoutError = exports.DiffioApiError = exports.DiffioError = void 0;
4
+ class DiffioError extends Error {
5
+ constructor(message) {
6
+ super(message);
7
+ this.name = "DiffioError";
8
+ }
9
+ }
10
+ exports.DiffioError = DiffioError;
11
+ class DiffioApiError extends DiffioError {
12
+ constructor(message, options) {
13
+ super(message);
14
+ this.name = "DiffioApiError";
15
+ this.statusCode = options?.statusCode;
16
+ this.responseBody = options?.responseBody;
17
+ }
18
+ }
19
+ exports.DiffioApiError = DiffioApiError;
20
+ class DiffioTimeoutError extends DiffioError {
21
+ constructor(message) {
22
+ super(message);
23
+ this.name = "DiffioTimeoutError";
24
+ }
25
+ }
26
+ exports.DiffioTimeoutError = DiffioTimeoutError;
@@ -0,0 +1,4 @@
1
+ export { DiffioClient } from "./Client";
2
+ export * as Diffio from "./api";
3
+ export * from "./errors";
4
+ export { DIFFIO_SDK_VERSION } from "./version";
package/dist/index.js ADDED
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
36
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.DIFFIO_SDK_VERSION = exports.Diffio = exports.DiffioClient = void 0;
40
+ var Client_1 = require("./Client");
41
+ Object.defineProperty(exports, "DiffioClient", { enumerable: true, get: function () { return Client_1.DiffioClient; } });
42
+ exports.Diffio = __importStar(require("./api"));
43
+ __exportStar(require("./errors"), exports);
44
+ var version_1 = require("./version");
45
+ Object.defineProperty(exports, "DIFFIO_SDK_VERSION", { enumerable: true, get: function () { return version_1.DIFFIO_SDK_VERSION; } });
@@ -0,0 +1 @@
1
+ export declare const DIFFIO_SDK_VERSION = "0.1.0";
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DIFFIO_SDK_VERSION = void 0;
4
+ exports.DIFFIO_SDK_VERSION = "0.1.0";
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "diffio",
3
+ "version": "0.1.0",
4
+ "description": "Diffio API client for Node.js",
5
+ "license": "MIT",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "files": [
9
+ "dist",
10
+ "LICENSE",
11
+ "README.md"
12
+ ],
13
+ "scripts": {
14
+ "build": "tsc -p tsconfig.json",
15
+ "prepublishOnly": "npm run build",
16
+ "test": "jest --config jest.config.mjs",
17
+ "test:unit": "jest --selectProjects unit",
18
+ "test:wire": "jest --selectProjects wire"
19
+ },
20
+ "dependencies": {
21
+ "mime-types": "^2.1.35"
22
+ },
23
+ "devDependencies": {
24
+ "@types/jest": "^29.5.14",
25
+ "@types/mime-types": "^2.1.4",
26
+ "@types/node": "^18.19.70",
27
+ "jest": "^29.7.0",
28
+ "msw": "^2.11.2",
29
+ "ts-jest": "^29.2.6",
30
+ "typescript": "~5.7.2"
31
+ },
32
+ "engines": {
33
+ "node": ">=18.0.0"
34
+ },
35
+ "sideEffects": false
36
+ }