@workbuddy/n8n-nodes-workbuddy-edge 1.0.22 → 1.0.24

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.
@@ -3,6 +3,7 @@ export declare class WorkBuddy implements INodeType {
3
3
  description: INodeTypeDescription;
4
4
  methods: {
5
5
  loadOptions: {
6
+ loadFlagCategoryOptions(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
6
7
  loadCustomerOptions(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
7
8
  loadSiteOptions(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
8
9
  loadJobTypeOptions(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
@@ -1 +1 @@
1
- {"version":3,"file":"WorkBuddy.node.d.ts","sourceRoot":"","sources":["../../../nodes/WorkBuddy/WorkBuddy.node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAsD5G,qBAAa,SAAU,YAAW,SAAS;IACzC,WAAW,EAAE,oBAAoB,CA8xX/B;IAEF,OAAO;;sCAE6B,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC;kCAG3D,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC;qCAGpD,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC;sCAGtD,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC;sCAGvD,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC;kCAG3D,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC;sCAGnD,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC;qCAGxD,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC;;MAIxF;CACH"}
1
+ {"version":3,"file":"WorkBuddy.node.d.ts","sourceRoot":"","sources":["../../../nodes/WorkBuddy/WorkBuddy.node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AA6E5G,qBAAa,SAAU,YAAW,SAAS;IACzC,WAAW,EAAE,oBAAoB,CAwrY/B;IAEF,OAAO;;0CAEiC,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC;sCAG3D,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC;kCAG3D,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC;qCAGpD,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC;sCAGtD,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC;sCAGvD,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC;kCAG3D,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC;sCAGnD,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC;qCAGxD,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC;;MAIxF;CACH"}
@@ -48,6 +48,27 @@ async function loadEntityOptions(context, endpoint) {
48
48
  }))
49
49
  .filter((item) => !!item.value);
50
50
  }
51
+ async function loadEntityRefOptions(context, endpoint) {
52
+ const token = await getAccessToken(context);
53
+ const credentials = await context.getCredentials('workBuddyApi');
54
+ const baseUrl = credentials.baseUrl;
55
+ const separator = endpoint.includes('?') ? '&' : '?';
56
+ const response = await context.helpers.httpRequest({
57
+ method: 'GET',
58
+ url: baseUrl + endpoint + separator + 'limit=100',
59
+ headers: {
60
+ Authorization: 'Bearer ' + token,
61
+ 'Content-Type': 'application/json',
62
+ 'X-WorkBuddy-Version': '2026-01',
63
+ },
64
+ });
65
+ return extractListItems(response)
66
+ .map((item) => ({
67
+ name: item.name ?? item.id,
68
+ value: JSON.stringify({ id: item.id, name: item.name }),
69
+ }))
70
+ .filter((item) => !!item.value);
71
+ }
51
72
  class WorkBuddy {
52
73
  description = {
53
74
  displayName: 'WorkBuddy',
@@ -179,6 +200,10 @@ class WorkBuddy {
179
200
  name: 'Agents',
180
201
  value: 'agents',
181
202
  },
203
+ {
204
+ name: 'Flags',
205
+ value: 'flags',
206
+ },
182
207
  {
183
208
  name: 'Mcp',
184
209
  value: 'mcp',
@@ -3799,12 +3824,14 @@ class WorkBuddy {
3799
3824
  },
3800
3825
  },
3801
3826
  {
3802
- displayName: 'Tag Ids',
3803
- name: 'tagIds',
3827
+ displayName: 'Tags Set',
3828
+ name: 'tagsSet',
3804
3829
  type: 'string',
3805
3830
  default: '',
3806
- description: 'Array of tag IDs (comma-separated, e.g. "id1,id2") — use /settings/tags to look up',
3807
- required: false,
3831
+ typeOptions: {
3832
+ multipleValues: true,
3833
+ },
3834
+ description: '',
3808
3835
  displayOptions: {
3809
3836
  show: {
3810
3837
  resource: ['jobs'],
@@ -3814,7 +3841,51 @@ class WorkBuddy {
3814
3841
  routing: {
3815
3842
  send: {
3816
3843
  type: 'body',
3817
- property: 'tagIds',
3844
+ property: 'tags.set',
3845
+ },
3846
+ },
3847
+ },
3848
+ {
3849
+ displayName: 'Tags Add',
3850
+ name: 'tagsAdd',
3851
+ type: 'string',
3852
+ default: '',
3853
+ typeOptions: {
3854
+ multipleValues: true,
3855
+ },
3856
+ description: '',
3857
+ displayOptions: {
3858
+ show: {
3859
+ resource: ['jobs'],
3860
+ operation: ['PublicApiJobController_update'],
3861
+ },
3862
+ },
3863
+ routing: {
3864
+ send: {
3865
+ type: 'body',
3866
+ property: 'tags.add',
3867
+ },
3868
+ },
3869
+ },
3870
+ {
3871
+ displayName: 'Tags Remove',
3872
+ name: 'tagsRemove',
3873
+ type: 'string',
3874
+ default: '',
3875
+ typeOptions: {
3876
+ multipleValues: true,
3877
+ },
3878
+ description: '',
3879
+ displayOptions: {
3880
+ show: {
3881
+ resource: ['jobs'],
3882
+ operation: ['PublicApiJobController_update'],
3883
+ },
3884
+ },
3885
+ routing: {
3886
+ send: {
3887
+ type: 'body',
3888
+ property: 'tags.remove',
3818
3889
  },
3819
3890
  },
3820
3891
  },
@@ -5532,8 +5603,8 @@ class WorkBuddy {
5532
5603
  {
5533
5604
  name: 'List tags',
5534
5605
  value: 'PublicApiTagController_list',
5535
- action: 'Retrieve all active tags (labels) configured. Use the optional `type` query parameter to filter by label type. Defaults to `job` if not specified. Supported types: job, scheduling, quote, customer, user, overheads, form, finance, system, work-order-system, account, contact, zone, work-categories, lead-source, lead, opportunity, opportunity-lost, project, project-type, payment-type, file, asset, item-location, task, phase, site, service-type, subscriptions, agreement, work, integration-types.',
5536
- description: 'Retrieve all active tags (labels) configured. Use the optional `type` query parameter to filter by label type. Defaults to `job` if not specified. Supported types: job, scheduling, quote, customer, user, overheads, form, finance, system, work-order-system, account, contact, zone, work-categories, lead-source, lead, opportunity, opportunity-lost, project, project-type, payment-type, file, asset, item-location, task, phase, site, service-type, subscriptions, agreement, work, integration-types.',
5606
+ action: 'Retrieve all active tags (labels) configured. Use the optional `type` query parameter to filter by label type. Defaults to `job` if not specified. Supported types: job, scheduling, quote, customer, user, overheads, form, finance, system, work-order-system, account, contact, zone, work-categories, lead-source, lead, opportunity, opportunity-lost, project, project-type, payment-type, file, asset, item-location, task, phase, site, service-type, subscriptions, agreement, work, integration-types, flag-category.',
5607
+ description: 'Retrieve all active tags (labels) configured. Use the optional `type` query parameter to filter by label type. Defaults to `job` if not specified. Supported types: job, scheduling, quote, customer, user, overheads, form, finance, system, work-order-system, account, contact, zone, work-categories, lead-source, lead, opportunity, opportunity-lost, project, project-type, payment-type, file, asset, item-location, task, phase, site, service-type, subscriptions, agreement, work, integration-types, flag-category.',
5537
5608
  routing: {
5538
5609
  request: {
5539
5610
  method: 'GET',
@@ -8811,12 +8882,14 @@ class WorkBuddy {
8811
8882
  },
8812
8883
  },
8813
8884
  {
8814
- displayName: 'Tag Ids',
8815
- name: 'tagIds',
8885
+ displayName: 'Tags Set',
8886
+ name: 'tagsSet',
8816
8887
  type: 'string',
8817
8888
  default: '',
8818
- description: 'Array of tag IDs (comma-separated, e.g. "id1,id2") — use /settings/tags to look up',
8819
- required: false,
8889
+ typeOptions: {
8890
+ multipleValues: true,
8891
+ },
8892
+ description: '',
8820
8893
  displayOptions: {
8821
8894
  show: {
8822
8895
  resource: ['jobs-tasks'],
@@ -8826,7 +8899,51 @@ class WorkBuddy {
8826
8899
  routing: {
8827
8900
  send: {
8828
8901
  type: 'body',
8829
- property: 'tagIds',
8902
+ property: 'tags.set',
8903
+ },
8904
+ },
8905
+ },
8906
+ {
8907
+ displayName: 'Tags Add',
8908
+ name: 'tagsAdd',
8909
+ type: 'string',
8910
+ default: '',
8911
+ typeOptions: {
8912
+ multipleValues: true,
8913
+ },
8914
+ description: '',
8915
+ displayOptions: {
8916
+ show: {
8917
+ resource: ['jobs-tasks'],
8918
+ operation: ['PublicJobTasksController_update'],
8919
+ },
8920
+ },
8921
+ routing: {
8922
+ send: {
8923
+ type: 'body',
8924
+ property: 'tags.add',
8925
+ },
8926
+ },
8927
+ },
8928
+ {
8929
+ displayName: 'Tags Remove',
8930
+ name: 'tagsRemove',
8931
+ type: 'string',
8932
+ default: '',
8933
+ typeOptions: {
8934
+ multipleValues: true,
8935
+ },
8936
+ description: '',
8937
+ displayOptions: {
8938
+ show: {
8939
+ resource: ['jobs-tasks'],
8940
+ operation: ['PublicJobTasksController_update'],
8941
+ },
8942
+ },
8943
+ routing: {
8944
+ send: {
8945
+ type: 'body',
8946
+ property: 'tags.remove',
8830
8947
  },
8831
8948
  },
8832
8949
  },
@@ -9787,12 +9904,14 @@ class WorkBuddy {
9787
9904
  },
9788
9905
  },
9789
9906
  {
9790
- displayName: 'Tag Ids',
9791
- name: 'tagIds',
9907
+ displayName: 'Tags Set',
9908
+ name: 'tagsSet',
9792
9909
  type: 'string',
9793
9910
  default: '',
9794
- description: 'Array of tag IDs (comma-separated, e.g. "id1,id2") — use /settings/tags to look up',
9795
- required: false,
9911
+ typeOptions: {
9912
+ multipleValues: true,
9913
+ },
9914
+ description: '',
9796
9915
  displayOptions: {
9797
9916
  show: {
9798
9917
  resource: ['stages-tasks'],
@@ -9802,7 +9921,51 @@ class WorkBuddy {
9802
9921
  routing: {
9803
9922
  send: {
9804
9923
  type: 'body',
9805
- property: 'tagIds',
9924
+ property: 'tags.set',
9925
+ },
9926
+ },
9927
+ },
9928
+ {
9929
+ displayName: 'Tags Add',
9930
+ name: 'tagsAdd',
9931
+ type: 'string',
9932
+ default: '',
9933
+ typeOptions: {
9934
+ multipleValues: true,
9935
+ },
9936
+ description: '',
9937
+ displayOptions: {
9938
+ show: {
9939
+ resource: ['stages-tasks'],
9940
+ operation: ['PublicStageTasksController_update'],
9941
+ },
9942
+ },
9943
+ routing: {
9944
+ send: {
9945
+ type: 'body',
9946
+ property: 'tags.add',
9947
+ },
9948
+ },
9949
+ },
9950
+ {
9951
+ displayName: 'Tags Remove',
9952
+ name: 'tagsRemove',
9953
+ type: 'string',
9954
+ default: '',
9955
+ typeOptions: {
9956
+ multipleValues: true,
9957
+ },
9958
+ description: '',
9959
+ displayOptions: {
9960
+ show: {
9961
+ resource: ['stages-tasks'],
9962
+ operation: ['PublicStageTasksController_update'],
9963
+ },
9964
+ },
9965
+ routing: {
9966
+ send: {
9967
+ type: 'body',
9968
+ property: 'tags.remove',
9806
9969
  },
9807
9970
  },
9808
9971
  },
@@ -11914,6 +12077,273 @@ class WorkBuddy {
11914
12077
  },
11915
12078
  },
11916
12079
  },
12080
+ // Flags Operations
12081
+ {
12082
+ displayName: 'Operation',
12083
+ name: 'operation',
12084
+ type: 'options',
12085
+ noDataExpression: true,
12086
+ displayOptions: {
12087
+ show: {
12088
+ resource: ['flags'],
12089
+ },
12090
+ },
12091
+ options: [
12092
+ {
12093
+ name: 'Create a flag on an entity',
12094
+ value: 'PublicApiFlagController_create',
12095
+ action: '',
12096
+ description: '',
12097
+ routing: {
12098
+ request: {
12099
+ method: 'POST',
12100
+ url: '/api/v2/public/flags',
12101
+ },
12102
+ },
12103
+ },
12104
+ {
12105
+ name: 'Close a flag',
12106
+ value: 'PublicApiFlagController_close',
12107
+ action: '',
12108
+ description: '',
12109
+ routing: {
12110
+ request: {
12111
+ method: 'PATCH',
12112
+ url: '/api/v2/public/flags/={{ $parameter["id"] }}/close',
12113
+ },
12114
+ },
12115
+ },
12116
+ {
12117
+ name: 'List flags for an entity',
12118
+ value: 'PublicApiFlagController_listByEntity',
12119
+ action: '',
12120
+ description: '',
12121
+ routing: {
12122
+ request: {
12123
+ method: 'GET',
12124
+ url: '/api/v2/public/flags/entity/={{ $parameter["entity"] }}/={{ $parameter["entityId"] }}',
12125
+ },
12126
+ },
12127
+ },
12128
+ ],
12129
+ default: 'PublicApiFlagController_create',
12130
+ },
12131
+ {
12132
+ displayName: 'Flag Category',
12133
+ name: 'category',
12134
+ type: 'options',
12135
+ default: '',
12136
+ description: 'Select a flag category',
12137
+ required: true,
12138
+ typeOptions: {
12139
+ loadOptionsMethod: 'loadFlagCategoryOptions',
12140
+ },
12141
+ displayOptions: {
12142
+ show: {
12143
+ resource: ['flags'],
12144
+ operation: ['PublicApiFlagController_create'],
12145
+ },
12146
+ },
12147
+ routing: {
12148
+ send: {
12149
+ type: 'body',
12150
+ property: 'category',
12151
+ value: '={{ JSON.parse($value) }}',
12152
+ },
12153
+ },
12154
+ },
12155
+ {
12156
+ displayName: 'Entity',
12157
+ name: 'entity',
12158
+ type: 'string',
12159
+ default: '',
12160
+ description: 'Entity type for the webhook',
12161
+ required: true,
12162
+ displayOptions: {
12163
+ show: {
12164
+ resource: ['flags'],
12165
+ operation: ['PublicApiFlagController_create'],
12166
+ },
12167
+ },
12168
+ routing: {
12169
+ send: {
12170
+ type: 'body',
12171
+ property: 'entity',
12172
+ },
12173
+ },
12174
+ },
12175
+ {
12176
+ displayName: 'Entity Id',
12177
+ name: 'entityId',
12178
+ type: 'string',
12179
+ default: '',
12180
+ description: 'entity ID',
12181
+ required: true,
12182
+ displayOptions: {
12183
+ show: {
12184
+ resource: ['flags'],
12185
+ operation: ['PublicApiFlagController_create'],
12186
+ },
12187
+ },
12188
+ routing: {
12189
+ send: {
12190
+ type: 'body',
12191
+ property: 'entityId',
12192
+ },
12193
+ },
12194
+ },
12195
+ {
12196
+ displayName: 'Message',
12197
+ name: 'message',
12198
+ type: 'string',
12199
+ default: '',
12200
+ description: '',
12201
+ required: true,
12202
+ displayOptions: {
12203
+ show: {
12204
+ resource: ['flags'],
12205
+ operation: ['PublicApiFlagController_create'],
12206
+ },
12207
+ },
12208
+ routing: {
12209
+ send: {
12210
+ type: 'body',
12211
+ property: 'message',
12212
+ },
12213
+ },
12214
+ },
12215
+ {
12216
+ displayName: 'Source',
12217
+ name: 'source',
12218
+ type: 'string',
12219
+ default: '',
12220
+ description: '',
12221
+ required: true,
12222
+ displayOptions: {
12223
+ show: {
12224
+ resource: ['flags'],
12225
+ operation: ['PublicApiFlagController_create'],
12226
+ },
12227
+ },
12228
+ routing: {
12229
+ send: {
12230
+ type: 'body',
12231
+ property: 'source',
12232
+ },
12233
+ },
12234
+ },
12235
+ {
12236
+ displayName: 'Links',
12237
+ name: 'links',
12238
+ type: 'json',
12239
+ default: {},
12240
+ description: '',
12241
+ required: false,
12242
+ displayOptions: {
12243
+ show: {
12244
+ resource: ['flags'],
12245
+ operation: ['PublicApiFlagController_create'],
12246
+ },
12247
+ },
12248
+ routing: {
12249
+ send: {
12250
+ type: 'body',
12251
+ property: 'links',
12252
+ },
12253
+ },
12254
+ },
12255
+ {
12256
+ displayName: 'Id',
12257
+ name: 'id',
12258
+ type: 'string',
12259
+ default: '',
12260
+ description: 'Flag ID',
12261
+ required: true,
12262
+ displayOptions: {
12263
+ show: {
12264
+ resource: ['flags'],
12265
+ operation: ['PublicApiFlagController_close'],
12266
+ },
12267
+ },
12268
+ },
12269
+ {
12270
+ displayName: 'Outcome',
12271
+ name: 'outcome',
12272
+ type: 'string',
12273
+ default: '',
12274
+ description: '',
12275
+ required: false,
12276
+ displayOptions: {
12277
+ show: {
12278
+ resource: ['flags'],
12279
+ operation: ['PublicApiFlagController_close'],
12280
+ },
12281
+ },
12282
+ routing: {
12283
+ send: {
12284
+ type: 'body',
12285
+ property: 'outcome',
12286
+ },
12287
+ },
12288
+ },
12289
+ {
12290
+ displayName: 'Entity',
12291
+ name: 'entity',
12292
+ type: 'string',
12293
+ default: '',
12294
+ description: 'Entity type',
12295
+ required: true,
12296
+ displayOptions: {
12297
+ show: {
12298
+ resource: ['flags'],
12299
+ operation: ['PublicApiFlagController_listByEntity'],
12300
+ },
12301
+ },
12302
+ },
12303
+ {
12304
+ displayName: 'Entity Id',
12305
+ name: 'entityId',
12306
+ type: 'string',
12307
+ default: '',
12308
+ description: 'Entity ID',
12309
+ required: true,
12310
+ displayOptions: {
12311
+ show: {
12312
+ resource: ['flags'],
12313
+ operation: ['PublicApiFlagController_listByEntity'],
12314
+ },
12315
+ },
12316
+ },
12317
+ {
12318
+ displayName: 'Status',
12319
+ name: 'status',
12320
+ type: 'options',
12321
+ default: '',
12322
+ description: 'Filter by status',
12323
+ required: false,
12324
+ displayOptions: {
12325
+ show: {
12326
+ resource: ['flags'],
12327
+ operation: ['PublicApiFlagController_listByEntity'],
12328
+ },
12329
+ },
12330
+ routing: {
12331
+ send: {
12332
+ type: 'body',
12333
+ property: 'status',
12334
+ },
12335
+ },
12336
+ options: [
12337
+ {
12338
+ name: 'Open',
12339
+ value: 'Open',
12340
+ },
12341
+ {
12342
+ name: 'Closed',
12343
+ value: 'Closed',
12344
+ },
12345
+ ],
12346
+ },
11917
12347
  // Mcp Operations
11918
12348
  {
11919
12349
  displayName: 'Operation',
@@ -12055,6 +12485,9 @@ class WorkBuddy {
12055
12485
  };
12056
12486
  methods = {
12057
12487
  loadOptions: {
12488
+ async loadFlagCategoryOptions() {
12489
+ return loadEntityRefOptions(this, '/api/v2/public/settings/tags?type=flag-category');
12490
+ },
12058
12491
  async loadCustomerOptions() {
12059
12492
  return loadEntityOptions(this, '/api/v2/public/customers');
12060
12493
  },