@shipdit/cli 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +148 -97
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -378,10 +378,11 @@ const _$1 = (...t) => hc(...t);
|
|
|
378
378
|
const v$1 = (...t) => hc(...t);
|
|
379
379
|
const y$1 = (...t) => hc(...t);
|
|
380
380
|
const b$1 = (...t) => hc(...t);
|
|
381
|
-
|
|
381
|
+
const x$1 = (...t) => hc(...t);
|
|
382
|
+
function S$1(e) {
|
|
382
383
|
return `${e.replace(/\/+$/, ``)}/api/v1/rpc`;
|
|
383
384
|
}
|
|
384
|
-
function
|
|
385
|
+
function C$1(e) {
|
|
385
386
|
return {
|
|
386
387
|
...e.fetch ? { fetch: e.fetch } : {},
|
|
387
388
|
init: { credentials: e.client === `dashboard` ? `include` : `same-origin` },
|
|
@@ -391,129 +392,142 @@ function S$1(e) {
|
|
|
391
392
|
}
|
|
392
393
|
};
|
|
393
394
|
}
|
|
394
|
-
async function
|
|
395
|
+
async function w$1(e, t) {
|
|
395
396
|
return i$1(await e({ json: t }));
|
|
396
397
|
}
|
|
397
|
-
function
|
|
398
|
-
let t =
|
|
398
|
+
function T$1(e) {
|
|
399
|
+
let t = S$1(e.baseUrl), n = C$1(e), r = a$1(t, n), i = o$1(t, n), T = s$1(t, n), E = c$1(t, n), D = l$1(t, n), O = u$1(t, n), k = d$2(t, n), A = f$2(t, n), j = g$1(t, n), M = h$1(t, n), N = p$1(t, n), P = m$1(t, n), F = _$1(t, n), I = v$1(t, n), L = y$1(t, n), R = b$1(t, n), z = x$1(t, n);
|
|
399
400
|
return {
|
|
400
401
|
me: {
|
|
401
|
-
get: (e = {}) =>
|
|
402
|
-
feedback: (e) =>
|
|
402
|
+
get: (e = {}) => w$1(r.me.$post, e),
|
|
403
|
+
feedback: (e) => w$1(r.me.feedback.$post, e)
|
|
403
404
|
},
|
|
404
405
|
project: {
|
|
405
|
-
list: (e = {}) =>
|
|
406
|
-
create: (e) =>
|
|
407
|
-
update: (e) =>
|
|
408
|
-
archive: (e) =>
|
|
409
|
-
listTeams: (e) =>
|
|
410
|
-
setTeams: (e) =>
|
|
406
|
+
list: (e = {}) => w$1(i.project.list.$post, e),
|
|
407
|
+
create: (e) => w$1(i.project.create.$post, e),
|
|
408
|
+
update: (e) => w$1(i.project.update.$post, e),
|
|
409
|
+
archive: (e) => w$1(i.project.archive.$post, e),
|
|
410
|
+
listTeams: (e) => w$1(i.project.listTeams.$post, e),
|
|
411
|
+
setTeams: (e) => w$1(i.project.setTeams.$post, e)
|
|
411
412
|
},
|
|
412
|
-
team: { listMembers: (e) =>
|
|
413
|
+
team: { listMembers: (e) => w$1(R.team.listMembers.$post, e) },
|
|
413
414
|
environment: {
|
|
414
|
-
list: (e) =>
|
|
415
|
-
create: (e) =>
|
|
416
|
-
update: (e) =>
|
|
417
|
-
archive: (e) =>
|
|
415
|
+
list: (e) => w$1(T.environment.list.$post, e),
|
|
416
|
+
create: (e) => w$1(T.environment.create.$post, e),
|
|
417
|
+
update: (e) => w$1(T.environment.update.$post, e),
|
|
418
|
+
archive: (e) => w$1(T.environment.archive.$post, e)
|
|
418
419
|
},
|
|
419
420
|
flag: {
|
|
420
|
-
list: (e) =>
|
|
421
|
-
get: (e) =>
|
|
422
|
-
create: (e) =>
|
|
423
|
-
update: (e) =>
|
|
424
|
-
archive: (e) =>
|
|
425
|
-
updateEnvironment: (e) =>
|
|
426
|
-
toggleEnvironment: (e) =>
|
|
427
|
-
listEnvironmentStates: (e) =>
|
|
428
|
-
pull: (e) =>
|
|
429
|
-
diff: (e) =>
|
|
430
|
-
push: (e) =>
|
|
421
|
+
list: (e) => w$1(E.flag.list.$post, e),
|
|
422
|
+
get: (e) => w$1(E.flag.get.$post, e),
|
|
423
|
+
create: (e) => w$1(E.flag.create.$post, e),
|
|
424
|
+
update: (e) => w$1(E.flag.update.$post, e),
|
|
425
|
+
archive: (e) => w$1(E.flag.archive.$post, e),
|
|
426
|
+
updateEnvironment: (e) => w$1(E.flag.updateEnvironment.$post, e),
|
|
427
|
+
toggleEnvironment: (e) => w$1(E.flag.toggleEnvironment.$post, e),
|
|
428
|
+
listEnvironmentStates: (e) => w$1(E.flag.listEnvironmentStates.$post, e),
|
|
429
|
+
pull: (e) => w$1(E.flag.pull.$post, e),
|
|
430
|
+
diff: (e) => w$1(E.flag.diff.$post, e),
|
|
431
|
+
push: (e) => w$1(E.flag.push.$post, e)
|
|
431
432
|
},
|
|
432
433
|
apiKey: {
|
|
433
|
-
list: (e = {}) =>
|
|
434
|
-
create: (e) =>
|
|
435
|
-
revoke: (e) =>
|
|
434
|
+
list: (e = {}) => w$1(D.apiKey.list.$post, e),
|
|
435
|
+
create: (e) => w$1(D.apiKey.create.$post, e),
|
|
436
|
+
revoke: (e) => w$1(D.apiKey.revoke.$post, e)
|
|
436
437
|
},
|
|
437
438
|
sdkKey: {
|
|
438
|
-
list: (e = {}) =>
|
|
439
|
-
create: (e) =>
|
|
440
|
-
revoke: (e) =>
|
|
439
|
+
list: (e = {}) => w$1(A.sdkKey.list.$post, e),
|
|
440
|
+
create: (e) => w$1(A.sdkKey.create.$post, e),
|
|
441
|
+
revoke: (e) => w$1(A.sdkKey.revoke.$post, e)
|
|
442
|
+
},
|
|
443
|
+
serviceAccount: {
|
|
444
|
+
list: (e = {}) => w$1(j.serviceAccount.list.$post, e),
|
|
445
|
+
get: (e) => w$1(j.serviceAccount.get.$post, e),
|
|
446
|
+
create: (e) => w$1(j.serviceAccount.create.$post, e),
|
|
447
|
+
update: (e) => w$1(j.serviceAccount.update.$post, e),
|
|
448
|
+
disable: (e) => w$1(j.serviceAccount.disable.$post, e),
|
|
449
|
+
enable: (e) => w$1(j.serviceAccount.enable.$post, e),
|
|
450
|
+
delete: (e) => w$1(j.serviceAccount.delete.$post, e),
|
|
451
|
+
createToken: (e) => w$1(j.serviceAccount.createToken.$post, e),
|
|
452
|
+
listTokens: (e) => w$1(j.serviceAccount.listTokens.$post, e),
|
|
453
|
+
revokeToken: (e) => w$1(j.serviceAccount.revokeToken.$post, e)
|
|
441
454
|
},
|
|
442
455
|
segment: {
|
|
443
|
-
list: (e) =>
|
|
444
|
-
get: (e) =>
|
|
445
|
-
create: (e) =>
|
|
446
|
-
update: (e) =>
|
|
447
|
-
archive: (e) =>
|
|
448
|
-
listEnvironmentStates: (e) =>
|
|
449
|
-
updateEnvironment: (e) =>
|
|
456
|
+
list: (e) => w$1(M.segment.list.$post, e),
|
|
457
|
+
get: (e) => w$1(M.segment.get.$post, e),
|
|
458
|
+
create: (e) => w$1(M.segment.create.$post, e),
|
|
459
|
+
update: (e) => w$1(M.segment.update.$post, e),
|
|
460
|
+
archive: (e) => w$1(M.segment.archive.$post, e),
|
|
461
|
+
listEnvironmentStates: (e) => w$1(M.segment.listEnvironmentStates.$post, e),
|
|
462
|
+
updateEnvironment: (e) => w$1(M.segment.updateEnvironment.$post, e)
|
|
450
463
|
},
|
|
451
464
|
evaluatedEntity: {
|
|
452
|
-
list: (e) =>
|
|
453
|
-
get: (e) =>
|
|
454
|
-
delete: (e) =>
|
|
465
|
+
list: (e) => w$1(N.evaluatedEntity.list.$post, e),
|
|
466
|
+
get: (e) => w$1(N.evaluatedEntity.get.$post, e),
|
|
467
|
+
delete: (e) => w$1(N.evaluatedEntity.delete.$post, e)
|
|
455
468
|
},
|
|
456
469
|
evaluationFact: {
|
|
457
|
-
list: (e) =>
|
|
458
|
-
byRule: (e) =>
|
|
459
|
-
orgSummary: (e = {}) =>
|
|
460
|
-
projectSummary: (e) =>
|
|
461
|
-
simulate: (e) =>
|
|
470
|
+
list: (e) => w$1(P.evaluationFact.list.$post, e),
|
|
471
|
+
byRule: (e) => w$1(P.evaluationFact.byRule.$post, e),
|
|
472
|
+
orgSummary: (e = {}) => w$1(P.evaluationFact.orgSummary.$post, e),
|
|
473
|
+
projectSummary: (e) => w$1(P.evaluationFact.projectSummary.$post, e),
|
|
474
|
+
simulate: (e) => w$1(P.evaluationFact.simulate.$post, e)
|
|
462
475
|
},
|
|
463
|
-
snapshot: { publish: (e) =>
|
|
464
|
-
device: { authorize: (e) =>
|
|
476
|
+
snapshot: { publish: (e) => w$1(F.snapshot.publish.$post, e) },
|
|
477
|
+
device: { authorize: (e) => w$1(I.device.authorize.$post, e) },
|
|
465
478
|
billing: {
|
|
466
|
-
get: (e = {}) =>
|
|
467
|
-
attach: (e) =>
|
|
468
|
-
openPortal: (e) =>
|
|
479
|
+
get: (e = {}) => w$1(L.billing.get.$post, e),
|
|
480
|
+
attach: (e) => w$1(L.billing.attach.$post, e),
|
|
481
|
+
openPortal: (e) => w$1(L.billing.openPortal.$post, e)
|
|
469
482
|
},
|
|
470
483
|
approval: {
|
|
471
|
-
listPolicies: (e = {}) =>
|
|
472
|
-
createPolicy: (e) =>
|
|
473
|
-
updatePolicy: (e) =>
|
|
474
|
-
deletePolicy: (e) =>
|
|
475
|
-
listRequests: (e = {}) =>
|
|
476
|
-
get: (e) =>
|
|
477
|
-
approve: (e) =>
|
|
478
|
-
reject: (e) =>
|
|
479
|
-
cancel: (e) =>
|
|
484
|
+
listPolicies: (e = {}) => w$1(O.approval.listPolicies.$post, e),
|
|
485
|
+
createPolicy: (e) => w$1(O.approval.createPolicy.$post, e),
|
|
486
|
+
updatePolicy: (e) => w$1(O.approval.updatePolicy.$post, e),
|
|
487
|
+
deletePolicy: (e) => w$1(O.approval.deletePolicy.$post, e),
|
|
488
|
+
listRequests: (e = {}) => w$1(O.approval.listRequests.$post, e),
|
|
489
|
+
get: (e) => w$1(O.approval.get.$post, e),
|
|
490
|
+
approve: (e) => w$1(O.approval.approve.$post, e),
|
|
491
|
+
reject: (e) => w$1(O.approval.reject.$post, e),
|
|
492
|
+
cancel: (e) => w$1(O.approval.cancel.$post, e)
|
|
480
493
|
},
|
|
481
494
|
audit: {
|
|
482
|
-
list: (e = {}) =>
|
|
483
|
-
get: (e) =>
|
|
484
|
-
actions: (e = {}) =>
|
|
485
|
-
export: (e) =>
|
|
486
|
-
getSettings: (e = {}) =>
|
|
487
|
-
updateSettings: (e) =>
|
|
488
|
-
listDestinations: (e = {}) =>
|
|
489
|
-
createDestination: (e) =>
|
|
490
|
-
updateDestination: (e) =>
|
|
491
|
-
deleteDestination: (e) =>
|
|
492
|
-
testDestination: (e) =>
|
|
495
|
+
list: (e = {}) => w$1(k.audit.list.$post, e),
|
|
496
|
+
get: (e) => w$1(k.audit.get.$post, e),
|
|
497
|
+
actions: (e = {}) => w$1(k.audit.actions.$post, e),
|
|
498
|
+
export: (e) => w$1(k.audit.export.$post, e),
|
|
499
|
+
getSettings: (e = {}) => w$1(k.audit.getSettings.$post, e),
|
|
500
|
+
updateSettings: (e) => w$1(k.audit.updateSettings.$post, e),
|
|
501
|
+
listDestinations: (e = {}) => w$1(k.audit.listDestinations.$post, e),
|
|
502
|
+
createDestination: (e) => w$1(k.audit.createDestination.$post, e),
|
|
503
|
+
updateDestination: (e) => w$1(k.audit.updateDestination.$post, e),
|
|
504
|
+
deleteDestination: (e) => w$1(k.audit.deleteDestination.$post, e),
|
|
505
|
+
testDestination: (e) => w$1(k.audit.testDestination.$post, e)
|
|
493
506
|
},
|
|
494
507
|
sso: {
|
|
495
|
-
getSettings: (e = {}) =>
|
|
496
|
-
listProviders: (e = {}) =>
|
|
497
|
-
updateAllowedDomains: (e) =>
|
|
498
|
-
setEnforcement: (e) =>
|
|
508
|
+
getSettings: (e = {}) => w$1(z.sso.getSettings.$post, e),
|
|
509
|
+
listProviders: (e = {}) => w$1(z.sso.listProviders.$post, e),
|
|
510
|
+
updateAllowedDomains: (e) => w$1(z.sso.updateAllowedDomains.$post, e),
|
|
511
|
+
setEnforcement: (e) => w$1(z.sso.setEnforcement.$post, e)
|
|
499
512
|
},
|
|
500
513
|
raw: {
|
|
501
514
|
me: r,
|
|
502
515
|
project: i,
|
|
503
|
-
environment:
|
|
504
|
-
flag:
|
|
505
|
-
apiKey:
|
|
506
|
-
approval:
|
|
507
|
-
audit:
|
|
508
|
-
sdkKey:
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
516
|
+
environment: T,
|
|
517
|
+
flag: E,
|
|
518
|
+
apiKey: D,
|
|
519
|
+
approval: O,
|
|
520
|
+
audit: k,
|
|
521
|
+
sdkKey: A,
|
|
522
|
+
serviceAccount: j,
|
|
523
|
+
segment: M,
|
|
524
|
+
evaluatedEntity: N,
|
|
525
|
+
evaluationFact: P,
|
|
526
|
+
snapshot: F,
|
|
527
|
+
device: I,
|
|
528
|
+
billing: L,
|
|
529
|
+
team: R,
|
|
530
|
+
sso: z
|
|
517
531
|
}
|
|
518
532
|
};
|
|
519
533
|
}
|
|
@@ -1860,6 +1874,18 @@ const t$1 = createAccessControl({
|
|
|
1860
1874
|
`read`,
|
|
1861
1875
|
`manage`,
|
|
1862
1876
|
`enforce`
|
|
1877
|
+
],
|
|
1878
|
+
service_account: [
|
|
1879
|
+
`create`,
|
|
1880
|
+
`read`,
|
|
1881
|
+
`update`,
|
|
1882
|
+
`disable`,
|
|
1883
|
+
`delete`
|
|
1884
|
+
],
|
|
1885
|
+
service_account_token: [
|
|
1886
|
+
`create`,
|
|
1887
|
+
`read`,
|
|
1888
|
+
`revoke`
|
|
1863
1889
|
]
|
|
1864
1890
|
});
|
|
1865
1891
|
const n$1 = {
|
|
@@ -1944,7 +1970,19 @@ const n$1 = {
|
|
|
1944
1970
|
],
|
|
1945
1971
|
evaluated_entity: [`read`, `delete`],
|
|
1946
1972
|
billing: [`read`, `manage`],
|
|
1947
|
-
sso: [`read`, `manage`]
|
|
1973
|
+
sso: [`read`, `manage`],
|
|
1974
|
+
service_account: [
|
|
1975
|
+
`create`,
|
|
1976
|
+
`read`,
|
|
1977
|
+
`update`,
|
|
1978
|
+
`disable`,
|
|
1979
|
+
`delete`
|
|
1980
|
+
],
|
|
1981
|
+
service_account_token: [
|
|
1982
|
+
`create`,
|
|
1983
|
+
`read`,
|
|
1984
|
+
`revoke`
|
|
1985
|
+
]
|
|
1948
1986
|
}),
|
|
1949
1987
|
owner: t$1.newRole({
|
|
1950
1988
|
organization: [`update`, `delete`],
|
|
@@ -2002,6 +2040,18 @@ const n$1 = {
|
|
|
2002
2040
|
`read`,
|
|
2003
2041
|
`manage`,
|
|
2004
2042
|
`enforce`
|
|
2043
|
+
],
|
|
2044
|
+
service_account: [
|
|
2045
|
+
`create`,
|
|
2046
|
+
`read`,
|
|
2047
|
+
`update`,
|
|
2048
|
+
`disable`,
|
|
2049
|
+
`delete`
|
|
2050
|
+
],
|
|
2051
|
+
service_account_token: [
|
|
2052
|
+
`create`,
|
|
2053
|
+
`read`,
|
|
2054
|
+
`revoke`
|
|
2005
2055
|
]
|
|
2006
2056
|
})
|
|
2007
2057
|
};
|
|
@@ -4036,7 +4086,7 @@ async function createCliApiClient(runtime) {
|
|
|
4036
4086
|
sessionToken,
|
|
4037
4087
|
orgSlug: runtime.org
|
|
4038
4088
|
});
|
|
4039
|
-
const client =
|
|
4089
|
+
const client = T$1({
|
|
4040
4090
|
baseUrl: runtime.apiUrl,
|
|
4041
4091
|
client: "cli",
|
|
4042
4092
|
getHeaders: () => {
|
|
@@ -4073,7 +4123,7 @@ async function resolveProjectId(client, runtime) {
|
|
|
4073
4123
|
if (!match) throw new CliError("not_found", `Project not found: ${runtime.project}`);
|
|
4074
4124
|
projectId = match.id;
|
|
4075
4125
|
}
|
|
4076
|
-
if (!projectId) throw new CliError("validation_error", "Project is required. Pass --project, set SHIPD_PROJECT, or use
|
|
4126
|
+
if (!projectId) throw new CliError("validation_error", "Project is required. Pass --project, set SHIPD_PROJECT, or use a management key / service-account token bound to a project.");
|
|
4077
4127
|
return {
|
|
4078
4128
|
organizationId: me.organization.id,
|
|
4079
4129
|
projectId
|
|
@@ -4087,7 +4137,7 @@ async function resolveIds(client, runtime) {
|
|
|
4087
4137
|
if (!match) throw new CliError("not_found", `Environment not found: ${runtime.env}`);
|
|
4088
4138
|
environmentId = match.id;
|
|
4089
4139
|
}
|
|
4090
|
-
if (!environmentId) throw new CliError("validation_error", "Environment is required. Pass --env, set SHIPD_ENV, or use
|
|
4140
|
+
if (!environmentId) throw new CliError("validation_error", "Environment is required. Pass --env, set SHIPD_ENV, or use a management key / service-account token bound to an environment.");
|
|
4091
4141
|
return {
|
|
4092
4142
|
organizationId,
|
|
4093
4143
|
projectId,
|
|
@@ -4213,6 +4263,7 @@ function registerAuthCommands(program) {
|
|
|
4213
4263
|
return;
|
|
4214
4264
|
}
|
|
4215
4265
|
if (me.auth.type === "user") console.log(`User: ${me.auth.name} <${me.auth.email}>`);
|
|
4266
|
+
else if (me.auth.type === "service_account") console.log(`Service account: ${me.auth.serviceAccountId} (token ${me.auth.tokenId})`);
|
|
4216
4267
|
else console.log(`API key: ${me.auth.keyId}`);
|
|
4217
4268
|
console.log(`Organization: ${me.organization.slug} (${me.organization.id})`);
|
|
4218
4269
|
if (me.project) console.log(`Project: ${me.project.slug} (${me.project.id})`);
|