@paid-ai/paid-node 0.3.0 → 0.4.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.
- package/dist/cjs/Client.js +2 -2
- package/dist/cjs/api/errors/BadRequestError.d.ts +9 -0
- package/dist/cjs/api/errors/BadRequestError.js +52 -0
- package/dist/cjs/api/errors/NotFoundError.d.ts +9 -0
- package/dist/cjs/api/errors/NotFoundError.js +52 -0
- package/dist/cjs/api/errors/index.d.ts +2 -0
- package/dist/cjs/api/errors/index.js +2 -0
- package/dist/cjs/api/types/Signal.d.ts +2 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/wrapper/BatchUsage.js +3 -1
- package/dist/esm/Client.mjs +2 -2
- package/dist/esm/api/errors/BadRequestError.d.mts +9 -0
- package/dist/esm/api/errors/BadRequestError.mjs +15 -0
- package/dist/esm/api/errors/NotFoundError.d.mts +9 -0
- package/dist/esm/api/errors/NotFoundError.mjs +15 -0
- package/dist/esm/api/errors/index.d.mts +2 -0
- package/dist/esm/api/errors/index.mjs +2 -0
- package/dist/esm/api/types/Signal.d.mts +2 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/dist/esm/wrapper/BatchUsage.mjs +3 -1
- package/package.json +5 -5
package/dist/cjs/Client.js
CHANGED
|
@@ -60,8 +60,8 @@ class PaidClient {
|
|
|
60
60
|
this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
|
|
61
61
|
"X-Fern-Language": "JavaScript",
|
|
62
62
|
"X-Fern-SDK-Name": "@paid-ai/paid-node",
|
|
63
|
-
"X-Fern-SDK-Version": "0.
|
|
64
|
-
"User-Agent": "@paid-ai/paid-node/0.
|
|
63
|
+
"X-Fern-SDK-Version": "0.4.0",
|
|
64
|
+
"User-Agent": "@paid-ai/paid-node/0.4.0",
|
|
65
65
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
66
66
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
67
67
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as errors from "../../errors/index.js";
|
|
5
|
+
import * as Paid from "../index.js";
|
|
6
|
+
import * as core from "../../core/index.js";
|
|
7
|
+
export declare class BadRequestError extends errors.PaidError {
|
|
8
|
+
constructor(body: Paid.Error_, rawResponse?: core.RawResponse);
|
|
9
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.BadRequestError = void 0;
|
|
40
|
+
const errors = __importStar(require("../../errors/index.js"));
|
|
41
|
+
class BadRequestError extends errors.PaidError {
|
|
42
|
+
constructor(body, rawResponse) {
|
|
43
|
+
super({
|
|
44
|
+
message: "BadRequestError",
|
|
45
|
+
statusCode: 400,
|
|
46
|
+
body: body,
|
|
47
|
+
rawResponse: rawResponse,
|
|
48
|
+
});
|
|
49
|
+
Object.setPrototypeOf(this, BadRequestError.prototype);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.BadRequestError = BadRequestError;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as errors from "../../errors/index.js";
|
|
5
|
+
import * as Paid from "../index.js";
|
|
6
|
+
import * as core from "../../core/index.js";
|
|
7
|
+
export declare class NotFoundError extends errors.PaidError {
|
|
8
|
+
constructor(body: Paid.Error_, rawResponse?: core.RawResponse);
|
|
9
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.NotFoundError = void 0;
|
|
40
|
+
const errors = __importStar(require("../../errors/index.js"));
|
|
41
|
+
class NotFoundError extends errors.PaidError {
|
|
42
|
+
constructor(body, rawResponse) {
|
|
43
|
+
super({
|
|
44
|
+
message: "NotFoundError",
|
|
45
|
+
statusCode: 404,
|
|
46
|
+
body: body,
|
|
47
|
+
rawResponse: rawResponse,
|
|
48
|
+
});
|
|
49
|
+
Object.setPrototypeOf(this, NotFoundError.prototype);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.NotFoundError = NotFoundError;
|
|
@@ -15,3 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./ForbiddenError.js"), exports);
|
|
18
|
+
__exportStar(require("./BadRequestError.js"), exports);
|
|
19
|
+
__exportStar(require("./NotFoundError.js"), exports);
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.
|
|
1
|
+
export declare const SDK_VERSION = "0.4.0";
|
package/dist/cjs/version.js
CHANGED
|
@@ -42,7 +42,9 @@ class Usage extends Client_js_1.Usage {
|
|
|
42
42
|
this.signals = [];
|
|
43
43
|
}
|
|
44
44
|
flush(requestOptions) {
|
|
45
|
-
|
|
45
|
+
const response = this.recordBulk({ signals: this.signals }, requestOptions);
|
|
46
|
+
this.signals = [];
|
|
47
|
+
return response;
|
|
46
48
|
}
|
|
47
49
|
record(signal = {}, requestOptions) {
|
|
48
50
|
if (!this.signals) {
|
package/dist/esm/Client.mjs
CHANGED
|
@@ -24,8 +24,8 @@ export class PaidClient {
|
|
|
24
24
|
this._options = Object.assign(Object.assign({}, _options), { headers: mergeHeaders({
|
|
25
25
|
"X-Fern-Language": "JavaScript",
|
|
26
26
|
"X-Fern-SDK-Name": "@paid-ai/paid-node",
|
|
27
|
-
"X-Fern-SDK-Version": "0.
|
|
28
|
-
"User-Agent": "@paid-ai/paid-node/0.
|
|
27
|
+
"X-Fern-SDK-Version": "0.4.0",
|
|
28
|
+
"User-Agent": "@paid-ai/paid-node/0.4.0",
|
|
29
29
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
30
30
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
31
31
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as errors from "../../errors/index.mjs";
|
|
5
|
+
import * as Paid from "../index.mjs";
|
|
6
|
+
import * as core from "../../core/index.mjs";
|
|
7
|
+
export declare class BadRequestError extends errors.PaidError {
|
|
8
|
+
constructor(body: Paid.Error_, rawResponse?: core.RawResponse);
|
|
9
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as errors from "../../errors/index.mjs";
|
|
5
|
+
export class BadRequestError extends errors.PaidError {
|
|
6
|
+
constructor(body, rawResponse) {
|
|
7
|
+
super({
|
|
8
|
+
message: "BadRequestError",
|
|
9
|
+
statusCode: 400,
|
|
10
|
+
body: body,
|
|
11
|
+
rawResponse: rawResponse,
|
|
12
|
+
});
|
|
13
|
+
Object.setPrototypeOf(this, BadRequestError.prototype);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as errors from "../../errors/index.mjs";
|
|
5
|
+
import * as Paid from "../index.mjs";
|
|
6
|
+
import * as core from "../../core/index.mjs";
|
|
7
|
+
export declare class NotFoundError extends errors.PaidError {
|
|
8
|
+
constructor(body: Paid.Error_, rawResponse?: core.RawResponse);
|
|
9
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as errors from "../../errors/index.mjs";
|
|
5
|
+
export class NotFoundError extends errors.PaidError {
|
|
6
|
+
constructor(body, rawResponse) {
|
|
7
|
+
super({
|
|
8
|
+
message: "NotFoundError",
|
|
9
|
+
statusCode: 404,
|
|
10
|
+
body: body,
|
|
11
|
+
rawResponse: rawResponse,
|
|
12
|
+
});
|
|
13
|
+
Object.setPrototypeOf(this, NotFoundError.prototype);
|
|
14
|
+
}
|
|
15
|
+
}
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.
|
|
1
|
+
export declare const SDK_VERSION = "0.4.0";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.
|
|
1
|
+
export const SDK_VERSION = "0.4.0";
|
|
@@ -6,7 +6,9 @@ export class Usage extends UsageClient {
|
|
|
6
6
|
this.signals = [];
|
|
7
7
|
}
|
|
8
8
|
flush(requestOptions) {
|
|
9
|
-
|
|
9
|
+
const response = this.recordBulk({ signals: this.signals }, requestOptions);
|
|
10
|
+
this.signals = [];
|
|
11
|
+
return response;
|
|
10
12
|
}
|
|
11
13
|
record(signal = {}, requestOptions) {
|
|
12
14
|
if (!this.signals) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paid-ai/paid-node",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": "https://github.com/paid-ai/paid-node",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -110,11 +110,11 @@
|
|
|
110
110
|
},
|
|
111
111
|
"peerDependencies": {
|
|
112
112
|
"@ai-sdk/openai": ">=1.0.0",
|
|
113
|
-
"@anthropic-ai/sdk": ">=0.
|
|
113
|
+
"@anthropic-ai/sdk": ">=0.36.3",
|
|
114
114
|
"@langchain/core": ">=0.3.0",
|
|
115
115
|
"@mistralai/mistralai": ">=1.0.0",
|
|
116
116
|
"ai": ">=5.0.0",
|
|
117
|
-
"openai": ">=
|
|
117
|
+
"openai": ">=4.85.4"
|
|
118
118
|
},
|
|
119
119
|
"peerDependenciesMeta": {
|
|
120
120
|
"@ai-sdk/openai": {
|
|
@@ -153,11 +153,11 @@
|
|
|
153
153
|
"prettier": "^3.4.2",
|
|
154
154
|
"typescript": "~5.7.2",
|
|
155
155
|
"@ai-sdk/openai": ">=1.0.0",
|
|
156
|
-
"@anthropic-ai/sdk": ">=0.
|
|
156
|
+
"@anthropic-ai/sdk": ">=0.36.3",
|
|
157
157
|
"@langchain/core": ">=0.3.0",
|
|
158
158
|
"@mistralai/mistralai": ">=1.0.0",
|
|
159
159
|
"ai": ">=5.0.0",
|
|
160
|
-
"openai": ">=
|
|
160
|
+
"openai": ">=4.85.4"
|
|
161
161
|
},
|
|
162
162
|
"browser": {
|
|
163
163
|
"fs": false,
|