@workbuddy/sdk-js-vnext 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +32 -34
- package/index.js +19 -18
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1349,24 +1349,12 @@ export interface WorkBuddySettingsItemsCreateParams extends WorkBuddyRequestPara
|
|
|
1349
1349
|
uoms?: { uomId?: string; uomName?: string; conversionRate: number }[];
|
|
1350
1350
|
}
|
|
1351
1351
|
|
|
1352
|
-
export interface
|
|
1353
|
-
/**
|
|
1354
|
-
* Entity ID
|
|
1355
|
-
*/
|
|
1356
|
-
id: string;
|
|
1357
|
-
}
|
|
1358
|
-
|
|
1359
|
-
export interface WorkBuddySettingsItemsUpdateParams extends WorkBuddyRequestParams {
|
|
1360
|
-
/**
|
|
1361
|
-
* Entity ID
|
|
1362
|
-
*/
|
|
1363
|
-
id: string;
|
|
1364
|
-
|
|
1352
|
+
export interface WorkBuddySettingsItemsUpsertParams extends WorkBuddyRequestParams {
|
|
1365
1353
|
type?: 'SERVICE' | 'INVENTORY' | 'NON-INVENTORY' | 'LABOUR' | 'INCENTIVE';
|
|
1366
1354
|
/**
|
|
1367
1355
|
* Display name
|
|
1368
1356
|
*/
|
|
1369
|
-
name
|
|
1357
|
+
name: string;
|
|
1370
1358
|
/**
|
|
1371
1359
|
* base uom ID
|
|
1372
1360
|
*/
|
|
@@ -1445,19 +1433,24 @@ export interface WorkBuddySettingsItemsUpdateParams extends WorkBuddyRequestPara
|
|
|
1445
1433
|
uoms?: { uomId?: string; uomName?: string; conversionRate: number }[];
|
|
1446
1434
|
}
|
|
1447
1435
|
|
|
1448
|
-
export interface
|
|
1436
|
+
export interface WorkBuddySettingsItemsGetParams extends WorkBuddyRequestParams {
|
|
1449
1437
|
/**
|
|
1450
1438
|
* Entity ID
|
|
1451
1439
|
*/
|
|
1452
1440
|
id: string;
|
|
1453
1441
|
}
|
|
1454
1442
|
|
|
1455
|
-
export interface
|
|
1456
|
-
|
|
1443
|
+
export interface WorkBuddySettingsItemsUpdateParams extends WorkBuddyRequestParams {
|
|
1444
|
+
/**
|
|
1445
|
+
* Entity ID
|
|
1446
|
+
*/
|
|
1447
|
+
id: string;
|
|
1448
|
+
|
|
1449
|
+
type?: 'SERVICE' | 'INVENTORY' | 'NON-INVENTORY' | 'LABOUR' | 'INCENTIVE';
|
|
1457
1450
|
/**
|
|
1458
1451
|
* Display name
|
|
1459
1452
|
*/
|
|
1460
|
-
name
|
|
1453
|
+
name?: string;
|
|
1461
1454
|
/**
|
|
1462
1455
|
* base uom ID
|
|
1463
1456
|
*/
|
|
@@ -1467,9 +1460,9 @@ export interface WorkBuddySettingsItemsUpsertParams extends WorkBuddyRequestPara
|
|
|
1467
1460
|
/**
|
|
1468
1461
|
* Detailed description
|
|
1469
1462
|
*/
|
|
1470
|
-
description
|
|
1463
|
+
description?: string;
|
|
1471
1464
|
|
|
1472
|
-
category
|
|
1465
|
+
category?: { categoryId?: string; categoryName?: string; subCategoryId?: string; subCategoryName?: string };
|
|
1473
1466
|
/**
|
|
1474
1467
|
* Whether the entity is active
|
|
1475
1468
|
*/
|
|
@@ -1534,8 +1527,13 @@ export interface WorkBuddySettingsItemsUpsertParams extends WorkBuddyRequestPara
|
|
|
1534
1527
|
trackingCategory2?: string;
|
|
1535
1528
|
|
|
1536
1529
|
uoms?: { uomId?: string; uomName?: string; conversionRate: number }[];
|
|
1530
|
+
}
|
|
1537
1531
|
|
|
1538
|
-
|
|
1532
|
+
export interface WorkBuddySettingsItemsDeleteParams extends WorkBuddyRequestParams {
|
|
1533
|
+
/**
|
|
1534
|
+
* Entity ID
|
|
1535
|
+
*/
|
|
1536
|
+
id: string;
|
|
1539
1537
|
}
|
|
1540
1538
|
|
|
1541
1539
|
export interface WorkBuddySettingsItemCategoriesListParams extends WorkBuddyRequestParams {}
|
|
@@ -4049,7 +4047,7 @@ export type WorkBuddySettingsItemsCreateResponse = {
|
|
|
4049
4047
|
updatedAt?: string;
|
|
4050
4048
|
};
|
|
4051
4049
|
};
|
|
4052
|
-
export type
|
|
4050
|
+
export type WorkBuddySettingsItemsUpsertResponse = {
|
|
4053
4051
|
item: {
|
|
4054
4052
|
id: string;
|
|
4055
4053
|
type: 'SERVICE' | 'INVENTORY' | 'NON-INVENTORY' | 'LABOUR' | 'INCENTIVE';
|
|
@@ -4085,7 +4083,7 @@ export type WorkBuddySettingsItemsGetResponse = {
|
|
|
4085
4083
|
updatedAt?: string;
|
|
4086
4084
|
};
|
|
4087
4085
|
};
|
|
4088
|
-
export type
|
|
4086
|
+
export type WorkBuddySettingsItemsGetResponse = {
|
|
4089
4087
|
item: {
|
|
4090
4088
|
id: string;
|
|
4091
4089
|
type: 'SERVICE' | 'INVENTORY' | 'NON-INVENTORY' | 'LABOUR' | 'INCENTIVE';
|
|
@@ -4121,8 +4119,7 @@ export type WorkBuddySettingsItemsUpdateResponse = {
|
|
|
4121
4119
|
updatedAt?: string;
|
|
4122
4120
|
};
|
|
4123
4121
|
};
|
|
4124
|
-
export type
|
|
4125
|
-
export type WorkBuddySettingsItemsUpsertResponse = {
|
|
4122
|
+
export type WorkBuddySettingsItemsUpdateResponse = {
|
|
4126
4123
|
item: {
|
|
4127
4124
|
id: string;
|
|
4128
4125
|
type: 'SERVICE' | 'INVENTORY' | 'NON-INVENTORY' | 'LABOUR' | 'INCENTIVE';
|
|
@@ -4158,6 +4155,7 @@ export type WorkBuddySettingsItemsUpsertResponse = {
|
|
|
4158
4155
|
updatedAt?: string;
|
|
4159
4156
|
};
|
|
4160
4157
|
};
|
|
4158
|
+
export type WorkBuddySettingsItemsDeleteResponse = unknown;
|
|
4161
4159
|
export type WorkBuddySettingsItemCategoriesListResponse = {
|
|
4162
4160
|
items: {
|
|
4163
4161
|
id: string;
|
|
@@ -5529,6 +5527,15 @@ export interface WorkBuddySettingsItemsResource {
|
|
|
5529
5527
|
options?: WorkBuddyRequestOptions
|
|
5530
5528
|
): Promise<TResponse>;
|
|
5531
5529
|
|
|
5530
|
+
/**
|
|
5531
|
+
* Create or partially update a settings item using integrationId when supplied, otherwise name. Create still requires mandatory item fields.
|
|
5532
|
+
* Operation: PublicApiItemController_upsert
|
|
5533
|
+
*/
|
|
5534
|
+
upsert<TResponse = WorkBuddySettingsItemsUpsertResponse>(
|
|
5535
|
+
params: WorkBuddySettingsItemsUpsertParams,
|
|
5536
|
+
options?: WorkBuddyRequestOptions
|
|
5537
|
+
): Promise<TResponse>;
|
|
5538
|
+
|
|
5532
5539
|
/**
|
|
5533
5540
|
* Retrieve a settings item by ID.
|
|
5534
5541
|
* Operation: PublicApiItemController_getById
|
|
@@ -5555,15 +5562,6 @@ export interface WorkBuddySettingsItemsResource {
|
|
|
5555
5562
|
params: WorkBuddySettingsItemsDeleteParams,
|
|
5556
5563
|
options?: WorkBuddyRequestOptions
|
|
5557
5564
|
): Promise<TResponse>;
|
|
5558
|
-
|
|
5559
|
-
/**
|
|
5560
|
-
* Create or update a settings item using integrationId or name as the match key.
|
|
5561
|
-
* Operation: PublicApiItemController_upsert
|
|
5562
|
-
*/
|
|
5563
|
-
upsert<TResponse = WorkBuddySettingsItemsUpsertResponse>(
|
|
5564
|
-
params: WorkBuddySettingsItemsUpsertParams,
|
|
5565
|
-
options?: WorkBuddyRequestOptions
|
|
5566
|
-
): Promise<TResponse>;
|
|
5567
5565
|
}
|
|
5568
5566
|
|
|
5569
5567
|
export interface WorkBuddySettingsItemCategoriesResource {
|
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const PUBLIC_API_BASE_PATH = '/api/v2/public';
|
|
2
2
|
const DEFAULT_API_VERSION = '2026-01';
|
|
3
|
-
const DEFAULT_TOKEN_URL = '
|
|
3
|
+
const DEFAULT_TOKEN_URL = '/api/oauth2/token';
|
|
4
4
|
|
|
5
5
|
export class WorkBuddyApiError extends Error {
|
|
6
6
|
constructor(message, response, data) {
|
|
@@ -561,6 +561,11 @@ export class WorkBuddyClient {
|
|
|
561
561
|
* Operation: PublicApiItemController_create
|
|
562
562
|
*/
|
|
563
563
|
create: (params = {}, options = {}) => this.request('PublicApiItemController_create', params, options),
|
|
564
|
+
/**
|
|
565
|
+
* Create or partially update a settings item using integrationId when supplied, otherwise name. Create still requires mandatory item fields.
|
|
566
|
+
* Operation: PublicApiItemController_upsert
|
|
567
|
+
*/
|
|
568
|
+
upsert: (params = {}, options = {}) => this.request('PublicApiItemController_upsert', params, options),
|
|
564
569
|
/**
|
|
565
570
|
* Retrieve a settings item by ID.
|
|
566
571
|
* Operation: PublicApiItemController_getById
|
|
@@ -576,11 +581,6 @@ export class WorkBuddyClient {
|
|
|
576
581
|
* Operation: PublicApiItemController_delete
|
|
577
582
|
*/
|
|
578
583
|
delete: (params = {}, options = {}) => this.request('PublicApiItemController_delete', params, options),
|
|
579
|
-
/**
|
|
580
|
-
* Create or update a settings item using integrationId or name as the match key.
|
|
581
|
-
* Operation: PublicApiItemController_upsert
|
|
582
|
-
*/
|
|
583
|
-
upsert: (params = {}, options = {}) => this.request('PublicApiItemController_upsert', params, options),
|
|
584
584
|
},
|
|
585
585
|
itemCategories: {
|
|
586
586
|
/**
|
|
@@ -1647,6 +1647,19 @@ export const operations = [
|
|
|
1647
1647
|
queryParams: [],
|
|
1648
1648
|
hasRequestBody: true,
|
|
1649
1649
|
},
|
|
1650
|
+
{
|
|
1651
|
+
operationId: 'PublicApiItemController_upsert',
|
|
1652
|
+
resourcePath: ['settings', 'items'],
|
|
1653
|
+
actionName: 'upsert',
|
|
1654
|
+
displayName: 'Upsert item',
|
|
1655
|
+
description:
|
|
1656
|
+
'Create or partially update a settings item using integrationId when supplied, otherwise name. Create still requires mandatory item fields.',
|
|
1657
|
+
method: 'PUT',
|
|
1658
|
+
path: '/settings/items',
|
|
1659
|
+
pathParams: [],
|
|
1660
|
+
queryParams: [],
|
|
1661
|
+
hasRequestBody: true,
|
|
1662
|
+
},
|
|
1650
1663
|
{
|
|
1651
1664
|
operationId: 'PublicApiItemController_getById',
|
|
1652
1665
|
resourcePath: ['settings', 'items'],
|
|
@@ -1683,18 +1696,6 @@ export const operations = [
|
|
|
1683
1696
|
queryParams: [],
|
|
1684
1697
|
hasRequestBody: false,
|
|
1685
1698
|
},
|
|
1686
|
-
{
|
|
1687
|
-
operationId: 'PublicApiItemController_upsert',
|
|
1688
|
-
resourcePath: ['settings', 'items'],
|
|
1689
|
-
actionName: 'upsert',
|
|
1690
|
-
displayName: 'Upsert item',
|
|
1691
|
-
description: 'Create or update a settings item using integrationId or name as the match key.',
|
|
1692
|
-
method: 'POST',
|
|
1693
|
-
path: '/settings/items/upsert',
|
|
1694
|
-
pathParams: [],
|
|
1695
|
-
queryParams: [],
|
|
1696
|
-
hasRequestBody: true,
|
|
1697
|
-
},
|
|
1698
1699
|
{
|
|
1699
1700
|
operationId: 'PublicApiItemCategoryController_list',
|
|
1700
1701
|
resourcePath: ['settings', 'itemCategories'],
|