@hyperdrive.bot/cli 1.0.11 → 1.0.13
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/README.md +60 -60
- package/dist/commands/auth/login.js +1 -2
- package/dist/services/hyperdrive-sigv4.d.ts +331 -4
- package/dist/services/hyperdrive-sigv4.js +143 -14
- package/dist/services/tenant-service.d.ts +7 -10
- package/dist/services/tenant-service.js +17 -21
- package/dist/utils/auth-flow.d.ts +1 -2
- package/dist/utils/auth-flow.js +2 -4
- package/oclif.manifest.json +2 -2
- package/package.json +1 -1
|
@@ -42,6 +42,7 @@ interface ModuleResponse {
|
|
|
42
42
|
ciService?: string;
|
|
43
43
|
createdAt?: string;
|
|
44
44
|
framework?: string;
|
|
45
|
+
moduleType?: 'backend' | 'frontend';
|
|
45
46
|
name?: string;
|
|
46
47
|
projectId?: string;
|
|
47
48
|
runCommand?: string;
|
|
@@ -49,6 +50,7 @@ interface ModuleResponse {
|
|
|
49
50
|
runtimeVersion?: string;
|
|
50
51
|
slug?: string;
|
|
51
52
|
sourceLocation?: string;
|
|
53
|
+
subdomain?: string;
|
|
52
54
|
}
|
|
53
55
|
interface ParameterSyncResponse {
|
|
54
56
|
errors?: Array<{
|
|
@@ -136,7 +138,9 @@ interface GitAuthInitiateResponse {
|
|
|
136
138
|
installUrl: string;
|
|
137
139
|
state: string;
|
|
138
140
|
}
|
|
139
|
-
export type
|
|
141
|
+
export type HookTriggerEvent = 'comment_added' | 'field_changed' | 'issue_assigned' | 'issue_created' | 'label_changed' | 'status_transition';
|
|
142
|
+
export type HookActionType = 'adhb-enrich' | 'ci-trigger' | 'git-create-branch' | 'git-create-mr' | 'git-delete-branch' | 'slack-notify' | 'webhook';
|
|
143
|
+
export type HookActionCategory = 'flex' | 'smart';
|
|
140
144
|
export interface SlackNotifyConfig {
|
|
141
145
|
channel: string;
|
|
142
146
|
template?: string;
|
|
@@ -167,15 +171,83 @@ export interface HookResponse {
|
|
|
167
171
|
export interface HookListResponse {
|
|
168
172
|
hooks: HookResponse[];
|
|
169
173
|
}
|
|
174
|
+
export interface HookLogEntry {
|
|
175
|
+
actionType: string;
|
|
176
|
+
durationMs: number;
|
|
177
|
+
errorMessage?: string;
|
|
178
|
+
hookId: string;
|
|
179
|
+
hookName: string;
|
|
180
|
+
httpStatusCode?: number;
|
|
181
|
+
issueKey: string;
|
|
182
|
+
status: 'failed' | 'success';
|
|
183
|
+
timestamp: string;
|
|
184
|
+
triggerEvent: string;
|
|
185
|
+
}
|
|
186
|
+
export interface HookLogListResponse {
|
|
187
|
+
items: HookLogEntry[];
|
|
188
|
+
}
|
|
170
189
|
export interface HookCreateRequest {
|
|
171
190
|
actionConfig: HookActionConfig;
|
|
172
191
|
actionType: HookActionType;
|
|
173
192
|
triggerStatus: string;
|
|
174
193
|
}
|
|
194
|
+
export interface HookCreateRequestV2 {
|
|
195
|
+
action: {
|
|
196
|
+
category: HookActionCategory;
|
|
197
|
+
config: Record<string, unknown>;
|
|
198
|
+
type: HookActionType;
|
|
199
|
+
};
|
|
200
|
+
order?: number;
|
|
201
|
+
trigger: {
|
|
202
|
+
conditions?: Record<string, string>;
|
|
203
|
+
event: HookTriggerEvent;
|
|
204
|
+
source: string;
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
export type BackupStatus = 'completed' | 'failed' | 'in-progress' | 'pending';
|
|
208
|
+
export type BackupType = 'clone' | 'restore' | 'snapshot';
|
|
209
|
+
export type SeedRunStatus = 'completed' | 'failed' | 'in-progress' | 'pending';
|
|
210
|
+
export type ClonePhase = 'completed' | 'credential-rotation' | 'failed' | 'registering' | 'restoring' | 'snapshot-creating' | 'snapshot-sharing';
|
|
211
|
+
export interface BackupResponse {
|
|
212
|
+
completedAt?: string;
|
|
213
|
+
createdAt: string;
|
|
214
|
+
errorMessage?: string;
|
|
215
|
+
id: string;
|
|
216
|
+
metadata?: Record<string, string>;
|
|
217
|
+
serviceSlug: string;
|
|
218
|
+
serviceType: string;
|
|
219
|
+
snapshotArn?: string;
|
|
220
|
+
snapshotIdentifier?: string;
|
|
221
|
+
status: BackupStatus;
|
|
222
|
+
type: BackupType;
|
|
223
|
+
updatedAt: string;
|
|
224
|
+
}
|
|
225
|
+
export interface BackupListResponse {
|
|
226
|
+
backups: BackupResponse[];
|
|
227
|
+
lastEvaluatedKey?: Record<string, unknown>;
|
|
228
|
+
}
|
|
229
|
+
export interface SeedRunResponse {
|
|
230
|
+
completedAt?: string;
|
|
231
|
+
createdAt: string;
|
|
232
|
+
errorMessage?: string;
|
|
233
|
+
id: string;
|
|
234
|
+
logGroupName?: string;
|
|
235
|
+
scriptPath?: string;
|
|
236
|
+
scriptSource: string;
|
|
237
|
+
serviceSlug: string;
|
|
238
|
+
serviceType: string;
|
|
239
|
+
status: SeedRunStatus;
|
|
240
|
+
updatedAt: string;
|
|
241
|
+
}
|
|
242
|
+
export interface SeedRunListResponse {
|
|
243
|
+
lastEvaluatedKey?: Record<string, unknown>;
|
|
244
|
+
seedRuns: SeedRunResponse[];
|
|
245
|
+
}
|
|
175
246
|
/**
|
|
176
247
|
* Hyperdrive API Service with AWS SigV4 authentication
|
|
177
248
|
*/
|
|
178
249
|
export declare class HyperdriveSigV4Service extends SigV4ApiClient {
|
|
250
|
+
private readonly projectsApiUrl?;
|
|
179
251
|
private readonly userGroupsApiUrl?;
|
|
180
252
|
constructor(domain?: string);
|
|
181
253
|
accountAdd(params: {
|
|
@@ -196,6 +268,242 @@ export declare class HyperdriveSigV4Service extends SigV4ApiClient {
|
|
|
196
268
|
accountVerify(params: {
|
|
197
269
|
accountId: string;
|
|
198
270
|
}): Promise<AWSAccountVerifyResponse>;
|
|
271
|
+
networkDiscover(params: {
|
|
272
|
+
accountId: string;
|
|
273
|
+
region: string;
|
|
274
|
+
}): Promise<{
|
|
275
|
+
vpcs: Array<{
|
|
276
|
+
vpcId: string;
|
|
277
|
+
name: string;
|
|
278
|
+
cidrBlock: string;
|
|
279
|
+
privateSubnetIds: string[];
|
|
280
|
+
publicSubnetIds: string[];
|
|
281
|
+
securityGroups: Array<{
|
|
282
|
+
groupId: string;
|
|
283
|
+
groupName: string;
|
|
284
|
+
description: string;
|
|
285
|
+
}>;
|
|
286
|
+
alreadyRegistered: boolean;
|
|
287
|
+
existingNetworkSlug?: string;
|
|
288
|
+
}>;
|
|
289
|
+
accountId: string;
|
|
290
|
+
region: string;
|
|
291
|
+
message?: string;
|
|
292
|
+
}>;
|
|
293
|
+
networkRegister(params: {
|
|
294
|
+
slug: string;
|
|
295
|
+
accountId: string;
|
|
296
|
+
region: string;
|
|
297
|
+
vpcId: string;
|
|
298
|
+
privateSubnetIds?: string[];
|
|
299
|
+
publicSubnetIds?: string[];
|
|
300
|
+
securityGroups?: Record<string, string>;
|
|
301
|
+
source?: string;
|
|
302
|
+
}): Promise<Record<string, unknown>>;
|
|
303
|
+
networkList(): Promise<Array<{
|
|
304
|
+
slug: string;
|
|
305
|
+
accountId: string;
|
|
306
|
+
region: string;
|
|
307
|
+
vpcId: string;
|
|
308
|
+
status: string;
|
|
309
|
+
source: string;
|
|
310
|
+
privateSubnetIds: string[];
|
|
311
|
+
publicSubnetIds: string[];
|
|
312
|
+
securityGroups: Record<string, string>;
|
|
313
|
+
createdAt: string;
|
|
314
|
+
updatedAt: string;
|
|
315
|
+
}>>;
|
|
316
|
+
networkGet(slug: string): Promise<{
|
|
317
|
+
slug: string;
|
|
318
|
+
accountId: string;
|
|
319
|
+
region: string;
|
|
320
|
+
vpcId: string;
|
|
321
|
+
status: string;
|
|
322
|
+
source: string;
|
|
323
|
+
privateSubnetIds: string[];
|
|
324
|
+
publicSubnetIds: string[];
|
|
325
|
+
securityGroups: Record<string, string>;
|
|
326
|
+
createdAt: string;
|
|
327
|
+
updatedAt: string;
|
|
328
|
+
}>;
|
|
329
|
+
serviceRegister(params: {
|
|
330
|
+
slug: string;
|
|
331
|
+
name: string;
|
|
332
|
+
type: string;
|
|
333
|
+
access: 'private' | 'public';
|
|
334
|
+
endpoint: string;
|
|
335
|
+
port?: number;
|
|
336
|
+
protocol?: string;
|
|
337
|
+
credentialSecretArn?: string;
|
|
338
|
+
networkSlug?: string;
|
|
339
|
+
accountId: string;
|
|
340
|
+
region: string;
|
|
341
|
+
exportedEnvVars?: Record<string, string>;
|
|
342
|
+
metadata?: Record<string, string>;
|
|
343
|
+
}): Promise<Record<string, unknown>>;
|
|
344
|
+
serviceList(params?: {
|
|
345
|
+
type?: string;
|
|
346
|
+
network?: string;
|
|
347
|
+
}): Promise<Array<{
|
|
348
|
+
slug: string;
|
|
349
|
+
name: string;
|
|
350
|
+
type: string;
|
|
351
|
+
access: string;
|
|
352
|
+
status: string;
|
|
353
|
+
endpoint: string;
|
|
354
|
+
port?: number;
|
|
355
|
+
protocol?: string;
|
|
356
|
+
credentialSecretArn?: string;
|
|
357
|
+
networkSlug?: string;
|
|
358
|
+
accountId: string;
|
|
359
|
+
region: string;
|
|
360
|
+
exportedEnvVars: Record<string, string>;
|
|
361
|
+
metadata: Record<string, string>;
|
|
362
|
+
createdAt: string;
|
|
363
|
+
updatedAt: string;
|
|
364
|
+
}>>;
|
|
365
|
+
serviceGet(slug: string): Promise<{
|
|
366
|
+
slug: string;
|
|
367
|
+
name: string;
|
|
368
|
+
type: string;
|
|
369
|
+
access: string;
|
|
370
|
+
status: string;
|
|
371
|
+
endpoint: string;
|
|
372
|
+
port?: number;
|
|
373
|
+
protocol?: string;
|
|
374
|
+
credentialSecretArn?: string;
|
|
375
|
+
networkSlug?: string;
|
|
376
|
+
accountId: string;
|
|
377
|
+
region: string;
|
|
378
|
+
templateId?: string;
|
|
379
|
+
stackName?: string;
|
|
380
|
+
stackArn?: string;
|
|
381
|
+
cdkRepo?: string;
|
|
382
|
+
exportedEnvVars: Record<string, string>;
|
|
383
|
+
metadata: Record<string, string>;
|
|
384
|
+
createdAt: string;
|
|
385
|
+
updatedAt: string;
|
|
386
|
+
}>;
|
|
387
|
+
serviceUpdate(slug: string, params: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
388
|
+
serviceProvision(body: {
|
|
389
|
+
templateId: string;
|
|
390
|
+
serviceSlug: string;
|
|
391
|
+
serviceName: string;
|
|
392
|
+
stage: string;
|
|
393
|
+
parameters?: Record<string, string>;
|
|
394
|
+
networkSlug?: string;
|
|
395
|
+
}): Promise<{
|
|
396
|
+
serviceSlug: string;
|
|
397
|
+
status: string;
|
|
398
|
+
logGroupName: string;
|
|
399
|
+
}>;
|
|
400
|
+
serviceTemplateGet(templateId: string): Promise<{
|
|
401
|
+
id: string;
|
|
402
|
+
name: string;
|
|
403
|
+
description: string;
|
|
404
|
+
type: string;
|
|
405
|
+
parameters: Array<{
|
|
406
|
+
name: string;
|
|
407
|
+
description: string;
|
|
408
|
+
type: string;
|
|
409
|
+
default?: string;
|
|
410
|
+
allowed?: string[];
|
|
411
|
+
required: boolean;
|
|
412
|
+
}>;
|
|
413
|
+
defaultExportedEnvVars: Record<string, string>;
|
|
414
|
+
defaultSecurityGroupPurpose: string | null;
|
|
415
|
+
}>;
|
|
416
|
+
serviceDecommission(slug: string): Promise<{
|
|
417
|
+
message: string;
|
|
418
|
+
}>;
|
|
419
|
+
serviceBind(serviceSlug: string, body: {
|
|
420
|
+
moduleSlug: string;
|
|
421
|
+
stage: string;
|
|
422
|
+
envVarMapping?: Record<string, string>;
|
|
423
|
+
templateVars?: Record<string, string>;
|
|
424
|
+
}): Promise<{
|
|
425
|
+
stage: string;
|
|
426
|
+
moduleSlug: string;
|
|
427
|
+
serviceSlug: string;
|
|
428
|
+
envVarMapping?: Record<string, string>;
|
|
429
|
+
templateVars?: Record<string, string>;
|
|
430
|
+
createdAt: string;
|
|
431
|
+
updatedAt: string;
|
|
432
|
+
}>;
|
|
433
|
+
serviceUnbind(serviceSlug: string, body: {
|
|
434
|
+
moduleSlug: string;
|
|
435
|
+
stage: string;
|
|
436
|
+
}): Promise<{
|
|
437
|
+
message: string;
|
|
438
|
+
}>;
|
|
439
|
+
serviceBindings(serviceSlug: string): Promise<Array<{
|
|
440
|
+
stage: string;
|
|
441
|
+
moduleSlug: string;
|
|
442
|
+
serviceSlug: string;
|
|
443
|
+
envVarMapping?: Record<string, string>;
|
|
444
|
+
templateVars?: Record<string, string>;
|
|
445
|
+
createdAt: string;
|
|
446
|
+
updatedAt: string;
|
|
447
|
+
}>>;
|
|
448
|
+
serviceTemplates(): Promise<Array<{
|
|
449
|
+
id: string;
|
|
450
|
+
name: string;
|
|
451
|
+
description: string;
|
|
452
|
+
type: string;
|
|
453
|
+
parameters: Array<{
|
|
454
|
+
name: string;
|
|
455
|
+
description: string;
|
|
456
|
+
type: string;
|
|
457
|
+
default: string;
|
|
458
|
+
allowed?: string[];
|
|
459
|
+
required: boolean;
|
|
460
|
+
}>;
|
|
461
|
+
defaultExportedEnvVars: Record<string, string>;
|
|
462
|
+
}>>;
|
|
463
|
+
serviceCreateBackup(serviceSlug: string, metadata?: Record<string, string>): Promise<BackupResponse>;
|
|
464
|
+
serviceListBackups(serviceSlug: string, params?: {
|
|
465
|
+
limit?: string;
|
|
466
|
+
lastEvaluatedKey?: string;
|
|
467
|
+
}): Promise<BackupListResponse>;
|
|
468
|
+
serviceGetBackup(serviceSlug: string, backupId: string): Promise<BackupResponse>;
|
|
469
|
+
serviceRestore(serviceSlug: string, body: {
|
|
470
|
+
backupId: string;
|
|
471
|
+
instanceClass?: string;
|
|
472
|
+
networkSlug?: string;
|
|
473
|
+
targetSlug?: string;
|
|
474
|
+
}): Promise<BackupResponse>;
|
|
475
|
+
serviceClone(serviceSlug: string, body: {
|
|
476
|
+
instanceClass?: string;
|
|
477
|
+
targetAccountId?: string;
|
|
478
|
+
targetNetworkSlug: string;
|
|
479
|
+
targetSlug: string;
|
|
480
|
+
templateVars?: Record<string, string>;
|
|
481
|
+
}): Promise<BackupResponse>;
|
|
482
|
+
serviceBackupSchedule(serviceSlug: string, schedule: 'daily' | 'weekly'): Promise<Record<string, unknown>>;
|
|
483
|
+
serviceSeed(serviceSlug: string, body: {
|
|
484
|
+
allowProduction?: boolean;
|
|
485
|
+
scriptPath?: string;
|
|
486
|
+
scriptSource: string;
|
|
487
|
+
}): Promise<SeedRunResponse>;
|
|
488
|
+
serviceListSeedRuns(serviceSlug: string, params?: {
|
|
489
|
+
lastEvaluatedKey?: string;
|
|
490
|
+
limit?: string;
|
|
491
|
+
}): Promise<SeedRunListResponse>;
|
|
492
|
+
serviceGetSeedRun(serviceSlug: string, seedRunId: string): Promise<SeedRunResponse>;
|
|
493
|
+
moduleBindings(moduleSlug: string, params?: {
|
|
494
|
+
stage?: string;
|
|
495
|
+
}): Promise<Array<{
|
|
496
|
+
stage: string;
|
|
497
|
+
moduleSlug: string;
|
|
498
|
+
serviceSlug: string;
|
|
499
|
+
serviceType?: string;
|
|
500
|
+
serviceAccess?: string;
|
|
501
|
+
networkSlug?: string;
|
|
502
|
+
envVarMapping?: Record<string, string>;
|
|
503
|
+
templateVars?: Record<string, string>;
|
|
504
|
+
createdAt: string;
|
|
505
|
+
updatedAt: string;
|
|
506
|
+
}>>;
|
|
199
507
|
ciAccountCreate(params: {
|
|
200
508
|
description?: string;
|
|
201
509
|
name: string;
|
|
@@ -252,6 +560,7 @@ export declare class HyperdriveSigV4Service extends SigV4ApiClient {
|
|
|
252
560
|
deploymentCreate(params: {
|
|
253
561
|
commit: string;
|
|
254
562
|
launch: boolean;
|
|
563
|
+
moduleType?: string;
|
|
255
564
|
name: string;
|
|
256
565
|
projectSlug: string;
|
|
257
566
|
regions: string[];
|
|
@@ -290,10 +599,15 @@ export declare class HyperdriveSigV4Service extends SigV4ApiClient {
|
|
|
290
599
|
totalCount: number;
|
|
291
600
|
}>;
|
|
292
601
|
hookCreate(projectId: string, body: HookCreateRequest): Promise<HookResponse>;
|
|
602
|
+
hookCreateV2(projectId: string, body: HookCreateRequestV2): Promise<HookResponse>;
|
|
293
603
|
hookDelete(projectId: string, hookId: string): Promise<{
|
|
294
604
|
message: string;
|
|
295
605
|
}>;
|
|
296
606
|
hookList(projectId: string): Promise<HookListResponse>;
|
|
607
|
+
hookLogList(projectId: string, options?: {
|
|
608
|
+
limit?: number;
|
|
609
|
+
status?: string;
|
|
610
|
+
}): Promise<HookLogListResponse>;
|
|
297
611
|
hookUpdate(projectId: string, hookId: string, body: Partial<HookCreateRequest> & {
|
|
298
612
|
enabled?: boolean;
|
|
299
613
|
}): Promise<HookResponse>;
|
|
@@ -404,16 +718,18 @@ export declare class HyperdriveSigV4Service extends SigV4ApiClient {
|
|
|
404
718
|
moduleCreate(module: {
|
|
405
719
|
buildCommand?: string;
|
|
406
720
|
buildFolder?: string;
|
|
407
|
-
buildRuntime
|
|
721
|
+
buildRuntime?: string;
|
|
408
722
|
buildRuntimeVersion?: string;
|
|
409
723
|
ciService?: string;
|
|
410
|
-
framework
|
|
724
|
+
framework?: string;
|
|
411
725
|
installCommand?: string;
|
|
726
|
+
moduleType?: 'backend' | 'frontend' | 'cdk';
|
|
412
727
|
name: string;
|
|
413
728
|
runCommand?: string;
|
|
414
|
-
runtime
|
|
729
|
+
runtime?: string;
|
|
415
730
|
slug: string;
|
|
416
731
|
sourceLocation: string;
|
|
732
|
+
subdomain?: string;
|
|
417
733
|
}): Promise<ModuleResponse>;
|
|
418
734
|
moduleDestroy(params: {
|
|
419
735
|
slug: string;
|
|
@@ -463,12 +779,14 @@ export declare class HyperdriveSigV4Service extends SigV4ApiClient {
|
|
|
463
779
|
ciService?: string;
|
|
464
780
|
framework?: string;
|
|
465
781
|
installCommand?: string;
|
|
782
|
+
moduleType?: 'backend' | 'frontend' | 'cdk';
|
|
466
783
|
name?: string;
|
|
467
784
|
runCommand?: string;
|
|
468
785
|
runtime?: string;
|
|
469
786
|
runtimeVersion?: string;
|
|
470
787
|
slug: string;
|
|
471
788
|
sourceLocation?: string;
|
|
789
|
+
subdomain?: string;
|
|
472
790
|
}): Promise<ModuleResponse>;
|
|
473
791
|
parameterAdd(params: {
|
|
474
792
|
accountId: string;
|
|
@@ -575,6 +893,15 @@ export declare class HyperdriveSigV4Service extends SigV4ApiClient {
|
|
|
575
893
|
stageAccessRevoke(stageName: string, targetType: 'user' | 'group', targetId: string): Promise<{
|
|
576
894
|
message: string;
|
|
577
895
|
}>;
|
|
896
|
+
domainSetProduction(params: {
|
|
897
|
+
domain: string;
|
|
898
|
+
}): Promise<{
|
|
899
|
+
tenantId: string;
|
|
900
|
+
domain: string;
|
|
901
|
+
status: string;
|
|
902
|
+
createdAt: string;
|
|
903
|
+
updatedAt: string;
|
|
904
|
+
}>;
|
|
578
905
|
groupList(): Promise<Array<{
|
|
579
906
|
groupId: string;
|
|
580
907
|
name: string;
|
|
@@ -18,6 +18,7 @@ const CLI_VERSION = packageJson.version;
|
|
|
18
18
|
* Hyperdrive API Service with AWS SigV4 authentication
|
|
19
19
|
*/
|
|
20
20
|
export class HyperdriveSigV4Service extends SigV4ApiClient {
|
|
21
|
+
projectsApiUrl;
|
|
21
22
|
userGroupsApiUrl;
|
|
22
23
|
constructor(domain) {
|
|
23
24
|
super({
|
|
@@ -28,8 +29,10 @@ export class HyperdriveSigV4Service extends SigV4ApiClient {
|
|
|
28
29
|
apiUrlOverride: process.env.HYPERDRIVE_API_URL,
|
|
29
30
|
regionOverride: process.env.HYPERDRIVE_AWS_REGION,
|
|
30
31
|
});
|
|
31
|
-
//
|
|
32
|
-
this.
|
|
32
|
+
// Keys match bootstrap REST config names (auto-discovered from additionalApiUrls)
|
|
33
|
+
this.projectsApiUrl = process.env.HYPERDRIVE_PROJECTS_API_URL
|
|
34
|
+
|| this.getAdditionalApiUrl('hyperdrive-projects');
|
|
35
|
+
this.userGroupsApiUrl = this.getAdditionalApiUrl('user-groups');
|
|
33
36
|
}
|
|
34
37
|
// ============================================================================
|
|
35
38
|
// AWS Account Methods
|
|
@@ -50,6 +53,114 @@ export class HyperdriveSigV4Service extends SigV4ApiClient {
|
|
|
50
53
|
return this.makeSignedRequest('POST', `/cloud-account/aws/account/${params.accountId}/verify`);
|
|
51
54
|
}
|
|
52
55
|
// ============================================================================
|
|
56
|
+
// Network Methods
|
|
57
|
+
// ============================================================================
|
|
58
|
+
async networkDiscover(params) {
|
|
59
|
+
return this.makeSignedRequest('POST', '/networks/discover', params);
|
|
60
|
+
}
|
|
61
|
+
async networkRegister(params) {
|
|
62
|
+
return this.makeSignedRequest('POST', '/networks', params);
|
|
63
|
+
}
|
|
64
|
+
async networkList() {
|
|
65
|
+
return this.makeSignedRequest('GET', '/networks');
|
|
66
|
+
}
|
|
67
|
+
async networkGet(slug) {
|
|
68
|
+
return this.makeSignedRequest('GET', `/networks/${encodeURIComponent(slug)}`);
|
|
69
|
+
}
|
|
70
|
+
// ============================================================================
|
|
71
|
+
// Service Registry Methods
|
|
72
|
+
// ============================================================================
|
|
73
|
+
async serviceRegister(params) {
|
|
74
|
+
return this.makeSignedRequest('POST', '/services', params);
|
|
75
|
+
}
|
|
76
|
+
async serviceList(params) {
|
|
77
|
+
const queryParts = [];
|
|
78
|
+
if (params?.type)
|
|
79
|
+
queryParts.push(`type=${encodeURIComponent(params.type)}`);
|
|
80
|
+
if (params?.network)
|
|
81
|
+
queryParts.push(`network=${encodeURIComponent(params.network)}`);
|
|
82
|
+
const qs = queryParts.length > 0 ? `?${queryParts.join('&')}` : '';
|
|
83
|
+
return this.makeSignedRequest('GET', `/services${qs}`);
|
|
84
|
+
}
|
|
85
|
+
async serviceGet(slug) {
|
|
86
|
+
return this.makeSignedRequest('GET', `/services/${encodeURIComponent(slug)}`);
|
|
87
|
+
}
|
|
88
|
+
async serviceUpdate(slug, params) {
|
|
89
|
+
return this.makeSignedRequest('PUT', `/services/${encodeURIComponent(slug)}`, params);
|
|
90
|
+
}
|
|
91
|
+
async serviceProvision(body) {
|
|
92
|
+
return this.makeSignedRequest('POST', '/services/provision', body);
|
|
93
|
+
}
|
|
94
|
+
async serviceTemplateGet(templateId) {
|
|
95
|
+
return this.makeSignedRequest('GET', `/services/templates/${encodeURIComponent(templateId)}`);
|
|
96
|
+
}
|
|
97
|
+
async serviceDecommission(slug) {
|
|
98
|
+
return this.makeSignedRequest('DELETE', `/services/${encodeURIComponent(slug)}`);
|
|
99
|
+
}
|
|
100
|
+
async serviceBind(serviceSlug, body) {
|
|
101
|
+
return this.makeSignedRequest('POST', `/services/${encodeURIComponent(serviceSlug)}/bind`, body);
|
|
102
|
+
}
|
|
103
|
+
async serviceUnbind(serviceSlug, body) {
|
|
104
|
+
return this.makeSignedRequest('DELETE', `/services/${encodeURIComponent(serviceSlug)}/bind`, body);
|
|
105
|
+
}
|
|
106
|
+
async serviceBindings(serviceSlug) {
|
|
107
|
+
return this.makeSignedRequest('GET', `/services/${encodeURIComponent(serviceSlug)}/bindings`);
|
|
108
|
+
}
|
|
109
|
+
async serviceTemplates() {
|
|
110
|
+
return this.makeSignedRequest('GET', '/services/templates');
|
|
111
|
+
}
|
|
112
|
+
// ============================================================================
|
|
113
|
+
// Service Lifecycle Methods (Backup + Restore)
|
|
114
|
+
// ============================================================================
|
|
115
|
+
async serviceCreateBackup(serviceSlug, metadata) {
|
|
116
|
+
return this.makeSignedRequest('POST', `/services/${encodeURIComponent(serviceSlug)}/backup`, metadata ? { metadata } : undefined);
|
|
117
|
+
}
|
|
118
|
+
async serviceListBackups(serviceSlug, params) {
|
|
119
|
+
const qs = new URLSearchParams();
|
|
120
|
+
if (params?.limit)
|
|
121
|
+
qs.set('limit', params.limit);
|
|
122
|
+
if (params?.lastEvaluatedKey)
|
|
123
|
+
qs.set('lastEvaluatedKey', params.lastEvaluatedKey);
|
|
124
|
+
const query = qs.toString();
|
|
125
|
+
return this.makeSignedRequest('GET', `/services/${encodeURIComponent(serviceSlug)}/backups${query ? `?${query}` : ''}`);
|
|
126
|
+
}
|
|
127
|
+
async serviceGetBackup(serviceSlug, backupId) {
|
|
128
|
+
return this.makeSignedRequest('GET', `/services/${encodeURIComponent(serviceSlug)}/backups/${encodeURIComponent(backupId)}`);
|
|
129
|
+
}
|
|
130
|
+
async serviceRestore(serviceSlug, body) {
|
|
131
|
+
return this.makeSignedRequest('POST', `/services/${encodeURIComponent(serviceSlug)}/restore`, body);
|
|
132
|
+
}
|
|
133
|
+
async serviceClone(serviceSlug, body) {
|
|
134
|
+
return this.makeSignedRequest('POST', `/services/${encodeURIComponent(serviceSlug)}/clone`, body);
|
|
135
|
+
}
|
|
136
|
+
async serviceBackupSchedule(serviceSlug, schedule) {
|
|
137
|
+
return this.makeSignedRequest('PUT', `/services/${encodeURIComponent(serviceSlug)}`, {
|
|
138
|
+
metadata: { backupSchedule: schedule },
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
// ============================================================================
|
|
142
|
+
// Service Lifecycle Methods (Seed)
|
|
143
|
+
// ============================================================================
|
|
144
|
+
async serviceSeed(serviceSlug, body) {
|
|
145
|
+
return this.makeSignedRequest('POST', `/services/${encodeURIComponent(serviceSlug)}/seed`, body);
|
|
146
|
+
}
|
|
147
|
+
async serviceListSeedRuns(serviceSlug, params) {
|
|
148
|
+
const qs = new URLSearchParams();
|
|
149
|
+
if (params?.limit)
|
|
150
|
+
qs.set('limit', params.limit);
|
|
151
|
+
if (params?.lastEvaluatedKey)
|
|
152
|
+
qs.set('lastEvaluatedKey', params.lastEvaluatedKey);
|
|
153
|
+
const query = qs.toString();
|
|
154
|
+
return this.makeSignedRequest('GET', `/services/${encodeURIComponent(serviceSlug)}/seed-runs${query ? `?${query}` : ''}`);
|
|
155
|
+
}
|
|
156
|
+
async serviceGetSeedRun(serviceSlug, seedRunId) {
|
|
157
|
+
return this.makeSignedRequest('GET', `/services/${encodeURIComponent(serviceSlug)}/seed-runs/${encodeURIComponent(seedRunId)}`);
|
|
158
|
+
}
|
|
159
|
+
async moduleBindings(moduleSlug, params) {
|
|
160
|
+
const qs = params?.stage ? `?stage=${encodeURIComponent(params.stage)}` : '';
|
|
161
|
+
return this.makeSignedRequest('GET', `/modules/${encodeURIComponent(moduleSlug)}/bindings${qs}`);
|
|
162
|
+
}
|
|
163
|
+
// ============================================================================
|
|
53
164
|
// CI Account Methods
|
|
54
165
|
// ============================================================================
|
|
55
166
|
async ciAccountCreate(params) {
|
|
@@ -105,16 +216,28 @@ export class HyperdriveSigV4Service extends SigV4ApiClient {
|
|
|
105
216
|
// Hook Methods
|
|
106
217
|
// ============================================================================
|
|
107
218
|
async hookCreate(projectId, body) {
|
|
108
|
-
return this.makeSignedRequest('POST', `/hyperdrive/projects/${encodeURIComponent(projectId)}/hooks`, body);
|
|
219
|
+
return this.makeSignedRequest('POST', `/hyperdrive/projects/${encodeURIComponent(projectId)}/hooks`, body, this.projectsApiUrl);
|
|
220
|
+
}
|
|
221
|
+
async hookCreateV2(projectId, body) {
|
|
222
|
+
return this.makeSignedRequest('POST', `/hyperdrive/projects/${encodeURIComponent(projectId)}/hooks`, body, this.projectsApiUrl);
|
|
109
223
|
}
|
|
110
224
|
async hookDelete(projectId, hookId) {
|
|
111
|
-
return this.makeSignedRequest('DELETE', `/hyperdrive/projects/${encodeURIComponent(projectId)}/hooks/${encodeURIComponent(hookId)}
|
|
225
|
+
return this.makeSignedRequest('DELETE', `/hyperdrive/projects/${encodeURIComponent(projectId)}/hooks/${encodeURIComponent(hookId)}`, undefined, this.projectsApiUrl);
|
|
112
226
|
}
|
|
113
227
|
async hookList(projectId) {
|
|
114
|
-
return this.makeSignedRequest('GET', `/hyperdrive/projects/${encodeURIComponent(projectId)}/hooks
|
|
228
|
+
return this.makeSignedRequest('GET', `/hyperdrive/projects/${encodeURIComponent(projectId)}/hooks`, undefined, this.projectsApiUrl);
|
|
229
|
+
}
|
|
230
|
+
async hookLogList(projectId, options) {
|
|
231
|
+
const params = new URLSearchParams();
|
|
232
|
+
if (options?.limit)
|
|
233
|
+
params.set('limit', String(options.limit));
|
|
234
|
+
if (options?.status)
|
|
235
|
+
params.set('status', options.status);
|
|
236
|
+
const qs = params.toString() ? `?${params.toString()}` : '';
|
|
237
|
+
return this.makeSignedRequest('GET', `/hyperdrive/projects/${encodeURIComponent(projectId)}/hook-logs${qs}`, undefined, this.projectsApiUrl);
|
|
115
238
|
}
|
|
116
239
|
async hookUpdate(projectId, hookId, body) {
|
|
117
|
-
return this.makeSignedRequest('PATCH', `/hyperdrive/projects/${encodeURIComponent(projectId)}/hooks/${encodeURIComponent(hookId)}`, body);
|
|
240
|
+
return this.makeSignedRequest('PATCH', `/hyperdrive/projects/${encodeURIComponent(projectId)}/hooks/${encodeURIComponent(hookId)}`, body, this.projectsApiUrl);
|
|
118
241
|
}
|
|
119
242
|
async projectGetJiraStatuses(projectId) {
|
|
120
243
|
return this.makeSignedRequest('GET', `/hyperdrive/projects/${encodeURIComponent(projectId)}/jira/statuses`);
|
|
@@ -126,31 +249,31 @@ export class HyperdriveSigV4Service extends SigV4ApiClient {
|
|
|
126
249
|
return this.makeSignedRequest('GET', `/hyperdrive/jira/projects/${encodeURIComponent(jiraProjectKey)}/statuses`);
|
|
127
250
|
}
|
|
128
251
|
async jiraPreRegister(params) {
|
|
129
|
-
return this.makeSignedRequest('POST', '/hyperdrive/jira/pre-register', params);
|
|
252
|
+
return this.makeSignedRequest('POST', '/hyperdrive/jira/pre-register', params, this.projectsApiUrl);
|
|
130
253
|
}
|
|
131
254
|
// ============================================================================
|
|
132
255
|
// Hyperdrive Project Methods
|
|
133
256
|
// ============================================================================
|
|
134
257
|
async projectAddRepo(projectId, repo) {
|
|
135
|
-
return this.makeSignedRequest('POST', `/hyperdrive/projects/${encodeURIComponent(projectId)}/repos`, repo);
|
|
258
|
+
return this.makeSignedRequest('POST', `/hyperdrive/projects/${encodeURIComponent(projectId)}/repos`, repo, this.projectsApiUrl);
|
|
136
259
|
}
|
|
137
260
|
async projectFindByJiraKey(jiraProjectKey) {
|
|
138
|
-
return this.makeSignedRequest('GET', `/hyperdrive/projects/by-jira-key/${encodeURIComponent(jiraProjectKey)}
|
|
261
|
+
return this.makeSignedRequest('GET', `/hyperdrive/projects/by-jira-key/${encodeURIComponent(jiraProjectKey)}`, undefined, this.projectsApiUrl);
|
|
139
262
|
}
|
|
140
263
|
async projectGetJiraConfig(projectId) {
|
|
141
|
-
return this.makeSignedRequest('GET', `/hyperdrive/projects/${encodeURIComponent(projectId)}/jira-config
|
|
264
|
+
return this.makeSignedRequest('GET', `/hyperdrive/projects/${encodeURIComponent(projectId)}/jira-config`, undefined, this.projectsApiUrl);
|
|
142
265
|
}
|
|
143
266
|
async projectListRepos(projectId) {
|
|
144
|
-
return this.makeSignedRequest('GET', `/hyperdrive/projects/${encodeURIComponent(projectId)}/repos
|
|
267
|
+
return this.makeSignedRequest('GET', `/hyperdrive/projects/${encodeURIComponent(projectId)}/repos`, undefined, this.projectsApiUrl);
|
|
145
268
|
}
|
|
146
269
|
async projectSetJiraConfig(projectId, config) {
|
|
147
|
-
return this.makeSignedRequest('PUT', `/hyperdrive/projects/${encodeURIComponent(projectId)}/jira-config`, config);
|
|
270
|
+
return this.makeSignedRequest('PUT', `/hyperdrive/projects/${encodeURIComponent(projectId)}/jira-config`, config, this.projectsApiUrl);
|
|
148
271
|
}
|
|
149
272
|
async projectUpdateRepo(projectId, repoId, updateData) {
|
|
150
|
-
return this.makeSignedRequest('PATCH', `/hyperdrive/projects/${encodeURIComponent(projectId)}/repos/${encodeURIComponent(repoId)}`, updateData);
|
|
273
|
+
return this.makeSignedRequest('PATCH', `/hyperdrive/projects/${encodeURIComponent(projectId)}/repos/${encodeURIComponent(repoId)}`, updateData, this.projectsApiUrl);
|
|
151
274
|
}
|
|
152
275
|
async projectUpdateEntities(projectId, repoId, entities) {
|
|
153
|
-
return this.makeSignedRequest('PUT', `/hyperdrive/projects/${encodeURIComponent(projectId)}/repos/${encodeURIComponent(repoId)}/entities`, entities);
|
|
276
|
+
return this.makeSignedRequest('PUT', `/hyperdrive/projects/${encodeURIComponent(projectId)}/repos/${encodeURIComponent(repoId)}/entities`, entities, this.projectsApiUrl);
|
|
154
277
|
}
|
|
155
278
|
// ============================================================================
|
|
156
279
|
// Module Methods
|
|
@@ -252,6 +375,12 @@ export class HyperdriveSigV4Service extends SigV4ApiClient {
|
|
|
252
375
|
return this.makeSignedRequest('DELETE', `/stages/${stageName}/access/${targetType}/${targetId}`);
|
|
253
376
|
}
|
|
254
377
|
// ============================================================================
|
|
378
|
+
// Domain Methods
|
|
379
|
+
// ============================================================================
|
|
380
|
+
async domainSetProduction(params) {
|
|
381
|
+
return this.makeSignedRequest('PUT', '/hyperdrive/domains/production', params);
|
|
382
|
+
}
|
|
383
|
+
// ============================================================================
|
|
255
384
|
// User Groups Methods
|
|
256
385
|
// ============================================================================
|
|
257
386
|
async groupList() {
|
|
@@ -8,8 +8,8 @@ export interface TenantConfig {
|
|
|
8
8
|
region: string;
|
|
9
9
|
tenantDomain: string;
|
|
10
10
|
tenantId: string;
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
/** All additional API URLs from bootstrap, keyed by module name */
|
|
12
|
+
additionalApiUrls?: Record<string, string>;
|
|
13
13
|
}
|
|
14
14
|
export interface CLIConfig {
|
|
15
15
|
apiUrl?: string;
|
|
@@ -102,15 +102,12 @@ export declare class TenantService {
|
|
|
102
102
|
*/
|
|
103
103
|
private getApiUrl;
|
|
104
104
|
/**
|
|
105
|
-
*
|
|
106
|
-
* Returns
|
|
105
|
+
* Extract all additional API URLs from bootstrap REST config.
|
|
106
|
+
* Returns a map of module name → endpoint URL for every REST API
|
|
107
|
+
* beyond the primary 'hyperdrive' endpoint. Services self-serve
|
|
108
|
+
* by looking up the key they need (e.g., 'hyperdrive-projects', 'user-groups').
|
|
107
109
|
*/
|
|
108
|
-
private
|
|
109
|
-
/**
|
|
110
|
-
* Get User Groups API URL from bootstrap config
|
|
111
|
-
* Returns undefined if not available (optional module)
|
|
112
|
-
*/
|
|
113
|
-
private getUserGroupsApiUrl;
|
|
110
|
+
private extractAdditionalApiUrls;
|
|
114
111
|
/**
|
|
115
112
|
* Get bootstrap URL with fallback chain:
|
|
116
113
|
* 1. Environment variable
|