@typeship-ax/cli 0.8.0 → 0.10.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.
Files changed (106) hide show
  1. package/AGENTS.md +31 -0
  2. package/README.md +26 -9
  3. package/api.json +3509 -800
  4. package/api.md +444 -494
  5. package/dist/api-identity.d.ts +40 -0
  6. package/dist/api-identity.d.ts.map +1 -0
  7. package/dist/api-identity.js +128 -0
  8. package/dist/auth-profiles.d.ts +30 -0
  9. package/dist/auth-profiles.d.ts.map +1 -0
  10. package/dist/auth-profiles.js +138 -0
  11. package/dist/cli.js +522 -355
  12. package/dist/console-login-check.d.ts +21 -0
  13. package/dist/console-login-check.d.ts.map +1 -0
  14. package/dist/console-login-check.js +107 -0
  15. package/dist/console-login-contract.d.ts +45 -0
  16. package/dist/console-login-contract.d.ts.map +1 -0
  17. package/dist/console-login-contract.js +40 -0
  18. package/dist/core/http.d.ts +17 -2
  19. package/dist/core/http.d.ts.map +1 -1
  20. package/dist/core/http.js +78 -17
  21. package/dist/credential-storage.d.ts +24 -0
  22. package/dist/credential-storage.d.ts.map +1 -0
  23. package/dist/credential-storage.js +207 -0
  24. package/dist/docs.d.ts +25 -0
  25. package/dist/docs.d.ts.map +1 -1
  26. package/dist/docs.js +144 -0
  27. package/dist/errors.d.ts +18 -10
  28. package/dist/errors.d.ts.map +1 -1
  29. package/dist/errors.js +24 -14
  30. package/dist/index.d.ts +10 -3
  31. package/dist/index.d.ts.map +1 -1
  32. package/dist/index.js +20 -4
  33. package/dist/named-credentials.d.ts +21 -0
  34. package/dist/named-credentials.d.ts.map +1 -0
  35. package/dist/named-credentials.js +86 -0
  36. package/dist/oauth-login.d.ts +39 -0
  37. package/dist/oauth-login.d.ts.map +1 -0
  38. package/dist/oauth-login.js +171 -0
  39. package/dist/oauth-request.d.ts +21 -0
  40. package/dist/oauth-request.d.ts.map +1 -0
  41. package/dist/oauth-request.js +119 -0
  42. package/dist/oauth-session.d.ts +106 -0
  43. package/dist/oauth-session.d.ts.map +1 -0
  44. package/dist/oauth-session.js +244 -0
  45. package/dist/ops.d.ts +14 -1
  46. package/dist/ops.d.ts.map +1 -1
  47. package/dist/ops.js +34 -30
  48. package/dist/polling-login.d.ts +57 -0
  49. package/dist/polling-login.d.ts.map +1 -0
  50. package/dist/polling-login.js +204 -0
  51. package/dist/resources/account.d.ts +2 -2
  52. package/dist/resources/account.d.ts.map +1 -1
  53. package/dist/resources/account.js +1 -0
  54. package/dist/resources/api-keys.d.ts +3 -3
  55. package/dist/resources/api-keys.d.ts.map +1 -1
  56. package/dist/resources/api-keys.js +2 -0
  57. package/dist/resources/definition-revisions.d.ts +5 -5
  58. package/dist/resources/definition-revisions.d.ts.map +1 -1
  59. package/dist/resources/definition-revisions.js +4 -0
  60. package/dist/resources/definitions.d.ts +15 -4
  61. package/dist/resources/definitions.d.ts.map +1 -1
  62. package/dist/resources/definitions.js +11 -2
  63. package/dist/resources/generate.d.ts +14 -3
  64. package/dist/resources/generate.d.ts.map +1 -1
  65. package/dist/resources/generate.js +10 -2
  66. package/dist/resources/generations.d.ts +3 -3
  67. package/dist/resources/generations.d.ts.map +1 -1
  68. package/dist/resources/generations.js +2 -0
  69. package/dist/resources/projects.d.ts +56 -20
  70. package/dist/resources/projects.d.ts.map +1 -1
  71. package/dist/resources/projects.js +40 -4
  72. package/dist/resources/targets.d.ts +84 -10
  73. package/dist/resources/targets.d.ts.map +1 -1
  74. package/dist/resources/targets.js +127 -2
  75. package/dist/schemas.d.ts.map +1 -1
  76. package/dist/schemas.js +55 -26
  77. package/dist/types.d.ts +602 -123
  78. package/dist/types.d.ts.map +1 -1
  79. package/dist/types.js +24 -0
  80. package/package.json +2 -1
  81. package/src/api-identity.ts +98 -0
  82. package/src/auth-profiles.ts +114 -0
  83. package/src/cli.ts +444 -332
  84. package/src/console-login-check.ts +88 -0
  85. package/src/console-login-contract.ts +65 -0
  86. package/src/core/http.ts +88 -19
  87. package/src/credential-storage.ts +183 -0
  88. package/src/docs.ts +138 -0
  89. package/src/errors.ts +26 -15
  90. package/src/index.ts +29 -4
  91. package/src/named-credentials.ts +74 -0
  92. package/src/oauth-login.ts +184 -0
  93. package/src/oauth-request.ts +90 -0
  94. package/src/oauth-session.ts +258 -0
  95. package/src/ops.ts +48 -31
  96. package/src/polling-login.ts +165 -0
  97. package/src/resources/account.ts +3 -0
  98. package/src/resources/api-keys.ts +5 -0
  99. package/src/resources/definition-revisions.ts +9 -0
  100. package/src/resources/definitions.ts +25 -0
  101. package/src/resources/generate.ts +23 -0
  102. package/src/resources/generations.ts +5 -0
  103. package/src/resources/projects.ts +95 -7
  104. package/src/resources/targets.ts +241 -0
  105. package/src/schemas.ts +55 -26
  106. package/src/types.ts +640 -123
@@ -4,9 +4,11 @@
4
4
  import { HttpCore, type ApiResult, type RequestOptions } from "../core/http.js";
5
5
  import { paginate, PagePromise } from "../core/pagination.js";
6
6
  import {
7
+ ResponseParseError,
7
8
  TransportError,
8
9
  UnexpectedApiError,
9
10
  ValidationError,
11
+ BadGatewayError,
10
12
  BadRequestError,
11
13
  ConflictError,
12
14
  ForbiddenError,
@@ -26,12 +28,12 @@ import type {
26
28
  DiagnosticRemediationRequest,
27
29
  DiagnosticReport,
28
30
  DiagnosticReportRead,
29
- Generation,
30
31
  GenerationBatch,
31
32
  GenerationBatchRead,
32
33
  GenerationList,
33
34
  GenerationListRead,
34
- GenerationRead,
35
+ GenerationSummary,
36
+ GenerationSummaryRead,
35
37
  Project,
36
38
  ProjectId,
37
39
  ProjectList,
@@ -60,6 +62,7 @@ export class ProjectsResource {
60
62
  return paginate<ProjectSummaryRead, ProjectsListError>(this._core, {
61
63
  method: "GET",
62
64
  path: "/projects",
65
+ security: [{"apiKey":[]}],
63
66
  query: {
64
67
  limit: params?.limit,
65
68
  cursor: params?.cursor,
@@ -102,6 +105,7 @@ export class ProjectsResource {
102
105
  return this._core.request<ProjectRead, ProjectsCreateError>({
103
106
  method: "POST",
104
107
  path: "/projects",
108
+ security: [{"apiKey":[]}],
105
109
  headers: {
106
110
  "Idempotency-Key": params?.idempotencyKey === undefined ? undefined : String(params?.idempotencyKey),
107
111
  },
@@ -124,6 +128,8 @@ export class ProjectsResource {
124
128
 
125
129
  /**
126
130
  * Retrieve a project
131
+ *
132
+ * Returns Project-owned fields only. List Targets separately for Target and Delivery data.
127
133
  * `GET /projects/{project_id}`
128
134
  */
129
135
  async retrieve(
@@ -133,6 +139,7 @@ export class ProjectsResource {
133
139
  return this._core.request<ProjectRead, ProjectsRetrieveError>({
134
140
  method: "GET",
135
141
  path: `/projects/${encodeURIComponent(String(projectId))}`,
142
+ security: [{"apiKey":[]}],
136
143
  errors: {
137
144
  "401": UnauthorizedError,
138
145
  "403": ForbiddenError,
@@ -156,6 +163,7 @@ export class ProjectsResource {
156
163
  return this._core.request<DeletedProjectRead, ProjectsDeleteError>({
157
164
  method: "DELETE",
158
165
  path: `/projects/${encodeURIComponent(String(projectId))}`,
166
+ security: [{"apiKey":[]}],
159
167
  errors: {
160
168
  "401": UnauthorizedError,
161
169
  "403": ForbiddenError,
@@ -180,6 +188,7 @@ export class ProjectsResource {
180
188
  return this._core.request<ProjectRead, ProjectsUpdateError>({
181
189
  method: "PATCH",
182
190
  path: `/projects/${encodeURIComponent(String(projectId))}`,
191
+ security: [{"apiKey":[]}],
183
192
  body,
184
193
  errors: {
185
194
  "400": BadRequestError,
@@ -187,8 +196,10 @@ export class ProjectsResource {
187
196
  "402": PaymentRequiredError,
188
197
  "403": ForbiddenError,
189
198
  "404": NotFoundError,
199
+ "409": ConflictError,
190
200
  "422": UnprocessableEntityError,
191
201
  "429": RateLimitedError,
202
+ "502": BadGatewayError,
192
203
  },
193
204
  schemaKey: "projects.update",
194
205
  options,
@@ -211,6 +222,7 @@ export class ProjectsResource {
211
222
  return this._core.request<DiagnosticReportRead, ProjectsRetrieveDiagnosticsError>({
212
223
  method: "GET",
213
224
  path: `/projects/${encodeURIComponent(String(projectId))}/diagnostics`,
225
+ security: [{"apiKey":[]}],
214
226
  errors: {
215
227
  "401": UnauthorizedError,
216
228
  "403": ForbiddenError,
@@ -229,22 +241,31 @@ export class ProjectsResource {
229
241
  * Fetches the complete configured source, records a new immutable revision only when content
230
242
  * changed, and returns its Diagnostics. This does not generate targets or consume a metered
231
243
  * generation.
244
+ *
245
+ * A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
232
246
  * `POST /projects/{project_id}/diagnostics`
233
247
  */
234
248
  async refreshDiagnostics(
235
249
  projectId: ProjectId,
250
+ params?: ProjectsRefreshDiagnosticsParams,
236
251
  options?: RequestOptions,
237
252
  ): Promise<ApiResult<DiagnosticReportRead, ProjectsRefreshDiagnosticsError>> {
238
253
  return this._core.request<DiagnosticReportRead, ProjectsRefreshDiagnosticsError>({
239
254
  method: "POST",
240
255
  path: `/projects/${encodeURIComponent(String(projectId))}/diagnostics`,
256
+ security: [{"apiKey":[]}],
257
+ headers: {
258
+ "Idempotency-Key": params?.idempotencyKey === undefined ? undefined : String(params?.idempotencyKey),
259
+ },
241
260
  errors: {
242
261
  "401": UnauthorizedError,
243
262
  "403": ForbiddenError,
244
263
  "404": NotFoundError,
264
+ "409": ConflictError,
245
265
  "422": UnprocessableEntityError,
246
266
  "429": RateLimitedError,
247
267
  },
268
+ idempotencyKey: "Idempotency-Key",
248
269
  schemaKey: "projects.refreshDiagnostics",
249
270
  options,
250
271
  });
@@ -256,25 +277,34 @@ export class ProjectsResource {
256
277
  * Applies only deterministic patches. Repository sources receive an updateable source pull
257
278
  * request; URL sources receive project overlays. Diagnostics that require API-owner intent return
258
279
  * 422 and include an authoring_brief in the Diagnostic instead.
280
+ *
281
+ * A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
259
282
  * `POST /projects/{project_id}/diagnostics/remediations`
260
283
  */
261
284
  async remediateDiagnostics(
262
285
  projectId: ProjectId,
263
286
  body: DiagnosticRemediationRequest,
287
+ params?: ProjectsRemediateDiagnosticsParams,
264
288
  options?: RequestOptions,
265
289
  ): Promise<ApiResult<DiagnosticRemediationRead, ProjectsRemediateDiagnosticsError>> {
266
290
  return this._core.request<DiagnosticRemediationRead, ProjectsRemediateDiagnosticsError>({
267
291
  method: "POST",
268
292
  path: `/projects/${encodeURIComponent(String(projectId))}/diagnostics/remediations`,
293
+ security: [{"apiKey":[]}],
294
+ headers: {
295
+ "Idempotency-Key": params?.idempotencyKey === undefined ? undefined : String(params?.idempotencyKey),
296
+ },
269
297
  body,
270
298
  errors: {
271
299
  "400": BadRequestError,
272
300
  "401": UnauthorizedError,
273
301
  "403": ForbiddenError,
274
302
  "404": NotFoundError,
303
+ "409": ConflictError,
275
304
  "422": UnprocessableEntityError,
276
305
  "429": RateLimitedError,
277
306
  },
307
+ idempotencyKey: "Idempotency-Key",
278
308
  schemaKey: "projects.remediateDiagnostics",
279
309
  options,
280
310
  });
@@ -295,6 +325,7 @@ export class ProjectsResource {
295
325
  return this._core.request<RepositoryIntegrationHealthRead, ProjectsRetrieveIntegrationHealthError>({
296
326
  method: "GET",
297
327
  path: `/projects/${encodeURIComponent(String(projectId))}/integration-health`,
328
+ security: [{"apiKey":[]}],
298
329
  errors: {
299
330
  "401": UnauthorizedError,
300
331
  "403": ForbiddenError,
@@ -317,10 +348,11 @@ export class ProjectsResource {
317
348
  projectId: ProjectId,
318
349
  params?: ProjectsListGenerationsParams,
319
350
  options?: RequestOptions,
320
- ): PagePromise<GenerationRead, ProjectsListGenerationsError> {
321
- return paginate<GenerationRead, ProjectsListGenerationsError>(this._core, {
351
+ ): PagePromise<GenerationSummaryRead, ProjectsListGenerationsError> {
352
+ return paginate<GenerationSummaryRead, ProjectsListGenerationsError>(this._core, {
322
353
  method: "GET",
323
354
  path: `/projects/${encodeURIComponent(String(projectId))}/generations`,
355
+ security: [{"apiKey":[]}],
324
356
  query: {
325
357
  limit: params?.limit,
326
358
  cursor: params?.cursor,
@@ -356,24 +388,33 @@ export class ProjectsResource {
356
388
  * commit, branch, or pull request is created and that generation reports
357
389
  * `pr_status: no_changes`. This is the same pipeline automatic
358
390
  * regeneration runs after a source change.
391
+ *
392
+ * A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
359
393
  * `POST /projects/{project_id}/generations`
360
394
  */
361
395
  async generate(
362
396
  projectId: ProjectId,
397
+ params?: ProjectsGenerateParams,
363
398
  options?: RequestOptions,
364
399
  ): Promise<ApiResult<GenerationBatchRead, ProjectsGenerateError>> {
365
400
  return this._core.request<GenerationBatchRead, ProjectsGenerateError>({
366
401
  method: "POST",
367
402
  path: `/projects/${encodeURIComponent(String(projectId))}/generations`,
403
+ security: [{"apiKey":[]}],
404
+ headers: {
405
+ "Idempotency-Key": params?.idempotencyKey === undefined ? undefined : String(params?.idempotencyKey),
406
+ },
368
407
  errors: {
369
408
  "401": UnauthorizedError,
370
409
  "402": PaymentRequiredError,
371
410
  "403": ForbiddenError,
372
411
  "404": NotFoundError,
412
+ "409": ConflictError,
373
413
  "422": UnprocessableEntityError,
374
414
  "429": RateLimitedError,
375
415
  "500": InternalServerError,
376
416
  },
417
+ idempotencyKey: "Idempotency-Key",
377
418
  schemaKey: "projects.generate",
378
419
  options,
379
420
  });
@@ -397,14 +438,16 @@ export type ProjectsListError =
397
438
  | ForbiddenError
398
439
  | RateLimitedError
399
440
  | UnexpectedApiError
441
+ | ResponseParseError
400
442
  | TransportError
401
443
  | ValidationError;
402
444
 
403
445
  export interface ProjectsCreateParams {
404
446
  /**
405
- * Uniquely identifies this creation attempt. Retrying the same request with the same key returns
406
- * the original response instead of creating another project. Reusing a key with different
407
- * parameters returns 409.
447
+ * Identifies one logical write for 24 hours. The key is scoped to the authenticated account and
448
+ * operation; account-less generation uses a hashed network identity. Retrying the same method,
449
+ * path, query, and JSON body replays the original response. Reusing the key with changed intent
450
+ * returns 409. After expiry the key starts a new write.
408
451
  */
409
452
  idempotencyKey?: string;
410
453
  }
@@ -420,6 +463,7 @@ export type ProjectsCreateError =
420
463
  | RateLimitedError
421
464
  | InternalServerError
422
465
  | UnexpectedApiError
466
+ | ResponseParseError
423
467
  | TransportError
424
468
  | ValidationError;
425
469
 
@@ -430,6 +474,7 @@ export type ProjectsRetrieveError =
430
474
  | NotFoundError
431
475
  | RateLimitedError
432
476
  | UnexpectedApiError
477
+ | ResponseParseError
433
478
  | TransportError
434
479
  | ValidationError;
435
480
 
@@ -440,6 +485,7 @@ export type ProjectsDeleteError =
440
485
  | NotFoundError
441
486
  | RateLimitedError
442
487
  | UnexpectedApiError
488
+ | ResponseParseError
443
489
  | TransportError
444
490
  | ValidationError;
445
491
 
@@ -450,9 +496,12 @@ export type ProjectsUpdateError =
450
496
  | PaymentRequiredError
451
497
  | ForbiddenError
452
498
  | NotFoundError
499
+ | ConflictError
453
500
  | UnprocessableEntityError
454
501
  | RateLimitedError
502
+ | BadGatewayError
455
503
  | UnexpectedApiError
504
+ | ResponseParseError
456
505
  | TransportError
457
506
  | ValidationError;
458
507
 
@@ -463,29 +512,54 @@ export type ProjectsRetrieveDiagnosticsError =
463
512
  | NotFoundError
464
513
  | RateLimitedError
465
514
  | UnexpectedApiError
515
+ | ResponseParseError
466
516
  | TransportError
467
517
  | ValidationError;
468
518
 
519
+ export interface ProjectsRefreshDiagnosticsParams {
520
+ /**
521
+ * Identifies one logical write for 24 hours. The key is scoped to the authenticated account and
522
+ * operation; account-less generation uses a hashed network identity. Retrying the same method,
523
+ * path, query, and JSON body replays the original response. Reusing the key with changed intent
524
+ * returns 409. After expiry the key starts a new write.
525
+ */
526
+ idempotencyKey?: string;
527
+ }
528
+
469
529
  /** Every error `refreshDiagnostics` can produce, as a discriminated union. */
470
530
  export type ProjectsRefreshDiagnosticsError =
471
531
  | UnauthorizedError
472
532
  | ForbiddenError
473
533
  | NotFoundError
534
+ | ConflictError
474
535
  | UnprocessableEntityError
475
536
  | RateLimitedError
476
537
  | UnexpectedApiError
538
+ | ResponseParseError
477
539
  | TransportError
478
540
  | ValidationError;
479
541
 
542
+ export interface ProjectsRemediateDiagnosticsParams {
543
+ /**
544
+ * Identifies one logical write for 24 hours. The key is scoped to the authenticated account and
545
+ * operation; account-less generation uses a hashed network identity. Retrying the same method,
546
+ * path, query, and JSON body replays the original response. Reusing the key with changed intent
547
+ * returns 409. After expiry the key starts a new write.
548
+ */
549
+ idempotencyKey?: string;
550
+ }
551
+
480
552
  /** Every error `remediateDiagnostics` can produce, as a discriminated union. */
481
553
  export type ProjectsRemediateDiagnosticsError =
482
554
  | BadRequestError
483
555
  | UnauthorizedError
484
556
  | ForbiddenError
485
557
  | NotFoundError
558
+ | ConflictError
486
559
  | UnprocessableEntityError
487
560
  | RateLimitedError
488
561
  | UnexpectedApiError
562
+ | ResponseParseError
489
563
  | TransportError
490
564
  | ValidationError;
491
565
 
@@ -496,6 +570,7 @@ export type ProjectsRetrieveIntegrationHealthError =
496
570
  | NotFoundError
497
571
  | RateLimitedError
498
572
  | UnexpectedApiError
573
+ | ResponseParseError
499
574
  | TransportError
500
575
  | ValidationError;
501
576
 
@@ -519,18 +594,31 @@ export type ProjectsListGenerationsError =
519
594
  | NotFoundError
520
595
  | RateLimitedError
521
596
  | UnexpectedApiError
597
+ | ResponseParseError
522
598
  | TransportError
523
599
  | ValidationError;
524
600
 
601
+ export interface ProjectsGenerateParams {
602
+ /**
603
+ * Identifies one logical write for 24 hours. The key is scoped to the authenticated account and
604
+ * operation; account-less generation uses a hashed network identity. Retrying the same method,
605
+ * path, query, and JSON body replays the original response. Reusing the key with changed intent
606
+ * returns 409. After expiry the key starts a new write.
607
+ */
608
+ idempotencyKey?: string;
609
+ }
610
+
525
611
  /** Every error `generate` can produce, as a discriminated union. */
526
612
  export type ProjectsGenerateError =
527
613
  | UnauthorizedError
528
614
  | PaymentRequiredError
529
615
  | ForbiddenError
530
616
  | NotFoundError
617
+ | ConflictError
531
618
  | UnprocessableEntityError
532
619
  | RateLimitedError
533
620
  | InternalServerError
534
621
  | UnexpectedApiError
622
+ | ResponseParseError
535
623
  | TransportError
536
624
  | ValidationError;