@crvouga/mockingbird-service-plane 2.0.0 → 2.2.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.
package/openapi.yaml CHANGED
@@ -2,7 +2,7 @@ openapi: 3.1.0
2
2
  info:
3
3
  title: Plane REST API (Mockingbird subset)
4
4
  description: 'Stateful mock subset of Plane''s public REST API v1 for one project: work items (cursor-paginated
5
- list, get, create, patch), comments, links, states and labels. Hand-authored from Plane''s API reference
5
+ list, get, create, patch), comments, links, states, labels, cycles and work-item types. Hand-authored from Plane''s API reference
6
6
  and the consumer''s zod schemas (plane-response.ts).
7
7
 
8
8
  '
@@ -337,6 +337,182 @@ paths:
337
337
  parameters:
338
338
  - $ref: '#/components/parameters/Slug'
339
339
  - $ref: '#/components/parameters/ProjectId'
340
+ /api/v1/workspaces/{slug}/projects/{project_id}/cycles/:
341
+ parameters:
342
+ - $ref: "#/components/parameters/Slug"
343
+ - $ref: "#/components/parameters/ProjectId"
344
+ get:
345
+ operationId: ListCycles
346
+ description: Cycles, paginated except cycle_view=current (a bare array).
347
+ x-mockingbird:
348
+ supported: true
349
+ parity:
350
+ enabled: true
351
+ safe: true
352
+ responses:
353
+ "200":
354
+ description: Cycle response
355
+ content:
356
+ application/json:
357
+ schema:
358
+ $ref: "#/components/schemas/CycleList"
359
+ "400": &a1
360
+ description: Validation failed
361
+ content:
362
+ application/json:
363
+ schema:
364
+ $ref: "#/components/schemas/CycleError"
365
+ "401": &a2
366
+ $ref: "#/components/responses/Unauthorized"
367
+ "404": &a3
368
+ $ref: "#/components/responses/NotFound"
369
+ "429": &a4
370
+ $ref: "#/components/responses/Throttled"
371
+ parameters:
372
+ - $ref: "#/components/parameters/PerPage"
373
+ - $ref: "#/components/parameters/Cursor"
374
+ - name: cycle_view
375
+ in: query
376
+ schema:
377
+ type: string
378
+ enum:
379
+ - all
380
+ - current
381
+ - upcoming
382
+ - completed
383
+ - draft
384
+ - incomplete
385
+ - name: order_by
386
+ in: query
387
+ schema:
388
+ type: string
389
+ enum:
390
+ - created_at
391
+ - -created_at
392
+ - name
393
+ - -name
394
+ - start_date
395
+ - -start_date
396
+ - end_date
397
+ - -end_date
398
+ post:
399
+ operationId: CreateCycle
400
+ description: Create a draft or a dated cycle in a UTC project.
401
+ x-mockingbird:
402
+ supported: true
403
+ parity:
404
+ enabled: true
405
+ safe: false
406
+ responses:
407
+ "201":
408
+ description: Created
409
+ content:
410
+ application/json:
411
+ schema:
412
+ $ref: "#/components/schemas/Cycle"
413
+ "400": *a1
414
+ "401": *a2
415
+ "404": *a3
416
+ "409":
417
+ description: Duplicate external source and id
418
+ content:
419
+ application/json:
420
+ schema:
421
+ $ref: "#/components/schemas/ErrorBody"
422
+ "429": *a4
423
+ requestBody:
424
+ required: true
425
+ content:
426
+ application/json:
427
+ schema:
428
+ $ref: "#/components/schemas/CreateCycleBody"
429
+ /api/v1/workspaces/{slug}/projects/{project_id}/cycles/{cycle_id}/cycle-issues/:
430
+ parameters:
431
+ - $ref: "#/components/parameters/Slug"
432
+ - $ref: "#/components/parameters/ProjectId"
433
+ - name: cycle_id
434
+ in: path
435
+ required: true
436
+ schema:
437
+ type: string
438
+ format: uuid
439
+ x-mockingbird-resource-ref:
440
+ type: cycle
441
+ missing: 00000000-0000-4000-8000-000000000000
442
+ get:
443
+ operationId: ListCycleWorkItems
444
+ description: Paginated live work items assigned to the cycle.
445
+ x-mockingbird:
446
+ supported: true
447
+ parity:
448
+ enabled: true
449
+ safe: true
450
+ responses:
451
+ "200":
452
+ description: Cycle response
453
+ content:
454
+ application/json:
455
+ schema:
456
+ $ref: "#/components/schemas/WorkItemPage"
457
+ "400": *a1
458
+ "401": *a2
459
+ "404": *a3
460
+ "429": *a4
461
+ parameters:
462
+ - $ref: "#/components/parameters/PerPage"
463
+ - $ref: "#/components/parameters/Cursor"
464
+ post:
465
+ operationId: AddCycleWorkItems
466
+ description: Add or move work items; unknown or foreign item ids are ignored.
467
+ x-mockingbird:
468
+ supported: true
469
+ parity:
470
+ enabled: true
471
+ safe: false
472
+ responses:
473
+ "200":
474
+ description: Cycle response
475
+ content:
476
+ application/json:
477
+ schema:
478
+ $ref: "#/components/schemas/CycleMemberships"
479
+ "400": *a1
480
+ "401": *a2
481
+ "404": *a3
482
+ "429": *a4
483
+ requestBody:
484
+ required: true
485
+ content:
486
+ application/json:
487
+ schema:
488
+ $ref: "#/components/schemas/AddCycleWorkItemsBody"
489
+ /api/v1/workspaces/{slug}/projects/{project_id}/work-item-types/:
490
+ parameters:
491
+ - $ref: "#/components/parameters/Slug"
492
+ - $ref: "#/components/parameters/ProjectId"
493
+ get:
494
+ operationId: ListWorkItemTypes
495
+ description: All work-item types for the project, as a bare array.
496
+ x-mockingbird:
497
+ supported: true
498
+ parity:
499
+ enabled: true
500
+ safe: true
501
+ responses:
502
+ "200":
503
+ description: Work-item types
504
+ content:
505
+ application/json:
506
+ schema:
507
+ type: array
508
+ items:
509
+ $ref: "#/components/schemas/WorkItemType"
510
+ "401":
511
+ $ref: "#/components/responses/Unauthorized"
512
+ "404":
513
+ $ref: "#/components/responses/NotFound"
514
+ "429":
515
+ $ref: "#/components/responses/Throttled"
340
516
  components:
341
517
  securitySchemes:
342
518
  apiKey:
@@ -437,6 +613,20 @@ components:
437
613
  - project
438
614
  - workspace
439
615
  properties:
616
+ type_id:
617
+ type:
618
+ - string
619
+ - "null"
620
+ format: uuid
621
+ x-mockingbird-volatile:
622
+ kind: id
623
+ type:
624
+ type:
625
+ - string
626
+ - "null"
627
+ format: uuid
628
+ x-mockingbird-volatile:
629
+ kind: id
440
630
  id:
441
631
  type: string
442
632
  format: uuid
@@ -891,6 +1081,14 @@ components:
891
1081
  required:
892
1082
  - name
893
1083
  properties:
1084
+ type_id:
1085
+ type:
1086
+ - string
1087
+ - "null"
1088
+ format: uuid
1089
+ x-mockingbird-resource-ref:
1090
+ type: work_item_type
1091
+ missing: 00000000-0000-4000-8000-000000000000
894
1092
  name:
895
1093
  type: string
896
1094
  minLength: 1
@@ -924,6 +1122,14 @@ components:
924
1122
  UpdateWorkItemBody:
925
1123
  type: object
926
1124
  properties:
1125
+ type_id:
1126
+ type:
1127
+ - string
1128
+ - "null"
1129
+ format: uuid
1130
+ x-mockingbird-resource-ref:
1131
+ type: work_item_type
1132
+ missing: 00000000-0000-4000-8000-000000000000
927
1133
  name:
928
1134
  type: string
929
1135
  minLength: 1
@@ -1012,3 +1218,241 @@ components:
1012
1218
  type: array
1013
1219
  items:
1014
1220
  type: string
1221
+ Cycle:
1222
+ type: object
1223
+ required:
1224
+ - id
1225
+ - name
1226
+ - start_date
1227
+ - end_date
1228
+ - project
1229
+ - workspace
1230
+ - created_at
1231
+ - updated_at
1232
+ properties:
1233
+ id:
1234
+ type: string
1235
+ format: uuid
1236
+ x-mockingbird-resource:
1237
+ type: cycle
1238
+ identity: true
1239
+ x-mockingbird-volatile:
1240
+ kind: id
1241
+ name: &a1
1242
+ type: string
1243
+ description: *a1
1244
+ start_date: &a2
1245
+ type:
1246
+ - string
1247
+ - "null"
1248
+ end_date: *a2
1249
+ owned_by: *a2
1250
+ timezone: *a1
1251
+ external_source: *a2
1252
+ external_id: *a2
1253
+ project: *a1
1254
+ workspace: *a1
1255
+ created_at: &a3
1256
+ type: string
1257
+ x-mockingbird-volatile:
1258
+ kind: timestamp
1259
+ updated_at: *a3
1260
+ archived_at: *a2
1261
+ deleted_at: *a2
1262
+ total_issues:
1263
+ type: integer
1264
+ completed_issues:
1265
+ type: integer
1266
+ cancelled_issues:
1267
+ type: integer
1268
+ started_issues:
1269
+ type: integer
1270
+ unstarted_issues:
1271
+ type: integer
1272
+ backlog_issues:
1273
+ type: integer
1274
+ CyclePage:
1275
+ type: object
1276
+ required:
1277
+ - results
1278
+ - next_cursor
1279
+ - prev_cursor
1280
+ - next_page_results
1281
+ - prev_page_results
1282
+ - count
1283
+ - total_count
1284
+ - total_pages
1285
+ - total_results
1286
+ properties:
1287
+ grouped_by:
1288
+ type:
1289
+ - string
1290
+ - "null"
1291
+ sub_grouped_by:
1292
+ type:
1293
+ - string
1294
+ - "null"
1295
+ total_count:
1296
+ type: integer
1297
+ next_cursor:
1298
+ type: string
1299
+ prev_cursor:
1300
+ type: string
1301
+ next_page_results:
1302
+ type: boolean
1303
+ prev_page_results:
1304
+ type: boolean
1305
+ count:
1306
+ type: integer
1307
+ total_pages:
1308
+ type: integer
1309
+ total_results:
1310
+ type: integer
1311
+ extra_stats:
1312
+ type:
1313
+ - object
1314
+ - "null"
1315
+ results:
1316
+ type: array
1317
+ items:
1318
+ $ref: "#/components/schemas/Cycle"
1319
+ CycleList:
1320
+ oneOf:
1321
+ - $ref: "#/components/schemas/CyclePage"
1322
+ - type: array
1323
+ items:
1324
+ $ref: "#/components/schemas/Cycle"
1325
+ CreateCycleBody:
1326
+ type: object
1327
+ required:
1328
+ - name
1329
+ properties:
1330
+ name:
1331
+ type: string
1332
+ minLength: 1
1333
+ maxLength: 255
1334
+ description: *a1
1335
+ start_date: *a2
1336
+ end_date: *a2
1337
+ owned_by:
1338
+ type:
1339
+ - string
1340
+ - "null"
1341
+ format: uuid
1342
+ timezone: *a1
1343
+ external_source: *a2
1344
+ external_id: *a2
1345
+ CycleMembership:
1346
+ type: object
1347
+ required:
1348
+ - id
1349
+ - cycle
1350
+ - issue
1351
+ - project
1352
+ - workspace
1353
+ - created_at
1354
+ - updated_at
1355
+ properties:
1356
+ id:
1357
+ type: string
1358
+ format: uuid
1359
+ x-mockingbird-resource:
1360
+ type: cycle_membership
1361
+ identity: true
1362
+ x-mockingbird-volatile:
1363
+ kind: id
1364
+ cycle:
1365
+ type: string
1366
+ format: uuid
1367
+ issue:
1368
+ type: string
1369
+ format: uuid
1370
+ project: *a1
1371
+ workspace: *a1
1372
+ created_at: *a3
1373
+ updated_at: *a3
1374
+ deleted_at: *a2
1375
+ CycleMemberships:
1376
+ type: array
1377
+ items:
1378
+ $ref: "#/components/schemas/CycleMembership"
1379
+ AddCycleWorkItemsBody:
1380
+ type: object
1381
+ properties:
1382
+ issues:
1383
+ type: array
1384
+ items:
1385
+ type: string
1386
+ format: uuid
1387
+ x-mockingbird-resource-ref:
1388
+ type: work_item
1389
+ missing: 00000000-0000-4000-8000-000000000000
1390
+ CycleError:
1391
+ anyOf:
1392
+ - $ref: '#/components/schemas/ValidationError'
1393
+ - type: object
1394
+ required: [error]
1395
+ properties:
1396
+ error:
1397
+ type: string
1398
+ code:
1399
+ type: string
1400
+ id:
1401
+ type: string
1402
+ - type: object
1403
+ required: [code, message]
1404
+ properties:
1405
+ code:
1406
+ type: string
1407
+ message:
1408
+ type: string
1409
+ WorkItemType:
1410
+ type: object
1411
+ required:
1412
+ - id
1413
+ - name
1414
+ - project_ids
1415
+ - is_default
1416
+ - is_active
1417
+ - created_at
1418
+ - updated_at
1419
+ properties:
1420
+ id:
1421
+ type: string
1422
+ format: uuid
1423
+ x-mockingbird-resource:
1424
+ type: work_item_type
1425
+ identity: true
1426
+ x-mockingbird-volatile:
1427
+ kind: id
1428
+ name:
1429
+ type: string
1430
+ description:
1431
+ type: string
1432
+ project_ids:
1433
+ type: array
1434
+ items:
1435
+ type: string
1436
+ format: uuid
1437
+ logo_props:
1438
+ type: object
1439
+ is_epic:
1440
+ type: boolean
1441
+ is_default:
1442
+ type: boolean
1443
+ is_active:
1444
+ type: boolean
1445
+ level:
1446
+ type: number
1447
+ created_at:
1448
+ type: string
1449
+ x-mockingbird-volatile:
1450
+ kind: timestamp
1451
+ updated_at:
1452
+ type: string
1453
+ x-mockingbird-volatile:
1454
+ kind: timestamp
1455
+ deleted_at:
1456
+ type:
1457
+ - string
1458
+ - "null"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crvouga/mockingbird-service-plane",
3
- "version": "2.0.0",
3
+ "version": "2.2.0",
4
4
  "description": "Stateful mock of the Plane REST API v1: cursor-paginated work items, comments, links, states and labels, with Plane's rate limit and error shapes.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -96,7 +96,7 @@
96
96
  "pack:check": "bun ../../../scripts/pack-check.ts"
97
97
  },
98
98
  "dependencies": {
99
- "@crvouga/mockingbird-service-sqlite": "2.0.0",
99
+ "@crvouga/mockingbird-service-sqlite": "2.1.0",
100
100
  "hono": "4.11.9"
101
101
  },
102
102
  "devDependencies": {