@boboddy/sdk 0.4.0 → 0.4.3

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/dist/index.js CHANGED
@@ -1200,6 +1200,16 @@ class PipelineExecutions extends HeyApiClient {
1200
1200
  cancelPipelineExecution(options) {
1201
1201
  return (options.client ?? this.client).put({ url: "/api/pipeline-executions/{pipelineExecutionId}/cancel", ...options });
1202
1202
  }
1203
+ cancelPipelineExecutions(options) {
1204
+ return (options.client ?? this.client).put({
1205
+ url: "/api/pipeline-executions/batch/cancel",
1206
+ ...options,
1207
+ headers: {
1208
+ "Content-Type": "application/json",
1209
+ ...options.headers
1210
+ }
1211
+ });
1212
+ }
1203
1213
  getPipelineExecution(options) {
1204
1214
  return (options.client ?? this.client).get({ url: "/api/pipeline-executions/{pipelineExecutionId}", ...options });
1205
1215
  }
@@ -1224,6 +1234,19 @@ class WorkItems extends HeyApiClient {
1224
1234
  getWorkItem(options) {
1225
1235
  return (options.client ?? this.client).get({ url: "/api/work-items/{workItemId}", ...options });
1226
1236
  }
1237
+ editWorkItem(options) {
1238
+ return (options.client ?? this.client).patch({
1239
+ url: "/api/work-items/{workItemId}",
1240
+ ...options,
1241
+ headers: {
1242
+ "Content-Type": "application/json",
1243
+ ...options.headers
1244
+ }
1245
+ });
1246
+ }
1247
+ listWorkItemChildren(options) {
1248
+ return (options.client ?? this.client).get({ url: "/api/work-items/{workItemId}/children", ...options });
1249
+ }
1227
1250
  createWorkItem(options) {
1228
1251
  return (options.client ?? this.client).post({
1229
1252
  url: "/api/work-items",
@@ -1274,6 +1297,16 @@ class WorkItems extends HeyApiClient {
1274
1297
  }
1275
1298
  });
1276
1299
  }
1300
+ setWorkItemParent(options) {
1301
+ return (options.client ?? this.client).patch({
1302
+ url: "/api/work-items/{workItemId}/parent",
1303
+ ...options,
1304
+ headers: {
1305
+ "Content-Type": "application/json",
1306
+ ...options.headers
1307
+ }
1308
+ });
1309
+ }
1277
1310
  }
1278
1311
 
1279
1312
  class WorkItemComments extends HeyApiClient {
@@ -1315,6 +1348,25 @@ class WorkItemComments extends HeyApiClient {
1315
1348
  }
1316
1349
  }
1317
1350
 
1351
+ class WorkItemBlocks extends HeyApiClient {
1352
+ listWorkItemBlocks(options) {
1353
+ return (options.client ?? this.client).get({ url: "/api/work-item-blocks", ...options });
1354
+ }
1355
+ createWorkItemBlock(options) {
1356
+ return (options.client ?? this.client).post({
1357
+ url: "/api/work-item-blocks",
1358
+ ...options,
1359
+ headers: {
1360
+ "Content-Type": "application/json",
1361
+ ...options.headers
1362
+ }
1363
+ });
1364
+ }
1365
+ deleteWorkItemBlock(options) {
1366
+ return (options.client ?? this.client).delete({ url: "/api/work-item-blocks/{blockId}", ...options });
1367
+ }
1368
+ }
1369
+
1318
1370
  class ProjectContext extends HeyApiClient {
1319
1371
  listProjectContextEntries(options) {
1320
1372
  return (options.client ?? this.client).get({ url: "/api/projects/{projectId}/context-entries", ...options });
@@ -1523,6 +1575,10 @@ class BoboddyClient extends HeyApiClient {
1523
1575
  get workItemComments() {
1524
1576
  return this._workItemComments ??= new WorkItemComments({ client: this.client });
1525
1577
  }
1578
+ _workItemBlocks;
1579
+ get workItemBlocks() {
1580
+ return this._workItemBlocks ??= new WorkItemBlocks({ client: this.client });
1581
+ }
1526
1582
  _projectContext;
1527
1583
  get projectContext() {
1528
1584
  return this._projectContext ??= new ProjectContext({ client: this.client });
@@ -16726,14 +16782,48 @@ function materializeAccessor(accessor) {
16726
16782
  };
16727
16783
  }
16728
16784
 
16785
+ // src/definitions/pipelines/work-item-fields.ts
16786
+ var WORK_ITEM_TOP_LEVEL_FIELDS = [
16787
+ "id",
16788
+ "projectId",
16789
+ "platform",
16790
+ "platformId",
16791
+ "platformKey",
16792
+ "url",
16793
+ "title",
16794
+ "description",
16795
+ "sourceCreatedAt",
16796
+ "sourceUpdatedAt",
16797
+ "createdByUserId",
16798
+ "parentWorkItemId",
16799
+ "createdAt",
16800
+ "updatedAt"
16801
+ ];
16802
+ var WORK_ITEM_FIELDS_PATH_PREFIX = "fields.";
16803
+ function resolveWorkItemFieldPath(record2, path) {
16804
+ if (typeof record2 !== "object" || record2 === null)
16805
+ return;
16806
+ const asRecord = record2;
16807
+ if (path.startsWith(WORK_ITEM_FIELDS_PATH_PREFIX)) {
16808
+ const fieldName = path.slice(WORK_ITEM_FIELDS_PATH_PREFIX.length);
16809
+ const fields = asRecord["fields"];
16810
+ if (typeof fields !== "object" || fields === null)
16811
+ return;
16812
+ return fields[fieldName];
16813
+ }
16814
+ return asRecord[path];
16815
+ }
16816
+
16729
16817
  // src/definitions/pipelines/builder-helpers.ts
16730
16818
  var WORK_ITEM_ACCESSOR = Object.freeze({
16731
- title: Object.freeze({ source: "work_item", field: "title" }),
16732
- description: Object.freeze({
16819
+ ...Object.fromEntries(WORK_ITEM_TOP_LEVEL_FIELDS.map((field) => [
16820
+ field,
16821
+ Object.freeze({ source: "work_item", field })
16822
+ ])),
16823
+ field: (fieldName) => Object.freeze({
16733
16824
  source: "work_item",
16734
- field: "description"
16735
- }),
16736
- field: (fieldName) => Object.freeze({ source: "work_item", field: `fields.${fieldName}` })
16825
+ field: `${WORK_ITEM_FIELDS_PATH_PREFIX}${fieldName}`
16826
+ })
16737
16827
  });
16738
16828
  var WORK_ITEM_FIELD_BINDINGS = {
16739
16829
  workItemTitle: { source: "work_item", field: "title" },
@@ -16784,7 +16874,7 @@ function resolveAdditionalStepInputBindings(label, definition) {
16784
16874
  const raw = definition.bindings({
16785
16875
  workItemField: (fieldName) => ({
16786
16876
  source: "work_item",
16787
- field: `fields.${fieldName}`
16877
+ field: `${WORK_ITEM_FIELDS_PATH_PREFIX}${fieldName}`
16788
16878
  }),
16789
16879
  literal: literal2
16790
16880
  });
@@ -17194,7 +17284,7 @@ function makeLeaf(fact, path, operator, value) {
17194
17284
  };
17195
17285
  }
17196
17286
  function makeFieldRef(fact, path) {
17197
- return {
17287
+ const untyped = {
17198
17288
  eq: (v) => makeLeaf(fact, path, "equal", v),
17199
17289
  ne: (v) => makeLeaf(fact, path, "notEqual", v),
17200
17290
  gt: (v) => makeLeaf(fact, path, "greaterThan", v),
@@ -17206,6 +17296,16 @@ function makeFieldRef(fact, path) {
17206
17296
  contains: (v) => makeLeaf(fact, path, "contains", v),
17207
17297
  doesNotContain: (v) => makeLeaf(fact, path, "doesNotContain", v)
17208
17298
  };
17299
+ return untyped;
17300
+ }
17301
+ function buildWorkItemAccessor() {
17302
+ const accessor = {
17303
+ field: (name) => makeFieldRef("workItem", `$.${WORK_ITEM_FIELDS_PATH_PREFIX}${name}`)
17304
+ };
17305
+ for (const key of WORK_ITEM_TOP_LEVEL_FIELDS) {
17306
+ accessor[key] = makeFieldRef("workItem", `$.${key}`);
17307
+ }
17308
+ return accessor;
17209
17309
  }
17210
17310
  function makeAssign(pipeline2) {
17211
17311
  if (typeof pipeline2 !== "object" || typeof pipeline2["key"] !== "string" || !Array.isArray(pipeline2["nodeDefinitions"])) {
@@ -17228,9 +17328,7 @@ function makeGroup(mode, refs) {
17228
17328
  }
17229
17329
  function buildCtx() {
17230
17330
  return {
17231
- workItem: {
17232
- field: (name) => makeFieldRef("workItem", `$.fields.${name}`)
17233
- },
17331
+ workItem: buildWorkItemAccessor(),
17234
17332
  context: {
17235
17333
  isNew: makeFieldRef("context", "$.isNew")
17236
17334
  },
@@ -17623,6 +17721,7 @@ export {
17623
17721
  stripTrailingCommas,
17624
17722
  stripJsoncComments,
17625
17723
  serializeDefaultPipelineAssignment,
17724
+ resolveWorkItemFieldPath,
17626
17725
  renderPromptTemplate,
17627
17726
  pipeline,
17628
17727
  parseJsonc,
@@ -17650,6 +17749,9 @@ export {
17650
17749
  artifactKindSchema,
17651
17750
  WorkItems,
17652
17751
  WorkItemComments,
17752
+ WorkItemBlocks,
17753
+ WORK_ITEM_TOP_LEVEL_FIELDS,
17754
+ WORK_ITEM_FIELDS_PATH_PREFIX,
17653
17755
  Username,
17654
17756
  UserNotifications,
17655
17757
  StepExecutions,
@@ -13266,6 +13266,16 @@ class PipelineExecutions extends HeyApiClient {
13266
13266
  cancelPipelineExecution(options) {
13267
13267
  return (options.client ?? this.client).put({ url: "/api/pipeline-executions/{pipelineExecutionId}/cancel", ...options });
13268
13268
  }
13269
+ cancelPipelineExecutions(options) {
13270
+ return (options.client ?? this.client).put({
13271
+ url: "/api/pipeline-executions/batch/cancel",
13272
+ ...options,
13273
+ headers: {
13274
+ "Content-Type": "application/json",
13275
+ ...options.headers
13276
+ }
13277
+ });
13278
+ }
13269
13279
  getPipelineExecution(options) {
13270
13280
  return (options.client ?? this.client).get({ url: "/api/pipeline-executions/{pipelineExecutionId}", ...options });
13271
13281
  }
@@ -13290,6 +13300,19 @@ class WorkItems extends HeyApiClient {
13290
13300
  getWorkItem(options) {
13291
13301
  return (options.client ?? this.client).get({ url: "/api/work-items/{workItemId}", ...options });
13292
13302
  }
13303
+ editWorkItem(options) {
13304
+ return (options.client ?? this.client).patch({
13305
+ url: "/api/work-items/{workItemId}",
13306
+ ...options,
13307
+ headers: {
13308
+ "Content-Type": "application/json",
13309
+ ...options.headers
13310
+ }
13311
+ });
13312
+ }
13313
+ listWorkItemChildren(options) {
13314
+ return (options.client ?? this.client).get({ url: "/api/work-items/{workItemId}/children", ...options });
13315
+ }
13293
13316
  createWorkItem(options) {
13294
13317
  return (options.client ?? this.client).post({
13295
13318
  url: "/api/work-items",
@@ -13340,6 +13363,16 @@ class WorkItems extends HeyApiClient {
13340
13363
  }
13341
13364
  });
13342
13365
  }
13366
+ setWorkItemParent(options) {
13367
+ return (options.client ?? this.client).patch({
13368
+ url: "/api/work-items/{workItemId}/parent",
13369
+ ...options,
13370
+ headers: {
13371
+ "Content-Type": "application/json",
13372
+ ...options.headers
13373
+ }
13374
+ });
13375
+ }
13343
13376
  }
13344
13377
 
13345
13378
  class WorkItemComments extends HeyApiClient {
@@ -13381,6 +13414,25 @@ class WorkItemComments extends HeyApiClient {
13381
13414
  }
13382
13415
  }
13383
13416
 
13417
+ class WorkItemBlocks extends HeyApiClient {
13418
+ listWorkItemBlocks(options) {
13419
+ return (options.client ?? this.client).get({ url: "/api/work-item-blocks", ...options });
13420
+ }
13421
+ createWorkItemBlock(options) {
13422
+ return (options.client ?? this.client).post({
13423
+ url: "/api/work-item-blocks",
13424
+ ...options,
13425
+ headers: {
13426
+ "Content-Type": "application/json",
13427
+ ...options.headers
13428
+ }
13429
+ });
13430
+ }
13431
+ deleteWorkItemBlock(options) {
13432
+ return (options.client ?? this.client).delete({ url: "/api/work-item-blocks/{blockId}", ...options });
13433
+ }
13434
+ }
13435
+
13384
13436
  class ProjectContext extends HeyApiClient {
13385
13437
  listProjectContextEntries(options) {
13386
13438
  return (options.client ?? this.client).get({ url: "/api/projects/{projectId}/context-entries", ...options });
@@ -13589,6 +13641,10 @@ class BoboddyClient extends HeyApiClient {
13589
13641
  get workItemComments() {
13590
13642
  return this._workItemComments ??= new WorkItemComments({ client: this.client });
13591
13643
  }
13644
+ _workItemBlocks;
13645
+ get workItemBlocks() {
13646
+ return this._workItemBlocks ??= new WorkItemBlocks({ client: this.client });
13647
+ }
13592
13648
  _projectContext;
13593
13649
  get projectContext() {
13594
13650
  return this._projectContext ??= new ProjectContext({ client: this.client });
@@ -16605,14 +16661,48 @@ function materializeAccessor(accessor) {
16605
16661
  };
16606
16662
  }
16607
16663
 
16664
+ // src/definitions/pipelines/work-item-fields.ts
16665
+ var WORK_ITEM_TOP_LEVEL_FIELDS = [
16666
+ "id",
16667
+ "projectId",
16668
+ "platform",
16669
+ "platformId",
16670
+ "platformKey",
16671
+ "url",
16672
+ "title",
16673
+ "description",
16674
+ "sourceCreatedAt",
16675
+ "sourceUpdatedAt",
16676
+ "createdByUserId",
16677
+ "parentWorkItemId",
16678
+ "createdAt",
16679
+ "updatedAt"
16680
+ ];
16681
+ var WORK_ITEM_FIELDS_PATH_PREFIX = "fields.";
16682
+ function resolveWorkItemFieldPath(record2, path) {
16683
+ if (typeof record2 !== "object" || record2 === null)
16684
+ return;
16685
+ const asRecord = record2;
16686
+ if (path.startsWith(WORK_ITEM_FIELDS_PATH_PREFIX)) {
16687
+ const fieldName = path.slice(WORK_ITEM_FIELDS_PATH_PREFIX.length);
16688
+ const fields = asRecord["fields"];
16689
+ if (typeof fields !== "object" || fields === null)
16690
+ return;
16691
+ return fields[fieldName];
16692
+ }
16693
+ return asRecord[path];
16694
+ }
16695
+
16608
16696
  // src/definitions/pipelines/builder-helpers.ts
16609
16697
  var WORK_ITEM_ACCESSOR = Object.freeze({
16610
- title: Object.freeze({ source: "work_item", field: "title" }),
16611
- description: Object.freeze({
16698
+ ...Object.fromEntries(WORK_ITEM_TOP_LEVEL_FIELDS.map((field) => [
16699
+ field,
16700
+ Object.freeze({ source: "work_item", field })
16701
+ ])),
16702
+ field: (fieldName) => Object.freeze({
16612
16703
  source: "work_item",
16613
- field: "description"
16614
- }),
16615
- field: (fieldName) => Object.freeze({ source: "work_item", field: `fields.${fieldName}` })
16704
+ field: `${WORK_ITEM_FIELDS_PATH_PREFIX}${fieldName}`
16705
+ })
16616
16706
  });
16617
16707
  var WORK_ITEM_FIELD_BINDINGS = {
16618
16708
  workItemTitle: { source: "work_item", field: "title" },
@@ -16663,7 +16753,7 @@ function resolveAdditionalStepInputBindings(label, definition) {
16663
16753
  const raw = definition.bindings({
16664
16754
  workItemField: (fieldName) => ({
16665
16755
  source: "work_item",
16666
- field: `fields.${fieldName}`
16756
+ field: `${WORK_ITEM_FIELDS_PATH_PREFIX}${fieldName}`
16667
16757
  }),
16668
16758
  literal: literal2
16669
16759
  });
@@ -17073,7 +17163,7 @@ function makeLeaf(fact, path, operator, value) {
17073
17163
  };
17074
17164
  }
17075
17165
  function makeFieldRef(fact, path) {
17076
- return {
17166
+ const untyped = {
17077
17167
  eq: (v) => makeLeaf(fact, path, "equal", v),
17078
17168
  ne: (v) => makeLeaf(fact, path, "notEqual", v),
17079
17169
  gt: (v) => makeLeaf(fact, path, "greaterThan", v),
@@ -17085,6 +17175,16 @@ function makeFieldRef(fact, path) {
17085
17175
  contains: (v) => makeLeaf(fact, path, "contains", v),
17086
17176
  doesNotContain: (v) => makeLeaf(fact, path, "doesNotContain", v)
17087
17177
  };
17178
+ return untyped;
17179
+ }
17180
+ function buildWorkItemAccessor() {
17181
+ const accessor = {
17182
+ field: (name) => makeFieldRef("workItem", `$.${WORK_ITEM_FIELDS_PATH_PREFIX}${name}`)
17183
+ };
17184
+ for (const key of WORK_ITEM_TOP_LEVEL_FIELDS) {
17185
+ accessor[key] = makeFieldRef("workItem", `$.${key}`);
17186
+ }
17187
+ return accessor;
17088
17188
  }
17089
17189
  function makeAssign(pipeline2) {
17090
17190
  if (typeof pipeline2 !== "object" || typeof pipeline2["key"] !== "string" || !Array.isArray(pipeline2["nodeDefinitions"])) {
@@ -17107,9 +17207,7 @@ function makeGroup(mode, refs) {
17107
17207
  }
17108
17208
  function buildCtx() {
17109
17209
  return {
17110
- workItem: {
17111
- field: (name) => makeFieldRef("workItem", `$.fields.${name}`)
17112
- },
17210
+ workItem: buildWorkItemAccessor(),
17113
17211
  context: {
17114
17212
  isNew: makeFieldRef("context", "$.isNew")
17115
17213
  },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@boboddy/sdk",
4
- "version": "0.4.0",
4
+ "version": "0.4.3",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {