@paid-ai/paid-node 0.0.5 → 0.0.7

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 (97) hide show
  1. package/README.md +8 -8
  2. package/dist/cjs/Client.d.ts +6 -6
  3. package/dist/cjs/Client.js +7 -7
  4. package/dist/cjs/api/resources/agents/client/Client.d.ts +11 -11
  5. package/dist/cjs/api/resources/agents/client/Client.js +43 -43
  6. package/dist/cjs/api/resources/contacts/client/Client.d.ts +7 -7
  7. package/dist/cjs/api/resources/contacts/client/Client.js +31 -31
  8. package/dist/cjs/api/resources/contacts/client/requests/ContactCreate.d.ts +2 -2
  9. package/dist/cjs/api/resources/customers/client/Client.d.ts +11 -11
  10. package/dist/cjs/api/resources/customers/client/Client.js +43 -43
  11. package/dist/cjs/api/resources/customers/client/requests/CustomerCreate.d.ts +4 -4
  12. package/dist/cjs/api/resources/orders/client/Client.d.ts +7 -7
  13. package/dist/cjs/api/resources/orders/client/Client.js +26 -26
  14. package/dist/cjs/api/resources/orders/client/requests/OrderCreate.d.ts +2 -2
  15. package/dist/cjs/api/resources/orders/resources/lines/client/Client.d.ts +4 -4
  16. package/dist/cjs/api/resources/orders/resources/lines/client/Client.js +6 -6
  17. package/dist/cjs/api/resources/orders/resources/lines/client/requests/LinesUpdateRequest.d.ts +2 -2
  18. package/dist/cjs/api/resources/usage/client/Client.d.ts +4 -4
  19. package/dist/cjs/api/resources/usage/client/Client.js +6 -6
  20. package/dist/cjs/api/resources/usage/client/requests/UsageRecordBulkRequest.d.ts +2 -2
  21. package/dist/cjs/api/types/Agent.d.ts +2 -2
  22. package/dist/cjs/api/types/AgentAttribute.d.ts +2 -2
  23. package/dist/cjs/api/types/AgentPricePoint.d.ts +2 -2
  24. package/dist/cjs/api/types/AgentUpdate.d.ts +2 -2
  25. package/dist/cjs/api/types/Contact.d.ts +2 -2
  26. package/dist/cjs/api/types/Customer.d.ts +5 -5
  27. package/dist/cjs/api/types/CustomerUpdate.d.ts +4 -4
  28. package/dist/cjs/api/types/Error_.d.ts +2 -2
  29. package/dist/cjs/api/types/Order.d.ts +4 -4
  30. package/dist/cjs/api/types/OrderLine.d.ts +4 -4
  31. package/dist/cjs/api/types/OrderLineAttribute.d.ts +2 -2
  32. package/dist/cjs/api/types/OrderLineAttributePricing.d.ts +5 -5
  33. package/dist/cjs/api/types/PricePoint.d.ts +2 -2
  34. package/dist/cjs/api/types/Pricing.d.ts +5 -5
  35. package/dist/cjs/environments.d.ts +2 -2
  36. package/dist/cjs/environments.js +2 -2
  37. package/dist/cjs/errors/{PaidApiError.d.ts → PaidError.d.ts} +1 -1
  38. package/dist/cjs/errors/{PaidApiError.js → PaidError.js} +4 -4
  39. package/dist/{esm/errors/PaidApiTimeoutError.d.mts → cjs/errors/PaidTimeoutError.d.ts} +1 -1
  40. package/dist/cjs/errors/{PaidApiTimeoutError.js → PaidTimeoutError.js} +4 -4
  41. package/dist/cjs/errors/index.d.ts +2 -2
  42. package/dist/cjs/errors/index.js +5 -5
  43. package/dist/cjs/index.d.ts +4 -4
  44. package/dist/cjs/index.js +6 -6
  45. package/dist/cjs/version.d.ts +1 -1
  46. package/dist/cjs/version.js +1 -1
  47. package/dist/cjs/wrapper/BatchUsage.d.ts +6 -0
  48. package/dist/cjs/wrapper/BatchUsage.js +24 -0
  49. package/dist/esm/Client.d.mts +6 -6
  50. package/dist/esm/Client.mjs +4 -4
  51. package/dist/esm/api/resources/agents/client/Client.d.mts +11 -11
  52. package/dist/esm/api/resources/agents/client/Client.mjs +43 -43
  53. package/dist/esm/api/resources/contacts/client/Client.d.mts +7 -7
  54. package/dist/esm/api/resources/contacts/client/Client.mjs +31 -31
  55. package/dist/esm/api/resources/contacts/client/requests/ContactCreate.d.mts +2 -2
  56. package/dist/esm/api/resources/customers/client/Client.d.mts +11 -11
  57. package/dist/esm/api/resources/customers/client/Client.mjs +43 -43
  58. package/dist/esm/api/resources/customers/client/requests/CustomerCreate.d.mts +4 -4
  59. package/dist/esm/api/resources/orders/client/Client.d.mts +7 -7
  60. package/dist/esm/api/resources/orders/client/Client.mjs +26 -26
  61. package/dist/esm/api/resources/orders/client/requests/OrderCreate.d.mts +2 -2
  62. package/dist/esm/api/resources/orders/resources/lines/client/Client.d.mts +4 -4
  63. package/dist/esm/api/resources/orders/resources/lines/client/Client.mjs +6 -6
  64. package/dist/esm/api/resources/orders/resources/lines/client/requests/LinesUpdateRequest.d.mts +2 -2
  65. package/dist/esm/api/resources/usage/client/Client.d.mts +4 -4
  66. package/dist/esm/api/resources/usage/client/Client.mjs +6 -6
  67. package/dist/esm/api/resources/usage/client/requests/UsageRecordBulkRequest.d.mts +2 -2
  68. package/dist/esm/api/types/Agent.d.mts +2 -2
  69. package/dist/esm/api/types/AgentAttribute.d.mts +2 -2
  70. package/dist/esm/api/types/AgentPricePoint.d.mts +2 -2
  71. package/dist/esm/api/types/AgentUpdate.d.mts +2 -2
  72. package/dist/esm/api/types/Contact.d.mts +2 -2
  73. package/dist/esm/api/types/Customer.d.mts +5 -5
  74. package/dist/esm/api/types/CustomerUpdate.d.mts +4 -4
  75. package/dist/esm/api/types/Error_.d.mts +2 -2
  76. package/dist/esm/api/types/Order.d.mts +4 -4
  77. package/dist/esm/api/types/OrderLine.d.mts +4 -4
  78. package/dist/esm/api/types/OrderLineAttribute.d.mts +2 -2
  79. package/dist/esm/api/types/OrderLineAttributePricing.d.mts +5 -5
  80. package/dist/esm/api/types/PricePoint.d.mts +2 -2
  81. package/dist/esm/api/types/Pricing.d.mts +5 -5
  82. package/dist/esm/environments.d.mts +2 -2
  83. package/dist/esm/environments.mjs +1 -1
  84. package/dist/esm/errors/{PaidApiError.d.mts → PaidError.d.mts} +1 -1
  85. package/dist/esm/errors/{PaidApiError.mjs → PaidError.mjs} +2 -2
  86. package/dist/{cjs/errors/PaidApiTimeoutError.d.ts → esm/errors/PaidTimeoutError.d.mts} +1 -1
  87. package/dist/esm/errors/{PaidApiTimeoutError.mjs → PaidTimeoutError.mjs} +2 -2
  88. package/dist/esm/errors/index.d.mts +2 -2
  89. package/dist/esm/errors/index.mjs +2 -2
  90. package/dist/esm/index.d.mts +4 -4
  91. package/dist/esm/index.mjs +4 -4
  92. package/dist/esm/version.d.mts +1 -1
  93. package/dist/esm/version.mjs +1 -1
  94. package/dist/esm/wrapper/BatchUsage.d.mts +6 -0
  95. package/dist/esm/wrapper/BatchUsage.mjs +20 -0
  96. package/package.json +1 -1
  97. package/reference.md +31 -31
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- import * as PaidApi from "../../../../index.js";
4
+ import * as Paid from "../../../../index.js";
5
5
  /**
6
6
  * @example
7
7
  * {
@@ -14,8 +14,8 @@ export interface CustomerCreate {
14
14
  phone?: string;
15
15
  employeeCount?: number;
16
16
  annualRevenue?: number;
17
- taxExemptStatus?: PaidApi.TaxExemptStatus;
18
- creationSource?: PaidApi.CreationSource;
17
+ taxExemptStatus?: Paid.TaxExemptStatus;
18
+ creationSource?: Paid.CreationSource;
19
19
  website?: string;
20
- billingAddress?: PaidApi.Address;
20
+ billingAddress?: Paid.Address;
21
21
  }
@@ -3,11 +3,11 @@
3
3
  */
4
4
  import * as environments from "../../../../environments.js";
5
5
  import * as core from "../../../../core/index.js";
6
- import * as PaidApi from "../../../index.js";
6
+ import * as Paid from "../../../index.js";
7
7
  import { Lines } from "../resources/lines/client/Client.js";
8
8
  export declare namespace Orders {
9
9
  interface Options {
10
- environment?: core.Supplier<environments.PaidApiEnvironment | string>;
10
+ environment?: core.Supplier<environments.PaidEnvironment | string>;
11
11
  /** Specify a custom URL to connect the client to. */
12
12
  baseUrl?: core.Supplier<string>;
13
13
  token: core.Supplier<core.BearerToken>;
@@ -36,10 +36,10 @@ export declare class Orders {
36
36
  * @example
37
37
  * await client.orders.list()
38
38
  */
39
- list(requestOptions?: Orders.RequestOptions): core.HttpResponsePromise<PaidApi.Order[]>;
39
+ list(requestOptions?: Orders.RequestOptions): core.HttpResponsePromise<Paid.Order[]>;
40
40
  private __list;
41
41
  /**
42
- * @param {PaidApi.OrderCreate} request
42
+ * @param {Paid.OrderCreate} request
43
43
  * @param {Orders.RequestOptions} requestOptions - Request-specific configuration.
44
44
  *
45
45
  * @example
@@ -51,7 +51,7 @@ export declare class Orders {
51
51
  * currency: "currency"
52
52
  * })
53
53
  */
54
- create(request: PaidApi.OrderCreate, requestOptions?: Orders.RequestOptions): core.HttpResponsePromise<PaidApi.Order>;
54
+ create(request: Paid.OrderCreate, requestOptions?: Orders.RequestOptions): core.HttpResponsePromise<Paid.Order>;
55
55
  private __create;
56
56
  /**
57
57
  * @param {string} orderId
@@ -60,7 +60,7 @@ export declare class Orders {
60
60
  * @example
61
61
  * await client.orders.get("orderId")
62
62
  */
63
- get(orderId: string, requestOptions?: Orders.RequestOptions): core.HttpResponsePromise<PaidApi.Order>;
63
+ get(orderId: string, requestOptions?: Orders.RequestOptions): core.HttpResponsePromise<Paid.Order>;
64
64
  private __get;
65
65
  /**
66
66
  * @param {string} orderId
@@ -78,7 +78,7 @@ export declare class Orders {
78
78
  * @example
79
79
  * await client.orders.activate("orderId")
80
80
  */
81
- activate(orderId: string, requestOptions?: Orders.RequestOptions): core.HttpResponsePromise<PaidApi.Order>;
81
+ activate(orderId: string, requestOptions?: Orders.RequestOptions): core.HttpResponsePromise<Paid.Order>;
82
82
  private __activate;
83
83
  protected _getAuthorizationHeader(): Promise<string>;
84
84
  }
@@ -76,7 +76,7 @@ class Orders {
76
76
  return __awaiter(this, void 0, void 0, function* () {
77
77
  var _a, _b, _c;
78
78
  const _response = yield core.fetcher({
79
- url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.PaidApiEnvironment.Production, "orders"),
79
+ url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.PaidEnvironment.Production, "orders"),
80
80
  method: "GET",
81
81
  headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
82
82
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -87,7 +87,7 @@ class Orders {
87
87
  return { data: _response.body, rawResponse: _response.rawResponse };
88
88
  }
89
89
  if (_response.error.reason === "status-code") {
90
- throw new errors.PaidApiError({
90
+ throw new errors.PaidError({
91
91
  statusCode: _response.error.statusCode,
92
92
  body: _response.error.body,
93
93
  rawResponse: _response.rawResponse,
@@ -95,15 +95,15 @@ class Orders {
95
95
  }
96
96
  switch (_response.error.reason) {
97
97
  case "non-json":
98
- throw new errors.PaidApiError({
98
+ throw new errors.PaidError({
99
99
  statusCode: _response.error.statusCode,
100
100
  body: _response.error.rawBody,
101
101
  rawResponse: _response.rawResponse,
102
102
  });
103
103
  case "timeout":
104
- throw new errors.PaidApiTimeoutError("Timeout exceeded when calling GET /orders.");
104
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /orders.");
105
105
  case "unknown":
106
- throw new errors.PaidApiError({
106
+ throw new errors.PaidError({
107
107
  message: _response.error.errorMessage,
108
108
  rawResponse: _response.rawResponse,
109
109
  });
@@ -111,7 +111,7 @@ class Orders {
111
111
  });
112
112
  }
113
113
  /**
114
- * @param {PaidApi.OrderCreate} request
114
+ * @param {Paid.OrderCreate} request
115
115
  * @param {Orders.RequestOptions} requestOptions - Request-specific configuration.
116
116
  *
117
117
  * @example
@@ -130,7 +130,7 @@ class Orders {
130
130
  return __awaiter(this, void 0, void 0, function* () {
131
131
  var _a, _b, _c;
132
132
  const _response = yield core.fetcher({
133
- url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.PaidApiEnvironment.Production, "orders"),
133
+ url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.PaidEnvironment.Production, "orders"),
134
134
  method: "POST",
135
135
  headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
136
136
  contentType: "application/json",
@@ -144,7 +144,7 @@ class Orders {
144
144
  return { data: _response.body, rawResponse: _response.rawResponse };
145
145
  }
146
146
  if (_response.error.reason === "status-code") {
147
- throw new errors.PaidApiError({
147
+ throw new errors.PaidError({
148
148
  statusCode: _response.error.statusCode,
149
149
  body: _response.error.body,
150
150
  rawResponse: _response.rawResponse,
@@ -152,15 +152,15 @@ class Orders {
152
152
  }
153
153
  switch (_response.error.reason) {
154
154
  case "non-json":
155
- throw new errors.PaidApiError({
155
+ throw new errors.PaidError({
156
156
  statusCode: _response.error.statusCode,
157
157
  body: _response.error.rawBody,
158
158
  rawResponse: _response.rawResponse,
159
159
  });
160
160
  case "timeout":
161
- throw new errors.PaidApiTimeoutError("Timeout exceeded when calling POST /orders.");
161
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /orders.");
162
162
  case "unknown":
163
- throw new errors.PaidApiError({
163
+ throw new errors.PaidError({
164
164
  message: _response.error.errorMessage,
165
165
  rawResponse: _response.rawResponse,
166
166
  });
@@ -181,7 +181,7 @@ class Orders {
181
181
  return __awaiter(this, void 0, void 0, function* () {
182
182
  var _a, _b, _c;
183
183
  const _response = yield core.fetcher({
184
- url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.PaidApiEnvironment.Production, `orders/${encodeURIComponent(orderId)}`),
184
+ url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.PaidEnvironment.Production, `orders/${encodeURIComponent(orderId)}`),
185
185
  method: "GET",
186
186
  headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
187
187
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -192,7 +192,7 @@ class Orders {
192
192
  return { data: _response.body, rawResponse: _response.rawResponse };
193
193
  }
194
194
  if (_response.error.reason === "status-code") {
195
- throw new errors.PaidApiError({
195
+ throw new errors.PaidError({
196
196
  statusCode: _response.error.statusCode,
197
197
  body: _response.error.body,
198
198
  rawResponse: _response.rawResponse,
@@ -200,15 +200,15 @@ class Orders {
200
200
  }
201
201
  switch (_response.error.reason) {
202
202
  case "non-json":
203
- throw new errors.PaidApiError({
203
+ throw new errors.PaidError({
204
204
  statusCode: _response.error.statusCode,
205
205
  body: _response.error.rawBody,
206
206
  rawResponse: _response.rawResponse,
207
207
  });
208
208
  case "timeout":
209
- throw new errors.PaidApiTimeoutError("Timeout exceeded when calling GET /orders/{orderId}.");
209
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /orders/{orderId}.");
210
210
  case "unknown":
211
- throw new errors.PaidApiError({
211
+ throw new errors.PaidError({
212
212
  message: _response.error.errorMessage,
213
213
  rawResponse: _response.rawResponse,
214
214
  });
@@ -229,7 +229,7 @@ class Orders {
229
229
  return __awaiter(this, void 0, void 0, function* () {
230
230
  var _a, _b, _c;
231
231
  const _response = yield core.fetcher({
232
- url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.PaidApiEnvironment.Production, `orders/${encodeURIComponent(orderId)}`),
232
+ url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.PaidEnvironment.Production, `orders/${encodeURIComponent(orderId)}`),
233
233
  method: "DELETE",
234
234
  headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
235
235
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -240,7 +240,7 @@ class Orders {
240
240
  return { data: undefined, rawResponse: _response.rawResponse };
241
241
  }
242
242
  if (_response.error.reason === "status-code") {
243
- throw new errors.PaidApiError({
243
+ throw new errors.PaidError({
244
244
  statusCode: _response.error.statusCode,
245
245
  body: _response.error.body,
246
246
  rawResponse: _response.rawResponse,
@@ -248,15 +248,15 @@ class Orders {
248
248
  }
249
249
  switch (_response.error.reason) {
250
250
  case "non-json":
251
- throw new errors.PaidApiError({
251
+ throw new errors.PaidError({
252
252
  statusCode: _response.error.statusCode,
253
253
  body: _response.error.rawBody,
254
254
  rawResponse: _response.rawResponse,
255
255
  });
256
256
  case "timeout":
257
- throw new errors.PaidApiTimeoutError("Timeout exceeded when calling DELETE /orders/{orderId}.");
257
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling DELETE /orders/{orderId}.");
258
258
  case "unknown":
259
- throw new errors.PaidApiError({
259
+ throw new errors.PaidError({
260
260
  message: _response.error.errorMessage,
261
261
  rawResponse: _response.rawResponse,
262
262
  });
@@ -277,7 +277,7 @@ class Orders {
277
277
  return __awaiter(this, void 0, void 0, function* () {
278
278
  var _a, _b, _c;
279
279
  const _response = yield core.fetcher({
280
- url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.PaidApiEnvironment.Production, `orders/${encodeURIComponent(orderId)}/activate`),
280
+ url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.PaidEnvironment.Production, `orders/${encodeURIComponent(orderId)}/activate`),
281
281
  method: "POST",
282
282
  headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
283
283
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -288,7 +288,7 @@ class Orders {
288
288
  return { data: _response.body, rawResponse: _response.rawResponse };
289
289
  }
290
290
  if (_response.error.reason === "status-code") {
291
- throw new errors.PaidApiError({
291
+ throw new errors.PaidError({
292
292
  statusCode: _response.error.statusCode,
293
293
  body: _response.error.body,
294
294
  rawResponse: _response.rawResponse,
@@ -296,15 +296,15 @@ class Orders {
296
296
  }
297
297
  switch (_response.error.reason) {
298
298
  case "non-json":
299
- throw new errors.PaidApiError({
299
+ throw new errors.PaidError({
300
300
  statusCode: _response.error.statusCode,
301
301
  body: _response.error.rawBody,
302
302
  rawResponse: _response.rawResponse,
303
303
  });
304
304
  case "timeout":
305
- throw new errors.PaidApiTimeoutError("Timeout exceeded when calling POST /orders/{orderId}/activate.");
305
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /orders/{orderId}/activate.");
306
306
  case "unknown":
307
- throw new errors.PaidApiError({
307
+ throw new errors.PaidError({
308
308
  message: _response.error.errorMessage,
309
309
  rawResponse: _response.rawResponse,
310
310
  });
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- import * as PaidApi from "../../../../index.js";
4
+ import * as Paid from "../../../../index.js";
5
5
  /**
6
6
  * @example
7
7
  * {
@@ -21,5 +21,5 @@ export interface OrderCreate {
21
21
  startDate: string;
22
22
  endDate?: string;
23
23
  currency: string;
24
- orderLines?: PaidApi.OrderLineCreate[];
24
+ orderLines?: Paid.OrderLineCreate[];
25
25
  }
@@ -3,10 +3,10 @@
3
3
  */
4
4
  import * as environments from "../../../../../../environments.js";
5
5
  import * as core from "../../../../../../core/index.js";
6
- import * as PaidApi from "../../../../../index.js";
6
+ import * as Paid from "../../../../../index.js";
7
7
  export declare namespace Lines {
8
8
  interface Options {
9
- environment?: core.Supplier<environments.PaidApiEnvironment | string>;
9
+ environment?: core.Supplier<environments.PaidEnvironment | string>;
10
10
  /** Specify a custom URL to connect the client to. */
11
11
  baseUrl?: core.Supplier<string>;
12
12
  token: core.Supplier<core.BearerToken>;
@@ -29,13 +29,13 @@ export declare class Lines {
29
29
  constructor(_options: Lines.Options);
30
30
  /**
31
31
  * @param {string} orderId
32
- * @param {PaidApi.orders.LinesUpdateRequest} request
32
+ * @param {Paid.orders.LinesUpdateRequest} request
33
33
  * @param {Lines.RequestOptions} requestOptions - Request-specific configuration.
34
34
  *
35
35
  * @example
36
36
  * await client.orders.lines.update("orderId")
37
37
  */
38
- update(orderId: string, request?: PaidApi.orders.LinesUpdateRequest, requestOptions?: Lines.RequestOptions): core.HttpResponsePromise<PaidApi.Order>;
38
+ update(orderId: string, request?: Paid.orders.LinesUpdateRequest, requestOptions?: Lines.RequestOptions): core.HttpResponsePromise<Paid.Order>;
39
39
  private __update;
40
40
  protected _getAuthorizationHeader(): Promise<string>;
41
41
  }
@@ -60,7 +60,7 @@ class Lines {
60
60
  }
61
61
  /**
62
62
  * @param {string} orderId
63
- * @param {PaidApi.orders.LinesUpdateRequest} request
63
+ * @param {Paid.orders.LinesUpdateRequest} request
64
64
  * @param {Lines.RequestOptions} requestOptions - Request-specific configuration.
65
65
  *
66
66
  * @example
@@ -73,7 +73,7 @@ class Lines {
73
73
  return __awaiter(this, arguments, void 0, function* (orderId, request = {}, requestOptions) {
74
74
  var _a, _b, _c;
75
75
  const _response = yield core.fetcher({
76
- url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.PaidApiEnvironment.Production, `orders/${encodeURIComponent(orderId)}/lines`),
76
+ url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.PaidEnvironment.Production, `orders/${encodeURIComponent(orderId)}/lines`),
77
77
  method: "PUT",
78
78
  headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
79
79
  contentType: "application/json",
@@ -87,7 +87,7 @@ class Lines {
87
87
  return { data: _response.body, rawResponse: _response.rawResponse };
88
88
  }
89
89
  if (_response.error.reason === "status-code") {
90
- throw new errors.PaidApiError({
90
+ throw new errors.PaidError({
91
91
  statusCode: _response.error.statusCode,
92
92
  body: _response.error.body,
93
93
  rawResponse: _response.rawResponse,
@@ -95,15 +95,15 @@ class Lines {
95
95
  }
96
96
  switch (_response.error.reason) {
97
97
  case "non-json":
98
- throw new errors.PaidApiError({
98
+ throw new errors.PaidError({
99
99
  statusCode: _response.error.statusCode,
100
100
  body: _response.error.rawBody,
101
101
  rawResponse: _response.rawResponse,
102
102
  });
103
103
  case "timeout":
104
- throw new errors.PaidApiTimeoutError("Timeout exceeded when calling PUT /orders/{orderId}/lines.");
104
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling PUT /orders/{orderId}/lines.");
105
105
  case "unknown":
106
- throw new errors.PaidApiError({
106
+ throw new errors.PaidError({
107
107
  message: _response.error.errorMessage,
108
108
  rawResponse: _response.rawResponse,
109
109
  });
@@ -1,11 +1,11 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- import * as PaidApi from "../../../../../../index.js";
4
+ import * as Paid from "../../../../../../index.js";
5
5
  /**
6
6
  * @example
7
7
  * {}
8
8
  */
9
9
  export interface LinesUpdateRequest {
10
- lines?: PaidApi.OrderLineCreate[];
10
+ lines?: Paid.OrderLineCreate[];
11
11
  }
@@ -3,10 +3,10 @@
3
3
  */
4
4
  import * as environments from "../../../../environments.js";
5
5
  import * as core from "../../../../core/index.js";
6
- import * as PaidApi from "../../../index.js";
6
+ import * as Paid from "../../../index.js";
7
7
  export declare namespace Usage {
8
8
  interface Options {
9
- environment?: core.Supplier<environments.PaidApiEnvironment | string>;
9
+ environment?: core.Supplier<environments.PaidEnvironment | string>;
10
10
  /** Specify a custom URL to connect the client to. */
11
11
  baseUrl?: core.Supplier<string>;
12
12
  token: core.Supplier<core.BearerToken>;
@@ -28,13 +28,13 @@ export declare class Usage {
28
28
  protected readonly _options: Usage.Options;
29
29
  constructor(_options: Usage.Options);
30
30
  /**
31
- * @param {PaidApi.UsageRecordBulkRequest} request
31
+ * @param {Paid.UsageRecordBulkRequest} request
32
32
  * @param {Usage.RequestOptions} requestOptions - Request-specific configuration.
33
33
  *
34
34
  * @example
35
35
  * await client.usage.recordBulk()
36
36
  */
37
- recordBulk(request?: PaidApi.UsageRecordBulkRequest, requestOptions?: Usage.RequestOptions): core.HttpResponsePromise<unknown[]>;
37
+ recordBulk(request?: Paid.UsageRecordBulkRequest, requestOptions?: Usage.RequestOptions): core.HttpResponsePromise<unknown[]>;
38
38
  private __recordBulk;
39
39
  protected _getAuthorizationHeader(): Promise<string>;
40
40
  }
@@ -59,7 +59,7 @@ class Usage {
59
59
  this._options = _options;
60
60
  }
61
61
  /**
62
- * @param {PaidApi.UsageRecordBulkRequest} request
62
+ * @param {Paid.UsageRecordBulkRequest} request
63
63
  * @param {Usage.RequestOptions} requestOptions - Request-specific configuration.
64
64
  *
65
65
  * @example
@@ -72,7 +72,7 @@ class Usage {
72
72
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
73
73
  var _a, _b, _c;
74
74
  const _response = yield core.fetcher({
75
- url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.PaidApiEnvironment.Production, "usage/signals/bulk"),
75
+ url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.PaidEnvironment.Production, "usage/signals/bulk"),
76
76
  method: "POST",
77
77
  headers: (0, headers_js_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
78
78
  contentType: "application/json",
@@ -86,7 +86,7 @@ class Usage {
86
86
  return { data: _response.body, rawResponse: _response.rawResponse };
87
87
  }
88
88
  if (_response.error.reason === "status-code") {
89
- throw new errors.PaidApiError({
89
+ throw new errors.PaidError({
90
90
  statusCode: _response.error.statusCode,
91
91
  body: _response.error.body,
92
92
  rawResponse: _response.rawResponse,
@@ -94,15 +94,15 @@ class Usage {
94
94
  }
95
95
  switch (_response.error.reason) {
96
96
  case "non-json":
97
- throw new errors.PaidApiError({
97
+ throw new errors.PaidError({
98
98
  statusCode: _response.error.statusCode,
99
99
  body: _response.error.rawBody,
100
100
  rawResponse: _response.rawResponse,
101
101
  });
102
102
  case "timeout":
103
- throw new errors.PaidApiTimeoutError("Timeout exceeded when calling POST /usage/signals/bulk.");
103
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /usage/signals/bulk.");
104
104
  case "unknown":
105
- throw new errors.PaidApiError({
105
+ throw new errors.PaidError({
106
106
  message: _response.error.errorMessage,
107
107
  rawResponse: _response.rawResponse,
108
108
  });
@@ -1,11 +1,11 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- import * as PaidApi from "../../../../index.js";
4
+ import * as Paid from "../../../../index.js";
5
5
  /**
6
6
  * @example
7
7
  * {}
8
8
  */
9
9
  export interface UsageRecordBulkRequest {
10
- signals?: PaidApi.Signal[];
10
+ signals?: Paid.Signal[];
11
11
  }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- import * as PaidApi from "../index.js";
4
+ import * as Paid from "../index.js";
5
5
  export interface Agent {
6
6
  id: string;
7
7
  externalId?: string;
@@ -10,5 +10,5 @@ export interface Agent {
10
10
  description?: string;
11
11
  active: boolean;
12
12
  agentCode?: string;
13
- agentAttributes?: PaidApi.AgentAttribute[];
13
+ agentAttributes?: Paid.AgentAttribute[];
14
14
  }
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- import * as PaidApi from "../index.js";
4
+ import * as Paid from "../index.js";
5
5
  export interface AgentAttribute {
6
6
  name: string;
7
7
  active: boolean;
8
- pricing: PaidApi.Pricing;
8
+ pricing: Paid.Pricing;
9
9
  }
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- import * as PaidApi from "../index.js";
4
+ import * as Paid from "../index.js";
5
5
  export interface AgentPricePoint {
6
6
  unitPrice?: number;
7
7
  minQuantity?: number;
8
8
  includedQuantity?: number;
9
- tiers?: PaidApi.AgentPricePointTiers[];
9
+ tiers?: Paid.AgentPricePointTiers[];
10
10
  }
@@ -1,12 +1,12 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- import * as PaidApi from "../index.js";
4
+ import * as Paid from "../index.js";
5
5
  export interface AgentUpdate {
6
6
  name?: string;
7
7
  description?: string;
8
8
  externalId?: string;
9
9
  active?: boolean;
10
10
  agentCode?: string;
11
- agentAttributes?: PaidApi.AgentAttribute[];
11
+ agentAttributes?: Paid.AgentAttribute[];
12
12
  }
@@ -1,14 +1,14 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- import * as PaidApi from "../index.js";
4
+ import * as Paid from "../index.js";
5
5
  export interface Contact {
6
6
  id?: string;
7
7
  externalId?: string;
8
8
  organizationId?: string;
9
9
  customerId?: string;
10
10
  customerExternalId?: string;
11
- salutation?: PaidApi.Salutation;
11
+ salutation?: Paid.Salutation;
12
12
  firstName?: string;
13
13
  lastName?: string;
14
14
  email?: string;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- import * as PaidApi from "../index.js";
4
+ import * as Paid from "../index.js";
5
5
  export interface Customer {
6
6
  id: string;
7
7
  organizationId: string;
@@ -10,9 +10,9 @@ export interface Customer {
10
10
  phone?: string;
11
11
  employeeCount?: number;
12
12
  annualRevenue?: number;
13
- taxExemptStatus?: PaidApi.TaxExemptStatus;
14
- creationSource?: PaidApi.CreationSource;
15
- creationState?: PaidApi.CreationState;
13
+ taxExemptStatus?: Paid.TaxExemptStatus;
14
+ creationSource?: Paid.CreationSource;
15
+ creationState?: Paid.CreationState;
16
16
  website?: string;
17
- billingAddress?: PaidApi.Address;
17
+ billingAddress?: Paid.Address;
18
18
  }
@@ -1,15 +1,15 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- import * as PaidApi from "../index.js";
4
+ import * as Paid from "../index.js";
5
5
  export interface CustomerUpdate {
6
6
  name?: string;
7
7
  externalId?: string;
8
8
  phone?: string;
9
9
  employeeCount?: number;
10
10
  annualRevenue?: number;
11
- taxExemptStatus?: PaidApi.TaxExemptStatus;
12
- creationSource?: PaidApi.CreationSource;
11
+ taxExemptStatus?: Paid.TaxExemptStatus;
12
+ creationSource?: Paid.CreationSource;
13
13
  website?: string;
14
- billingAddress?: PaidApi.Address;
14
+ billingAddress?: Paid.Address;
15
15
  }
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- import * as PaidApi from "../index.js";
4
+ import * as Paid from "../index.js";
5
5
  /**
6
6
  * An error response from the Paid API
7
7
  */
8
8
  export interface Error_ {
9
- error: PaidApi.ApiError;
9
+ error: Paid.ApiError;
10
10
  }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- import * as PaidApi from "../index.js";
4
+ import * as Paid from "../index.js";
5
5
  export interface Order {
6
6
  id?: string;
7
7
  name?: string;
@@ -16,7 +16,7 @@ export interface Order {
16
16
  billedTax?: number;
17
17
  totalBilledAmount?: number;
18
18
  pendingBillingAmount?: number;
19
- creationState?: PaidApi.CreationState;
20
- orderLines?: PaidApi.OrderLine[];
21
- customer?: PaidApi.Customer;
19
+ creationState?: Paid.CreationState;
20
+ orderLines?: Paid.OrderLine[];
21
+ customer?: Paid.Customer;
22
22
  }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- import * as PaidApi from "../index.js";
4
+ import * as Paid from "../index.js";
5
5
  export interface OrderLine {
6
6
  id?: string;
7
7
  orderId?: string;
@@ -14,7 +14,7 @@ export interface OrderLine {
14
14
  billedAmountWithoutTax?: number;
15
15
  billedTax?: number;
16
16
  totalBilledAmount?: number;
17
- creationState?: PaidApi.CreationState;
18
- agent?: PaidApi.Agent;
19
- orderLineAttributes?: PaidApi.OrderLineAttribute[];
17
+ creationState?: Paid.CreationState;
18
+ agent?: Paid.Agent;
19
+ orderLineAttributes?: Paid.OrderLineAttribute[];
20
20
  }