@madewithremy/admin 0.1.58 → 0.1.59

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.
@@ -1,5 +1,7 @@
1
1
  /**
2
- * App secrets operations: list, read, write, and delete encrypted key/value pairs.
2
+ * App secrets operations: list, write and delete encrypted key/value pairs.
3
+ * Values are write-only: no op reads one back, and the app's code gets them as
4
+ * environment variables.
3
5
  *
4
6
  * `SecretsSetParams` allows `null` values to explicitly clear an environment's
5
7
  * stored value (mapped from the CLI's `--dev-clear` / `--prod-clear` flags).
@@ -9,26 +11,16 @@
9
11
  * AdminTimeoutError. No printing, no process coupling.
10
12
  */
11
13
  import type { AdminContext } from '../ctx.js';
12
- import type { SecretsListResult, SecretsGetResult, SecretsSetResult, SecretsDeleteResult } from '../types/secrets.js';
14
+ import type { SecretsListResult, SecretsSetResult, SecretsDeleteResult } from '../types/secrets.js';
13
15
  /**
14
- * List all secret keys for the app (values are not returned — use `get` to
15
- * retrieve decrypted values for a specific key).
16
+ * List all secret keys for the app, with which environments have a value.
17
+ * Values are never returned, by this or any op.
16
18
  *
17
19
  * @example
18
20
  * const { secrets } = await admin.secrets.list();
19
21
  * const withProd = secrets.filter((s) => s.hasProdValue);
20
22
  */
21
23
  export declare function list(ctx: AdminContext): Promise<SecretsListResult>;
22
- /**
23
- * Get the decrypted dev and prod values for a secret key.
24
- *
25
- * This call is audited as a `secret.reveal` event on the workspace.
26
- *
27
- * @throws AdminApiError `secret_not_found` (404).
28
- * @example
29
- * const { devValue, prodValue } = await admin.secrets.get('STRIPE_SECRET_KEY');
30
- */
31
- export declare function get(ctx: AdminContext, key: string): Promise<SecretsGetResult>;
32
24
  export interface SecretsSetParams {
33
25
  /**
34
26
  * Value for the dev environment; `null` clears the stored dev value;
package/dist/prod.js CHANGED
@@ -2439,13 +2439,6 @@ function list6(ctx) {
2439
2439
  `/_internal/v2/apps/${ctx.appId}/secrets`
2440
2440
  );
2441
2441
  }
2442
- function get5(ctx, key) {
2443
- return call(
2444
- ctx,
2445
- "GET",
2446
- `/_internal/v2/apps/${ctx.appId}/secrets/${seg(key)}`
2447
- );
2448
- }
2449
2442
  function set2(ctx, key, params) {
2450
2443
  const body = {};
2451
2444
  if ("devValue" in params) {
@@ -2474,10 +2467,6 @@ var secretsSpecs = {
2474
2467
  "secrets list": {
2475
2468
  usage: "Usage: remy-admin secrets list"
2476
2469
  },
2477
- "secrets get": {
2478
- usage: "Usage: remy-admin secrets get <KEY>",
2479
- positionals: [{ name: "key", required: true }]
2480
- },
2481
2470
  "secrets set": {
2482
2471
  usage: "Usage: remy-admin secrets set <KEY> [--dev <value>] [--prod <value>] [--dev-clear] [--prod-clear]",
2483
2472
  positionals: [{ name: "key", required: true }],
@@ -2500,9 +2489,6 @@ var secretsSpecs = {
2500
2489
  async function secretsList(ctx) {
2501
2490
  out(await list6(ctx));
2502
2491
  }
2503
- async function secretsGet(ctx, a) {
2504
- out(await get5(ctx, a.req("key")));
2505
- }
2506
2492
  async function secretsSet(ctx, a) {
2507
2493
  const key = a.req("key");
2508
2494
  const dev = a.str("dev");
@@ -2532,7 +2518,6 @@ async function secretsDelete(ctx, a) {
2532
2518
  }
2533
2519
  var secretsHandlers = {
2534
2520
  "secrets list": secretsList,
2535
- "secrets get": secretsGet,
2536
2521
  "secrets set": secretsSet,
2537
2522
  "secrets delete": secretsDelete
2538
2523
  };
@@ -2540,13 +2525,11 @@ var secretsHelp = `remy-admin secrets \u2014 Manage app secrets (environment var
2540
2525
 
2541
2526
  Subcommands:
2542
2527
  list List all secret keys (values are not shown, only which environments have values)
2543
- get Get decrypted values for a secret
2544
2528
  set Create or update a secret's value for dev and/or prod
2545
2529
  delete Delete a secret entirely (both dev and prod values)
2546
2530
 
2547
2531
  Usage:
2548
2532
  remy-admin secrets list
2549
- remy-admin secrets get <KEY>
2550
2533
  remy-admin secrets set <KEY> [--dev <value>] [--prod <value>] [--dev-clear] [--prod-clear]
2551
2534
  remy-admin secrets delete <KEY>
2552
2535
 
@@ -2559,13 +2542,14 @@ The set command updates only the environments you specify:
2559
2542
 
2560
2543
  Examples:
2561
2544
  remy-admin secrets list
2562
- remy-admin secrets get STRIPE_SECRET_KEY
2563
2545
  remy-admin secrets set STRIPE_SECRET_KEY --dev sk_test_abc --prod sk_live_xyz
2564
2546
  remy-admin secrets set OPENAI_API_KEY --prod sk-abc123
2565
2547
  remy-admin secrets set OLD_KEY --prod-clear
2566
2548
  remy-admin secrets delete OLD_KEY
2567
2549
 
2568
2550
  Notes:
2551
+ - Values are write-only: nothing reads one back once it's saved. The app's
2552
+ code gets them as environment variables; to change one, set it again.
2569
2553
  - If a value starts with a dash, use the '=' form so it isn't read as a flag:
2570
2554
  remy-admin secrets set KEY --prod=-abc123`;
2571
2555
 
@@ -3007,7 +2991,7 @@ function filed(ctx, params = {}) {
3007
2991
  `/_internal/v2/apps/${ctx.appId}/issues/filed${listQuery(params)}`
3008
2992
  );
3009
2993
  }
3010
- function get6(ctx, number) {
2994
+ function get5(ctx, number) {
3011
2995
  return call(
3012
2996
  ctx,
3013
2997
  "GET",
@@ -3219,7 +3203,7 @@ async function issuesFiled(ctx, a) {
3219
3203
  );
3220
3204
  }
3221
3205
  async function issuesGet(ctx, a) {
3222
- out(await get6(ctx, a.req("number")));
3206
+ out(await get5(ctx, a.req("number")));
3223
3207
  }
3224
3208
  async function issuesCreate(ctx, a) {
3225
3209
  const issueBody = readBodyFlag(a);
@@ -4420,7 +4404,7 @@ function list11(ctx, params) {
4420
4404
  `${base2(ctx.appId)}${qs({ slug: params?.slug })}`
4421
4405
  );
4422
4406
  }
4423
- function get7(ctx, params) {
4407
+ function get6(ctx, params) {
4424
4408
  return call(
4425
4409
  ctx,
4426
4410
  "GET",
@@ -4484,7 +4468,7 @@ function waitForJob(ctx, params) {
4484
4468
  async function settle(ctx, params, isSettled) {
4485
4469
  const timeoutMs = params.timeoutMs ?? DEFAULT_WAIT_TIMEOUT_MS2;
4486
4470
  const outcome = await pollUntil(
4487
- async () => (await get7(ctx, { id: params.id })).job,
4471
+ async () => (await get6(ctx, { id: params.id })).job,
4488
4472
  isSettled,
4489
4473
  {
4490
4474
  timeoutMs,
@@ -4633,7 +4617,7 @@ function connect(ctx, params) {
4633
4617
  }
4634
4618
  );
4635
4619
  }
4636
- function get8(ctx, params) {
4620
+ function get7(ctx, params) {
4637
4621
  return call(
4638
4622
  ctx,
4639
4623
  "GET",
@@ -4740,7 +4724,7 @@ async function connect2(ctx, a) {
4740
4724
  }
4741
4725
  async function show(ctx, a) {
4742
4726
  const slug = sourceOf(a);
4743
- out({ dataSource: slug, ...await get8(ctx, { slug }) });
4727
+ out({ dataSource: slug, ...await get7(ctx, { slug }) });
4744
4728
  }
4745
4729
  async function disconnect2(ctx, a) {
4746
4730
  const slug = a.str("source");
@@ -5834,7 +5818,7 @@ async function jobsList(ctx, a) {
5834
5818
  async function jobsStatus(ctx, a) {
5835
5819
  const id = a.req("id");
5836
5820
  if (!a.bool("wait")) {
5837
- out(await get7(ctx, { id }));
5821
+ out(await get6(ctx, { id }));
5838
5822
  return;
5839
5823
  }
5840
5824
  await waitAndReport(ctx, a, id, "job", { action: "status" });
@@ -7851,7 +7835,7 @@ function list12(ctx, params = {}) {
7851
7835
  `/_internal/v2/apps/${ctx.appId}/task-traces${qs(params)}`
7852
7836
  );
7853
7837
  }
7854
- function get9(ctx, traceId) {
7838
+ function get8(ctx, traceId) {
7855
7839
  return call(
7856
7840
  ctx,
7857
7841
  "GET",
@@ -7881,12 +7865,12 @@ async function list13(ctx, a) {
7881
7865
  })
7882
7866
  );
7883
7867
  }
7884
- async function get10(ctx, a) {
7885
- out(await get9(ctx, a.req("traceId")));
7868
+ async function get9(ctx, a) {
7869
+ out(await get8(ctx, a.req("traceId")));
7886
7870
  }
7887
7871
  var tasksHandlers = {
7888
7872
  "tasks list": list13,
7889
- "tasks get": get10
7873
+ "tasks get": get9
7890
7874
  };
7891
7875
  var tasksHelp = `remy-admin tasks \u2014 Log of the app's task agents (runTask), kept 90 days.
7892
7876
 
@@ -8932,7 +8916,7 @@ function list14(ctx, params = {}) {
8932
8916
  `/_internal/v2/apps/${ctx.appId}/outbound-email/messages${qs(params)}`
8933
8917
  );
8934
8918
  }
8935
- function get11(ctx, messageId) {
8919
+ function get10(ctx, messageId) {
8936
8920
  return call(
8937
8921
  ctx,
8938
8922
  "GET",
@@ -9138,7 +9122,7 @@ async function emailList(ctx, a) {
9138
9122
  );
9139
9123
  }
9140
9124
  async function emailGet(ctx, a) {
9141
- out(await get11(ctx, a.req("messageId")));
9125
+ out(await get10(ctx, a.req("messageId")));
9142
9126
  }
9143
9127
  async function emailStats(ctx, a) {
9144
9128
  out(await stats2(ctx, { start: a.str("start"), end: a.str("end") }));
@@ -9464,7 +9448,7 @@ function list16(ctx, params) {
9464
9448
  `${base7(ctx.appId)}${params?.includeDestroyed ? "?includeDestroyed=true" : ""}`
9465
9449
  );
9466
9450
  }
9467
- function get12(ctx, params) {
9451
+ function get11(ctx, params) {
9468
9452
  return call(
9469
9453
  ctx,
9470
9454
  "GET",
@@ -9534,7 +9518,7 @@ async function waitForPhase(ctx, params) {
9534
9518
  const wanted = new Set(params.phases);
9535
9519
  const arrived = (resource2) => wanted.has(resource2.phase) && (params.until?.(resource2) ?? true);
9536
9520
  const outcome = await pollUntil(
9537
- async () => (await get12(ctx, { id: params.id })).resource,
9521
+ async () => (await get11(ctx, { id: params.id })).resource,
9538
9522
  (resource2) => arrived(resource2) || resource2.phase === "failed",
9539
9523
  {
9540
9524
  timeoutMs,
@@ -9652,7 +9636,7 @@ async function infraList(ctx, a) {
9652
9636
  out(await list16(ctx, { includeDestroyed: a.bool("include-destroyed") }));
9653
9637
  }
9654
9638
  async function infraGet(ctx, a) {
9655
- out(await get12(ctx, { id: a.req("id") }));
9639
+ out(await get11(ctx, { id: a.req("id") }));
9656
9640
  }
9657
9641
  var FOLLOW_POLL_MS = 4e3;
9658
9642
  async function infraLogs(ctx, a) {
@@ -3,7 +3,6 @@
3
3
  *
4
4
  * Sources in the api (apps/api/src/):
5
5
  * GET /secrets → roles/http/routes/Apps/manage/secrets.ts
6
- * GET /secrets/:key → roles/http/routes/Apps/manage/secrets.ts
7
6
  * PUT /secrets/:key → roles/http/routes/Apps/manage/secrets.ts
8
7
  * DELETE /secrets/:key → roles/http/routes/Apps/manage/secrets.ts
9
8
  * AppSecretsDao → customerApps/AppSecrets/dao/AppSecretsDao.ts
@@ -27,15 +26,6 @@ export interface AppSecretRow {
27
26
  export interface SecretsListResult {
28
27
  secrets: AppSecretRow[];
29
28
  }
30
- /**
31
- * Response from GET /_internal/v2/apps/:appId/secrets/:key.
32
- * Returns KMS-decrypted values inline.
33
- */
34
- export interface SecretsGetResult {
35
- key: string;
36
- devValue: string | null;
37
- prodValue: string | null;
38
- }
39
29
  /**
40
30
  * Response from PUT /_internal/v2/apps/:appId/secrets/:key.
41
31
  * Route returns HTTP 200 with { ok: true } (not a 204).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@madewithremy/admin",
3
- "version": "0.1.58",
3
+ "version": "0.1.59",
4
4
  "description": "Admin SDK + CLI for managing production Remy apps",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",