@workbuddy/sdk-js-vnext 1.0.70 → 1.0.71

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 (3) hide show
  1. package/index.d.ts +153 -0
  2. package/index.js +59 -0
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -1335,6 +1335,19 @@ export interface WorkBuddyStagesCancelCancelParams extends WorkBuddyRequestParam
1335
1335
  note: string;
1336
1336
  }
1337
1337
 
1338
+ export interface WorkBuddyStagesOnHoldOnHoldParams extends WorkBuddyRequestParams {
1339
+ /**
1340
+ * Stage ID
1341
+ */
1342
+ id: string;
1343
+ /**
1344
+ * status ID
1345
+ */
1346
+ statusId: string;
1347
+
1348
+ note?: string;
1349
+ }
1350
+
1338
1351
  export interface WorkBuddyStagesReverseReverseParams extends WorkBuddyRequestParams {
1339
1352
  /**
1340
1353
  * Stage ID
@@ -1476,6 +1489,37 @@ export interface WorkBuddySettingsJobTemplatesListParams extends WorkBuddyReques
1476
1489
 
1477
1490
  export interface WorkBuddySettingsPrioritiesListParams extends WorkBuddyRequestParams {}
1478
1491
 
1492
+ export interface WorkBuddySettingsPricebooksListParams extends WorkBuddyRequestParams {
1493
+ limit?: number;
1494
+
1495
+ assignableOnly?: boolean;
1496
+
1497
+ mode?: 'static' | 'dynamic';
1498
+ /**
1499
+ * Name contains or exact id
1500
+ */
1501
+ search?: string;
1502
+
1503
+ includeGlobal?: boolean;
1504
+ /**
1505
+ * account ID
1506
+ */
1507
+ accountId?: string;
1508
+
1509
+ status?: 'current' | 'expired' | 'future' | 'all';
1510
+
1511
+ category: 'customer' | 'contractor' | 'supplier';
1512
+ }
1513
+
1514
+ export interface WorkBuddySettingsPricebooksGetByIdOrNameParams extends WorkBuddyRequestParams {
1515
+ /**
1516
+ * Pricebook id or exact name
1517
+ */
1518
+ idOrName: string;
1519
+
1520
+ category?: 'customer' | 'contractor' | 'supplier';
1521
+ }
1522
+
1479
1523
  export interface WorkBuddySettingsStageStatusesListParams extends WorkBuddyRequestParams {}
1480
1524
 
1481
1525
  export interface WorkBuddySettingsTagsListParams extends WorkBuddyRequestParams {}
@@ -4614,6 +4658,52 @@ export type WorkBuddyStagesCancelCancelResponse = {
4614
4658
  createdAt: string;
4615
4659
  updatedAt: string;
4616
4660
  };
4661
+ export type WorkBuddyStagesOnHoldOnHoldResponse = {
4662
+ id: string;
4663
+ stageNumber: string;
4664
+ jobId: string;
4665
+ job?: { id: string; jobNumber: string; description?: string };
4666
+ name?: string;
4667
+ status: { id?: string; name?: string; systemStatus: string };
4668
+ sequence?: string;
4669
+ owner?: string;
4670
+ contractor?: string;
4671
+ technician?: string;
4672
+ resources?: string;
4673
+ startDate?: string;
4674
+ dueDate?: string;
4675
+ completedDate?: string;
4676
+ completedBy?: string;
4677
+ completedNote?: string;
4678
+ finalisedDate?: string;
4679
+ tags?: string;
4680
+ systemTags?: string;
4681
+ schedulingTags?: string;
4682
+ items?: {
4683
+ id: string;
4684
+ jobId: string;
4685
+ stageId: string;
4686
+ integrationId?: string;
4687
+ code?: string;
4688
+ description: string;
4689
+ type?: string;
4690
+ quantity: number;
4691
+ unit?: string;
4692
+ location?: string;
4693
+ note?: string;
4694
+ status?: string;
4695
+ buyPrice?: number;
4696
+ sellPrice?: number;
4697
+ invoicingStatus?: string;
4698
+ suppliedBySubcontractor: boolean;
4699
+ createdAt: string;
4700
+ updatedAt: string;
4701
+ }[];
4702
+ totals?: { sellTotal: number; buyTotal: number };
4703
+ customFields?: string;
4704
+ createdAt: string;
4705
+ updatedAt: string;
4706
+ };
4617
4707
  export type WorkBuddyStagesReverseReverseResponse = {
4618
4708
  id: string;
4619
4709
  stageNumber: string;
@@ -4700,6 +4790,34 @@ export type WorkBuddySettingsJobTemplatesListResponse = { items: { id: string; n
4700
4790
  export type WorkBuddySettingsPrioritiesListResponse = {
4701
4791
  items: { id: string; name: string; sortOrder?: number; color?: string }[];
4702
4792
  };
4793
+ export type WorkBuddySettingsPricebooksListResponse = {
4794
+ items: {
4795
+ id: string;
4796
+ name: string;
4797
+ description?: string;
4798
+ category: 'customer' | 'contractor' | 'supplier';
4799
+ mode?: string;
4800
+ status: 'current' | 'expired' | 'future';
4801
+ parentOnly: boolean;
4802
+ isGlobal: boolean;
4803
+ account?: string;
4804
+ dateStart?: string;
4805
+ dateEnd?: string;
4806
+ }[];
4807
+ };
4808
+ export type WorkBuddySettingsPricebooksGetByIdOrNameResponse = {
4809
+ id: string;
4810
+ name: string;
4811
+ description?: string;
4812
+ category: 'customer' | 'contractor' | 'supplier';
4813
+ mode?: string;
4814
+ status: 'current' | 'expired' | 'future';
4815
+ parentOnly: boolean;
4816
+ isGlobal: boolean;
4817
+ account?: string;
4818
+ dateStart?: string;
4819
+ dateEnd?: string;
4820
+ };
4703
4821
  export type WorkBuddySettingsStageStatusesListResponse = {
4704
4822
  items: { id: string; name: string; systemName: string; systemStatus: string; sortOrder?: number }[];
4705
4823
  };
@@ -6662,6 +6780,8 @@ export interface WorkBuddyStagesResource {
6662
6780
  finalise: WorkBuddyStagesFinaliseResource;
6663
6781
  /** Cancel API operations. */
6664
6782
  cancel: WorkBuddyStagesCancelResource;
6783
+ /** On Hold API operations. */
6784
+ onHold: WorkBuddyStagesOnHoldResource;
6665
6785
  /** Reverse API operations. */
6666
6786
  reverse: WorkBuddyStagesReverseResource;
6667
6787
  /** Reissue API operations. */
@@ -6736,6 +6856,17 @@ export interface WorkBuddyStagesCancelResource {
6736
6856
  ): Promise<TResponse>;
6737
6857
  }
6738
6858
 
6859
+ export interface WorkBuddyStagesOnHoldResource {
6860
+ /**
6861
+ * Set the stage to an On Hold status. Pass statusId from GET /settings/stage-statuses with systemStatus On Hold (multiple peer statuses may share that systemStatus). Blocked from Completed, Closed, or Finalised.
6862
+ * Operation: PublicJobStageController_onHold
6863
+ */
6864
+ onHold<TResponse = WorkBuddyStagesOnHoldOnHoldResponse>(
6865
+ params: WorkBuddyStagesOnHoldOnHoldParams,
6866
+ options?: WorkBuddyRequestOptions
6867
+ ): Promise<TResponse>;
6868
+ }
6869
+
6739
6870
  export interface WorkBuddyStagesReverseResource {
6740
6871
  /**
6741
6872
  * Reverse (reopen) a stage to a previous status. This is an admin action that bypasses normal transition rules and clears fields appropriate to the target status.
@@ -6769,6 +6900,8 @@ export interface WorkBuddySettingsResource {
6769
6900
  jobTemplates: WorkBuddySettingsJobTemplatesResource;
6770
6901
  /** Priorities API operations. */
6771
6902
  priorities: WorkBuddySettingsPrioritiesResource;
6903
+ /** Pricebooks API operations. */
6904
+ pricebooks: WorkBuddySettingsPricebooksResource;
6772
6905
  /** Stage Statuses API operations. */
6773
6906
  stageStatuses: WorkBuddySettingsStageStatusesResource;
6774
6907
  /** Tags API operations. */
@@ -6846,6 +6979,26 @@ export interface WorkBuddySettingsPrioritiesResource {
6846
6979
  ): Promise<TResponse>;
6847
6980
  }
6848
6981
 
6982
+ export interface WorkBuddySettingsPricebooksResource {
6983
+ /**
6984
+ * Discover tenant pricebooks for a category (customer / contractor / supplier). Use category=customer&status=current&assignableOnly=true for job-create candidates. Optional accountId scopes to a CRM account (includeGlobal defaults true).
6985
+ * Operation: PublicApiPriceBookController_list
6986
+ */
6987
+ list<TResponse = WorkBuddySettingsPricebooksListResponse>(
6988
+ params: WorkBuddySettingsPricebooksListParams,
6989
+ options?: WorkBuddyRequestOptions
6990
+ ): Promise<TResponse>;
6991
+
6992
+ /**
6993
+ * Retrieve a pricebook by id (preferred) or exact name (case-insensitive). Pass category when the name may exist in more than one category.
6994
+ * Operation: PublicApiPriceBookController_getByIdOrName
6995
+ */
6996
+ getByIdOrName<TResponse = WorkBuddySettingsPricebooksGetByIdOrNameResponse>(
6997
+ params: WorkBuddySettingsPricebooksGetByIdOrNameParams,
6998
+ options?: WorkBuddyRequestOptions
6999
+ ): Promise<TResponse>;
7000
+ }
7001
+
6849
7002
  export interface WorkBuddySettingsStageStatusesResource {
6850
7003
  /**
6851
7004
  * Retrieve all stage statuses configured for the tenant. Stage statuses represent the workflow states a stage (work order) can transition through (e.g., New, Dispatched, En Route, On Site, Completed, Finalised).
package/index.js CHANGED
@@ -481,6 +481,13 @@ export class WorkBuddyClient {
481
481
  */
482
482
  cancel: (params = {}, options = {}) => this.request('PublicJobStageController_cancel', params, options),
483
483
  },
484
+ onHold: {
485
+ /**
486
+ * Set the stage to an On Hold status. Pass statusId from GET /settings/stage-statuses with systemStatus On Hold (multiple peer statuses may share that systemStatus). Blocked from Completed, Closed, or Finalised.
487
+ * Operation: PublicJobStageController_onHold
488
+ */
489
+ onHold: (params = {}, options = {}) => this.request('PublicJobStageController_onHold', params, options),
490
+ },
484
491
  reverse: {
485
492
  /**
486
493
  * Reverse (reopen) a stage to a previous status. This is an admin action that bypasses normal transition rules and clears fields appropriate to the target status.
@@ -553,6 +560,19 @@ export class WorkBuddyClient {
553
560
  */
554
561
  list: (params = {}, options = {}) => this.request('PublicApiPriorityController_list', params, options),
555
562
  },
563
+ pricebooks: {
564
+ /**
565
+ * Discover tenant pricebooks for a category (customer / contractor / supplier). Use category=customer&status=current&assignableOnly=true for job-create candidates. Optional accountId scopes to a CRM account (includeGlobal defaults true).
566
+ * Operation: PublicApiPriceBookController_list
567
+ */
568
+ list: (params = {}, options = {}) => this.request('PublicApiPriceBookController_list', params, options),
569
+ /**
570
+ * Retrieve a pricebook by id (preferred) or exact name (case-insensitive). Pass category when the name may exist in more than one category.
571
+ * Operation: PublicApiPriceBookController_getByIdOrName
572
+ */
573
+ getByIdOrName: (params = {}, options = {}) =>
574
+ this.request('PublicApiPriceBookController_getByIdOrName', params, options),
575
+ },
556
576
  stageStatuses: {
557
577
  /**
558
578
  * Retrieve all stage statuses configured for the tenant. Stage statuses represent the workflow states a stage (work order) can transition through (e.g., New, Dispatched, En Route, On Site, Completed, Finalised).
@@ -1662,6 +1682,19 @@ export const operations = [
1662
1682
  queryParams: [],
1663
1683
  hasRequestBody: true,
1664
1684
  },
1685
+ {
1686
+ operationId: 'PublicJobStageController_onHold',
1687
+ resourcePath: ['stages', 'onHold'],
1688
+ actionName: 'onHold',
1689
+ displayName: 'Put a stage on hold',
1690
+ description:
1691
+ 'Set the stage to an On Hold status. Pass statusId from GET /settings/stage-statuses with systemStatus On Hold (multiple peer statuses may share that systemStatus). Blocked from Completed, Closed, or Finalised.',
1692
+ method: 'POST',
1693
+ path: '/stages/{id}/on-hold',
1694
+ pathParams: ['id'],
1695
+ queryParams: [],
1696
+ hasRequestBody: true,
1697
+ },
1665
1698
  {
1666
1699
  operationId: 'PublicJobStageController_reverse',
1667
1700
  resourcePath: ['stages', 'reverse'],
@@ -1826,6 +1859,32 @@ export const operations = [
1826
1859
  queryParams: [],
1827
1860
  hasRequestBody: false,
1828
1861
  },
1862
+ {
1863
+ operationId: 'PublicApiPriceBookController_list',
1864
+ resourcePath: ['settings', 'pricebooks'],
1865
+ actionName: 'list',
1866
+ displayName: 'List pricebooks',
1867
+ description:
1868
+ 'Discover tenant pricebooks for a category (customer / contractor / supplier). Use category=customer&status=current&assignableOnly=true for job-create candidates. Optional accountId scopes to a CRM account (includeGlobal defaults true).',
1869
+ method: 'GET',
1870
+ path: '/settings/pricebooks',
1871
+ pathParams: [],
1872
+ queryParams: ['limit', 'assignableOnly', 'mode', 'search', 'includeGlobal', 'accountId', 'status', 'category'],
1873
+ hasRequestBody: false,
1874
+ },
1875
+ {
1876
+ operationId: 'PublicApiPriceBookController_getByIdOrName',
1877
+ resourcePath: ['settings', 'pricebooks'],
1878
+ actionName: 'getByIdOrName',
1879
+ displayName: 'Get pricebook',
1880
+ description:
1881
+ 'Retrieve a pricebook by id (preferred) or exact name (case-insensitive). Pass category when the name may exist in more than one category.',
1882
+ method: 'GET',
1883
+ path: '/settings/pricebooks/{idOrName}',
1884
+ pathParams: ['idOrName'],
1885
+ queryParams: ['category'],
1886
+ hasRequestBody: false,
1887
+ },
1829
1888
  {
1830
1889
  operationId: 'PublicApiStageStatusController_list',
1831
1890
  resourcePath: ['settings', 'stageStatuses'],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workbuddy/sdk-js-vnext",
3
- "version": "1.0.70",
3
+ "version": "1.0.71",
4
4
  "description": "WorkBuddy Public API JavaScript client",
5
5
  "license": "MIT",
6
6
  "type": "module",