@terrantula/sdk 0.5.2 → 0.6.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.
@@ -132,7 +132,7 @@ function createOrgsClient(cloud, baseUrl, hcOpts) {
132
132
  id: z.string().describe("Organization ID")
133
133
  }),
134
134
  async (params) => callPersonalTokens(
135
- await personalTokensRequest(baseUrl, hcOpts, `/orgs/${params.id}/personal-tokens`)
135
+ await personalTokensRequest(baseUrl, hcOpts, `/api/orgs/${params.id}/personal-tokens`)
136
136
  )
137
137
  ),
138
138
  createPersonalToken: withSchema(
@@ -144,7 +144,7 @@ function createOrgsClient(cloud, baseUrl, hcOpts) {
144
144
  async (params) => {
145
145
  const { id, ...body } = params;
146
146
  return callPersonalTokens(
147
- await personalTokensRequest(baseUrl, hcOpts, `/orgs/${id}/personal-tokens`, {
147
+ await personalTokensRequest(baseUrl, hcOpts, `/api/orgs/${id}/personal-tokens`, {
148
148
  method: "POST",
149
149
  headers: { "Content-Type": "application/json" },
150
150
  body: JSON.stringify(body)
@@ -161,7 +161,7 @@ function createOrgsClient(cloud, baseUrl, hcOpts) {
161
161
  await personalTokensRequest(
162
162
  baseUrl,
163
163
  hcOpts,
164
- `/orgs/${params.id}/personal-tokens/${params.tokenId}`,
164
+ `/api/orgs/${params.id}/personal-tokens/${params.tokenId}`,
165
165
  { method: "DELETE" }
166
166
  )
167
167
  )
@@ -171,7 +171,7 @@ function createOrgsClient(cloud, baseUrl, hcOpts) {
171
171
  id: z.string().describe("Organization ID")
172
172
  }),
173
173
  async (params) => callPersonalTokens(
174
- await personalTokensRequest(baseUrl, hcOpts, `/orgs/${params.id}/sso-extras`)
174
+ await personalTokensRequest(baseUrl, hcOpts, `/api/orgs/${params.id}/sso-extras`)
175
175
  )
176
176
  ),
177
177
  setSsoForce: withSchema(
@@ -184,7 +184,7 @@ function createOrgsClient(cloud, baseUrl, hcOpts) {
184
184
  await personalTokensRequest(
185
185
  baseUrl,
186
186
  hcOpts,
187
- `/orgs/${params.id}/sso-extras/${params.providerId}`,
187
+ `/api/orgs/${params.id}/sso-extras/${params.providerId}`,
188
188
  {
189
189
  method: "PATCH",
190
190
  headers: { "Content-Type": "application/json" },
@@ -310,7 +310,7 @@ function createProjectsClient(cloud, baseUrl, hcOpts) {
310
310
  }),
311
311
  (params) => call(
312
312
  hc(
313
- `${baseUrl}/orgs/${params.orgId}/projects/${params.projectId}/tokens`,
313
+ `${baseUrl}/api/orgs/${params.orgId}/projects/${params.projectId}/tokens`,
314
314
  hcOpts
315
315
  ).index.$get()
316
316
  )
@@ -331,7 +331,7 @@ function createProjectsClient(cloud, baseUrl, hcOpts) {
331
331
  const { orgId, projectId, ...body } = params;
332
332
  return call(
333
333
  hc(
334
- `${baseUrl}/orgs/${orgId}/projects/${projectId}/tokens`,
334
+ `${baseUrl}/api/orgs/${orgId}/projects/${projectId}/tokens`,
335
335
  hcOpts
336
336
  ).index.$post({ json: body })
337
337
  );
@@ -345,10 +345,42 @@ function createProjectsClient(cloud, baseUrl, hcOpts) {
345
345
  }),
346
346
  (params) => call(
347
347
  hc(
348
- `${baseUrl}/orgs/${params.orgId}/projects/${params.projectId}/tokens`,
348
+ `${baseUrl}/api/orgs/${params.orgId}/projects/${params.projectId}/tokens`,
349
349
  hcOpts
350
350
  )[":tokenId"].$delete({ param: { tokenId: params.tokenId } })
351
351
  )
352
+ ),
353
+ /**
354
+ * DELETE /projects/:projectId/nuke
355
+ * Wipe all project-scoped runtime + catalog rows. Callable with a project
356
+ * API token (terr_*) at admin or owner role. Preserves the project row,
357
+ * members, GitHub repo links, API tokens, and environments. Idempotent.
358
+ */
359
+ nuke: withSchema(
360
+ z2.object({
361
+ orgId: z2.string().describe("Organization slug"),
362
+ projectId: z2.string().describe("Project ID to nuke")
363
+ }),
364
+ async (params) => {
365
+ const url = `${baseUrl}/api/${encodeURIComponent(params.orgId)}/${encodeURIComponent(params.projectId)}/nuke`;
366
+ const fetchImpl = hcOpts?.fetch ?? fetch;
367
+ const rawHeaders = hcOpts?.headers;
368
+ const resolvedHeaders = typeof rawHeaders === "function" ? await rawHeaders() : rawHeaders ?? {};
369
+ const res = await fetchImpl(url, {
370
+ method: "DELETE",
371
+ headers: resolvedHeaders
372
+ });
373
+ if (!res.ok) {
374
+ let message = fallbackMessage(res.status);
375
+ try {
376
+ const body = await res.json();
377
+ if (body.error) message = body.error;
378
+ } catch {
379
+ }
380
+ throw new TerrantulaError(res.status, { error: message });
381
+ }
382
+ return res.json();
383
+ }
352
384
  )
353
385
  };
354
386
  }
@@ -363,40 +395,49 @@ function createEntityTypesClient(proj) {
363
395
  return {
364
396
  list: withSchema(
365
397
  z3.object({
398
+ orgId: z3.string().describe("Organization slug"),
366
399
  projectId: z3.string().describe("Project ID")
367
400
  }),
368
- (params) => call(proj(params.projectId)["entity-types"].$get())
401
+ (params) => call(proj(params.orgId, params.projectId)["entity-types"].$get())
369
402
  ),
370
403
  get: withSchema(
371
404
  z3.object({
405
+ orgId: z3.string().describe("Organization slug"),
372
406
  projectId: z3.string().describe("Project ID"),
373
407
  name: z3.string().describe("Entity type name")
374
408
  }),
375
- (params) => call(proj(params.projectId)["entity-types"][":name"].$get({ param: { name: params.name } }))
409
+ (params) => call(proj(params.orgId, params.projectId)["entity-types"][":name"].$get({ param: { name: params.name } }))
376
410
  ),
377
411
  create: withSchema(
378
- EntityTypeSchema.extend({ projectId: z3.string().describe("Project ID") }),
412
+ EntityTypeSchema.extend({
413
+ orgId: z3.string().describe("Organization slug"),
414
+ projectId: z3.string().describe("Project ID")
415
+ }),
379
416
  (params) => {
380
- const { projectId, ...body } = params;
381
- return call(proj(projectId)["entity-types"].$post({ json: body }));
417
+ const { orgId, projectId, ...body } = params;
418
+ return call(proj(orgId, projectId)["entity-types"].$post({ json: body }));
382
419
  }
383
420
  ),
384
421
  update: withSchema(
385
- EntityTypeSchema.extend({ projectId: z3.string().describe("Project ID") }),
422
+ EntityTypeSchema.extend({
423
+ orgId: z3.string().describe("Organization slug"),
424
+ projectId: z3.string().describe("Project ID")
425
+ }),
386
426
  (params) => {
387
- const { projectId, ...body } = params;
427
+ const { orgId, projectId, ...body } = params;
388
428
  return call(
389
- proj(projectId)["entity-types"][":name"].$put({ param: { name: params.name }, json: body })
429
+ proj(orgId, projectId)["entity-types"][":name"].$put({ param: { name: params.name }, json: body })
390
430
  );
391
431
  }
392
432
  ),
393
433
  delete: withSchema(
394
434
  z3.object({
435
+ orgId: z3.string().describe("Organization slug"),
395
436
  projectId: z3.string().describe("Project ID"),
396
437
  name: z3.string().describe("Entity type name")
397
438
  }),
398
439
  (params) => call(
399
- proj(params.projectId)["entity-types"][":name"].$delete({ param: { name: params.name } })
440
+ proj(params.orgId, params.projectId)["entity-types"][":name"].$delete({ param: { name: params.name } })
400
441
  )
401
442
  )
402
443
  };
@@ -405,6 +446,7 @@ function createEntitiesClient(projEnv) {
405
446
  return {
406
447
  list: withSchema(
407
448
  z3.object({
449
+ orgId: z3.string().describe("Organization slug"),
408
450
  projectId: z3.string().describe("Project ID"),
409
451
  envName: z3.string().describe("Environment name"),
410
452
  entityType: z3.string().optional().describe("Filter by entity type"),
@@ -414,42 +456,46 @@ function createEntitiesClient(projEnv) {
414
456
  cursor: z3.string().optional().describe("Pagination cursor")
415
457
  }),
416
458
  (params) => {
417
- const { projectId, envName, ...query } = params;
459
+ const { orgId, projectId, envName, ...query } = params;
418
460
  return call(
419
- projEnv(projectId, envName)["entities"].$get({ query: stringifyQuery(query) })
461
+ projEnv(orgId, projectId, envName)["entities"].$get({ query: stringifyQuery(query) })
420
462
  );
421
463
  }
422
464
  ),
423
465
  get: withSchema(
424
466
  z3.object({
467
+ orgId: z3.string().describe("Organization slug"),
425
468
  projectId: z3.string().describe("Project ID"),
426
469
  envName: z3.string().describe("Environment name"),
427
470
  id: z3.string().uuid().describe("Entity ID")
428
471
  }),
429
- (params) => call(projEnv(params.projectId, params.envName)["entities"][":id"].$get({ param: { id: params.id } }))
472
+ (params) => call(projEnv(params.orgId, params.projectId, params.envName)["entities"][":id"].$get({ param: { id: params.id } }))
430
473
  ),
431
474
  create: withSchema(
432
475
  EntitySchema.extend({
476
+ orgId: z3.string().describe("Organization slug"),
433
477
  projectId: z3.string().describe("Project ID"),
434
478
  envName: z3.string().describe("Environment name")
435
479
  }),
436
480
  (params) => {
437
- const { projectId, envName, ...body } = params;
438
- return call(projEnv(projectId, envName)["entities"].$post({ json: body }));
481
+ const { orgId, projectId, envName, ...body } = params;
482
+ return call(projEnv(orgId, projectId, envName)["entities"].$post({ json: body }));
439
483
  }
440
484
  ),
441
485
  delete: withSchema(
442
486
  z3.object({
487
+ orgId: z3.string().describe("Organization slug"),
443
488
  projectId: z3.string().describe("Project ID"),
444
489
  envName: z3.string().describe("Environment name"),
445
490
  id: z3.string().uuid().describe("Entity ID")
446
491
  }),
447
492
  (params) => call(
448
- projEnv(params.projectId, params.envName)["entities"][":id"].$delete({ param: { id: params.id } })
493
+ projEnv(params.orgId, params.projectId, params.envName)["entities"][":id"].$delete({ param: { id: params.id } })
449
494
  )
450
495
  ),
451
496
  setMetric: withSchema(
452
497
  z3.object({
498
+ orgId: z3.string().describe("Organization slug"),
453
499
  projectId: z3.string().describe("Project ID"),
454
500
  envName: z3.string().describe("Environment name"),
455
501
  id: z3.string().uuid().describe("Entity ID"),
@@ -457,9 +503,9 @@ function createEntitiesClient(projEnv) {
457
503
  value: z3.number().describe("Metric value")
458
504
  }),
459
505
  (params) => {
460
- const { projectId, envName, id, metricName, value } = params;
506
+ const { orgId, projectId, envName, id, metricName, value } = params;
461
507
  return call(
462
- projEnv(projectId, envName)["entities"][":id"]["metrics"][":metricName"].$put({
508
+ projEnv(orgId, projectId, envName)["entities"][":id"]["metrics"][":metricName"].$put({
463
509
  param: { id, metricName },
464
510
  json: { value }
465
511
  })
@@ -468,6 +514,7 @@ function createEntitiesClient(projEnv) {
468
514
  ),
469
515
  trigger: withSchema(
470
516
  z3.object({
517
+ orgId: z3.string().describe("Organization slug"),
471
518
  projectId: z3.string().describe("Project ID"),
472
519
  envName: z3.string().describe("Environment name"),
473
520
  id: z3.string().uuid().describe("Entity ID"),
@@ -476,9 +523,9 @@ function createEntitiesClient(projEnv) {
476
523
  recommendations: z3.record(z3.string()).optional().describe("Recommendation selections as JSON")
477
524
  }).describe("Trigger an instance-scope action on a single entity"),
478
525
  (params) => {
479
- const { projectId, envName, id, actionName, parameters, recommendations } = params;
526
+ const { orgId, projectId, envName, id, actionName, parameters, recommendations } = params;
480
527
  return call(
481
- projEnv(projectId, envName)["entities"][":id"]["actions"][":actionName"].$post({
528
+ projEnv(orgId, projectId, envName)["entities"][":id"]["actions"][":actionName"].$post({
482
529
  param: { id, actionName },
483
530
  json: { parameters, recommendations }
484
531
  })
@@ -487,22 +534,24 @@ function createEntitiesClient(projEnv) {
487
534
  ),
488
535
  getMetrics: withSchema(
489
536
  z3.object({
537
+ orgId: z3.string().describe("Organization slug"),
490
538
  projectId: z3.string().describe("Project ID"),
491
539
  envName: z3.string().describe("Environment name"),
492
540
  entityId: z3.string().describe("Entity ID")
493
541
  }),
494
- (params) => call(projEnv(params.projectId, params.envName).entities[":id"].metrics.$get({ param: { id: params.entityId } }))
542
+ (params) => call(projEnv(params.orgId, params.projectId, params.envName).entities[":id"].metrics.$get({ param: { id: params.entityId } }))
495
543
  ),
496
544
  getMetricsBatch: withSchema(
497
545
  z3.object({
546
+ orgId: z3.string().describe("Organization slug"),
498
547
  projectId: z3.string().describe("Project ID"),
499
548
  envName: z3.string().describe("Environment name"),
500
549
  entityIds: z3.array(z3.string().uuid()).min(1).max(500).describe("Entity IDs to fetch metrics for (max 500)")
501
550
  }),
502
551
  (params) => {
503
- const { projectId, envName, entityIds } = params;
552
+ const { orgId, projectId, envName, entityIds } = params;
504
553
  return call(
505
- projEnv(projectId, envName).entities.metrics.$get({
554
+ projEnv(orgId, projectId, envName).entities.metrics.$get({
506
555
  query: { ids: entityIds.join(",") }
507
556
  })
508
557
  );
@@ -510,14 +559,16 @@ function createEntitiesClient(projEnv) {
510
559
  ),
511
560
  getRelationships: withSchema(
512
561
  z3.object({
562
+ orgId: z3.string().describe("Organization slug"),
513
563
  projectId: z3.string().describe("Project ID"),
514
564
  envName: z3.string().describe("Environment name"),
515
565
  entityId: z3.string().describe("Entity ID")
516
566
  }),
517
- (params) => call(projEnv(params.projectId, params.envName).entities[":id"].relationships.$get({ param: { id: params.entityId } }))
567
+ (params) => call(projEnv(params.orgId, params.projectId, params.envName).entities[":id"].relationships.$get({ param: { id: params.entityId } }))
518
568
  ),
519
569
  syncStamp: withSchema(
520
570
  z3.object({
571
+ orgId: z3.string().describe("Organization slug"),
521
572
  projectId: z3.string().describe("Project ID"),
522
573
  envName: z3.string().describe("Environment name"),
523
574
  id: z3.string().uuid().describe("Entity ID"),
@@ -525,9 +576,9 @@ function createEntitiesClient(projEnv) {
525
576
  observedAt: z3.string().datetime().optional().describe("ISO-8601 observation timestamp; defaults to server time")
526
577
  }),
527
578
  (params) => {
528
- const { projectId, envName, id, source, observedAt } = params;
579
+ const { orgId, projectId, envName, id, source, observedAt } = params;
529
580
  return call(
530
- projEnv(projectId, envName)["entities"][":id"]["sync-stamp"].$post({
581
+ projEnv(orgId, projectId, envName)["entities"][":id"]["sync-stamp"].$post({
531
582
  param: { id },
532
583
  json: { source, observedAt }
533
584
  })
@@ -544,76 +595,103 @@ function createCellsClient(proj) {
544
595
  return {
545
596
  list: withSchema(
546
597
  z4.object({
598
+ orgId: z4.string().describe("Organization slug"),
547
599
  projectId: z4.string().describe("Project ID")
548
600
  }),
549
- (params) => call(proj(params.projectId)["cells"].$get())
601
+ (params) => call(proj(params.orgId, params.projectId)["cells"].$get())
550
602
  ),
551
603
  get: withSchema(
552
604
  z4.object({
605
+ orgId: z4.string().describe("Organization slug"),
553
606
  projectId: z4.string().describe("Project ID"),
554
607
  name: z4.string().describe("Cell name")
555
608
  }),
556
- (params) => call(proj(params.projectId)["cells"][":name"].$get({ param: { name: params.name } }))
609
+ (params) => call(proj(params.orgId, params.projectId)["cells"][":name"].$get({ param: { name: params.name } }))
557
610
  ),
558
611
  create: withSchema(
559
- CellSchema.extend({ projectId: z4.string().describe("Project ID") }),
612
+ CellSchema.extend({
613
+ orgId: z4.string().describe("Organization slug"),
614
+ projectId: z4.string().describe("Project ID")
615
+ }),
560
616
  (params) => {
561
- const { projectId, ...body } = params;
562
- return call(proj(projectId)["cells"].$post({ json: body }));
617
+ const { orgId, projectId, ...body } = params;
618
+ return call(proj(orgId, projectId)["cells"].$post({ json: body }));
563
619
  }
564
620
  ),
565
621
  update: withSchema(
566
- CellSchema.extend({ projectId: z4.string().describe("Project ID") }),
622
+ CellSchema.extend({
623
+ orgId: z4.string().describe("Organization slug"),
624
+ projectId: z4.string().describe("Project ID")
625
+ }),
567
626
  (params) => {
568
- const { projectId, ...body } = params;
627
+ const { orgId, projectId, ...body } = params;
569
628
  return call(
570
- proj(projectId)["cells"][":name"].$put({ param: { name: params.name }, json: body })
629
+ proj(orgId, projectId)["cells"][":name"].$put({ param: { name: params.name }, json: body })
571
630
  );
572
631
  }
573
632
  ),
574
633
  delete: withSchema(
575
634
  z4.object({
635
+ orgId: z4.string().describe("Organization slug"),
576
636
  projectId: z4.string().describe("Project ID"),
577
637
  name: z4.string().describe("Cell name")
578
638
  }),
579
- (params) => call(proj(params.projectId)["cells"][":name"].$delete({ param: { name: params.name } }))
639
+ (params) => call(proj(params.orgId, params.projectId)["cells"][":name"].$delete({ param: { name: params.name } }))
580
640
  ),
581
641
  listMembers: withSchema(
582
642
  z4.object({
643
+ orgId: z4.string().describe("Organization slug"),
583
644
  projectId: z4.string().describe("Project ID"),
584
- name: z4.string().describe("Cell name")
645
+ name: z4.string().describe("Cell name"),
646
+ envName: z4.string().describe("Environment name").default("default")
585
647
  }),
586
- (params) => call(
587
- proj(params.projectId)["cells"][":name"]["members"].$get({ param: { name: params.name } })
588
- )
648
+ (params) => {
649
+ const envName = params.envName ?? "default";
650
+ return call(
651
+ proj(params.orgId, params.projectId)["cells"][":name"]["members"].$get({
652
+ param: { name: params.name },
653
+ query: { envName }
654
+ })
655
+ );
656
+ }
589
657
  ),
590
658
  addMember: withSchema(
591
659
  z4.object({
660
+ orgId: z4.string().describe("Organization slug"),
592
661
  projectId: z4.string().describe("Project ID"),
593
662
  name: z4.string().describe("Cell name"),
594
- entityId: z4.string().uuid().describe("Entity ID")
663
+ entityName: z4.string().describe("Entity name (M5-rework natural key)"),
664
+ entityTypeName: z4.string().describe("Entity type name (M5-rework natural key)"),
665
+ envName: z4.string().describe("Environment name").default("default")
595
666
  }),
596
667
  (params) => {
597
- const { projectId, name, entityId } = params;
668
+ const { orgId, projectId, name, entityName, entityTypeName } = params;
669
+ const envName = params.envName ?? "default";
598
670
  return call(
599
- proj(projectId)["cells"][":name"]["members"].$post({
671
+ proj(orgId, projectId)["cells"][":name"]["members"].$post({
600
672
  param: { name },
601
- json: { entityId }
673
+ json: { entityName, entityTypeName, envName }
602
674
  })
603
675
  );
604
676
  }
605
677
  ),
606
678
  removeMember: withSchema(
607
679
  z4.object({
680
+ orgId: z4.string().describe("Organization slug"),
608
681
  projectId: z4.string().describe("Project ID"),
609
682
  name: z4.string().describe("Cell name"),
610
- entityId: z4.string().uuid().describe("Entity ID")
683
+ entityName: z4.string().describe("Entity name (M5-rework natural key)"),
684
+ envName: z4.string().describe("Environment name").default("default")
611
685
  }),
612
- (params) => call(
613
- proj(params.projectId)["cells"][":name"]["members"][":entityId"].$delete({
614
- param: { name: params.name, entityId: params.entityId }
615
- })
616
- )
686
+ (params) => {
687
+ const envName = params.envName ?? "default";
688
+ return call(
689
+ proj(params.orgId, params.projectId)["cells"][":name"]["members"][":entityName"].$delete({
690
+ param: { name: params.name, entityName: params.entityName },
691
+ query: { envName }
692
+ })
693
+ );
694
+ }
617
695
  )
618
696
  };
619
697
  }
@@ -625,34 +703,42 @@ function createRelationshipTypesClient(proj) {
625
703
  return {
626
704
  list: withSchema(
627
705
  z5.object({
706
+ orgId: z5.string().describe("Organization slug"),
628
707
  projectId: z5.string().describe("Project ID")
629
708
  }),
630
- (params) => call(proj(params.projectId)["relationship-types"].$get())
709
+ (params) => call(proj(params.orgId, params.projectId)["relationship-types"].$get())
631
710
  ),
632
711
  get: withSchema(
633
712
  z5.object({
713
+ orgId: z5.string().describe("Organization slug"),
634
714
  projectId: z5.string().describe("Project ID"),
635
715
  name: z5.string().describe("Relationship type name")
636
716
  }),
637
717
  (params) => call(
638
- proj(params.projectId)["relationship-types"][":name"].$get({
718
+ proj(params.orgId, params.projectId)["relationship-types"][":name"].$get({
639
719
  param: { name: params.name }
640
720
  })
641
721
  )
642
722
  ),
643
723
  create: withSchema(
644
- RelationshipTypeSchema.extend({ projectId: z5.string().describe("Project ID") }),
724
+ RelationshipTypeSchema.extend({
725
+ orgId: z5.string().describe("Organization slug"),
726
+ projectId: z5.string().describe("Project ID")
727
+ }),
645
728
  (params) => {
646
- const { projectId, ...body } = params;
647
- return call(proj(projectId)["relationship-types"].$post({ json: body }));
729
+ const { orgId, projectId, ...body } = params;
730
+ return call(proj(orgId, projectId)["relationship-types"].$post({ json: body }));
648
731
  }
649
732
  ),
650
733
  update: withSchema(
651
- RelationshipTypeSchema.extend({ projectId: z5.string().describe("Project ID") }),
734
+ RelationshipTypeSchema.extend({
735
+ orgId: z5.string().describe("Organization slug"),
736
+ projectId: z5.string().describe("Project ID")
737
+ }),
652
738
  (params) => {
653
- const { projectId, ...body } = params;
739
+ const { orgId, projectId, ...body } = params;
654
740
  return call(
655
- proj(projectId)["relationship-types"][":name"].$put({
741
+ proj(orgId, projectId)["relationship-types"][":name"].$put({
656
742
  param: { name: params.name },
657
743
  json: body
658
744
  })
@@ -661,11 +747,12 @@ function createRelationshipTypesClient(proj) {
661
747
  ),
662
748
  delete: withSchema(
663
749
  z5.object({
750
+ orgId: z5.string().describe("Organization slug"),
664
751
  projectId: z5.string().describe("Project ID"),
665
752
  name: z5.string().describe("Relationship type name")
666
753
  }),
667
754
  (params) => call(
668
- proj(params.projectId)["relationship-types"][":name"].$delete({
755
+ proj(params.orgId, params.projectId)["relationship-types"][":name"].$delete({
669
756
  param: { name: params.name }
670
757
  })
671
758
  )
@@ -676,6 +763,7 @@ function createRelationshipsClient(projEnv) {
676
763
  return {
677
764
  list: withSchema(
678
765
  z5.object({
766
+ orgId: z5.string().describe("Organization slug"),
679
767
  projectId: z5.string().describe("Project ID"),
680
768
  envName: z5.string().describe("Environment name"),
681
769
  relationshipType: z5.string().optional().describe("Filter by relationship type"),
@@ -687,40 +775,43 @@ function createRelationshipsClient(projEnv) {
687
775
  limit: z5.coerce.number().int().min(1).max(100).optional().describe("Max results (1-100)")
688
776
  }),
689
777
  (params) => {
690
- const { projectId, envName, ...query } = params;
778
+ const { orgId, projectId, envName, ...query } = params;
691
779
  return call(
692
- projEnv(projectId, envName)["relationships"].$get({ query: stringifyQuery(query) })
780
+ projEnv(orgId, projectId, envName)["relationships"].$get({ query: stringifyQuery(query) })
693
781
  );
694
782
  }
695
783
  ),
696
784
  get: withSchema(
697
785
  z5.object({
786
+ orgId: z5.string().describe("Organization slug"),
698
787
  projectId: z5.string().describe("Project ID"),
699
788
  envName: z5.string().describe("Environment name"),
700
789
  id: z5.string().uuid().describe("Relationship ID")
701
790
  }),
702
791
  (params) => call(
703
- projEnv(params.projectId, params.envName)["relationships"][":id"].$get({ param: { id: params.id } })
792
+ projEnv(params.orgId, params.projectId, params.envName)["relationships"][":id"].$get({ param: { id: params.id } })
704
793
  )
705
794
  ),
706
795
  create: withSchema(
707
796
  RelationshipSchema.extend({
797
+ orgId: z5.string().describe("Organization slug"),
708
798
  projectId: z5.string().describe("Project ID"),
709
799
  envName: z5.string().describe("Environment name")
710
800
  }),
711
801
  (params) => {
712
- const { projectId, envName, ...body } = params;
713
- return call(projEnv(projectId, envName)["relationships"].$post({ json: body }));
802
+ const { orgId, projectId, envName, ...body } = params;
803
+ return call(projEnv(orgId, projectId, envName)["relationships"].$post({ json: body }));
714
804
  }
715
805
  ),
716
806
  delete: withSchema(
717
807
  z5.object({
808
+ orgId: z5.string().describe("Organization slug"),
718
809
  projectId: z5.string().describe("Project ID"),
719
810
  envName: z5.string().describe("Environment name"),
720
811
  id: z5.string().uuid().describe("Relationship ID")
721
812
  }),
722
813
  (params) => call(
723
- projEnv(params.projectId, params.envName)["relationships"][":id"].$delete({ param: { id: params.id } })
814
+ projEnv(params.orgId, params.projectId, params.envName)["relationships"][":id"].$delete({ param: { id: params.id } })
724
815
  )
725
816
  )
726
817
  };
@@ -733,44 +824,54 @@ function createActionsClient(proj, projEnv) {
733
824
  return {
734
825
  list: withSchema(
735
826
  z6.object({
827
+ orgId: z6.string().describe("Organization slug"),
736
828
  projectId: z6.string().describe("Project ID")
737
829
  }),
738
- (params) => call(proj(params.projectId)["actions"].$get())
830
+ (params) => call(proj(params.orgId, params.projectId)["actions"].$get())
739
831
  ),
740
832
  get: withSchema(
741
833
  z6.object({
834
+ orgId: z6.string().describe("Organization slug"),
742
835
  projectId: z6.string().describe("Project ID"),
743
836
  name: z6.string().describe("Action name")
744
837
  }),
745
- (params) => call(proj(params.projectId)["actions"][":name"].$get({ param: { name: params.name } }))
838
+ (params) => call(proj(params.orgId, params.projectId)["actions"][":name"].$get({ param: { name: params.name } }))
746
839
  ),
747
840
  create: withSchema(
748
- ActionSchema.extend({ projectId: z6.string().describe("Project ID") }),
841
+ ActionSchema.extend({
842
+ orgId: z6.string().describe("Organization slug"),
843
+ projectId: z6.string().describe("Project ID")
844
+ }),
749
845
  (params) => {
750
- const { projectId, ...body } = params;
751
- return call(proj(projectId)["actions"].$post({ json: body }));
846
+ const { orgId, projectId, ...body } = params;
847
+ return call(proj(orgId, projectId)["actions"].$post({ json: body }));
752
848
  }
753
849
  ),
754
850
  update: withSchema(
755
- ActionSchema.extend({ projectId: z6.string().describe("Project ID") }),
851
+ ActionSchema.extend({
852
+ orgId: z6.string().describe("Organization slug"),
853
+ projectId: z6.string().describe("Project ID")
854
+ }),
756
855
  (params) => {
757
- const { projectId, ...body } = params;
856
+ const { orgId, projectId, ...body } = params;
758
857
  return call(
759
- proj(projectId)["actions"][":name"].$put({ param: { name: params.name }, json: body })
858
+ proj(orgId, projectId)["actions"][":name"].$put({ param: { name: params.name }, json: body })
760
859
  );
761
860
  }
762
861
  ),
763
862
  delete: withSchema(
764
863
  z6.object({
864
+ orgId: z6.string().describe("Organization slug"),
765
865
  projectId: z6.string().describe("Project ID"),
766
866
  name: z6.string().describe("Action name")
767
867
  }),
768
868
  (params) => call(
769
- proj(params.projectId)["actions"][":name"].$delete({ param: { name: params.name } })
869
+ proj(params.orgId, params.projectId)["actions"][":name"].$delete({ param: { name: params.name } })
770
870
  )
771
871
  ),
772
872
  run: withSchema(
773
873
  z6.object({
874
+ orgId: z6.string().describe("Organization slug"),
774
875
  projectId: z6.string().describe("Project ID"),
775
876
  envName: z6.string().describe("Environment name"),
776
877
  actionName: z6.string().describe("Action name"),
@@ -778,9 +879,9 @@ function createActionsClient(proj, projEnv) {
778
879
  recommendations: z6.record(z6.string()).optional().describe("Recommendation selections as JSON")
779
880
  }),
780
881
  (params) => {
781
- const { projectId, envName, actionName, parameters, recommendations } = params;
882
+ const { orgId, projectId, envName, actionName, parameters, recommendations } = params;
782
883
  return call(
783
- projEnv(projectId, envName)["actions"][":name"]["run"].$post({
884
+ projEnv(orgId, projectId, envName)["actions"][":name"]["run"].$post({
784
885
  param: { name: actionName },
785
886
  json: { parameters, recommendations }
786
887
  })
@@ -793,6 +894,7 @@ function createActionRunsClient(projEnv) {
793
894
  return {
794
895
  list: withSchema(
795
896
  z6.object({
897
+ orgId: z6.string().describe("Organization slug"),
796
898
  projectId: z6.string().describe("Project ID"),
797
899
  envName: z6.string().describe("Environment name"),
798
900
  actionName: z6.string().optional().describe("Filter by action name"),
@@ -801,30 +903,32 @@ function createActionRunsClient(projEnv) {
801
903
  limit: z6.coerce.number().int().min(1).max(100).optional().describe("Max results (1-100)")
802
904
  }),
803
905
  (params) => {
804
- const { projectId, envName, ...query } = params;
906
+ const { orgId, projectId, envName, ...query } = params;
805
907
  return call(
806
- projEnv(projectId, envName)["action-runs"].$get({ query: stringifyQuery(query) })
908
+ projEnv(orgId, projectId, envName)["action-runs"].$get({ query: stringifyQuery(query) })
807
909
  );
808
910
  }
809
911
  ),
810
912
  get: withSchema(
811
913
  z6.object({
914
+ orgId: z6.string().describe("Organization slug"),
812
915
  projectId: z6.string().describe("Project ID"),
813
916
  envName: z6.string().describe("Environment name"),
814
917
  id: z6.string().uuid().describe("Action run ID")
815
918
  }),
816
919
  (params) => call(
817
- projEnv(params.projectId, params.envName)["action-runs"][":id"].$get({ param: { id: params.id } })
920
+ projEnv(params.orgId, params.projectId, params.envName)["action-runs"][":id"].$get({ param: { id: params.id } })
818
921
  )
819
922
  ),
820
923
  cancel: withSchema(
821
924
  z6.object({
925
+ orgId: z6.string().describe("Organization slug"),
822
926
  projectId: z6.string().describe("Project ID"),
823
927
  envName: z6.string().describe("Environment name"),
824
928
  id: z6.string().uuid().describe("Action run ID")
825
929
  }),
826
930
  (params) => call(
827
- projEnv(params.projectId, params.envName)["action-runs"][":id"].$delete({ param: { id: params.id } })
931
+ projEnv(params.orgId, params.projectId, params.envName)["action-runs"][":id"].$delete({ param: { id: params.id } })
828
932
  )
829
933
  )
830
934
  };
@@ -837,56 +941,61 @@ function createSecretsClient(projEnv) {
837
941
  return {
838
942
  list: withSchema(
839
943
  z7.object({
944
+ orgId: z7.string().describe("Organization slug"),
840
945
  projectId: z7.string().describe("Project ID"),
841
946
  envName: z7.string().describe("Environment name")
842
947
  }),
843
- (params) => call(projEnv(params.projectId, params.envName)["secrets"].$get())
948
+ (params) => call(projEnv(params.orgId, params.projectId, params.envName)["secrets"].$get())
844
949
  ),
845
950
  get: withSchema(
846
951
  z7.object({
952
+ orgId: z7.string().describe("Organization slug"),
847
953
  projectId: z7.string().describe("Project ID"),
848
954
  envName: z7.string().describe("Environment name"),
849
955
  name: z7.string().describe("Secret name")
850
956
  }),
851
957
  (params) => call(
852
- projEnv(params.projectId, params.envName)["secrets"][":name"].$get({ param: { name: params.name } })
958
+ projEnv(params.orgId, params.projectId, params.envName)["secrets"][":name"].$get({ param: { name: params.name } })
853
959
  )
854
960
  ),
855
961
  create: withSchema(
856
962
  z7.object({
963
+ orgId: z7.string().describe("Organization slug"),
857
964
  projectId: z7.string().describe("Project ID"),
858
965
  envName: z7.string().describe("Environment name"),
859
966
  name: z7.string().describe("Secret name"),
860
967
  description: z7.string().optional().describe("Description")
861
968
  }),
862
969
  (params) => {
863
- const { projectId, envName, name, description } = params;
970
+ const { orgId, projectId, envName, name, description } = params;
864
971
  return call(
865
- projEnv(projectId, envName)["secrets"].$post({ json: { kind: "Secret", name, description } })
972
+ projEnv(orgId, projectId, envName)["secrets"].$post({ json: { kind: "Secret", name, description } })
866
973
  );
867
974
  }
868
975
  ),
869
976
  delete: withSchema(
870
977
  z7.object({
978
+ orgId: z7.string().describe("Organization slug"),
871
979
  projectId: z7.string().describe("Project ID"),
872
980
  envName: z7.string().describe("Environment name"),
873
981
  name: z7.string().describe("Secret name")
874
982
  }),
875
983
  (params) => call(
876
- projEnv(params.projectId, params.envName)["secrets"][":name"].$delete({ param: { name: params.name } })
984
+ projEnv(params.orgId, params.projectId, params.envName)["secrets"][":name"].$delete({ param: { name: params.name } })
877
985
  )
878
986
  ),
879
987
  setValue: withSchema(
880
988
  z7.object({
989
+ orgId: z7.string().describe("Organization slug"),
881
990
  projectId: z7.string().describe("Project ID"),
882
991
  envName: z7.string().describe("Environment name"),
883
992
  name: z7.string().describe("Secret name"),
884
993
  value: z7.string().min(1).describe("Secret value")
885
994
  }),
886
995
  (params) => {
887
- const { projectId, envName, name, value } = params;
996
+ const { orgId, projectId, envName, name, value } = params;
888
997
  return call(
889
- projEnv(projectId, envName)["secrets"][":name"]["value"].$put({
998
+ projEnv(orgId, projectId, envName)["secrets"][":name"]["value"].$put({
890
999
  param: { name },
891
1000
  json: { value }
892
1001
  })
@@ -898,12 +1007,13 @@ function createSecretsClient(projEnv) {
898
1007
  function createApplyClient(projEnv) {
899
1008
  return withSchema(
900
1009
  ApplyRequestSchema.extend({
1010
+ orgId: z7.string().describe("Organization slug"),
901
1011
  projectId: z7.string().describe("Project ID"),
902
1012
  envName: z7.string().describe("Environment name")
903
1013
  }),
904
1014
  (params) => {
905
- const { projectId, envName, ...body } = params;
906
- return call(projEnv(projectId, envName)["apply"].$post({ json: body }));
1015
+ const { orgId, projectId, envName, ...body } = params;
1016
+ return call(projEnv(orgId, projectId, envName)["apply"].$post({ json: body }));
907
1017
  }
908
1018
  );
909
1019
  }
@@ -916,21 +1026,21 @@ function createGithubClient(cloud, _baseUrl, _hcOpts) {
916
1026
  z8.object({
917
1027
  projectId: z8.string().describe("Project ID")
918
1028
  }),
919
- (params) => call(cloud.api.github["install-url"].$post({ json: params }))
1029
+ (params) => call(cloud.github["install-url"].$post({ json: params }))
920
1030
  ),
921
1031
  installations: {
922
1032
  list: withSchema(
923
1033
  z8.object({
924
1034
  orgId: z8.string().describe("Organization ID")
925
1035
  }),
926
- (params) => call(cloud.api.github.installations.$get({ query: params }))
1036
+ (params) => call(cloud.github.installations.$get({ query: params }))
927
1037
  ),
928
1038
  repos: withSchema(
929
1039
  z8.object({
930
1040
  installationId: z8.string().describe("Installation row ID")
931
1041
  }),
932
1042
  (params) => call(
933
- cloud.api.github.installations[":installationId"].repos.$get({
1043
+ cloud.github.installations[":installationId"].repos.$get({
934
1044
  param: params
935
1045
  })
936
1046
  )
@@ -940,7 +1050,7 @@ function createGithubClient(cloud, _baseUrl, _hcOpts) {
940
1050
  installationId: z8.string().describe("Installation row ID")
941
1051
  }),
942
1052
  (params) => call(
943
- cloud.api.github.installations[":installationId"].$delete({
1053
+ cloud.github.installations[":installationId"].$delete({
944
1054
  param: params
945
1055
  })
946
1056
  )
@@ -950,7 +1060,7 @@ function createGithubClient(cloud, _baseUrl, _hcOpts) {
950
1060
  orgId: z8.string().describe("Organization ID"),
951
1061
  installationId: z8.number().int().positive().describe("GitHub installation ID (from the GitHub install URL)")
952
1062
  }),
953
- (params) => call(cloud.api.github.installations.recover.$post({ json: params }))
1063
+ (params) => call(cloud.github.installations.recover.$post({ json: params }))
954
1064
  )
955
1065
  },
956
1066
  projects: {
@@ -1011,12 +1121,13 @@ function stripServerFields(row) {
1011
1121
  function createExportCatalogFn(proj, projEnv) {
1012
1122
  return withSchema(
1013
1123
  z9.object({
1124
+ orgId: z9.string().describe("Organization slug"),
1014
1125
  projectId: z9.string().describe("Project ID"),
1015
1126
  envName: z9.string().describe("Environment name to export secret declarations from")
1016
1127
  }).describe("Export every catalog kind as a single apply-shaped payload"),
1017
1128
  async (params) => {
1018
- const projClient = proj(params.projectId);
1019
- const envClient = projEnv(params.projectId, params.envName);
1129
+ const projClient = proj(params.orgId, params.projectId);
1130
+ const envClient = projEnv(params.orgId, params.projectId, params.envName);
1020
1131
  const [entityTypes, cells, relationshipTypes, actions, secrets] = await Promise.all([
1021
1132
  call(projClient["entity-types"].$get()),
1022
1133
  call(projClient["cells"].$get()),
@@ -1056,32 +1167,35 @@ function createCatalogRevisionsClient(proj) {
1056
1167
  return {
1057
1168
  list: withSchema(
1058
1169
  z10.object({
1170
+ orgId: z10.string().describe("Organization slug"),
1059
1171
  projectId: z10.string().describe("Project ID"),
1060
1172
  limit: z10.coerce.number().int().min(1).max(200).optional().describe("Max revisions to return (1-200)")
1061
1173
  }),
1062
1174
  (params) => {
1063
- const { projectId, ...query } = params;
1175
+ const { orgId, projectId, ...query } = params;
1064
1176
  return call(
1065
- proj(projectId)["catalog-revisions"].$get({ query: stringifyQuery(query) })
1177
+ proj(orgId, projectId)["catalog-revisions"].$get({ query: stringifyQuery(query) })
1066
1178
  );
1067
1179
  }
1068
1180
  ),
1069
1181
  get: withSchema(
1070
1182
  z10.object({
1183
+ orgId: z10.string().describe("Organization slug"),
1071
1184
  projectId: z10.string().describe("Project ID"),
1072
1185
  id: z10.string().uuid().describe("Revision ID")
1073
1186
  }),
1074
1187
  (params) => call(
1075
- proj(params.projectId)["catalog-revisions"][":id"].$get({ param: { id: params.id } })
1188
+ proj(params.orgId, params.projectId)["catalog-revisions"][":id"].$get({ param: { id: params.id } })
1076
1189
  )
1077
1190
  ),
1078
1191
  snapshots: withSchema(
1079
1192
  z10.object({
1193
+ orgId: z10.string().describe("Organization slug"),
1080
1194
  projectId: z10.string().describe("Project ID"),
1081
1195
  id: z10.string().uuid().describe("Revision ID to read snapshots for")
1082
1196
  }),
1083
1197
  (params) => call(
1084
- proj(params.projectId)["catalog-revisions"][":id"]["snapshots"].$get({
1198
+ proj(params.orgId, params.projectId)["catalog-revisions"][":id"]["snapshots"].$get({
1085
1199
  param: { id: params.id }
1086
1200
  })
1087
1201
  )
@@ -1093,15 +1207,16 @@ function createCatalogRevisionsClient(proj) {
1093
1207
  */
1094
1208
  rollback: withSchema(
1095
1209
  z10.object({
1210
+ orgId: z10.string().describe("Organization slug"),
1096
1211
  projectId: z10.string().describe("Project ID"),
1097
1212
  id: z10.string().uuid().describe("Revision ID to roll back to"),
1098
1213
  hunkId: z10.string().uuid().optional().describe("Single-hunk filter"),
1099
1214
  force: z10.boolean().optional().describe("Required if the inverse diff is destructive")
1100
1215
  }),
1101
1216
  (params) => {
1102
- const { projectId, id, hunkId, force } = params;
1217
+ const { orgId, projectId, id, hunkId, force } = params;
1103
1218
  return call(
1104
- proj(projectId)["catalog-revisions"][":id"]["rollback"].$post({
1219
+ proj(orgId, projectId)["catalog-revisions"][":id"]["rollback"].$post({
1105
1220
  param: { id },
1106
1221
  json: { force: force ?? false },
1107
1222
  query: hunkId ? stringifyQuery({ hunkId }) : void 0
@@ -1118,6 +1233,7 @@ function createAuditEventsClient(proj) {
1118
1233
  return {
1119
1234
  list: withSchema(
1120
1235
  z11.object({
1236
+ orgId: z11.string().describe("Organization slug"),
1121
1237
  projectId: z11.string().describe("Project ID"),
1122
1238
  envName: z11.string().optional().describe("Filter to a single env"),
1123
1239
  actorType: z11.enum(["user", "token"]).optional().describe("Filter by actor type"),
@@ -1128,8 +1244,8 @@ function createAuditEventsClient(proj) {
1128
1244
  limit: z11.coerce.number().int().min(1).max(500).optional().describe("Max rows (1-500)")
1129
1245
  }).describe("List audit events for a project \u2014 auditor-friendly read-only feed"),
1130
1246
  (params) => {
1131
- const { projectId, ...query } = params;
1132
- return call(proj(projectId)["audit-events"].$get({ query: stringifyQuery(query) }));
1247
+ const { orgId, projectId, ...query } = params;
1248
+ return call(proj(orgId, projectId)["audit-events"].$get({ query: stringifyQuery(query) }));
1133
1249
  }
1134
1250
  )
1135
1251
  };
@@ -1141,27 +1257,30 @@ function createEnvironmentsClient(proj) {
1141
1257
  return {
1142
1258
  list: withSchema(
1143
1259
  z12.object({
1260
+ orgId: z12.string().describe("Organization slug"),
1144
1261
  projectId: z12.string().describe("Project ID")
1145
1262
  }),
1146
- (params) => call(proj(params.projectId)["environments"].$get())
1263
+ (params) => call(proj(params.orgId, params.projectId)["environments"].$get())
1147
1264
  ),
1148
1265
  create: withSchema(
1149
1266
  z12.object({
1267
+ orgId: z12.string().describe("Organization slug"),
1150
1268
  projectId: z12.string().describe("Project ID"),
1151
1269
  name: z12.string().min(1).max(31).regex(/^[a-z0-9][a-z0-9-]{0,30}$/).describe("Environment name (lowercase letters, digits, hyphens; max 31 chars)")
1152
1270
  }),
1153
1271
  (params) => {
1154
- const { projectId, name } = params;
1155
- return call(proj(projectId)["environments"].$post({ json: { name } }));
1272
+ const { orgId, projectId, name } = params;
1273
+ return call(proj(orgId, projectId)["environments"].$post({ json: { name } }));
1156
1274
  }
1157
1275
  ),
1158
1276
  delete: withSchema(
1159
1277
  z12.object({
1278
+ orgId: z12.string().describe("Organization slug"),
1160
1279
  projectId: z12.string().describe("Project ID"),
1161
1280
  name: z12.string().describe("Environment name")
1162
1281
  }),
1163
1282
  (params) => call(
1164
- proj(params.projectId)["environments"][":envName"].$delete({
1283
+ proj(params.orgId, params.projectId)["environments"][":envName"].$delete({
1165
1284
  param: { envName: params.name }
1166
1285
  })
1167
1286
  )
@@ -1175,6 +1294,7 @@ function createDriftEventsClient(projEnv) {
1175
1294
  return {
1176
1295
  list: withSchema(
1177
1296
  z13.object({
1297
+ orgId: z13.string().describe("Organization slug"),
1178
1298
  projectId: z13.string().describe("Project ID"),
1179
1299
  envName: z13.string().describe("Environment name"),
1180
1300
  status: z13.enum(["open", "accepted", "reapplied", "snoozed"]).optional(),
@@ -1184,61 +1304,69 @@ function createDriftEventsClient(projEnv) {
1184
1304
  limit: z13.coerce.number().int().min(1).max(500).optional()
1185
1305
  }),
1186
1306
  (params) => {
1187
- const { projectId, envName, ...query } = params;
1307
+ const { orgId, projectId, envName, ...query } = params;
1188
1308
  return call(
1189
- projEnv(projectId, envName)["drift-events"].$get({ query: stringifyQuery(query) })
1309
+ projEnv(orgId, projectId, envName)["drift-events"].$get({ query: stringifyQuery(query) })
1190
1310
  );
1191
1311
  }
1192
1312
  ),
1193
1313
  count: withSchema(
1194
- z13.object({ projectId: z13.string(), envName: z13.string() }),
1195
- (params) => call(projEnv(params.projectId, params.envName)["drift-events"].count.$get())
1314
+ z13.object({
1315
+ orgId: z13.string().describe("Organization slug"),
1316
+ projectId: z13.string().describe("Project ID"),
1317
+ envName: z13.string().describe("Environment name")
1318
+ }),
1319
+ (params) => call(projEnv(params.orgId, params.projectId, params.envName)["drift-events"].count.$get())
1196
1320
  ),
1197
1321
  get: withSchema(
1198
1322
  z13.object({
1199
- projectId: z13.string(),
1200
- envName: z13.string(),
1323
+ orgId: z13.string().describe("Organization slug"),
1324
+ projectId: z13.string().describe("Project ID"),
1325
+ envName: z13.string().describe("Environment name"),
1201
1326
  id: z13.string().uuid()
1202
1327
  }),
1203
1328
  (params) => call(
1204
- projEnv(params.projectId, params.envName)["drift-events"][":id"].$get({
1329
+ projEnv(params.orgId, params.projectId, params.envName)["drift-events"][":id"].$get({
1205
1330
  param: { id: params.id }
1206
1331
  })
1207
1332
  )
1208
1333
  ),
1209
1334
  accept: withSchema(
1210
1335
  z13.object({
1211
- projectId: z13.string(),
1212
- envName: z13.string(),
1336
+ orgId: z13.string().describe("Organization slug"),
1337
+ projectId: z13.string().describe("Project ID"),
1338
+ envName: z13.string().describe("Environment name"),
1213
1339
  id: z13.string().uuid()
1214
1340
  }),
1215
1341
  (params) => call(
1216
- projEnv(params.projectId, params.envName)["drift-events"][":id"].accept.$post({
1342
+ projEnv(params.orgId, params.projectId, params.envName)["drift-events"][":id"].accept.$post({
1217
1343
  param: { id: params.id }
1218
1344
  })
1219
1345
  )
1220
1346
  ),
1221
1347
  reapply: withSchema(
1222
1348
  z13.object({
1223
- projectId: z13.string(),
1224
- envName: z13.string(),
1349
+ orgId: z13.string().describe("Organization slug"),
1350
+ projectId: z13.string().describe("Project ID"),
1351
+ envName: z13.string().describe("Environment name"),
1225
1352
  id: z13.string().uuid()
1226
1353
  }),
1227
1354
  (params) => call(
1228
- projEnv(params.projectId, params.envName)["drift-events"][":id"].reapply.$post({
1355
+ projEnv(params.orgId, params.projectId, params.envName)["drift-events"][":id"].reapply.$post({
1229
1356
  param: { id: params.id }
1230
1357
  })
1231
1358
  )
1232
1359
  ),
1233
1360
  snooze: withSchema(
1234
1361
  z13.object({
1235
- projectId: z13.string(),
1236
- envName: z13.string(),
1362
+ orgId: z13.string().describe("Organization slug"),
1363
+ projectId: z13.string().describe("Project ID"),
1364
+ envName: z13.string().describe("Environment name"),
1237
1365
  id: z13.string().uuid(),
1238
1366
  untilSeconds: z13.number().int().positive().optional()
1239
1367
  }),
1240
1368
  (params) => call(
1241
- projEnv(params.projectId, params.envName)["drift-events"][":id"].snooze.$post({
1369
+ projEnv(params.orgId, params.projectId, params.envName)["drift-events"][":id"].snooze.$post({
1242
1370
  param: { id: params.id },
1243
1371
  json: { untilSeconds: params.untilSeconds }
1244
1372
  })
@@ -1255,58 +1383,136 @@ function createStatsClient(proj) {
1255
1383
  return {
1256
1384
  entitiesByState: withSchema(
1257
1385
  z14.object({
1386
+ orgId: z14.string().describe("Organization slug"),
1258
1387
  projectId: z14.string().describe("Project ID"),
1259
1388
  window: WindowSchema,
1260
1389
  bucket: BucketSchema
1261
1390
  }),
1262
1391
  (params) => {
1263
- const { projectId, ...query } = params;
1264
- return call(proj(projectId)["stats"]["entities-by-state"].$get({ query: stringifyQuery(query) }));
1392
+ const { orgId, projectId, ...query } = params;
1393
+ return call(proj(orgId, projectId)["stats"]["entities-by-state"].$get({ query: stringifyQuery(query) }));
1265
1394
  }
1266
1395
  ),
1267
1396
  runsByType: withSchema(
1268
1397
  z14.object({
1398
+ orgId: z14.string().describe("Organization slug"),
1269
1399
  projectId: z14.string().describe("Project ID"),
1270
1400
  window: WindowSchema
1271
1401
  }),
1272
1402
  (params) => {
1273
- const { projectId, ...query } = params;
1274
- return call(proj(projectId)["stats"]["runs-by-type"].$get({ query: stringifyQuery(query) }));
1403
+ const { orgId, projectId, ...query } = params;
1404
+ return call(proj(orgId, projectId)["stats"]["runs-by-type"].$get({ query: stringifyQuery(query) }));
1275
1405
  }
1276
1406
  ),
1277
1407
  failingKinds: withSchema(
1278
1408
  z14.object({
1409
+ orgId: z14.string().describe("Organization slug"),
1279
1410
  projectId: z14.string().describe("Project ID"),
1280
1411
  window: WindowSchema
1281
1412
  }),
1282
1413
  (params) => {
1283
- const { projectId, ...query } = params;
1284
- return call(proj(projectId)["stats"]["failing-kinds"].$get({ query: stringifyQuery(query) }));
1414
+ const { orgId, projectId, ...query } = params;
1415
+ return call(proj(orgId, projectId)["stats"]["failing-kinds"].$get({ query: stringifyQuery(query) }));
1285
1416
  }
1286
1417
  ),
1287
1418
  driftDensity: withSchema(
1288
1419
  z14.object({
1420
+ orgId: z14.string().describe("Organization slug"),
1289
1421
  projectId: z14.string().describe("Project ID"),
1290
1422
  dim: z14.string().optional().describe('Dimensions to bucket \u2014 e.g. "kind,cell"')
1291
1423
  }),
1292
1424
  (params) => {
1293
- const { projectId, ...query } = params;
1294
- return call(proj(projectId)["stats"]["drift-density"].$get({ query: stringifyQuery(query) }));
1425
+ const { orgId, projectId, ...query } = params;
1426
+ return call(proj(orgId, projectId)["stats"]["drift-density"].$get({ query: stringifyQuery(query) }));
1295
1427
  }
1296
1428
  )
1297
1429
  };
1298
1430
  }
1299
1431
 
1300
- // src/notifications.ts
1432
+ // src/graph-views.ts
1301
1433
  import { z as z15 } from "zod";
1434
+ var ViewConfigSchema = z15.unknown();
1435
+ var PinnedPositionsSchema = z15.record(z15.string(), z15.object({ x: z15.number(), y: z15.number() })).nullable();
1436
+ function createGraphViewsClient(proj) {
1437
+ return {
1438
+ list: withSchema(
1439
+ z15.object({
1440
+ orgId: z15.string().describe("Organization slug"),
1441
+ projectId: z15.string().describe("Project ID")
1442
+ }),
1443
+ (params) => call(proj(params.orgId, params.projectId)["graph-views"].$get())
1444
+ ),
1445
+ get: withSchema(
1446
+ z15.object({
1447
+ orgId: z15.string().describe("Organization slug"),
1448
+ projectId: z15.string().describe("Project ID"),
1449
+ id: z15.string().describe("View id")
1450
+ }),
1451
+ (params) => call(proj(params.orgId, params.projectId)["graph-views"][":id"].$get({ param: { id: params.id } }))
1452
+ ),
1453
+ create: withSchema(
1454
+ z15.object({
1455
+ orgId: z15.string().describe("Organization slug"),
1456
+ projectId: z15.string().describe("Project ID"),
1457
+ name: z15.string().describe("View name"),
1458
+ scope: z15.enum(["user", "project"]).describe("Personal or project scope"),
1459
+ config: ViewConfigSchema.describe("ViewConfig JSON"),
1460
+ pinnedPositions: PinnedPositionsSchema.optional().describe("Pinned node positions")
1461
+ }),
1462
+ (params) => {
1463
+ const { orgId, projectId, ...body } = params;
1464
+ return call(proj(orgId, projectId)["graph-views"].$post({ json: body }));
1465
+ }
1466
+ ),
1467
+ update: withSchema(
1468
+ z15.object({
1469
+ orgId: z15.string().describe("Organization slug"),
1470
+ projectId: z15.string().describe("Project ID"),
1471
+ id: z15.string().describe("View id"),
1472
+ name: z15.string().optional().describe("New name"),
1473
+ config: ViewConfigSchema.optional().describe("Replacement ViewConfig JSON"),
1474
+ pinnedPositions: PinnedPositionsSchema.optional().describe("Replacement pinned positions")
1475
+ }),
1476
+ (params) => {
1477
+ const { orgId, projectId, id, ...body } = params;
1478
+ return call(
1479
+ proj(orgId, projectId)["graph-views"][":id"].$put({ param: { id }, json: body })
1480
+ );
1481
+ }
1482
+ ),
1483
+ delete: withSchema(
1484
+ z15.object({
1485
+ orgId: z15.string().describe("Organization slug"),
1486
+ projectId: z15.string().describe("Project ID"),
1487
+ id: z15.string().describe("View id")
1488
+ }),
1489
+ (params) => call(proj(params.orgId, params.projectId)["graph-views"][":id"].$delete({ param: { id: params.id } }))
1490
+ ),
1491
+ setDefault: withSchema(
1492
+ z15.object({
1493
+ orgId: z15.string().describe("Organization slug"),
1494
+ projectId: z15.string().describe("Project ID"),
1495
+ id: z15.string().describe("View id")
1496
+ }),
1497
+ (params) => call(
1498
+ proj(params.orgId, params.projectId)["graph-views"][":id"]["default"].$patch({
1499
+ param: { id: params.id }
1500
+ })
1501
+ )
1502
+ )
1503
+ };
1504
+ }
1505
+
1506
+ // src/notifications.ts
1507
+ import { z as z16 } from "zod";
1302
1508
  import { hc as hc2 } from "hono/client";
1303
1509
  function createNotificationsClient(baseUrl, hcOpts) {
1304
- const c = hc2(`${baseUrl}/notifications`, hcOpts);
1510
+ const c = hc2(`${baseUrl}/api/notifications`, hcOpts);
1305
1511
  return {
1306
1512
  list: withSchema(
1307
- z15.object({
1308
- limit: z15.coerce.number().int().min(1).max(100).optional(),
1309
- unread: z15.boolean().optional()
1513
+ z16.object({
1514
+ limit: z16.coerce.number().int().min(1).max(100).optional(),
1515
+ unread: z16.boolean().optional()
1310
1516
  }),
1311
1517
  (params) => {
1312
1518
  const query = {};
@@ -1316,18 +1522,18 @@ function createNotificationsClient(baseUrl, hcOpts) {
1316
1522
  }
1317
1523
  ),
1318
1524
  read: withSchema(
1319
- z15.object({ id: z15.string().uuid() }),
1525
+ z16.object({ id: z16.string().uuid() }),
1320
1526
  (params) => call(c[":id"].read.$post({ param: { id: params.id } }))
1321
1527
  ),
1322
1528
  readAll: withSchema(
1323
- z15.object({}),
1529
+ z16.object({}),
1324
1530
  () => call(c["read-all"].$post())
1325
1531
  )
1326
1532
  };
1327
1533
  }
1328
1534
 
1329
1535
  // src/audit-export.ts
1330
- import { z as z16 } from "zod";
1536
+ import { z as z17 } from "zod";
1331
1537
  async function rawRequest(baseUrl, hcOpts, path, init = {}) {
1332
1538
  const fetchImpl = hcOpts?.fetch ?? fetch;
1333
1539
  const rawHeaders = hcOpts?.headers;
@@ -1356,24 +1562,24 @@ function createAuditExportClient(baseUrl, hcOpts) {
1356
1562
  return {
1357
1563
  /** GET /orgs/:orgId/audit-export/config — returns current config or throws 404. */
1358
1564
  getConfig: withSchema(
1359
- z16.object({ orgId: z16.string().describe("Organization ID") }),
1565
+ z17.object({ orgId: z17.string().describe("Organization ID") }),
1360
1566
  async (params) => callRaw(
1361
- await rawRequest(baseUrl, hcOpts, `/orgs/${params.orgId}/audit-export/config`)
1567
+ await rawRequest(baseUrl, hcOpts, `/api/orgs/${params.orgId}/audit-export/config`)
1362
1568
  )
1363
1569
  ),
1364
1570
  /** POST /orgs/:orgId/audit-export/config — upsert the S3 export config. */
1365
1571
  setConfig: withSchema(
1366
- z16.object({
1367
- orgId: z16.string().describe("Organization ID"),
1368
- bucket: z16.string().describe("S3 bucket name"),
1369
- region: z16.string().describe("AWS region"),
1370
- roleArn: z16.string().describe("IAM role ARN for assume-role"),
1371
- enabled: z16.boolean().optional().describe("Enable/disable export")
1572
+ z17.object({
1573
+ orgId: z17.string().describe("Organization ID"),
1574
+ bucket: z17.string().describe("S3 bucket name"),
1575
+ region: z17.string().describe("AWS region"),
1576
+ roleArn: z17.string().describe("IAM role ARN for assume-role"),
1577
+ enabled: z17.boolean().optional().describe("Enable/disable export")
1372
1578
  }),
1373
1579
  async (params) => {
1374
1580
  const { orgId, ...body } = params;
1375
1581
  return callRaw(
1376
- await rawRequest(baseUrl, hcOpts, `/orgs/${orgId}/audit-export/config`, {
1582
+ await rawRequest(baseUrl, hcOpts, `/api/orgs/${orgId}/audit-export/config`, {
1377
1583
  method: "POST",
1378
1584
  headers: { "Content-Type": "application/json" },
1379
1585
  body: JSON.stringify(body)
@@ -1383,16 +1589,16 @@ function createAuditExportClient(baseUrl, hcOpts) {
1383
1589
  ),
1384
1590
  /** POST /orgs/:orgId/audit-export/test-connection — dry-run write+delete. */
1385
1591
  testConnection: withSchema(
1386
- z16.object({
1387
- orgId: z16.string().describe("Organization ID"),
1388
- bucket: z16.string().describe("S3 bucket name"),
1389
- region: z16.string().describe("AWS region"),
1390
- roleArn: z16.string().describe("IAM role ARN for assume-role")
1592
+ z17.object({
1593
+ orgId: z17.string().describe("Organization ID"),
1594
+ bucket: z17.string().describe("S3 bucket name"),
1595
+ region: z17.string().describe("AWS region"),
1596
+ roleArn: z17.string().describe("IAM role ARN for assume-role")
1391
1597
  }),
1392
1598
  async (params) => {
1393
1599
  const { orgId, ...body } = params;
1394
1600
  return callRaw(
1395
- await rawRequest(baseUrl, hcOpts, `/orgs/${orgId}/audit-export/test-connection`, {
1601
+ await rawRequest(baseUrl, hcOpts, `/api/orgs/${orgId}/audit-export/test-connection`, {
1396
1602
  method: "POST",
1397
1603
  headers: { "Content-Type": "application/json" },
1398
1604
  body: JSON.stringify(body)
@@ -1402,9 +1608,9 @@ function createAuditExportClient(baseUrl, hcOpts) {
1402
1608
  ),
1403
1609
  /** GET /orgs/:orgId/audit-export/runs — recent batch run history. */
1404
1610
  listRuns: withSchema(
1405
- z16.object({
1406
- orgId: z16.string().describe("Organization ID"),
1407
- limit: z16.number().optional().describe("Max results (default 20, max 100)")
1611
+ z17.object({
1612
+ orgId: z17.string().describe("Organization ID"),
1613
+ limit: z17.number().optional().describe("Max results (default 20, max 100)")
1408
1614
  }),
1409
1615
  async (params) => {
1410
1616
  const qs = params.limit ? `?limit=${params.limit}` : "";
@@ -1412,7 +1618,7 @@ function createAuditExportClient(baseUrl, hcOpts) {
1412
1618
  await rawRequest(
1413
1619
  baseUrl,
1414
1620
  hcOpts,
1415
- `/orgs/${params.orgId}/audit-export/runs${qs}`
1621
+ `/api/orgs/${params.orgId}/audit-export/runs${qs}`
1416
1622
  )
1417
1623
  );
1418
1624
  }
@@ -1424,7 +1630,7 @@ function createAuditExportClient(baseUrl, hcOpts) {
1424
1630
  import { hc as hc3 } from "hono/client";
1425
1631
  function createUserPreferencesClient(baseUrl, hcOpts) {
1426
1632
  const c = hc3(
1427
- `${baseUrl}/user/preferences`,
1633
+ `${baseUrl}/api/user/preferences`,
1428
1634
  hcOpts
1429
1635
  );
1430
1636
  return {
@@ -1440,47 +1646,53 @@ function createUserPreferencesClient(baseUrl, hcOpts) {
1440
1646
  }
1441
1647
 
1442
1648
  // src/import-sources.ts
1443
- import { z as z17 } from "zod";
1444
- var SourceKindEnum = z17.enum(["tf-state", "atmos-manifests"]);
1445
- var PolicyEnum = z17.enum(["auto-update", "human-approval"]);
1649
+ import { z as z18 } from "zod";
1650
+ var SourceKindEnum = z18.enum(["tf-state", "atmos-manifests"]);
1651
+ var PolicyEnum = z18.enum(["auto-update", "human-approval"]);
1446
1652
  function createImportSourcesClient(proj) {
1447
1653
  return {
1448
1654
  list: withSchema(
1449
- z17.object({ projectId: z17.string().describe("Project ID") }),
1450
- (params) => call(proj(params.projectId)["import-sources"].$get())
1655
+ z18.object({
1656
+ orgId: z18.string().describe("Organization slug"),
1657
+ projectId: z18.string().describe("Project ID")
1658
+ }),
1659
+ (params) => call(proj(params.orgId, params.projectId)["import-sources"].$get())
1451
1660
  ),
1452
1661
  get: withSchema(
1453
- z17.object({
1454
- projectId: z17.string().describe("Project ID"),
1455
- id: z17.string().uuid().describe("ImportSource ID")
1662
+ z18.object({
1663
+ orgId: z18.string().describe("Organization slug"),
1664
+ projectId: z18.string().describe("Project ID"),
1665
+ id: z18.string().uuid().describe("ImportSource ID")
1456
1666
  }),
1457
- (params) => call(proj(params.projectId)["import-sources"][":id"].$get({ param: { id: params.id } }))
1667
+ (params) => call(proj(params.orgId, params.projectId)["import-sources"][":id"].$get({ param: { id: params.id } }))
1458
1668
  ),
1459
1669
  registerOrUpdate: withSchema(
1460
- z17.object({
1461
- projectId: z17.string().describe("Project ID"),
1462
- envName: z17.string().describe("Env name the source belongs to"),
1670
+ z18.object({
1671
+ orgId: z18.string().describe("Organization slug"),
1672
+ projectId: z18.string().describe("Project ID"),
1673
+ envName: z18.string().describe("Env name the source belongs to"),
1463
1674
  sourceKind: SourceKindEnum,
1464
- sourceUri: z17.string().describe("Stable URI identifying the source"),
1675
+ sourceUri: z18.string().describe("Stable URI identifying the source"),
1465
1676
  reconciliationPolicy: PolicyEnum.optional()
1466
1677
  }),
1467
1678
  (params) => {
1468
- const { projectId, ...body } = params;
1469
- return call(proj(projectId)["import-sources"].$post({ json: body }));
1679
+ const { orgId, projectId, ...body } = params;
1680
+ return call(proj(orgId, projectId)["import-sources"].$post({ json: body }));
1470
1681
  }
1471
1682
  ),
1472
1683
  rescan: withSchema(
1473
- z17.object({
1474
- projectId: z17.string(),
1475
- id: z17.string().uuid(),
1476
- envName: z17.string(),
1477
- items: z17.array(z17.unknown()),
1478
- deletions: z17.array(z17.object({ kind: z17.string(), name: z17.string() })).optional()
1684
+ z18.object({
1685
+ orgId: z18.string().describe("Organization slug"),
1686
+ projectId: z18.string().describe("Project ID"),
1687
+ id: z18.string().uuid(),
1688
+ envName: z18.string(),
1689
+ items: z18.array(z18.unknown()),
1690
+ deletions: z18.array(z18.object({ kind: z18.string(), name: z18.string() })).optional()
1479
1691
  }),
1480
1692
  (params) => {
1481
- const { projectId, id, ...body } = params;
1693
+ const { orgId, projectId, id, ...body } = params;
1482
1694
  return call(
1483
- proj(projectId)["import-sources"][":id"].rescan.$post({
1695
+ proj(orgId, projectId)["import-sources"][":id"].rescan.$post({
1484
1696
  param: { id },
1485
1697
  // why: the Hono RPC type for the body is the AnyKindSchema union;
1486
1698
  // the SDK accepts `unknown[]` so callers don't have to re-import the
@@ -1491,32 +1703,35 @@ function createImportSourcesClient(proj) {
1491
1703
  }
1492
1704
  ),
1493
1705
  drift: withSchema(
1494
- z17.object({
1495
- projectId: z17.string(),
1496
- id: z17.string().uuid()
1706
+ z18.object({
1707
+ orgId: z18.string().describe("Organization slug"),
1708
+ projectId: z18.string().describe("Project ID"),
1709
+ id: z18.string().uuid()
1497
1710
  }),
1498
- (params) => call(proj(params.projectId)["import-sources"][":id"].drift.$get({ param: { id: params.id } }))
1711
+ (params) => call(proj(params.orgId, params.projectId)["import-sources"][":id"].drift.$get({ param: { id: params.id } }))
1499
1712
  ),
1500
1713
  approveProposal: withSchema(
1501
- z17.object({
1502
- projectId: z17.string(),
1503
- id: z17.string().uuid(),
1504
- proposalId: z17.string().uuid()
1714
+ z18.object({
1715
+ orgId: z18.string().describe("Organization slug"),
1716
+ projectId: z18.string().describe("Project ID"),
1717
+ id: z18.string().uuid(),
1718
+ proposalId: z18.string().uuid()
1505
1719
  }),
1506
1720
  (params) => call(
1507
- proj(params.projectId)["import-sources"][":id"]["drift-proposals"][":proposalId"].approve.$post({
1721
+ proj(params.orgId, params.projectId)["import-sources"][":id"]["drift-proposals"][":proposalId"].approve.$post({
1508
1722
  param: { id: params.id, proposalId: params.proposalId }
1509
1723
  })
1510
1724
  )
1511
1725
  ),
1512
1726
  rejectProposal: withSchema(
1513
- z17.object({
1514
- projectId: z17.string(),
1515
- id: z17.string().uuid(),
1516
- proposalId: z17.string().uuid()
1727
+ z18.object({
1728
+ orgId: z18.string().describe("Organization slug"),
1729
+ projectId: z18.string().describe("Project ID"),
1730
+ id: z18.string().uuid(),
1731
+ proposalId: z18.string().uuid()
1517
1732
  }),
1518
1733
  (params) => call(
1519
- proj(params.projectId)["import-sources"][":id"]["drift-proposals"][":proposalId"].reject.$post({
1734
+ proj(params.orgId, params.projectId)["import-sources"][":id"]["drift-proposals"][":proposalId"].reject.$post({
1520
1735
  param: { id: params.id, proposalId: params.proposalId }
1521
1736
  })
1522
1737
  )
@@ -1525,7 +1740,7 @@ function createImportSourcesClient(proj) {
1525
1740
  }
1526
1741
 
1527
1742
  // src/admin.ts
1528
- import { z as z18 } from "zod";
1743
+ import { z as z19 } from "zod";
1529
1744
  async function rawRequest2(baseUrl, hcOpts, path, init = {}) {
1530
1745
  const fetchImpl = hcOpts?.fetch ?? fetch;
1531
1746
  const rawHeaders = hcOpts?.headers;
@@ -1558,14 +1773,14 @@ function createAdminClient(baseUrl, hcOpts) {
1558
1773
  * List super-admin audit events with optional filters.
1559
1774
  */
1560
1775
  list: withSchema(
1561
- z18.object({
1562
- actor: z18.string().optional().describe("Filter by actor user ID"),
1563
- action: z18.string().optional().describe("Filter by action name"),
1564
- resourceKind: z18.string().optional().describe("Filter by resource kind"),
1565
- since: z18.string().optional().describe("ISO 8601 datetime lower bound"),
1566
- until: z18.string().optional().describe("ISO 8601 datetime upper bound"),
1567
- limit: z18.coerce.number().int().min(1).max(200).optional().describe("Max results (1-200)"),
1568
- offset: z18.coerce.number().int().min(0).optional().describe("Pagination offset")
1776
+ z19.object({
1777
+ actor: z19.string().optional().describe("Filter by actor user ID"),
1778
+ action: z19.string().optional().describe("Filter by action name"),
1779
+ resourceKind: z19.string().optional().describe("Filter by resource kind"),
1780
+ since: z19.string().optional().describe("ISO 8601 datetime lower bound"),
1781
+ until: z19.string().optional().describe("ISO 8601 datetime upper bound"),
1782
+ limit: z19.coerce.number().int().min(1).max(200).optional().describe("Max results (1-200)"),
1783
+ offset: z19.coerce.number().int().min(0).optional().describe("Pagination offset")
1569
1784
  }),
1570
1785
  async (params) => {
1571
1786
  const qs = new URLSearchParams();
@@ -1589,7 +1804,7 @@ function createAdminClient(baseUrl, hcOpts) {
1589
1804
  * List all organizations across tenants with member + project counts.
1590
1805
  */
1591
1806
  list: withSchema(
1592
- z18.object({}),
1807
+ z19.object({}),
1593
1808
  async () => callRaw2(
1594
1809
  await rawRequest2(baseUrl, hcOpts, "/admin/orgs")
1595
1810
  )
@@ -1599,7 +1814,7 @@ function createAdminClient(baseUrl, hcOpts) {
1599
1814
  * Detail view: org fields + member list + project list.
1600
1815
  */
1601
1816
  get: withSchema(
1602
- z18.object({ id: z18.string().describe("Organization ID") }),
1817
+ z19.object({ id: z19.string().describe("Organization ID") }),
1603
1818
  async (params) => callRaw2(
1604
1819
  await rawRequest2(baseUrl, hcOpts, `/admin/orgs/${params.id}`)
1605
1820
  )
@@ -1609,7 +1824,7 @@ function createAdminClient(baseUrl, hcOpts) {
1609
1824
  * Set suspended_at = now(). Idempotent.
1610
1825
  */
1611
1826
  suspend: withSchema(
1612
- z18.object({ id: z18.string().describe("Organization ID") }),
1827
+ z19.object({ id: z19.string().describe("Organization ID") }),
1613
1828
  async (params) => callRaw2(
1614
1829
  await rawRequest2(baseUrl, hcOpts, `/admin/orgs/${params.id}/suspend`, {
1615
1830
  method: "POST"
@@ -1621,7 +1836,7 @@ function createAdminClient(baseUrl, hcOpts) {
1621
1836
  * Clear suspended_at.
1622
1837
  */
1623
1838
  unsuspend: withSchema(
1624
- z18.object({ id: z18.string().describe("Organization ID") }),
1839
+ z19.object({ id: z19.string().describe("Organization ID") }),
1625
1840
  async (params) => callRaw2(
1626
1841
  await rawRequest2(baseUrl, hcOpts, `/admin/orgs/${params.id}/unsuspend`, {
1627
1842
  method: "POST"
@@ -1637,7 +1852,7 @@ function createAdminClient(baseUrl, hcOpts) {
1637
1852
  * api tokens, and environments. Idempotent. Super-admin only.
1638
1853
  */
1639
1854
  nuke: withSchema(
1640
- z18.object({ projectId: z18.string().describe("Project ID to nuke") }),
1855
+ z19.object({ projectId: z19.string().describe("Project ID to nuke") }),
1641
1856
  async (params) => callRaw2(
1642
1857
  await rawRequest2(
1643
1858
  baseUrl,
@@ -1655,7 +1870,7 @@ function createAdminClient(baseUrl, hcOpts) {
1655
1870
  * all derived from single-table COUNT queries.
1656
1871
  */
1657
1872
  overview: withSchema(
1658
- z18.object({}),
1873
+ z19.object({}),
1659
1874
  async () => callRaw2(
1660
1875
  await rawRequest2(baseUrl, hcOpts, "/admin/metrics/overview")
1661
1876
  )
@@ -1670,7 +1885,7 @@ function createAdminClient(baseUrl, hcOpts) {
1670
1885
  * Requires super-admin.
1671
1886
  */
1672
1887
  list: withSchema(
1673
- z18.object({}),
1888
+ z19.object({}),
1674
1889
  async () => callRaw2(
1675
1890
  await rawRequest2(
1676
1891
  baseUrl,
@@ -1690,9 +1905,9 @@ var createClient = (baseUrl, options = {}) => {
1690
1905
  const headers = buildHeaders(opts.token);
1691
1906
  const fetchImpl = opts.fetch;
1692
1907
  const hcOpts = fetchImpl ? { headers, fetch: fetchImpl } : { headers };
1693
- const cloud = hc4(baseUrl, hcOpts);
1694
- const proj = (projectId) => hc4(`${baseUrl}/projects/${projectId}`, hcOpts);
1695
- const projEnv = (projectId, envName) => hc4(`${baseUrl}/projects/${projectId}/envs/${envName}`, hcOpts);
1908
+ const cloud = hc4(`${baseUrl}/api`, hcOpts);
1909
+ const proj = (orgId, projectId) => hc4(`${baseUrl}/api/${orgId}/${projectId}`, hcOpts);
1910
+ const projEnv = (orgId, projectId, envName) => hc4(`${baseUrl}/api/${orgId}/${projectId}/envs/${envName}`, hcOpts);
1696
1911
  const cells = createCellsClient(proj);
1697
1912
  const catalogRevisions = createCatalogRevisionsClient(proj);
1698
1913
  const exportCatalog = createExportCatalogFn(proj, projEnv);
@@ -1714,6 +1929,7 @@ var createClient = (baseUrl, options = {}) => {
1714
1929
  auditEvents: createAuditEventsClient(proj),
1715
1930
  driftEvents: createDriftEventsClient(projEnv),
1716
1931
  stats: createStatsClient(proj),
1932
+ graphViews: createGraphViewsClient(proj),
1717
1933
  notifications: createNotificationsClient(baseUrl, hcOpts),
1718
1934
  auditExport: createAuditExportClient(baseUrl, hcOpts),
1719
1935
  userPreferences: createUserPreferencesClient(baseUrl, hcOpts),