deepline 0.3.294 → 0.3.296
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/bundling-sources/sdk/src/compat.ts +35 -7
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +108 -35
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-api-origin.ts +25 -0
- package/dist/bundling-sources/shared_libs/play-runtime/tool-http-errors.ts +14 -1
- package/dist/cli/auth-JCGIDVDF.mjs +31 -0
- package/dist/cli/auth-QDWV3TXX.js +31 -0
- package/dist/cli/billing-OQBSIXRG.mjs +1749 -0
- package/dist/cli/billing-YBK3J4WP.js +1749 -0
- package/dist/cli/chunk-2C3AVPTY.js +5688 -0
- package/dist/cli/chunk-2MZ5EQZE.mjs +499 -0
- package/dist/cli/chunk-3KC45UVF.js +150 -0
- package/dist/cli/chunk-3XX5TEA4.js +15 -0
- package/dist/cli/chunk-4MBOJQPL.mjs +0 -0
- package/dist/cli/chunk-4Y6CG4GE.js +2240 -0
- package/dist/cli/chunk-4ZB3CJRD.js +1269 -0
- package/dist/cli/chunk-5JLQPVNX.js +3056 -0
- package/dist/cli/chunk-6A3TJUWC.js +76 -0
- package/dist/cli/chunk-6HPEDBSJ.js +1995 -0
- package/dist/cli/chunk-7D6QG5KF.js +890 -0
- package/dist/cli/chunk-7P5AA3SN.js +344 -0
- package/dist/cli/chunk-7UAO5MWV.mjs +190 -0
- package/dist/cli/chunk-A7427JJH.js +190 -0
- package/dist/cli/chunk-AQRTLPHZ.js +735 -0
- package/dist/cli/chunk-AYHLUHE5.js +52 -0
- package/dist/cli/chunk-BZ77OTRF.mjs +923 -0
- package/dist/cli/chunk-CBVIJSHF.mjs +560 -0
- package/dist/cli/chunk-COGTRVWW.js +30 -0
- package/dist/cli/chunk-DLIRSHV6.mjs +28 -0
- package/dist/cli/chunk-DYWHXO7O.mjs +34 -0
- package/dist/cli/chunk-EDWJY6T4.mjs +3056 -0
- package/dist/cli/chunk-EXMLR72R.mjs +0 -0
- package/dist/cli/chunk-G46HHFNB.mjs +1269 -0
- package/dist/cli/chunk-GAMFK2ZP.mjs +148 -0
- package/dist/cli/chunk-GLKUGBTP.mjs +2240 -0
- package/dist/cli/chunk-GONRLVV3.js +3440 -0
- package/dist/cli/chunk-GVUJJJ5G.mjs +76 -0
- package/dist/cli/chunk-H7HIDGZ7.mjs +150 -0
- package/dist/cli/chunk-HUZXWOSK.mjs +503 -0
- package/dist/cli/chunk-I5YZLGMG.js +1 -0
- package/dist/cli/chunk-ITOFSXIU.mjs +15 -0
- package/dist/cli/chunk-J2D3VDOU.mjs +5688 -0
- package/dist/cli/chunk-J5NA2TTX.js +503 -0
- package/dist/cli/chunk-JCS5TPNY.mjs +3440 -0
- package/dist/cli/chunk-JNNOCMQY.js +47 -0
- package/dist/cli/chunk-KRD6H754.mjs +30 -0
- package/dist/cli/chunk-L4HBNHFW.js +34 -0
- package/dist/cli/chunk-LA46MMTL.js +560 -0
- package/dist/cli/chunk-LIKFCE7Z.js +190 -0
- package/dist/cli/chunk-MIMASXO4.mjs +389 -0
- package/dist/cli/chunk-NPPJX3BL.mjs +1995 -0
- package/dist/cli/chunk-NTEZFZLE.mjs +890 -0
- package/dist/cli/chunk-NXDRDJ4K.js +389 -0
- package/dist/cli/chunk-NXGCO4JB.mjs +344 -0
- package/dist/cli/chunk-OG64RBAC.js +6 -0
- package/dist/cli/chunk-OWJZUE3Y.mjs +103 -0
- package/dist/cli/chunk-QSIO4TX2.mjs +190 -0
- package/dist/cli/chunk-RCUE5C5C.mjs +735 -0
- package/dist/cli/chunk-SDK3ZA2C.js +103 -0
- package/dist/cli/chunk-SFLARO4Y.mjs +47 -0
- package/dist/cli/chunk-TAC3JIFE.mjs +354 -0
- package/dist/cli/chunk-UC6GHEL4.js +499 -0
- package/dist/cli/chunk-UFS752TU.mjs +52 -0
- package/dist/cli/chunk-UNEMDKXN.js +1 -0
- package/dist/cli/chunk-WB6Z2Q44.mjs +1622 -0
- package/dist/cli/chunk-WJYPBHTE.js +148 -0
- package/dist/cli/chunk-WOHBA5PV.js +354 -0
- package/dist/cli/chunk-WZYKRD7T.mjs +6 -0
- package/dist/cli/chunk-XNYIZMNQ.js +28 -0
- package/dist/cli/chunk-ZDO3TO3M.js +1622 -0
- package/dist/cli/chunk-ZDOC4HFL.js +923 -0
- package/dist/cli/client-CZDA4JKO.mjs +20 -0
- package/dist/cli/client-IZGIN2ZA.js +20 -0
- package/dist/cli/csv-6KOMZA2H.mjs +585 -0
- package/dist/cli/csv-UTEQY3NA.js +585 -0
- package/dist/cli/db-D5EP6TKO.mjs +486 -0
- package/dist/cli/db-SIBLPIKC.js +486 -0
- package/dist/cli/executions-2PHT57IO.js +28 -0
- package/dist/cli/executions-DFWM2YYY.mjs +28 -0
- package/dist/cli/feedback-GZW37JMI.mjs +107 -0
- package/dist/cli/feedback-IQVWIJZ4.js +107 -0
- package/dist/cli/getting-started.js +18 -76
- package/dist/cli/getting-started.mjs +10 -37
- package/dist/cli/git-563GYLMA.js +23 -0
- package/dist/cli/git-B72Y4FFQ.mjs +23 -0
- package/dist/cli/index.js +291 -54294
- package/dist/cli/index.mjs +209 -54352
- package/dist/cli/legacy-noops-37F5MX2P.mjs +157 -0
- package/dist/cli/legacy-noops-IFGVDCOM.js +157 -0
- package/dist/cli/monitors-42H6LOVT.mjs +3251 -0
- package/dist/cli/monitors-GQCHXBXZ.js +3251 -0
- package/dist/cli/org-4GCPBTGR.js +849 -0
- package/dist/cli/org-JYZA3ZRJ.mjs +849 -0
- package/dist/cli/play-46ZJ4FMI.js +18439 -0
- package/dist/cli/play-Q2XV3FZZ.mjs +18439 -0
- package/dist/cli/providers-CTKQP45X.mjs +95 -0
- package/dist/cli/providers-PCNF5E3K.js +95 -0
- package/dist/cli/proxy-env-EBANZHPV.js +161 -0
- package/dist/cli/proxy-env-M4ZHXHRL.mjs +161 -0
- package/dist/cli/quickstart-FTHWRVWN.js +69 -0
- package/dist/cli/quickstart-X7EVVWRG.mjs +69 -0
- package/dist/cli/search-73YPOFDO.mjs +18 -0
- package/dist/cli/search-XA5UVC3G.js +18 -0
- package/dist/cli/secrets-OUMPT4FX.mjs +400 -0
- package/dist/cli/secrets-UOEVR73Q.js +400 -0
- package/dist/cli/sessions-CMKXCN5Y.js +15 -0
- package/dist/cli/sessions-ZIFGDZE7.mjs +15 -0
- package/dist/cli/settings-OO5R3G52.mjs +846 -0
- package/dist/cli/settings-ULZT2NIC.js +846 -0
- package/dist/cli/setup-6GZH52OZ.mjs +1257 -0
- package/dist/cli/setup-DHGERXPZ.js +1257 -0
- package/dist/cli/skills-Q7NUCS2W.js +28 -0
- package/dist/cli/skills-T3EY2656.mjs +28 -0
- package/dist/cli/tools-BIMOAOTX.mjs +2955 -0
- package/dist/cli/tools-ODXVCKO7.js +2955 -0
- package/dist/cli/update-UMB3ULBR.js +28 -0
- package/dist/cli/update-X4HX7Z3M.mjs +28 -0
- package/dist/cli/workflow-EAUFVPIP.mjs +1936 -0
- package/dist/cli/workflow-IVLCPFTG.js +1936 -0
- package/dist/helpers.js +6 -32
- package/dist/helpers.mjs +2 -0
- package/dist/index.js +1972 -12825
- package/dist/index.mjs +1910 -12672
- package/dist/install-integrity.json +110 -0
- package/dist/monitor-fleet-contract.js +31 -730
- package/dist/monitor-fleet-contract.mjs +18 -667
- package/dist/monitor-input-contract.js +10 -390
- package/dist/monitor-input-contract.mjs +7 -348
- package/dist/plays/bundle-play-file.mjs +13 -5178
- package/dist/plays/csv-data-input.js +5 -3132
- package/dist/plays/csv-data-input.mjs +5 -3105
- package/dist/plays/run-request.js +56 -664
- package/dist/plays/run-request.mjs +30 -588
- package/dist/release.d.mts +1 -1
- package/dist/release.d.ts +1 -1
- package/dist/release.js +5 -212
- package/dist/release.mjs +5 -185
- package/package.json +1 -1
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
+
|
|
3
|
+
var _chunk2C3AVPTYjs = require('./chunk-2C3AVPTY.js');
|
|
4
|
+
require('./chunk-LA46MMTL.js');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
var _chunk7D6QG5KFjs = require('./chunk-7D6QG5KF.js');
|
|
9
|
+
require('./chunk-6HPEDBSJ.js');
|
|
10
|
+
require('./chunk-XNYIZMNQ.js');
|
|
11
|
+
require('./chunk-LIKFCE7Z.js');
|
|
12
|
+
require('./chunk-6A3TJUWC.js');
|
|
13
|
+
require('./chunk-7P5AA3SN.js');
|
|
14
|
+
require('./chunk-OG64RBAC.js');
|
|
15
|
+
require('./chunk-COGTRVWW.js');
|
|
16
|
+
|
|
17
|
+
// src/cli/commands/secrets.ts
|
|
18
|
+
var _process = require('process');
|
|
19
|
+
var _promises = require('fs/promises');
|
|
20
|
+
var hiddenInputBuffer = "";
|
|
21
|
+
function normalizeSecretName(value) {
|
|
22
|
+
const normalized = value.trim().toUpperCase();
|
|
23
|
+
if (!/^[A-Z][A-Z0-9_]{1,63}$/.test(normalized)) {
|
|
24
|
+
throw new Error(
|
|
25
|
+
"Secret names must be 2-64 characters and use uppercase letters, numbers, and underscores."
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
return normalized;
|
|
29
|
+
}
|
|
30
|
+
function normalizePlaySelector(value) {
|
|
31
|
+
const normalized = _optionalChain([value, 'optionalAccess', _ => _.trim, 'call', _2 => _2()]);
|
|
32
|
+
if (value !== void 0 && !normalized) {
|
|
33
|
+
throw new Error("--play requires a bare Play name.");
|
|
34
|
+
}
|
|
35
|
+
if (!normalized) return void 0;
|
|
36
|
+
if (normalized.includes("/")) {
|
|
37
|
+
throw new Error(
|
|
38
|
+
"--play expects the bare Play name, not an org-qualified name."
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
return normalized;
|
|
42
|
+
}
|
|
43
|
+
function resolveSecretWriteScope(options) {
|
|
44
|
+
const playName = normalizePlaySelector(options.play);
|
|
45
|
+
if (options.scope && options.scope !== "org" && options.scope !== "play") {
|
|
46
|
+
throw new Error("--scope must be either org or play.");
|
|
47
|
+
}
|
|
48
|
+
const scope = options.scope === void 0 ? playName ? "play" : "org" : options.scope;
|
|
49
|
+
if (scope === "play" && !playName) {
|
|
50
|
+
throw new Error("--play <name> is required when --scope play is used.");
|
|
51
|
+
}
|
|
52
|
+
if (scope === "org" && playName) {
|
|
53
|
+
throw new Error("--play can only be used with --scope play.");
|
|
54
|
+
}
|
|
55
|
+
return scope === "play" ? { scope, playName } : { scope };
|
|
56
|
+
}
|
|
57
|
+
function renderSecret(secret) {
|
|
58
|
+
const scope = secret.scope === "play" && secret.playName ? `play:${secret.playName}` : secret.scope;
|
|
59
|
+
const added = new Date(secret.createdAt).toISOString();
|
|
60
|
+
const updated = new Date(secret.updatedAt).toISOString();
|
|
61
|
+
const lastUsed = secret.lastUsedAt ? `, last used ${new Date(secret.lastUsedAt).toISOString()}` : ", never used";
|
|
62
|
+
const note = secret.note ? `, note ${JSON.stringify(secret.note)}` : "";
|
|
63
|
+
return `${secret.name} (${scope}) - ${secret.status}${secret.hasValue ? ", set" : ", empty"}${note}, added ${added}${updated !== added ? `, updated ${updated}` : ""}${lastUsed}`;
|
|
64
|
+
}
|
|
65
|
+
async function readHiddenLine(prompt, streams = {}) {
|
|
66
|
+
const inputStream = _nullishCoalesce(streams.input, () => ( _process.stdin));
|
|
67
|
+
const outputStream = _nullishCoalesce(streams.output, () => ( _process.stdout));
|
|
68
|
+
if (!inputStream.isTTY || !outputStream.isTTY) {
|
|
69
|
+
throw new Error(
|
|
70
|
+
"Secret values must be entered from an interactive TTY. Do not pipe, pass, or script secret values."
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
outputStream.write(prompt);
|
|
74
|
+
const previousRawMode = inputStream.isRaw;
|
|
75
|
+
const wasPaused = typeof inputStream.isPaused === "function" ? inputStream.isPaused() : false;
|
|
76
|
+
if (typeof inputStream.setRawMode === "function") {
|
|
77
|
+
inputStream.setRawMode(true);
|
|
78
|
+
}
|
|
79
|
+
let value = "";
|
|
80
|
+
inputStream.resume();
|
|
81
|
+
return await new Promise((resolve, reject) => {
|
|
82
|
+
let settled = false;
|
|
83
|
+
const cleanup = () => {
|
|
84
|
+
inputStream.off("data", onData);
|
|
85
|
+
inputStream.off("end", onEnd);
|
|
86
|
+
inputStream.off("error", onError);
|
|
87
|
+
if (typeof inputStream.setRawMode === "function") {
|
|
88
|
+
inputStream.setRawMode(previousRawMode);
|
|
89
|
+
}
|
|
90
|
+
if (wasPaused || inputStream === _process.stdin) {
|
|
91
|
+
inputStream.pause();
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
const finish = (line) => {
|
|
95
|
+
if (settled) return;
|
|
96
|
+
settled = true;
|
|
97
|
+
outputStream.write("\n");
|
|
98
|
+
cleanup();
|
|
99
|
+
resolve(line);
|
|
100
|
+
};
|
|
101
|
+
const fail = (error) => {
|
|
102
|
+
if (settled) return;
|
|
103
|
+
settled = true;
|
|
104
|
+
outputStream.write("\n");
|
|
105
|
+
cleanup();
|
|
106
|
+
reject(error);
|
|
107
|
+
};
|
|
108
|
+
const processText = (text) => {
|
|
109
|
+
for (let index = 0; index < text.length; index++) {
|
|
110
|
+
const char = text[index];
|
|
111
|
+
const code = char.charCodeAt(0);
|
|
112
|
+
if (char === "\r" || char === "\n") {
|
|
113
|
+
hiddenInputBuffer = text.slice(index + 1);
|
|
114
|
+
finish(value);
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
if (code === 3) {
|
|
118
|
+
fail(new Error("Secret input cancelled."));
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
if (code === 8 || code === 127) {
|
|
122
|
+
value = value.slice(0, -1);
|
|
123
|
+
continue;
|
|
124
|
+
}
|
|
125
|
+
if (code >= 32) {
|
|
126
|
+
value += char;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
hiddenInputBuffer = "";
|
|
130
|
+
};
|
|
131
|
+
const onData = (chunk) => {
|
|
132
|
+
processText(chunk.toString());
|
|
133
|
+
};
|
|
134
|
+
const onEnd = () => fail(new Error("Secret input ended before a value was entered."));
|
|
135
|
+
const onError = (error) => fail(error);
|
|
136
|
+
inputStream.on("data", onData);
|
|
137
|
+
inputStream.once("end", onEnd);
|
|
138
|
+
inputStream.once("error", onError);
|
|
139
|
+
if (hiddenInputBuffer) {
|
|
140
|
+
const buffered = hiddenInputBuffer;
|
|
141
|
+
hiddenInputBuffer = "";
|
|
142
|
+
processText(buffered);
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
async function readSecretValue() {
|
|
147
|
+
const first = await readHiddenLine("Secret value: ");
|
|
148
|
+
if (!first) throw new Error("Secret value is required.");
|
|
149
|
+
const second = await readHiddenLine("Confirm secret value: ");
|
|
150
|
+
if (first !== second) {
|
|
151
|
+
throw new Error("Secret values did not match.");
|
|
152
|
+
}
|
|
153
|
+
return first;
|
|
154
|
+
}
|
|
155
|
+
function trimOneTerminalNewline(value) {
|
|
156
|
+
return value.endsWith("\r\n") ? value.slice(0, -2) : value.endsWith("\n") ? value.slice(0, -1) : value;
|
|
157
|
+
}
|
|
158
|
+
async function readSecretValueFromOptions(options) {
|
|
159
|
+
const sources = [
|
|
160
|
+
options.valueStdin ? "--value-stdin" : null,
|
|
161
|
+
options.fromEnv ? "--from-env" : null,
|
|
162
|
+
options.fromFile ? "--from-file" : null
|
|
163
|
+
].filter((source) => Boolean(source));
|
|
164
|
+
if (sources.length > 1) {
|
|
165
|
+
throw new Error(
|
|
166
|
+
"Use exactly one secret source: --value-stdin, --from-env, or --from-file."
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
if (sources.length === 0) return readSecretValue();
|
|
170
|
+
let value;
|
|
171
|
+
if (options.valueStdin) {
|
|
172
|
+
if (_process.stdin.isTTY) {
|
|
173
|
+
throw new Error(
|
|
174
|
+
"--value-stdin requires piped stdin. Omit it to use the hidden interactive prompt."
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
const chunks = [];
|
|
178
|
+
for await (const chunk of _process.stdin) {
|
|
179
|
+
chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
|
|
180
|
+
}
|
|
181
|
+
value = trimOneTerminalNewline(Buffer.concat(chunks).toString("utf8"));
|
|
182
|
+
} else if (options.fromEnv) {
|
|
183
|
+
if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(options.fromEnv)) {
|
|
184
|
+
throw new Error("--from-env must name a valid environment variable.");
|
|
185
|
+
}
|
|
186
|
+
const envValue = process.env[options.fromEnv];
|
|
187
|
+
if (envValue === void 0) {
|
|
188
|
+
throw new Error(`Environment variable ${options.fromEnv} is not set.`);
|
|
189
|
+
}
|
|
190
|
+
value = envValue;
|
|
191
|
+
} else {
|
|
192
|
+
value = trimOneTerminalNewline(await _promises.readFile.call(void 0, options.fromFile, "utf8"));
|
|
193
|
+
}
|
|
194
|
+
if (!value) throw new Error("Secret value is required.");
|
|
195
|
+
return value;
|
|
196
|
+
}
|
|
197
|
+
function preventShellHistoryLeak(forbidden) {
|
|
198
|
+
if (forbidden.length > 0) {
|
|
199
|
+
throw new Error(
|
|
200
|
+
"Do not pass secret values as command arguments. Run `deepline secrets set NAME` and enter the value at the hidden prompt."
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
async function handleList(options) {
|
|
205
|
+
const client = new (0, _chunk2C3AVPTYjs.DeeplineClient)();
|
|
206
|
+
const secrets = await client.listSecrets();
|
|
207
|
+
_chunk7D6QG5KFjs.printCommandEnvelope.call(void 0,
|
|
208
|
+
{
|
|
209
|
+
secrets,
|
|
210
|
+
count: secrets.length,
|
|
211
|
+
render: {
|
|
212
|
+
sections: [
|
|
213
|
+
{
|
|
214
|
+
title: "secrets",
|
|
215
|
+
lines: secrets.length ? secrets.map(renderSecret) : ["No play secrets are configured."]
|
|
216
|
+
}
|
|
217
|
+
]
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
{ json: options.json }
|
|
221
|
+
);
|
|
222
|
+
}
|
|
223
|
+
async function handleCheck(nameInput, options) {
|
|
224
|
+
const name = normalizeSecretName(nameInput);
|
|
225
|
+
const client = new (0, _chunk2C3AVPTYjs.DeeplineClient)();
|
|
226
|
+
const playName = options.play === void 0 ? void 0 : normalizePlaySelector(options.play);
|
|
227
|
+
const check = playName !== void 0 ? await client.inspectSecret(name, { playName }) : null;
|
|
228
|
+
const secret = check ? check.secret : await client.checkSecret(name);
|
|
229
|
+
const ok = check ? check.ok : Boolean(secret);
|
|
230
|
+
const quotedPlay = `'${(_nullishCoalesce(options.play, () => ( "PLAY"))).replace(/'/g, `'"'"'`)}'`;
|
|
231
|
+
const scopeHint = check ? _optionalChain([secret, 'optionalAccess', _3 => _3.scope]) === "play" ? check.reason === "disabled" ? `The Play-scoped secret is disabled and no active org fallback is available. Restore it with: deepline secrets set ${name} --scope play --play ${quotedPlay}` : `The active Play-scoped secret takes precedence over the org secret.${ok ? "" : ` Restore it with: deepline secrets set ${name} --scope play --play ${quotedPlay}`}` : `No Play override.${ok ? " The org secret is available." : ` Set or rotate the org secret with: deepline secrets set ${name}`}` : `Metadata only. Verify effective scope and active version with: deepline secrets check ${name} --play <play-name>`;
|
|
232
|
+
_chunk7D6QG5KFjs.printCommandEnvelope.call(void 0,
|
|
233
|
+
{
|
|
234
|
+
ok,
|
|
235
|
+
name,
|
|
236
|
+
secret: _nullishCoalesce(secret, () => ( null)),
|
|
237
|
+
check: check ? { playName: check.playName, reason: check.reason } : null,
|
|
238
|
+
scopeHint,
|
|
239
|
+
render: {
|
|
240
|
+
sections: [
|
|
241
|
+
{
|
|
242
|
+
title: "secret check",
|
|
243
|
+
lines: [
|
|
244
|
+
check ? `${name}: ${check.reason} for ${check.playName}${secret ? ` (${secret.scope})` : ""}` : secret ? `${name}: active metadata \u2014 ${renderSecret(secret)}` : `${name}: missing, disabled, or empty`,
|
|
245
|
+
scopeHint
|
|
246
|
+
]
|
|
247
|
+
}
|
|
248
|
+
]
|
|
249
|
+
}
|
|
250
|
+
},
|
|
251
|
+
{ json: options.json }
|
|
252
|
+
);
|
|
253
|
+
if (!ok) process.exitCode = 4;
|
|
254
|
+
}
|
|
255
|
+
async function handleSet(nameInput, forbidden, options) {
|
|
256
|
+
preventShellHistoryLeak(forbidden);
|
|
257
|
+
const name = normalizeSecretName(nameInput);
|
|
258
|
+
const { scope, playName } = resolveSecretWriteScope(options);
|
|
259
|
+
const value = await readSecretValueFromOptions(options);
|
|
260
|
+
const { http } = _chunk7D6QG5KFjs.getAuthedHttpClient.call(void 0, );
|
|
261
|
+
const response = await http.post(
|
|
262
|
+
"/api/v2/secrets",
|
|
263
|
+
{
|
|
264
|
+
name,
|
|
265
|
+
value,
|
|
266
|
+
scope,
|
|
267
|
+
...playName ? { playName } : {},
|
|
268
|
+
...options.note !== void 0 ? { note: options.note } : {}
|
|
269
|
+
}
|
|
270
|
+
);
|
|
271
|
+
const secret = response.secret;
|
|
272
|
+
_chunk7D6QG5KFjs.printCommandEnvelope.call(void 0,
|
|
273
|
+
{
|
|
274
|
+
ok: true,
|
|
275
|
+
secret,
|
|
276
|
+
render: {
|
|
277
|
+
sections: [
|
|
278
|
+
{
|
|
279
|
+
title: "secret saved",
|
|
280
|
+
lines: [
|
|
281
|
+
`${secret.name}: saved (${secret.scope}); secret value was not displayed.`,
|
|
282
|
+
renderSecret(secret)
|
|
283
|
+
]
|
|
284
|
+
}
|
|
285
|
+
]
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
{ json: options.json }
|
|
289
|
+
);
|
|
290
|
+
}
|
|
291
|
+
async function handleNote(secretId, noteInput, options) {
|
|
292
|
+
if (options.clear && noteInput !== void 0) {
|
|
293
|
+
throw new Error("Pass either a note or --clear, not both.");
|
|
294
|
+
}
|
|
295
|
+
if (!options.clear && noteInput === void 0) {
|
|
296
|
+
throw new Error("Provide a note or use --clear.");
|
|
297
|
+
}
|
|
298
|
+
const note = options.clear ? "" : noteInput;
|
|
299
|
+
if (options.dryRun) {
|
|
300
|
+
_chunk7D6QG5KFjs.printCommandEnvelope.call(void 0,
|
|
301
|
+
{
|
|
302
|
+
ok: true,
|
|
303
|
+
dryRun: true,
|
|
304
|
+
secretId,
|
|
305
|
+
note,
|
|
306
|
+
render: {
|
|
307
|
+
sections: [
|
|
308
|
+
{
|
|
309
|
+
title: "secret note",
|
|
310
|
+
lines: [
|
|
311
|
+
options.clear ? `Would clear the note on secret ${secretId}.` : `Would save a note on secret ${secretId}.`
|
|
312
|
+
]
|
|
313
|
+
}
|
|
314
|
+
]
|
|
315
|
+
}
|
|
316
|
+
},
|
|
317
|
+
{ json: options.json }
|
|
318
|
+
);
|
|
319
|
+
return;
|
|
320
|
+
}
|
|
321
|
+
const client = new (0, _chunk2C3AVPTYjs.DeeplineClient)();
|
|
322
|
+
const secret = await client.updateSecretNote(secretId, note);
|
|
323
|
+
_chunk7D6QG5KFjs.printCommandEnvelope.call(void 0,
|
|
324
|
+
{
|
|
325
|
+
ok: true,
|
|
326
|
+
secret,
|
|
327
|
+
render: {
|
|
328
|
+
sections: [
|
|
329
|
+
{
|
|
330
|
+
title: "secret note saved",
|
|
331
|
+
lines: [
|
|
332
|
+
secret.note ? `${secret.name}: note saved.` : `${secret.name}: note cleared.`,
|
|
333
|
+
renderSecret(secret)
|
|
334
|
+
]
|
|
335
|
+
}
|
|
336
|
+
]
|
|
337
|
+
}
|
|
338
|
+
},
|
|
339
|
+
{ json: options.json }
|
|
340
|
+
);
|
|
341
|
+
}
|
|
342
|
+
function registerSecretsCommands(program) {
|
|
343
|
+
const secrets = program.command("secrets").description("Manage play secrets without revealing values.").addHelpText(
|
|
344
|
+
"after",
|
|
345
|
+
`
|
|
346
|
+
Notes:
|
|
347
|
+
Secret values are never accepted as command arguments. Use the hidden prompt,
|
|
348
|
+
or one explicit non-argv source: --value-stdin, --from-env NAME, or
|
|
349
|
+
--from-file PATH. Values are never printed. secrets list shows only metadata,
|
|
350
|
+
including any note you intentionally added. Supplying --play implies
|
|
351
|
+
--scope play; --play expects the bare Play name in the current workspace.
|
|
352
|
+
|
|
353
|
+
Examples:
|
|
354
|
+
deepline secrets list
|
|
355
|
+
deepline secrets check HUBSPOT_TOKEN
|
|
356
|
+
deepline secrets check HUBSPOT_TOKEN --play hubspot-sync
|
|
357
|
+
deepline secrets set HUBSPOT_TOKEN
|
|
358
|
+
printf %s "$HUBSPOT_TOKEN" | deepline secrets set HUBSPOT_TOKEN --value-stdin
|
|
359
|
+
deepline secrets set HUBSPOT_TOKEN --from-env HUBSPOT_TOKEN
|
|
360
|
+
deepline secrets set HUBSPOT_TOKEN --from-file ./hubspot-token.txt
|
|
361
|
+
deepline secrets set HUBSPOT_TOKEN --note "Chrome extension \u2014 Avery"
|
|
362
|
+
deepline secrets note <secret-id> "Chrome extension \u2014 Avery"
|
|
363
|
+
deepline secrets note <secret-id> --clear
|
|
364
|
+
`
|
|
365
|
+
);
|
|
366
|
+
secrets.command("list").description("List secret metadata only.").option("--json", "Emit JSON output").action(async (options) => {
|
|
367
|
+
await handleList(options);
|
|
368
|
+
});
|
|
369
|
+
secrets.command("check").description(
|
|
370
|
+
"Check secret metadata, or effective availability with --play."
|
|
371
|
+
).argument("<name>", "Secret name").option(
|
|
372
|
+
"--play <name>",
|
|
373
|
+
"Validate the effective secret for a bare Play name and active version"
|
|
374
|
+
).option("--json", "Emit JSON output").action(async (name, options) => {
|
|
375
|
+
await handleCheck(name, options);
|
|
376
|
+
});
|
|
377
|
+
secrets.command("set").description("Set or rotate a secret without exposing its value in argv.").argument("<name>", "Secret name").argument("[forbidden...]", "Do not pass secret values here").option("--json", "Emit JSON output").option("--scope <scope>", "Secret scope: org or play; --play implies play").option("--play <name>", "Play name for play-scoped secrets").option(
|
|
378
|
+
"--note <note>",
|
|
379
|
+
"Optional non-sensitive memo (maximum 500 characters)"
|
|
380
|
+
).option("--value-stdin", "Read the value from piped stdin").option("--from-env <name>", "Read the value from an environment variable").option("--from-file <path>", "Read the value from a file").action(
|
|
381
|
+
async (name, forbidden, options) => {
|
|
382
|
+
await handleSet(name, _nullishCoalesce(forbidden, () => ( [])), options);
|
|
383
|
+
}
|
|
384
|
+
);
|
|
385
|
+
secrets.command("note").description("Add, replace, or clear a non-sensitive note on one secret.").argument("<secret-id>", "Secret ID from `deepline secrets list --json`").argument("[note]", "Note text (maximum 500 characters)").option("--clear", "Clear the existing note").option("--dry-run", "Show the note change without saving it").option("--json", "Emit JSON output").action(
|
|
386
|
+
async (secretId, note, options) => {
|
|
387
|
+
await handleNote(secretId, note, options);
|
|
388
|
+
}
|
|
389
|
+
);
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
exports.normalizePlaySelector = normalizePlaySelector; exports.normalizeSecretName = normalizeSecretName; exports.preventShellHistoryLeak = preventShellHistoryLeak; exports.readHiddenLine = readHiddenLine; exports.readSecretValueFromOptions = readSecretValueFromOptions; exports.registerSecretsCommands = registerSecretsCommands; exports.resolveSecretWriteScope = resolveSecretWriteScope; exports.trimOneTerminalNewline = trimOneTerminalNewline;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkAQRTLPHZjs = require('./chunk-AQRTLPHZ.js');
|
|
5
|
+
require('./chunk-7D6QG5KF.js');
|
|
6
|
+
require('./chunk-6HPEDBSJ.js');
|
|
7
|
+
require('./chunk-XNYIZMNQ.js');
|
|
8
|
+
require('./chunk-LIKFCE7Z.js');
|
|
9
|
+
require('./chunk-7P5AA3SN.js');
|
|
10
|
+
require('./chunk-OG64RBAC.js');
|
|
11
|
+
require('./chunk-COGTRVWW.js');
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
exports.registerSessionSendRenderCommands = _chunkAQRTLPHZjs.registerSessionSendRenderCommands; exports.registerSessionsCommands = _chunkAQRTLPHZjs.registerSessionsCommands;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
registerSessionSendRenderCommands,
|
|
3
|
+
registerSessionsCommands
|
|
4
|
+
} from "./chunk-RCUE5C5C.mjs";
|
|
5
|
+
import "./chunk-NTEZFZLE.mjs";
|
|
6
|
+
import "./chunk-NPPJX3BL.mjs";
|
|
7
|
+
import "./chunk-DLIRSHV6.mjs";
|
|
8
|
+
import "./chunk-QSIO4TX2.mjs";
|
|
9
|
+
import "./chunk-NXGCO4JB.mjs";
|
|
10
|
+
import "./chunk-WZYKRD7T.mjs";
|
|
11
|
+
import "./chunk-KRD6H754.mjs";
|
|
12
|
+
export {
|
|
13
|
+
registerSessionSendRenderCommands,
|
|
14
|
+
registerSessionsCommands
|
|
15
|
+
};
|