@paid-ai/paid-node 1.0.0 → 1.0.1-alpha0

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 (156) hide show
  1. package/dist/cjs/BaseClient.d.ts +4 -17
  2. package/dist/cjs/BaseClient.js +0 -59
  3. package/dist/cjs/Client.d.ts +28 -28
  4. package/dist/cjs/Client.js +52 -11
  5. package/dist/cjs/api/errors/BadRequestError.js +1 -5
  6. package/dist/cjs/api/errors/ForbiddenError.js +1 -5
  7. package/dist/cjs/api/errors/InternalServerError.js +1 -5
  8. package/dist/cjs/api/errors/NotFoundError.js +1 -5
  9. package/dist/cjs/api/resources/agents/client/Client.d.ts +23 -22
  10. package/dist/cjs/api/resources/agents/client/Client.js +158 -55
  11. package/dist/cjs/api/resources/contacts/client/Client.d.ts +19 -18
  12. package/dist/cjs/api/resources/contacts/client/Client.js +122 -43
  13. package/dist/cjs/api/resources/customers/client/Client.d.ts +37 -36
  14. package/dist/cjs/api/resources/customers/client/Client.js +315 -113
  15. package/dist/cjs/api/resources/orders/client/Client.d.ts +28 -27
  16. package/dist/cjs/api/resources/orders/client/Client.js +177 -62
  17. package/dist/cjs/api/resources/orders/resources/lines/client/Client.d.ts +9 -8
  18. package/dist/cjs/api/resources/orders/resources/lines/client/Client.js +32 -13
  19. package/dist/cjs/api/resources/plans/client/Client.d.ts +13 -12
  20. package/dist/cjs/api/resources/plans/client/Client.js +82 -32
  21. package/dist/cjs/api/resources/products/client/Client.d.ts +23 -22
  22. package/dist/cjs/api/resources/products/client/Client.js +158 -55
  23. package/dist/cjs/api/resources/products/client/requests/index.d.ts +1 -1
  24. package/dist/cjs/api/resources/products/client/requests/index.js +0 -3
  25. package/dist/cjs/api/resources/traces/client/Client.d.ts +9 -8
  26. package/dist/cjs/api/resources/traces/client/Client.js +57 -23
  27. package/dist/cjs/api/resources/usage/client/Client.d.ts +13 -12
  28. package/dist/cjs/api/resources/usage/client/Client.js +68 -25
  29. package/dist/cjs/core/auth/AuthProvider.d.ts +1 -4
  30. package/dist/cjs/core/auth/BearerToken.d.ts +1 -3
  31. package/dist/cjs/core/auth/BearerToken.js +6 -7
  32. package/dist/cjs/core/auth/index.d.ts +0 -1
  33. package/dist/cjs/core/auth/index.js +1 -3
  34. package/dist/cjs/core/fetcher/BinaryResponse.d.ts +7 -6
  35. package/dist/cjs/core/fetcher/EndpointSupplier.d.ts +2 -2
  36. package/dist/cjs/core/fetcher/Fetcher.d.ts +4 -10
  37. package/dist/cjs/core/fetcher/Fetcher.js +10 -204
  38. package/dist/cjs/core/fetcher/ResponseWithBody.d.ts +4 -0
  39. package/dist/cjs/core/fetcher/ResponseWithBody.js +6 -0
  40. package/dist/cjs/core/fetcher/getRequestBody.d.ts +1 -1
  41. package/dist/cjs/core/fetcher/getRequestBody.js +0 -4
  42. package/dist/cjs/core/fetcher/getResponseBody.js +4 -18
  43. package/dist/cjs/core/fetcher/makeRequest.d.ts +1 -1
  44. package/dist/cjs/core/fetcher/makeRequest.js +2 -0
  45. package/dist/cjs/core/fetcher/requestWithRetries.js +9 -0
  46. package/dist/cjs/core/fetcher/signals.d.ts +7 -1
  47. package/dist/cjs/core/fetcher/signals.js +12 -0
  48. package/dist/cjs/core/headers.d.ts +2 -2
  49. package/dist/cjs/core/headers.js +4 -6
  50. package/dist/cjs/core/index.d.ts +0 -1
  51. package/dist/cjs/core/index.js +1 -2
  52. package/dist/cjs/core/runtime/runtime.js +10 -11
  53. package/dist/cjs/core/url/join.js +1 -0
  54. package/dist/cjs/errors/PaidError.js +1 -5
  55. package/dist/cjs/errors/PaidTimeoutError.js +1 -5
  56. package/dist/cjs/index.d.ts +0 -1
  57. package/dist/cjs/index.js +0 -4
  58. package/dist/cjs/version.d.ts +1 -1
  59. package/dist/cjs/version.js +1 -1
  60. package/dist/esm/BaseClient.d.mts +4 -17
  61. package/dist/esm/BaseClient.mjs +1 -24
  62. package/dist/esm/Client.d.mts +28 -28
  63. package/dist/esm/Client.mjs +27 -19
  64. package/dist/esm/api/errors/BadRequestError.mjs +1 -5
  65. package/dist/esm/api/errors/ForbiddenError.mjs +1 -5
  66. package/dist/esm/api/errors/InternalServerError.mjs +1 -5
  67. package/dist/esm/api/errors/NotFoundError.mjs +1 -5
  68. package/dist/esm/api/resources/agents/client/Client.d.mts +23 -22
  69. package/dist/esm/api/resources/agents/client/Client.mjs +157 -54
  70. package/dist/esm/api/resources/contacts/client/Client.d.mts +19 -18
  71. package/dist/esm/api/resources/contacts/client/Client.mjs +121 -42
  72. package/dist/esm/api/resources/customers/client/Client.d.mts +37 -36
  73. package/dist/esm/api/resources/customers/client/Client.mjs +314 -112
  74. package/dist/esm/api/resources/orders/client/Client.d.mts +28 -27
  75. package/dist/esm/api/resources/orders/client/Client.mjs +177 -62
  76. package/dist/esm/api/resources/orders/resources/lines/client/Client.d.mts +9 -8
  77. package/dist/esm/api/resources/orders/resources/lines/client/Client.mjs +31 -12
  78. package/dist/esm/api/resources/plans/client/Client.d.mts +13 -12
  79. package/dist/esm/api/resources/plans/client/Client.mjs +81 -31
  80. package/dist/esm/api/resources/products/client/Client.d.mts +23 -22
  81. package/dist/esm/api/resources/products/client/Client.mjs +157 -54
  82. package/dist/esm/api/resources/products/client/requests/index.d.mts +1 -1
  83. package/dist/esm/api/resources/products/client/requests/index.mjs +1 -1
  84. package/dist/esm/api/resources/traces/client/Client.d.mts +9 -8
  85. package/dist/esm/api/resources/traces/client/Client.mjs +56 -22
  86. package/dist/esm/api/resources/usage/client/Client.d.mts +13 -12
  87. package/dist/esm/api/resources/usage/client/Client.mjs +67 -24
  88. package/dist/esm/core/auth/AuthProvider.d.mts +1 -4
  89. package/dist/esm/core/auth/BearerToken.d.mts +1 -3
  90. package/dist/esm/core/auth/BearerToken.mjs +6 -7
  91. package/dist/esm/core/auth/index.d.mts +0 -1
  92. package/dist/esm/core/auth/index.mjs +0 -1
  93. package/dist/esm/core/fetcher/BinaryResponse.d.mts +7 -6
  94. package/dist/esm/core/fetcher/EndpointSupplier.d.mts +2 -2
  95. package/dist/esm/core/fetcher/Fetcher.d.mts +4 -10
  96. package/dist/esm/core/fetcher/Fetcher.mjs +10 -204
  97. package/dist/esm/core/fetcher/ResponseWithBody.d.mts +4 -0
  98. package/dist/esm/core/fetcher/ResponseWithBody.mjs +3 -0
  99. package/dist/esm/core/fetcher/getRequestBody.d.mts +1 -1
  100. package/dist/esm/core/fetcher/getRequestBody.mjs +0 -4
  101. package/dist/esm/core/fetcher/getResponseBody.mjs +4 -18
  102. package/dist/esm/core/fetcher/makeRequest.d.mts +1 -1
  103. package/dist/esm/core/fetcher/makeRequest.mjs +2 -0
  104. package/dist/esm/core/fetcher/requestWithRetries.mjs +9 -0
  105. package/dist/esm/core/fetcher/signals.d.mts +7 -1
  106. package/dist/esm/core/fetcher/signals.mjs +12 -0
  107. package/dist/esm/core/headers.d.mts +2 -2
  108. package/dist/esm/core/headers.mjs +4 -6
  109. package/dist/esm/core/index.d.mts +0 -1
  110. package/dist/esm/core/index.mjs +0 -1
  111. package/dist/esm/core/runtime/runtime.mjs +10 -11
  112. package/dist/esm/core/url/join.mjs +1 -0
  113. package/dist/esm/errors/PaidError.mjs +1 -5
  114. package/dist/esm/errors/PaidTimeoutError.mjs +1 -5
  115. package/dist/esm/index.d.mts +0 -1
  116. package/dist/esm/index.mjs +0 -1
  117. package/dist/esm/version.d.mts +1 -1
  118. package/dist/esm/version.mjs +1 -1
  119. package/package.json +3 -6
  120. package/reference.md +54 -54
  121. package/dist/cjs/auth/BearerAuthProvider.d.ts +0 -20
  122. package/dist/cjs/auth/BearerAuthProvider.js +0 -79
  123. package/dist/cjs/auth/index.d.ts +0 -1
  124. package/dist/cjs/auth/index.js +0 -5
  125. package/dist/cjs/core/auth/NoOpAuthProvider.d.ts +0 -5
  126. package/dist/cjs/core/auth/NoOpAuthProvider.js +0 -9
  127. package/dist/cjs/core/exports.d.ts +0 -1
  128. package/dist/cjs/core/exports.js +0 -17
  129. package/dist/cjs/core/logging/exports.d.ts +0 -18
  130. package/dist/cjs/core/logging/exports.js +0 -45
  131. package/dist/cjs/core/logging/index.d.ts +0 -1
  132. package/dist/cjs/core/logging/index.js +0 -17
  133. package/dist/cjs/core/logging/logger.d.ts +0 -126
  134. package/dist/cjs/core/logging/logger.js +0 -144
  135. package/dist/cjs/errors/handleNonStatusCodeError.d.ts +0 -2
  136. package/dist/cjs/errors/handleNonStatusCodeError.js +0 -65
  137. package/dist/cjs/exports.d.ts +0 -1
  138. package/dist/cjs/exports.js +0 -17
  139. package/dist/esm/auth/BearerAuthProvider.d.mts +0 -20
  140. package/dist/esm/auth/BearerAuthProvider.mjs +0 -42
  141. package/dist/esm/auth/index.d.mts +0 -1
  142. package/dist/esm/auth/index.mjs +0 -1
  143. package/dist/esm/core/auth/NoOpAuthProvider.d.mts +0 -5
  144. package/dist/esm/core/auth/NoOpAuthProvider.mjs +0 -5
  145. package/dist/esm/core/exports.d.mts +0 -1
  146. package/dist/esm/core/exports.mjs +0 -1
  147. package/dist/esm/core/logging/exports.d.mts +0 -18
  148. package/dist/esm/core/logging/exports.mjs +0 -9
  149. package/dist/esm/core/logging/index.d.mts +0 -1
  150. package/dist/esm/core/logging/index.mjs +0 -1
  151. package/dist/esm/core/logging/logger.d.mts +0 -126
  152. package/dist/esm/core/logging/logger.mjs +0 -138
  153. package/dist/esm/errors/handleNonStatusCodeError.d.mts +0 -2
  154. package/dist/esm/errors/handleNonStatusCodeError.mjs +0 -29
  155. package/dist/esm/exports.d.mts +0 -1
  156. package/dist/esm/exports.mjs +0 -1
@@ -1,21 +1,17 @@
1
- import { BearerAuthProvider } from "./auth/BearerAuthProvider.js";
2
- import * as core from "./core/index.js";
1
+ import type * as core from "./core/index.js";
3
2
  import type * as environments from "./environments.js";
4
- export type BaseClientOptions = {
3
+ export interface BaseClientOptions {
5
4
  environment?: core.Supplier<environments.PaidEnvironment | string>;
6
5
  /** Specify a custom URL to connect the client to. */
7
6
  baseUrl?: core.Supplier<string>;
7
+ token?: core.Supplier<core.BearerToken | undefined>;
8
8
  /** Additional headers to include in requests. */
9
9
  headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
10
10
  /** The default maximum time to wait for a response in seconds. */
11
11
  timeoutInSeconds?: number;
12
12
  /** The default number of times to retry the request. Defaults to 2. */
13
13
  maxRetries?: number;
14
- /** Provide a custom fetch implementation. Useful for platforms that don't have a built-in fetch or need a custom implementation. */
15
- fetch?: typeof fetch;
16
- /** Configure logging for the client. */
17
- logging?: core.logging.LogConfig | core.logging.Logger;
18
- } & BearerAuthProvider.AuthOptions;
14
+ }
19
15
  export interface BaseRequestOptions {
20
16
  /** The maximum time to wait for a response in seconds. */
21
17
  timeoutInSeconds?: number;
@@ -28,12 +24,3 @@ export interface BaseRequestOptions {
28
24
  /** Additional headers to include in the request. */
29
25
  headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
30
26
  }
31
- export type NormalizedClientOptions<T extends BaseClientOptions = BaseClientOptions> = T & {
32
- logging: core.logging.Logger;
33
- authProvider?: core.AuthProvider;
34
- };
35
- export type NormalizedClientOptionsWithAuth<T extends BaseClientOptions = BaseClientOptions> = NormalizedClientOptions<T> & {
36
- authProvider: core.AuthProvider;
37
- };
38
- export declare function normalizeClientOptions<T extends BaseClientOptions = BaseClientOptions>(options: T): NormalizedClientOptions<T>;
39
- export declare function normalizeClientOptionsWithAuth<T extends BaseClientOptions = BaseClientOptions>(options: T): NormalizedClientOptionsWithAuth<T>;
@@ -1,62 +1,3 @@
1
1
  "use strict";
2
2
  // This file was auto-generated by Fern from our API Definition.
3
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
- if (k2 === undefined) k2 = k;
5
- var desc = Object.getOwnPropertyDescriptor(m, k);
6
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
- desc = { enumerable: true, get: function() { return m[k]; } };
8
- }
9
- Object.defineProperty(o, k2, desc);
10
- }) : (function(o, m, k, k2) {
11
- if (k2 === undefined) k2 = k;
12
- o[k2] = m[k];
13
- }));
14
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
- Object.defineProperty(o, "default", { enumerable: true, value: v });
16
- }) : function(o, v) {
17
- o["default"] = v;
18
- });
19
- var __importStar = (this && this.__importStar) || (function () {
20
- var ownKeys = function(o) {
21
- ownKeys = Object.getOwnPropertyNames || function (o) {
22
- var ar = [];
23
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
- return ar;
25
- };
26
- return ownKeys(o);
27
- };
28
- return function (mod) {
29
- if (mod && mod.__esModule) return mod;
30
- var result = {};
31
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
- __setModuleDefault(result, mod);
33
- return result;
34
- };
35
- })();
36
3
  Object.defineProperty(exports, "__esModule", { value: true });
37
- exports.normalizeClientOptions = normalizeClientOptions;
38
- exports.normalizeClientOptionsWithAuth = normalizeClientOptionsWithAuth;
39
- const BearerAuthProvider_js_1 = require("./auth/BearerAuthProvider.js");
40
- const headers_js_1 = require("./core/headers.js");
41
- const core = __importStar(require("./core/index.js"));
42
- function normalizeClientOptions(options) {
43
- const headers = (0, headers_js_1.mergeHeaders)({
44
- "X-Fern-Language": "JavaScript",
45
- "X-Fern-SDK-Name": "@paid-ai/paid-node",
46
- "X-Fern-SDK-Version": "1.0.0",
47
- "User-Agent": "@paid-ai/paid-node/1.0.0",
48
- "X-Fern-Runtime": core.RUNTIME.type,
49
- "X-Fern-Runtime-Version": core.RUNTIME.version,
50
- }, options === null || options === void 0 ? void 0 : options.headers);
51
- return Object.assign(Object.assign({}, options), { logging: core.logging.createLogger(options === null || options === void 0 ? void 0 : options.logging), headers });
52
- }
53
- function normalizeClientOptionsWithAuth(options) {
54
- var _a;
55
- const normalized = normalizeClientOptions(options);
56
- const normalizedWithNoOpAuthProvider = withNoOpAuthProvider(normalized);
57
- (_a = normalized.authProvider) !== null && _a !== void 0 ? _a : (normalized.authProvider = new BearerAuthProvider_js_1.BearerAuthProvider(normalizedWithNoOpAuthProvider));
58
- return normalized;
59
- }
60
- function withNoOpAuthProvider(options) {
61
- return Object.assign(Object.assign({}, options), { authProvider: new core.NoOpAuthProvider() });
62
- }
@@ -1,35 +1,35 @@
1
- import { AgentsClient } from "./api/resources/agents/client/Client.js";
2
- import { ContactsClient } from "./api/resources/contacts/client/Client.js";
3
- import { CustomersClient } from "./api/resources/customers/client/Client.js";
4
- import { OrdersClient } from "./api/resources/orders/client/Client.js";
5
- import { PlansClient } from "./api/resources/plans/client/Client.js";
6
- import { ProductsClient } from "./api/resources/products/client/Client.js";
7
- import { TracesClient } from "./api/resources/traces/client/Client.js";
8
- import { UsageClient } from "./api/resources/usage/client/Client.js";
1
+ import { Agents } from "./api/resources/agents/client/Client.js";
2
+ import { Contacts } from "./api/resources/contacts/client/Client.js";
3
+ import { Customers } from "./api/resources/customers/client/Client.js";
4
+ import { Orders } from "./api/resources/orders/client/Client.js";
5
+ import { Plans } from "./api/resources/plans/client/Client.js";
6
+ import { Products } from "./api/resources/products/client/Client.js";
7
+ import { Traces } from "./api/resources/traces/client/Client.js";
8
+ import { Usage } from "./api/resources/usage/client/Client.js";
9
9
  import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.js";
10
- import { type NormalizedClientOptions } from "./BaseClient.js";
11
10
  export declare namespace PaidClient {
12
- type Options = BaseClientOptions;
11
+ interface Options extends BaseClientOptions {
12
+ }
13
13
  interface RequestOptions extends BaseRequestOptions {
14
14
  }
15
15
  }
16
16
  export declare class PaidClient {
17
- protected readonly _options: NormalizedClientOptions<PaidClient.Options>;
18
- protected _customers: CustomersClient | undefined;
19
- protected _agents: AgentsClient | undefined;
20
- protected _products: ProductsClient | undefined;
21
- protected _contacts: ContactsClient | undefined;
22
- protected _orders: OrdersClient | undefined;
23
- protected _plans: PlansClient | undefined;
24
- protected _usage: UsageClient | undefined;
25
- protected _traces: TracesClient | undefined;
26
- constructor(options?: PaidClient.Options);
27
- get customers(): CustomersClient;
28
- get agents(): AgentsClient;
29
- get products(): ProductsClient;
30
- get contacts(): ContactsClient;
31
- get orders(): OrdersClient;
32
- get plans(): PlansClient;
33
- get usage(): UsageClient;
34
- get traces(): TracesClient;
17
+ protected readonly _options: PaidClient.Options;
18
+ protected _customers: Customers | undefined;
19
+ protected _agents: Agents | undefined;
20
+ protected _products: Products | undefined;
21
+ protected _contacts: Contacts | undefined;
22
+ protected _orders: Orders | undefined;
23
+ protected _plans: Plans | undefined;
24
+ protected _usage: Usage | undefined;
25
+ protected _traces: Traces | undefined;
26
+ constructor(_options?: PaidClient.Options);
27
+ get customers(): Customers;
28
+ get agents(): Agents;
29
+ get products(): Products;
30
+ get contacts(): Contacts;
31
+ get orders(): Orders;
32
+ get plans(): Plans;
33
+ get usage(): Usage;
34
+ get traces(): Traces;
35
35
  }
@@ -1,5 +1,38 @@
1
1
  "use strict";
2
2
  // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
3
36
  Object.defineProperty(exports, "__esModule", { value: true });
4
37
  exports.PaidClient = void 0;
5
38
  const Client_js_1 = require("./api/resources/agents/client/Client.js");
@@ -10,42 +43,50 @@ const Client_js_5 = require("./api/resources/plans/client/Client.js");
10
43
  const Client_js_6 = require("./api/resources/products/client/Client.js");
11
44
  const Client_js_7 = require("./api/resources/traces/client/Client.js");
12
45
  const Client_js_8 = require("./api/resources/usage/client/Client.js");
13
- const BaseClient_js_1 = require("./BaseClient.js");
46
+ const headers_js_1 = require("./core/headers.js");
47
+ const core = __importStar(require("./core/index.js"));
14
48
  class PaidClient {
15
- constructor(options = {}) {
16
- this._options = (0, BaseClient_js_1.normalizeClientOptions)(options);
49
+ constructor(_options = {}) {
50
+ this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
51
+ "X-Fern-Language": "JavaScript",
52
+ "X-Fern-SDK-Name": "@paid-ai/paid-node",
53
+ "X-Fern-SDK-Version": "1.0.1-alpha0",
54
+ "User-Agent": "@paid-ai/paid-node/1.0.1-alpha0",
55
+ "X-Fern-Runtime": core.RUNTIME.type,
56
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
57
+ }, _options === null || _options === void 0 ? void 0 : _options.headers) });
17
58
  }
18
59
  get customers() {
19
60
  var _a;
20
- return ((_a = this._customers) !== null && _a !== void 0 ? _a : (this._customers = new Client_js_3.CustomersClient(this._options)));
61
+ return ((_a = this._customers) !== null && _a !== void 0 ? _a : (this._customers = new Client_js_3.Customers(this._options)));
21
62
  }
22
63
  get agents() {
23
64
  var _a;
24
- return ((_a = this._agents) !== null && _a !== void 0 ? _a : (this._agents = new Client_js_1.AgentsClient(this._options)));
65
+ return ((_a = this._agents) !== null && _a !== void 0 ? _a : (this._agents = new Client_js_1.Agents(this._options)));
25
66
  }
26
67
  get products() {
27
68
  var _a;
28
- return ((_a = this._products) !== null && _a !== void 0 ? _a : (this._products = new Client_js_6.ProductsClient(this._options)));
69
+ return ((_a = this._products) !== null && _a !== void 0 ? _a : (this._products = new Client_js_6.Products(this._options)));
29
70
  }
30
71
  get contacts() {
31
72
  var _a;
32
- return ((_a = this._contacts) !== null && _a !== void 0 ? _a : (this._contacts = new Client_js_2.ContactsClient(this._options)));
73
+ return ((_a = this._contacts) !== null && _a !== void 0 ? _a : (this._contacts = new Client_js_2.Contacts(this._options)));
33
74
  }
34
75
  get orders() {
35
76
  var _a;
36
- return ((_a = this._orders) !== null && _a !== void 0 ? _a : (this._orders = new Client_js_4.OrdersClient(this._options)));
77
+ return ((_a = this._orders) !== null && _a !== void 0 ? _a : (this._orders = new Client_js_4.Orders(this._options)));
37
78
  }
38
79
  get plans() {
39
80
  var _a;
40
- return ((_a = this._plans) !== null && _a !== void 0 ? _a : (this._plans = new Client_js_5.PlansClient(this._options)));
81
+ return ((_a = this._plans) !== null && _a !== void 0 ? _a : (this._plans = new Client_js_5.Plans(this._options)));
41
82
  }
42
83
  get usage() {
43
84
  var _a;
44
- return ((_a = this._usage) !== null && _a !== void 0 ? _a : (this._usage = new Client_js_8.UsageClient(this._options)));
85
+ return ((_a = this._usage) !== null && _a !== void 0 ? _a : (this._usage = new Client_js_8.Usage(this._options)));
45
86
  }
46
87
  get traces() {
47
88
  var _a;
48
- return ((_a = this._traces) !== null && _a !== void 0 ? _a : (this._traces = new Client_js_7.TracesClient(this._options)));
89
+ return ((_a = this._traces) !== null && _a !== void 0 ? _a : (this._traces = new Client_js_7.Traces(this._options)));
49
90
  }
50
91
  }
51
92
  exports.PaidClient = PaidClient;
@@ -44,11 +44,7 @@ class BadRequestError extends errors.PaidError {
44
44
  body: body,
45
45
  rawResponse: rawResponse,
46
46
  });
47
- Object.setPrototypeOf(this, new.target.prototype);
48
- if (Error.captureStackTrace) {
49
- Error.captureStackTrace(this, this.constructor);
50
- }
51
- this.name = this.constructor.name;
47
+ Object.setPrototypeOf(this, BadRequestError.prototype);
52
48
  }
53
49
  }
54
50
  exports.BadRequestError = BadRequestError;
@@ -44,11 +44,7 @@ class ForbiddenError extends errors.PaidError {
44
44
  body: body,
45
45
  rawResponse: rawResponse,
46
46
  });
47
- Object.setPrototypeOf(this, new.target.prototype);
48
- if (Error.captureStackTrace) {
49
- Error.captureStackTrace(this, this.constructor);
50
- }
51
- this.name = this.constructor.name;
47
+ Object.setPrototypeOf(this, ForbiddenError.prototype);
52
48
  }
53
49
  }
54
50
  exports.ForbiddenError = ForbiddenError;
@@ -44,11 +44,7 @@ class InternalServerError extends errors.PaidError {
44
44
  body: body,
45
45
  rawResponse: rawResponse,
46
46
  });
47
- Object.setPrototypeOf(this, new.target.prototype);
48
- if (Error.captureStackTrace) {
49
- Error.captureStackTrace(this, this.constructor);
50
- }
51
- this.name = this.constructor.name;
47
+ Object.setPrototypeOf(this, InternalServerError.prototype);
52
48
  }
53
49
  }
54
50
  exports.InternalServerError = InternalServerError;
@@ -44,11 +44,7 @@ class NotFoundError extends errors.PaidError {
44
44
  body: body,
45
45
  rawResponse: rawResponse,
46
46
  });
47
- Object.setPrototypeOf(this, new.target.prototype);
48
- if (Error.captureStackTrace) {
49
- Error.captureStackTrace(this, this.constructor);
50
- }
51
- this.name = this.constructor.name;
47
+ Object.setPrototypeOf(this, NotFoundError.prototype);
52
48
  }
53
49
  }
54
50
  exports.NotFoundError = NotFoundError;
@@ -1,30 +1,30 @@
1
1
  import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
2
- import { type NormalizedClientOptions } from "../../../../BaseClient.js";
3
2
  import * as core from "../../../../core/index.js";
4
3
  import type * as Paid from "../../../index.js";
5
- export declare namespace AgentsClient {
6
- type Options = BaseClientOptions;
4
+ export declare namespace Agents {
5
+ interface Options extends BaseClientOptions {
6
+ }
7
7
  interface RequestOptions extends BaseRequestOptions {
8
8
  }
9
9
  }
10
- export declare class AgentsClient {
11
- protected readonly _options: NormalizedClientOptions<AgentsClient.Options>;
12
- constructor(options?: AgentsClient.Options);
10
+ export declare class Agents {
11
+ protected readonly _options: Agents.Options;
12
+ constructor(_options?: Agents.Options);
13
13
  /**
14
14
  * DEPRECATED: Use /products instead. Agents are now products with type='agent'.
15
15
  *
16
- * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
16
+ * @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
17
17
  *
18
18
  * @example
19
19
  * await client.agents.list()
20
20
  */
21
- list(requestOptions?: AgentsClient.RequestOptions): core.HttpResponsePromise<Paid.Agent[]>;
21
+ list(requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<Paid.Agent[]>;
22
22
  private __list;
23
23
  /**
24
24
  * DEPRECATED: Use POST /products instead.
25
25
  *
26
26
  * @param {Paid.AgentCreate} request
27
- * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
27
+ * @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
28
28
  *
29
29
  * @example
30
30
  * await client.agents.create({
@@ -33,25 +33,25 @@ export declare class AgentsClient {
33
33
  * externalId: "acme-agent"
34
34
  * })
35
35
  */
36
- create(request: Paid.AgentCreate, requestOptions?: AgentsClient.RequestOptions): core.HttpResponsePromise<Paid.Agent>;
36
+ create(request: Paid.AgentCreate, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<Paid.Agent>;
37
37
  private __create;
38
38
  /**
39
39
  * DEPRECATED: Use GET /products/{productId} instead.
40
40
  *
41
41
  * @param {string} agentId
42
- * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
42
+ * @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
43
43
  *
44
44
  * @example
45
45
  * await client.agents.get("agentId")
46
46
  */
47
- get(agentId: string, requestOptions?: AgentsClient.RequestOptions): core.HttpResponsePromise<Paid.Agent>;
47
+ get(agentId: string, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<Paid.Agent>;
48
48
  private __get;
49
49
  /**
50
50
  * DEPRECATED: Use PUT /products/{productId} instead.
51
51
  *
52
52
  * @param {string} agentId
53
53
  * @param {Paid.AgentUpdate} request
54
- * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
54
+ * @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
55
55
  *
56
56
  * @example
57
57
  * await client.agents.update("agentId", {
@@ -85,36 +85,36 @@ export declare class AgentsClient {
85
85
  * }]
86
86
  * })
87
87
  */
88
- update(agentId: string, request: Paid.AgentUpdate, requestOptions?: AgentsClient.RequestOptions): core.HttpResponsePromise<Paid.Agent>;
88
+ update(agentId: string, request: Paid.AgentUpdate, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<Paid.Agent>;
89
89
  private __update;
90
90
  /**
91
91
  * DEPRECATED: Use DELETE /products/{productId} instead.
92
92
  *
93
93
  * @param {string} agentId
94
- * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
94
+ * @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
95
95
  *
96
96
  * @example
97
97
  * await client.agents.delete("agentId")
98
98
  */
99
- delete(agentId: string, requestOptions?: AgentsClient.RequestOptions): core.HttpResponsePromise<void>;
99
+ delete(agentId: string, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<void>;
100
100
  private __delete;
101
101
  /**
102
102
  * DEPRECATED: Use GET /products/external/{externalId} instead.
103
103
  *
104
104
  * @param {string} externalId
105
- * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
105
+ * @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
106
106
  *
107
107
  * @example
108
108
  * await client.agents.getByExternalId("externalId")
109
109
  */
110
- getByExternalId(externalId: string, requestOptions?: AgentsClient.RequestOptions): core.HttpResponsePromise<Paid.Agent>;
110
+ getByExternalId(externalId: string, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<Paid.Agent>;
111
111
  private __getByExternalId;
112
112
  /**
113
113
  * DEPRECATED: Use PUT /products/external/{externalId} instead.
114
114
  *
115
115
  * @param {string} externalId
116
116
  * @param {Paid.AgentUpdate} request
117
- * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
117
+ * @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
118
118
  *
119
119
  * @example
120
120
  * await client.agents.updateByExternalId("externalId", {
@@ -137,17 +137,18 @@ export declare class AgentsClient {
137
137
  * }]
138
138
  * })
139
139
  */
140
- updateByExternalId(externalId: string, request: Paid.AgentUpdate, requestOptions?: AgentsClient.RequestOptions): core.HttpResponsePromise<Paid.Agent>;
140
+ updateByExternalId(externalId: string, request: Paid.AgentUpdate, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<Paid.Agent>;
141
141
  private __updateByExternalId;
142
142
  /**
143
143
  * DEPRECATED: Use DELETE /products/external/{externalId} instead.
144
144
  *
145
145
  * @param {string} externalId
146
- * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
146
+ * @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
147
147
  *
148
148
  * @example
149
149
  * await client.agents.deleteByExternalId("externalId")
150
150
  */
151
- deleteByExternalId(externalId: string, requestOptions?: AgentsClient.RequestOptions): core.HttpResponsePromise<void>;
151
+ deleteByExternalId(externalId: string, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<void>;
152
152
  private __deleteByExternalId;
153
+ protected _getAuthorizationHeader(): Promise<string | undefined>;
153
154
  }