conductor-node 12.23.1 → 12.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/index.d.ts.map +1 -1
  3. package/index.js +1 -1
  4. package/index.js.map +1 -1
  5. package/index.mjs +1 -1
  6. package/index.mjs.map +1 -1
  7. package/package.json +1 -1
  8. package/resources/qbd/index.d.ts +1 -0
  9. package/resources/qbd/index.d.ts.map +1 -1
  10. package/resources/qbd/index.js +3 -1
  11. package/resources/qbd/index.js.map +1 -1
  12. package/resources/qbd/index.mjs +1 -0
  13. package/resources/qbd/index.mjs.map +1 -1
  14. package/resources/qbd/qbd.d.ts +4 -0
  15. package/resources/qbd/qbd.d.ts.map +1 -1
  16. package/resources/qbd/qbd.js +4 -0
  17. package/resources/qbd/qbd.js.map +1 -1
  18. package/resources/qbd/qbd.mjs +4 -0
  19. package/resources/qbd/qbd.mjs.map +1 -1
  20. package/resources/qbd/sales-receipts.d.ts +6 -7
  21. package/resources/qbd/sales-receipts.d.ts.map +1 -1
  22. package/resources/qbd/sales-receipts.js +0 -1
  23. package/resources/qbd/sales-receipts.js.map +1 -1
  24. package/resources/qbd/sales-receipts.mjs +0 -1
  25. package/resources/qbd/sales-receipts.mjs.map +1 -1
  26. package/resources/qbd/unit-of-measure-sets.d.ts +426 -0
  27. package/resources/qbd/unit-of-measure-sets.d.ts.map +1 -0
  28. package/resources/qbd/unit-of-measure-sets.js +80 -0
  29. package/resources/qbd/unit-of-measure-sets.js.map +1 -0
  30. package/resources/qbd/unit-of-measure-sets.mjs +76 -0
  31. package/resources/qbd/unit-of-measure-sets.mjs.map +1 -0
  32. package/src/index.ts +2 -1
  33. package/src/resources/qbd/index.ts +8 -0
  34. package/src/resources/qbd/qbd.ts +22 -0
  35. package/src/resources/qbd/sales-receipts.ts +7 -8
  36. package/src/resources/qbd/unit-of-measure-sets.ts +515 -0
  37. package/src/version.ts +1 -1
  38. package/version.d.ts +1 -1
  39. package/version.js +1 -1
  40. package/version.mjs +1 -1
@@ -0,0 +1,515 @@
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 UnitOfMeasureSets extends APIResource {
7
+ /**
8
+ * Creates a new unit-of-measure set.
9
+ *
10
+ * NOTE: The QuickBooks company file must have unit-of-measure enabled (either a
11
+ * single unit per item or multiple units per item). To support both
12
+ * configurations, prefix all UOM set names with "By the" (for example, "By the
13
+ * Barrel"); otherwise, the set may not appear in the QuickBooks UI when the
14
+ * company file is configured for a single unit per item.
15
+ *
16
+ * @example
17
+ * ```ts
18
+ * const unitOfMeasureSet =
19
+ * await conductor.qbd.unitOfMeasureSets.create({
20
+ * baseUnit: { abbreviation: 'ea', name: 'Each' },
21
+ * name: 'Weight Units',
22
+ * unitOfMeasureType: 'count',
23
+ * conductorEndUserId: 'end_usr_1234567abcdefg',
24
+ * });
25
+ * ```
26
+ */
27
+ create(
28
+ params: UnitOfMeasureSetCreateParams,
29
+ options?: Core.RequestOptions,
30
+ ): Core.APIPromise<UnitOfMeasureSet> {
31
+ const { conductorEndUserId, ...body } = params;
32
+ return this._client.post('/quickbooks-desktop/unit-of-measure-sets', {
33
+ body,
34
+ ...options,
35
+ headers: { 'Conductor-End-User-Id': conductorEndUserId, ...options?.headers },
36
+ });
37
+ }
38
+
39
+ /**
40
+ * Retrieves an unit-of-measure set by ID.
41
+ *
42
+ * @example
43
+ * ```ts
44
+ * const unitOfMeasureSet =
45
+ * await conductor.qbd.unitOfMeasureSets.retrieve(
46
+ * '80000001-1234567890',
47
+ * { conductorEndUserId: 'end_usr_1234567abcdefg' },
48
+ * );
49
+ * ```
50
+ */
51
+ retrieve(
52
+ id: string,
53
+ params: UnitOfMeasureSetRetrieveParams,
54
+ options?: Core.RequestOptions,
55
+ ): Core.APIPromise<UnitOfMeasureSet> {
56
+ const { conductorEndUserId } = params;
57
+ return this._client.get(`/quickbooks-desktop/unit-of-measure-sets/${id}`, {
58
+ ...options,
59
+ headers: { 'Conductor-End-User-Id': conductorEndUserId, ...options?.headers },
60
+ });
61
+ }
62
+
63
+ /**
64
+ * Lists all unit-of-measure sets. NOTE: QuickBooks Desktop does not support
65
+ * pagination for unit-of-measure sets; hence, there is no cursor parameter. Users
66
+ * typically have few unit-of-measure sets.
67
+ *
68
+ * NOTE: The QuickBooks company file must have unit-of-measure enabled (either a
69
+ * single unit per item or multiple units per item).
70
+ *
71
+ * @example
72
+ * ```ts
73
+ * const unitOfMeasureSets =
74
+ * await conductor.qbd.unitOfMeasureSets.list({
75
+ * conductorEndUserId: 'end_usr_1234567abcdefg',
76
+ * });
77
+ * ```
78
+ */
79
+ list(
80
+ params: UnitOfMeasureSetListParams,
81
+ options?: Core.RequestOptions,
82
+ ): Core.APIPromise<UnitOfMeasureSetListResponse> {
83
+ const { conductorEndUserId, ...query } = params;
84
+ return this._client.get('/quickbooks-desktop/unit-of-measure-sets', {
85
+ query,
86
+ ...options,
87
+ headers: { 'Conductor-End-User-Id': conductorEndUserId, ...options?.headers },
88
+ });
89
+ }
90
+ }
91
+
92
+ export interface UnitOfMeasureSet {
93
+ /**
94
+ * The unique identifier assigned by QuickBooks to this unit-of-measure set. This
95
+ * ID is unique across all unit-of-measure sets but not across different QuickBooks
96
+ * object types.
97
+ */
98
+ id: string;
99
+
100
+ /**
101
+ * The unit-of-measure set's base unit used to track and price item quantities. If
102
+ * the company file is enabled for a single unit of measure per item, the base unit
103
+ * is the only unit available on transaction line items. If enabled for multiple
104
+ * units per item, the base unit is the default unless overridden by the set's
105
+ * default units.
106
+ */
107
+ baseUnit: UnitOfMeasureSet.BaseUnit;
108
+
109
+ /**
110
+ * The date and time when this unit-of-measure set was created, in ISO 8601 format
111
+ * (YYYY-MM-DDThh:mm:ss±hh:mm). The time zone is the same as the user's time zone
112
+ * in QuickBooks.
113
+ */
114
+ createdAt: string;
115
+
116
+ /**
117
+ * The unit-of-measure set's default units to appear in the U/M field on
118
+ * transaction line items. You can specify separate defaults for purchases, sales,
119
+ * and shipping.
120
+ */
121
+ defaultUnits: Array<UnitOfMeasureSet.DefaultUnit>;
122
+
123
+ /**
124
+ * Indicates whether this unit-of-measure set is active. Inactive objects are
125
+ * typically hidden from views and reports in QuickBooks. Defaults to `true`.
126
+ */
127
+ isActive: boolean;
128
+
129
+ /**
130
+ * The case-insensitive unique name of this unit-of-measure set, unique across all
131
+ * unit-of-measure sets. To ensure this set appears in the QuickBooks UI for
132
+ * companies configured with a single unit per item, prefix the name with "By the"
133
+ * (e.g., "By the Barrel").
134
+ *
135
+ * **NOTE**: Unit-of-measure sets do not have a `fullName` field because they are
136
+ * not hierarchical objects, which is why `name` is unique for them but not for
137
+ * objects that have parents.
138
+ */
139
+ name: string;
140
+
141
+ /**
142
+ * The type of object. This value is always `"qbd_unit_of_measure_set"`.
143
+ */
144
+ objectType: 'qbd_unit_of_measure_set';
145
+
146
+ /**
147
+ * The unit-of-measure set's related units, each specifying how many base units
148
+ * they represent (conversion ratio).
149
+ */
150
+ relatedUnits: Array<UnitOfMeasureSet.RelatedUnit>;
151
+
152
+ /**
153
+ * The current QuickBooks-assigned revision number of this unit-of-measure set
154
+ * object, which changes each time the object is modified. When updating this
155
+ * object, you must provide the most recent `revisionNumber` to ensure you're
156
+ * working with the latest data; otherwise, the update will return an error.
157
+ */
158
+ revisionNumber: string;
159
+
160
+ /**
161
+ * The unit-of-measure set's type. Use "other" for a custom type defined in
162
+ * QuickBooks.
163
+ */
164
+ unitOfMeasureType: 'area' | 'count' | 'length' | 'other' | 'time' | 'volume' | 'weight';
165
+
166
+ /**
167
+ * The date and time when this unit-of-measure set was last updated, in ISO 8601
168
+ * format (YYYY-MM-DDThh:mm:ss±hh:mm). The time zone is the same as the user's time
169
+ * zone in QuickBooks.
170
+ */
171
+ updatedAt: string;
172
+ }
173
+
174
+ export namespace UnitOfMeasureSet {
175
+ /**
176
+ * The unit-of-measure set's base unit used to track and price item quantities. If
177
+ * the company file is enabled for a single unit of measure per item, the base unit
178
+ * is the only unit available on transaction line items. If enabled for multiple
179
+ * units per item, the base unit is the default unless overridden by the set's
180
+ * default units.
181
+ */
182
+ export interface BaseUnit {
183
+ /**
184
+ * The base unit's short identifier shown in the QuickBooks U/M field on
185
+ * transaction line items.
186
+ */
187
+ abbreviation: string;
188
+
189
+ /**
190
+ * The case-insensitive unique name of this base unit, unique across all base
191
+ * units.
192
+ *
193
+ * **NOTE**: Base units do not have a `fullName` field because they are not
194
+ * hierarchical objects, which is why `name` is unique for them but not for objects
195
+ * that have parents.
196
+ */
197
+ name: string;
198
+ }
199
+
200
+ export interface DefaultUnit {
201
+ /**
202
+ * The unit name for this default unit, as displayed in the U/M field. If the
203
+ * company file is enabled for multiple units per item, this appears as an
204
+ * available unit for the item. Must correspond to the base unit or a related unit
205
+ * defined in this set.
206
+ */
207
+ unit: string;
208
+
209
+ /**
210
+ * Where this default unit is used as the default: purchase line items, sales line
211
+ * items, or shipping lines.
212
+ */
213
+ unitUsedFor: 'purchase' | 'sales' | 'shipping';
214
+ }
215
+
216
+ export interface RelatedUnit {
217
+ /**
218
+ * The related unit's short identifier shown in the QuickBooks U/M field on
219
+ * transaction line items.
220
+ */
221
+ abbreviation: string;
222
+
223
+ /**
224
+ * The number of base units in this related unit, represented as a decimal string.
225
+ * For example, if the base unit is "box" and this related unit is "case" with
226
+ * `conversionRatio` = "10", that means there are 10 boxes in one case.
227
+ */
228
+ conversionRatio: string;
229
+
230
+ /**
231
+ * The case-insensitive unique name of this related unit, unique across all related
232
+ * units.
233
+ *
234
+ * **NOTE**: Related units do not have a `fullName` field because they are not
235
+ * hierarchical objects, which is why `name` is unique for them but not for objects
236
+ * that have parents.
237
+ */
238
+ name: string;
239
+ }
240
+ }
241
+
242
+ export interface UnitOfMeasureSetListResponse {
243
+ /**
244
+ * The array of unit-of-measure sets.
245
+ */
246
+ data: Array<UnitOfMeasureSet>;
247
+
248
+ /**
249
+ * The type of object. This value is always `"list"`.
250
+ */
251
+ objectType: 'list';
252
+
253
+ /**
254
+ * The endpoint URL where this list can be accessed.
255
+ */
256
+ url: string;
257
+ }
258
+
259
+ export interface UnitOfMeasureSetCreateParams {
260
+ /**
261
+ * Body param: The unit-of-measure set's base unit used to track and price item
262
+ * quantities. If the company file is enabled for a single unit of measure per
263
+ * item, the base unit is the only unit available on transaction line items. If
264
+ * enabled for multiple units per item, the base unit is the default unless
265
+ * overridden by the set's default units.
266
+ */
267
+ baseUnit: UnitOfMeasureSetCreateParams.BaseUnit;
268
+
269
+ /**
270
+ * Body param: The case-insensitive unique name of this unit-of-measure set, unique
271
+ * across all unit-of-measure sets. To ensure this set appears in the QuickBooks UI
272
+ * for companies configured with a single unit per item, prefix the name with "By
273
+ * the" (e.g., "By the Barrel").
274
+ *
275
+ * **NOTE**: Unit-of-measure sets do not have a `fullName` field because they are
276
+ * not hierarchical objects, which is why `name` is unique for them but not for
277
+ * objects that have parents.
278
+ *
279
+ * Maximum length: 31 characters.
280
+ */
281
+ name: string;
282
+
283
+ /**
284
+ * Body param: The unit-of-measure set's type. Use "other" for a custom type
285
+ * defined in QuickBooks.
286
+ */
287
+ unitOfMeasureType: 'area' | 'count' | 'length' | 'other' | 'time' | 'volume' | 'weight';
288
+
289
+ /**
290
+ * Header param: The ID of the EndUser to receive this request (e.g.,
291
+ * `"Conductor-End-User-Id: {{END_USER_ID}}"`).
292
+ */
293
+ conductorEndUserId: string;
294
+
295
+ /**
296
+ * Body param: The unit-of-measure set's default units to appear in the U/M field
297
+ * on transaction line items. You can specify separate defaults for purchases,
298
+ * sales, and shipping.
299
+ */
300
+ defaultUnits?: Array<UnitOfMeasureSetCreateParams.DefaultUnit>;
301
+
302
+ /**
303
+ * Body param: Indicates whether this unit-of-measure set is active. Inactive
304
+ * objects are typically hidden from views and reports in QuickBooks. Defaults to
305
+ * `true`.
306
+ */
307
+ isActive?: boolean;
308
+
309
+ /**
310
+ * Body param: The unit-of-measure set's related units, each specifying how many
311
+ * base units they represent (conversion ratio).
312
+ */
313
+ relatedUnits?: Array<UnitOfMeasureSetCreateParams.RelatedUnit>;
314
+ }
315
+
316
+ export namespace UnitOfMeasureSetCreateParams {
317
+ /**
318
+ * The unit-of-measure set's base unit used to track and price item quantities. If
319
+ * the company file is enabled for a single unit of measure per item, the base unit
320
+ * is the only unit available on transaction line items. If enabled for multiple
321
+ * units per item, the base unit is the default unless overridden by the set's
322
+ * default units.
323
+ */
324
+ export interface BaseUnit {
325
+ /**
326
+ * The base unit's short identifier shown in the QuickBooks U/M field on
327
+ * transaction line items.
328
+ *
329
+ * Maximum length: 31 characters.
330
+ */
331
+ abbreviation: string;
332
+
333
+ /**
334
+ * The case-insensitive unique name of this base unit, unique across all base
335
+ * units.
336
+ *
337
+ * **NOTE**: Base units do not have a `fullName` field because they are not
338
+ * hierarchical objects, which is why `name` is unique for them but not for objects
339
+ * that have parents.
340
+ *
341
+ * Maximum length: 31 characters.
342
+ */
343
+ name: string;
344
+ }
345
+
346
+ export interface DefaultUnit {
347
+ /**
348
+ * The unit name for this default unit, as displayed in the U/M field. If the
349
+ * company file is enabled for multiple units per item, this appears as an
350
+ * available unit for the item. Must correspond to the base unit or a related unit
351
+ * defined in this set.
352
+ *
353
+ * Maximum length: 31 characters.
354
+ */
355
+ unit: string;
356
+
357
+ /**
358
+ * Where this default unit is used as the default: purchase line items, sales line
359
+ * items, or shipping lines.
360
+ */
361
+ unitUsedFor: 'purchase' | 'sales' | 'shipping';
362
+ }
363
+
364
+ export interface RelatedUnit {
365
+ /**
366
+ * The related unit's short identifier shown in the QuickBooks U/M field on
367
+ * transaction line items.
368
+ *
369
+ * Maximum length: 31 characters.
370
+ */
371
+ abbreviation: string;
372
+
373
+ /**
374
+ * The number of base units in this related unit, represented as a decimal string.
375
+ * For example, if the base unit is "box" and this related unit is "case" with
376
+ * `conversionRatio` = "10", that means there are 10 boxes in one case.
377
+ */
378
+ conversionRatio: string;
379
+
380
+ /**
381
+ * The case-insensitive unique name of this related unit, unique across all related
382
+ * units.
383
+ *
384
+ * **NOTE**: Related units do not have a `fullName` field because they are not
385
+ * hierarchical objects, which is why `name` is unique for them but not for objects
386
+ * that have parents.
387
+ *
388
+ * Maximum length: 31 characters.
389
+ */
390
+ name: string;
391
+ }
392
+ }
393
+
394
+ export interface UnitOfMeasureSetRetrieveParams {
395
+ /**
396
+ * The ID of the EndUser to receive this request (e.g.,
397
+ * `"Conductor-End-User-Id: {{END_USER_ID}}"`).
398
+ */
399
+ conductorEndUserId: string;
400
+ }
401
+
402
+ export interface UnitOfMeasureSetListParams {
403
+ /**
404
+ * Header param: The ID of the EndUser to receive this request (e.g.,
405
+ * `"Conductor-End-User-Id: {{END_USER_ID}}"`).
406
+ */
407
+ conductorEndUserId: string;
408
+
409
+ /**
410
+ * Query param: Filter for specific unit-of-measure sets by their
411
+ * QuickBooks-assigned unique identifier(s).
412
+ *
413
+ * **IMPORTANT**: If you include this parameter, QuickBooks will ignore all other
414
+ * query parameters for this request.
415
+ *
416
+ * **NOTE**: If any of the values you specify in this parameter are not found, the
417
+ * request will return an error.
418
+ */
419
+ ids?: Array<string>;
420
+
421
+ /**
422
+ * Query param: The maximum number of objects to return.
423
+ *
424
+ * **IMPORTANT**: QuickBooks Desktop does not support cursor-based pagination for
425
+ * unit-of-measure sets. This parameter will limit the response size, but you
426
+ * cannot fetch subsequent results using a cursor. For pagination, use the
427
+ * name-range parameters instead (e.g., `nameFrom=A&nameTo=B`).
428
+ *
429
+ * When this parameter is omitted, the endpoint returns all unit-of-measure sets
430
+ * without limit, unlike paginated endpoints which default to 150 records. This is
431
+ * acceptable because unit-of-measure sets typically have low record counts.
432
+ */
433
+ limit?: number;
434
+
435
+ /**
436
+ * Query param: Filter for unit-of-measure sets whose `name` contains this
437
+ * substring, case-insensitive.
438
+ *
439
+ * **NOTE**: If you use this parameter, you cannot also use `nameStartsWith` or
440
+ * `nameEndsWith`.
441
+ */
442
+ nameContains?: string;
443
+
444
+ /**
445
+ * Query param: Filter for unit-of-measure sets whose `name` ends with this
446
+ * substring, case-insensitive.
447
+ *
448
+ * **NOTE**: If you use this parameter, you cannot also use `nameContains` or
449
+ * `nameStartsWith`.
450
+ */
451
+ nameEndsWith?: string;
452
+
453
+ /**
454
+ * Query param: Filter for unit-of-measure sets whose `name` is alphabetically
455
+ * greater than or equal to this value.
456
+ */
457
+ nameFrom?: string;
458
+
459
+ /**
460
+ * Query param: Filter for specific unit-of-measure sets by their name(s),
461
+ * case-insensitive. Like `id`, `name` is a unique identifier for an
462
+ * unit-of-measure set.
463
+ *
464
+ * **IMPORTANT**: If you include this parameter, QuickBooks will ignore all other
465
+ * query parameters for this request.
466
+ *
467
+ * **NOTE**: If any of the values you specify in this parameter are not found, the
468
+ * request will return an error.
469
+ */
470
+ names?: Array<string>;
471
+
472
+ /**
473
+ * Query param: Filter for unit-of-measure sets whose `name` starts with this
474
+ * substring, case-insensitive.
475
+ *
476
+ * **NOTE**: If you use this parameter, you cannot also use `nameContains` or
477
+ * `nameEndsWith`.
478
+ */
479
+ nameStartsWith?: string;
480
+
481
+ /**
482
+ * Query param: Filter for unit-of-measure sets whose `name` is alphabetically less
483
+ * than or equal to this value.
484
+ */
485
+ nameTo?: string;
486
+
487
+ /**
488
+ * Query param: Filter for unit-of-measure sets that are active, inactive, or both.
489
+ */
490
+ status?: 'active' | 'all' | 'inactive';
491
+
492
+ /**
493
+ * Query param: Filter for unit-of-measure sets updated on or after this date and
494
+ * time, in ISO 8601 format (YYYY-MM-DDTHH:mm:ss). If you only provide a date
495
+ * (YYYY-MM-DD), the time is assumed to be 00:00:00 of that day.
496
+ */
497
+ updatedAfter?: string;
498
+
499
+ /**
500
+ * Query param: Filter for unit-of-measure sets updated on or before this date and
501
+ * time, in ISO 8601 format (YYYY-MM-DDTHH:mm:ss). If you only provide a date
502
+ * (YYYY-MM-DD), the time is assumed to be 23:59:59 of that day.
503
+ */
504
+ updatedBefore?: string;
505
+ }
506
+
507
+ export declare namespace UnitOfMeasureSets {
508
+ export {
509
+ type UnitOfMeasureSet as UnitOfMeasureSet,
510
+ type UnitOfMeasureSetListResponse as UnitOfMeasureSetListResponse,
511
+ type UnitOfMeasureSetCreateParams as UnitOfMeasureSetCreateParams,
512
+ type UnitOfMeasureSetRetrieveParams as UnitOfMeasureSetRetrieveParams,
513
+ type UnitOfMeasureSetListParams as UnitOfMeasureSetListParams,
514
+ };
515
+ }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '12.23.1'; // x-release-please-version
1
+ export const VERSION = '12.25.0'; // x-release-please-version
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "12.23.1";
1
+ export declare const VERSION = "12.25.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.23.1'; // x-release-please-version
4
+ exports.VERSION = '12.25.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '12.23.1'; // x-release-please-version
1
+ export const VERSION = '12.25.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map