conductor-node 12.38.0 → 12.40.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.
@@ -0,0 +1,372 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from "../../resource.js";
4
+ import * as Core from "../../core.js";
5
+
6
+ export class CustomerTypes extends APIResource {
7
+ /**
8
+ * Creates a new customer type.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * const customerType =
13
+ * await conductor.qbd.customerTypes.create({
14
+ * name: 'Healthcare',
15
+ * conductorEndUserId: 'end_usr_1234567abcdefg',
16
+ * });
17
+ * ```
18
+ */
19
+ create(params: CustomerTypeCreateParams, options?: Core.RequestOptions): Core.APIPromise<CustomerType> {
20
+ const { conductorEndUserId, ...body } = params;
21
+ return this._client.post('/quickbooks-desktop/customer-types', {
22
+ body,
23
+ ...options,
24
+ headers: { 'Conductor-End-User-Id': conductorEndUserId, ...options?.headers },
25
+ });
26
+ }
27
+
28
+ /**
29
+ * Retrieves a customer type by ID.
30
+ *
31
+ * **IMPORTANT:** If you need to fetch multiple specific customer types by ID, use
32
+ * the list endpoint instead with the `ids` parameter. It accepts an array of IDs
33
+ * so you can batch the request into a single call, which is significantly faster.
34
+ *
35
+ * @example
36
+ * ```ts
37
+ * const customerType =
38
+ * await conductor.qbd.customerTypes.retrieve(
39
+ * '80000001-1234567890',
40
+ * { conductorEndUserId: 'end_usr_1234567abcdefg' },
41
+ * );
42
+ * ```
43
+ */
44
+ retrieve(
45
+ id: string,
46
+ params: CustomerTypeRetrieveParams,
47
+ options?: Core.RequestOptions,
48
+ ): Core.APIPromise<CustomerType> {
49
+ const { conductorEndUserId } = params;
50
+ return this._client.get(`/quickbooks-desktop/customer-types/${id}`, {
51
+ ...options,
52
+ headers: { 'Conductor-End-User-Id': conductorEndUserId, ...options?.headers },
53
+ });
54
+ }
55
+
56
+ /**
57
+ * Returns a list of customer types. NOTE: QuickBooks Desktop does not support
58
+ * pagination for customer types; hence, there is no `cursor` parameter. Users
59
+ * typically have few customer types.
60
+ *
61
+ * @example
62
+ * ```ts
63
+ * const customerTypes =
64
+ * await conductor.qbd.customerTypes.list({
65
+ * conductorEndUserId: 'end_usr_1234567abcdefg',
66
+ * });
67
+ * ```
68
+ */
69
+ list(
70
+ params: CustomerTypeListParams,
71
+ options?: Core.RequestOptions,
72
+ ): Core.APIPromise<CustomerTypeListResponse> {
73
+ const { conductorEndUserId, ...query } = params;
74
+ return this._client.get('/quickbooks-desktop/customer-types', {
75
+ query,
76
+ ...options,
77
+ headers: { 'Conductor-End-User-Id': conductorEndUserId, ...options?.headers },
78
+ });
79
+ }
80
+ }
81
+
82
+ export interface CustomerType {
83
+ /**
84
+ * The unique identifier assigned by QuickBooks to this customer type. This ID is
85
+ * unique across all customer types but not across different QuickBooks object
86
+ * types.
87
+ */
88
+ id: string;
89
+
90
+ /**
91
+ * The date and time when this customer type was created, in ISO 8601 format
92
+ * (YYYY-MM-DDThh:mm:ss±hh:mm), which QuickBooks Desktop interprets in the local
93
+ * timezone of the end-user's computer.
94
+ */
95
+ createdAt: string;
96
+
97
+ /**
98
+ * The case-insensitive fully-qualified unique name of this customer type, formed
99
+ * by combining the names of its hierarchical parent objects with its own `name`,
100
+ * separated by colons. For example, if a customer type is under "Industry" and has
101
+ * the `name` "Healthcare", its `fullName` would be "Industry:Healthcare".
102
+ *
103
+ * **NOTE**: Unlike `name`, `fullName` is guaranteed to be unique across all
104
+ * customer type objects. However, `fullName` can still be arbitrarily changed by
105
+ * the QuickBooks user when they modify the underlying `name` field.
106
+ */
107
+ fullName: string;
108
+
109
+ /**
110
+ * Indicates whether this customer type is active. Inactive objects are typically
111
+ * hidden from views and reports in QuickBooks. Defaults to `true`.
112
+ */
113
+ isActive: boolean;
114
+
115
+ /**
116
+ * The case-insensitive name of this customer type. Not guaranteed to be unique
117
+ * because it does not include the names of its hierarchical parent objects like
118
+ * `fullName` does. For example, two customer types could both have the `name`
119
+ * "Healthcare", but they could have unique `fullName` values, such as
120
+ * "Industry:Healthcare" and "Region:Healthcare".
121
+ */
122
+ name: string;
123
+
124
+ /**
125
+ * The type of object. This value is always `"qbd_customer_type"`.
126
+ */
127
+ objectType: 'qbd_customer_type';
128
+
129
+ /**
130
+ * The parent customer type one level above this one in the hierarchy. For example,
131
+ * if this customer type has a `fullName` of "Industry:Healthcare", its parent has
132
+ * a `fullName` of "Industry". If this customer type is at the top level, this
133
+ * field will be `null`.
134
+ */
135
+ parent: CustomerType.Parent | null;
136
+
137
+ /**
138
+ * The current QuickBooks-assigned revision number of this customer type object,
139
+ * which changes each time the object is modified. When updating this object, you
140
+ * must provide the most recent `revisionNumber` to ensure you're working with the
141
+ * latest data; otherwise, the update will return an error.
142
+ */
143
+ revisionNumber: string;
144
+
145
+ /**
146
+ * The depth level of this customer type in the hierarchy. A top-level customer
147
+ * type has a `sublevel` of 0; each subsequent sublevel increases this number by 1.
148
+ * For example, a customer type with a `fullName` of "Industry:Healthcare" would
149
+ * have a `sublevel` of 1.
150
+ */
151
+ sublevel: number;
152
+
153
+ /**
154
+ * The date and time when this customer type was last updated, in ISO 8601 format
155
+ * (YYYY-MM-DDThh:mm:ss±hh:mm), which QuickBooks Desktop interprets in the local
156
+ * timezone of the end-user's computer.
157
+ */
158
+ updatedAt: string;
159
+ }
160
+
161
+ export namespace CustomerType {
162
+ /**
163
+ * The parent customer type one level above this one in the hierarchy. For example,
164
+ * if this customer type has a `fullName` of "Industry:Healthcare", its parent has
165
+ * a `fullName` of "Industry". If this customer type is at the top level, this
166
+ * field will be `null`.
167
+ */
168
+ export interface Parent {
169
+ /**
170
+ * The unique identifier assigned by QuickBooks to this object. This ID is unique
171
+ * across all objects of the same type, but not across different QuickBooks object
172
+ * types.
173
+ */
174
+ id: string | null;
175
+
176
+ /**
177
+ * The fully-qualified unique name for this object, formed by combining the names
178
+ * of its parent objects with its own `name`, separated by colons. Not
179
+ * case-sensitive.
180
+ */
181
+ fullName: string | null;
182
+ }
183
+ }
184
+
185
+ export interface CustomerTypeListResponse {
186
+ /**
187
+ * The array of customer types.
188
+ */
189
+ data: Array<CustomerType>;
190
+
191
+ /**
192
+ * The type of object. This value is always `"list"`.
193
+ */
194
+ objectType: 'list';
195
+
196
+ /**
197
+ * The endpoint URL where this list can be accessed.
198
+ */
199
+ url: string;
200
+ }
201
+
202
+ export interface CustomerTypeCreateParams {
203
+ /**
204
+ * Body param: The case-insensitive name of this customer type. Not guaranteed to
205
+ * be unique because it does not include the names of its hierarchical parent
206
+ * objects like `fullName` does. For example, two customer types could both have
207
+ * the `name` "Healthcare", but they could have unique `fullName` values, such as
208
+ * "Industry:Healthcare" and "Region:Healthcare".
209
+ *
210
+ * Maximum length: 31 characters.
211
+ */
212
+ name: string;
213
+
214
+ /**
215
+ * Header param: The ID of the EndUser to receive this request (e.g.,
216
+ * `"Conductor-End-User-Id: {{END_USER_ID}}"`).
217
+ */
218
+ conductorEndUserId: string;
219
+
220
+ /**
221
+ * Body param: Indicates whether this customer type is active. Inactive objects are
222
+ * typically hidden from views and reports in QuickBooks. Defaults to `true`.
223
+ */
224
+ isActive?: boolean;
225
+
226
+ /**
227
+ * Body param: The parent customer type one level above this one in the hierarchy.
228
+ * For example, if this customer type has a `fullName` of "Industry:Healthcare",
229
+ * its parent has a `fullName` of "Industry". If this customer type is at the top
230
+ * level, this field will be `null`.
231
+ */
232
+ parentId?: string;
233
+ }
234
+
235
+ export interface CustomerTypeRetrieveParams {
236
+ /**
237
+ * The ID of the EndUser to receive this request (e.g.,
238
+ * `"Conductor-End-User-Id: {{END_USER_ID}}"`).
239
+ */
240
+ conductorEndUserId: string;
241
+ }
242
+
243
+ export interface CustomerTypeListParams {
244
+ /**
245
+ * Header param: The ID of the EndUser to receive this request (e.g.,
246
+ * `"Conductor-End-User-Id: {{END_USER_ID}}"`).
247
+ */
248
+ conductorEndUserId: string;
249
+
250
+ /**
251
+ * Query param: Filter for specific customer types by their full-name(s),
252
+ * case-insensitive. Like `id`, `fullName` is a unique identifier for a customer
253
+ * type, formed by by combining the names of its parent objects with its own
254
+ * `name`, separated by colons. For example, if a customer type is under "Industry"
255
+ * and has the `name` "Healthcare", its `fullName` would be "Industry:Healthcare".
256
+ *
257
+ * **IMPORTANT**: If you include this parameter, QuickBooks will ignore all other
258
+ * query parameters for this request.
259
+ *
260
+ * **NOTE**: If any of the values you specify in this parameter are not found, the
261
+ * request will return an error.
262
+ */
263
+ fullNames?: Array<string>;
264
+
265
+ /**
266
+ * Query param: Filter for specific customer types by their QuickBooks-assigned
267
+ * unique identifier(s).
268
+ *
269
+ * **IMPORTANT**: If you include this parameter, QuickBooks will ignore all other
270
+ * query parameters for this request.
271
+ *
272
+ * **NOTE**: If any of the values you specify in this parameter are not found, the
273
+ * request will return an error.
274
+ */
275
+ ids?: Array<string>;
276
+
277
+ /**
278
+ * Query param: The maximum number of objects to return.
279
+ *
280
+ * **IMPORTANT**: QuickBooks Desktop does not support cursor-based pagination for
281
+ * customer types. This parameter will limit the response size, but you cannot
282
+ * fetch subsequent results using a cursor. For pagination, use the name-range
283
+ * parameters instead (e.g., `nameFrom=A&nameTo=B`).
284
+ *
285
+ * When this parameter is omitted, the endpoint returns all customer types without
286
+ * limit, unlike paginated endpoints which default to 150 records. This is
287
+ * acceptable because customer types typically have low record counts.
288
+ */
289
+ limit?: number;
290
+
291
+ /**
292
+ * Query param: Filter for customer types whose `name` contains this substring,
293
+ * case-insensitive.
294
+ *
295
+ * **NOTE**: If you use this parameter, you cannot also use `nameStartsWith` or
296
+ * `nameEndsWith`.
297
+ */
298
+ nameContains?: string;
299
+
300
+ /**
301
+ * Query param: Filter for customer types whose `name` ends with this substring,
302
+ * case-insensitive.
303
+ *
304
+ * **NOTE**: If you use this parameter, you cannot also use `nameContains` or
305
+ * `nameStartsWith`.
306
+ */
307
+ nameEndsWith?: string;
308
+
309
+ /**
310
+ * Query param: Filter for customer types whose `name` is alphabetically greater
311
+ * than or equal to this value.
312
+ */
313
+ nameFrom?: string;
314
+
315
+ /**
316
+ * Query param: Filter for customer types whose `name` starts with this substring,
317
+ * case-insensitive.
318
+ *
319
+ * **NOTE**: If you use this parameter, you cannot also use `nameContains` or
320
+ * `nameEndsWith`.
321
+ */
322
+ nameStartsWith?: string;
323
+
324
+ /**
325
+ * Query param: Filter for customer types whose `name` is alphabetically less than
326
+ * or equal to this value.
327
+ */
328
+ nameTo?: string;
329
+
330
+ /**
331
+ * Query param: Filter for customer types that are active, inactive, or both.
332
+ */
333
+ status?: 'active' | 'all' | 'inactive';
334
+
335
+ /**
336
+ * Query param: Filter for customer types updated on or after this date/time.
337
+ * Accepts the following ISO 8601 formats:
338
+ *
339
+ * - **date-only** (YYYY-MM-DD) - QuickBooks Desktop interprets the date as the
340
+ * **start of the specified day** in the local timezone of the end-user's
341
+ * computer (e.g., `2025-01-01` → `2025-01-01T00:00:00`).
342
+ * - **datetime without timezone** (YYYY-MM-DDTHH:mm:ss) - QuickBooks Desktop
343
+ * interprets the timestamp in the local timezone of the end-user's computer.
344
+ * - **datetime with timezone** (YYYY-MM-DDTHH:mm:ss±HH:mm) - QuickBooks Desktop
345
+ * interprets the timestamp using the specified timezone.
346
+ */
347
+ updatedAfter?: string;
348
+
349
+ /**
350
+ * Query param: Filter for customer types updated on or before this date/time.
351
+ * Accepts the following ISO 8601 formats:
352
+ *
353
+ * - **date-only** (YYYY-MM-DD) - QuickBooks Desktop interprets the date as the
354
+ * **end of the specified day** in the local timezone of the end-user's computer
355
+ * (e.g., `2025-01-01` → `2025-01-01T23:59:59`).
356
+ * - **datetime without timezone** (YYYY-MM-DDTHH:mm:ss) - QuickBooks Desktop
357
+ * interprets the timestamp in the local timezone of the end-user's computer.
358
+ * - **datetime with timezone** (YYYY-MM-DDTHH:mm:ss±HH:mm) - QuickBooks Desktop
359
+ * interprets the timestamp using the specified timezone.
360
+ */
361
+ updatedBefore?: string;
362
+ }
363
+
364
+ export declare namespace CustomerTypes {
365
+ export {
366
+ type CustomerType as CustomerType,
367
+ type CustomerTypeListResponse as CustomerTypeListResponse,
368
+ type CustomerTypeCreateParams as CustomerTypeCreateParams,
369
+ type CustomerTypeRetrieveParams as CustomerTypeRetrieveParams,
370
+ type CustomerTypeListParams as CustomerTypeListParams,
371
+ };
372
+ }
@@ -131,6 +131,14 @@ export {
131
131
  type CurrencyUpdateParams,
132
132
  type CurrencyListParams,
133
133
  } from "./currencies.js";
134
+ export {
135
+ CustomerTypes,
136
+ type CustomerType,
137
+ type CustomerTypeListResponse,
138
+ type CustomerTypeCreateParams,
139
+ type CustomerTypeRetrieveParams,
140
+ type CustomerTypeListParams,
141
+ } from "./customer-types.js";
134
142
  export {
135
143
  CustomersCursorPage,
136
144
  Customers,
@@ -147,6 +147,15 @@ import {
147
147
  CurrencyRetrieveParams,
148
148
  CurrencyUpdateParams,
149
149
  } from "./currencies.js";
150
+ import * as CustomerTypesAPI from "./customer-types.js";
151
+ import {
152
+ CustomerType,
153
+ CustomerTypeCreateParams,
154
+ CustomerTypeListParams,
155
+ CustomerTypeListResponse,
156
+ CustomerTypeRetrieveParams,
157
+ CustomerTypes,
158
+ } from "./customer-types.js";
150
159
  import * as CustomersAPI from "./customers.js";
151
160
  import {
152
161
  Customer,
@@ -563,6 +572,7 @@ export class Qbd extends APIResource {
563
572
  );
564
573
  creditMemos: CreditMemosAPI.CreditMemos = new CreditMemosAPI.CreditMemos(this._client);
565
574
  currencies: CurrenciesAPI.Currencies = new CurrenciesAPI.Currencies(this._client);
575
+ customerTypes: CustomerTypesAPI.CustomerTypes = new CustomerTypesAPI.CustomerTypes(this._client);
566
576
  customers: CustomersAPI.Customers = new CustomersAPI.Customers(this._client);
567
577
  dateDrivenTerms: DateDrivenTermsAPI.DateDrivenTerms = new DateDrivenTermsAPI.DateDrivenTerms(this._client);
568
578
  deletedListObjects: DeletedListObjectsAPI.DeletedListObjects = new DeletedListObjectsAPI.DeletedListObjects(
@@ -689,6 +699,7 @@ Qbd.CreditCardRefundsCursorPage = CreditCardRefundsCursorPage;
689
699
  Qbd.CreditMemos = CreditMemos;
690
700
  Qbd.CreditMemosCursorPage = CreditMemosCursorPage;
691
701
  Qbd.Currencies = Currencies;
702
+ Qbd.CustomerTypes = CustomerTypes;
692
703
  Qbd.Customers = Customers;
693
704
  Qbd.CustomersCursorPage = CustomersCursorPage;
694
705
  Qbd.DateDrivenTerms = DateDrivenTerms;
@@ -909,6 +920,15 @@ export declare namespace Qbd {
909
920
  type CurrencyListParams as CurrencyListParams,
910
921
  };
911
922
 
923
+ export {
924
+ CustomerTypes as CustomerTypes,
925
+ type CustomerType as CustomerType,
926
+ type CustomerTypeListResponse as CustomerTypeListResponse,
927
+ type CustomerTypeCreateParams as CustomerTypeCreateParams,
928
+ type CustomerTypeRetrieveParams as CustomerTypeRetrieveParams,
929
+ type CustomerTypeListParams as CustomerTypeListParams,
930
+ };
931
+
912
932
  export {
913
933
  Customers as Customers,
914
934
  type Customer as Customer,
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '12.38.0'; // x-release-please-version
1
+ export const VERSION = '12.40.0'; // x-release-please-version
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "12.38.0";
1
+ export declare const VERSION = "12.40.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '12.38.0'; // x-release-please-version
4
+ exports.VERSION = '12.40.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '12.38.0'; // x-release-please-version
1
+ export const VERSION = '12.40.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map