storyforge 0.5.3 → 0.7.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.
- package/dist/bridge-poller-JIP6RGMN.js +7033 -0
- package/dist/chunk-2UXQZTSS.js +877 -0
- package/dist/chunk-3ZW2KMKN.js +5657 -0
- package/dist/chunk-56OB3EDN.js +29 -0
- package/dist/chunk-62PNWAA7.js +1020 -0
- package/dist/chunk-C5KB4UV6.js +242 -0
- package/dist/chunk-CDQ3UP6J.js +52 -0
- package/dist/chunk-CQ2IV4Q2.js +14 -0
- package/dist/chunk-L4BNY5R3.js +175 -0
- package/dist/chunk-M6JAFPDI.js +314 -0
- package/dist/chunk-NSPRIPOP.js +36 -0
- package/dist/chunk-U6LFS35L.js +62 -0
- package/dist/chunk-WVPXYQ2G.js +164 -0
- package/dist/chunk-YLY3P6CS.js +39 -0
- package/dist/chunk-ZHDWKDF5.js +44 -0
- package/dist/{cli-usage-FG3YUG3W.js → cli-usage-G762TREV.js} +1 -0
- package/dist/dist-es-2LINLMXN.js +89 -0
- package/dist/dist-es-4NQJAKNU.js +381 -0
- package/dist/dist-es-4RCBWWWT.js +71 -0
- package/dist/dist-es-JQWJEY7F.js +490 -0
- package/dist/dist-es-KZQIITSZ.js +168 -0
- package/dist/dist-es-QJ3UEHQZ.js +325 -0
- package/dist/dist-es-SXKTBYGM.js +47 -0
- package/dist/event-streams-DNC7XM6J.js +245 -0
- package/dist/index.js +339 -7
- package/dist/loadSso-SM6TYICZ.js +591 -0
- package/dist/signin-TZJIHAWM.js +703 -0
- package/dist/sso-oidc-MO5NOHP3.js +828 -0
- package/dist/stitch-7XB7ZA4D.js +446 -0
- package/dist/sts-PUI4IC7G.js +3942 -0
- package/package.json +2 -2
- package/dist/bridge-poller-WEKSUZMT.js +0 -367
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// ../pipeline/src/clip-render/ffmpeg.ts
|
|
4
|
+
import { spawn } from "child_process";
|
|
5
|
+
import * as fs from "fs";
|
|
6
|
+
import * as path from "path";
|
|
7
|
+
var defaultRunner = (cmd, args, { timeoutMs = 3e5, signal }) => new Promise((resolve, reject) => {
|
|
8
|
+
const child = spawn(cmd, args, { stdio: ["pipe", "pipe", "pipe"] });
|
|
9
|
+
let stdout = "";
|
|
10
|
+
let stderr = "";
|
|
11
|
+
let timer;
|
|
12
|
+
const onAbort = () => {
|
|
13
|
+
try {
|
|
14
|
+
child.kill("SIGKILL");
|
|
15
|
+
} catch {
|
|
16
|
+
}
|
|
17
|
+
reject(new Error(`${cmd} aborted`));
|
|
18
|
+
};
|
|
19
|
+
if (signal) {
|
|
20
|
+
if (signal.aborted) {
|
|
21
|
+
onAbort();
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
25
|
+
}
|
|
26
|
+
child.stdout?.on("data", (d) => {
|
|
27
|
+
stdout += d.toString();
|
|
28
|
+
});
|
|
29
|
+
child.stderr?.on("data", (d) => {
|
|
30
|
+
stderr += d.toString();
|
|
31
|
+
});
|
|
32
|
+
child.on("error", (err) => {
|
|
33
|
+
if (timer) clearTimeout(timer);
|
|
34
|
+
signal?.removeEventListener("abort", onAbort);
|
|
35
|
+
reject(err);
|
|
36
|
+
});
|
|
37
|
+
child.on("close", (code) => {
|
|
38
|
+
if (timer) clearTimeout(timer);
|
|
39
|
+
signal?.removeEventListener("abort", onAbort);
|
|
40
|
+
resolve({ code: code ?? -1, stdout, stderr });
|
|
41
|
+
});
|
|
42
|
+
timer = setTimeout(() => {
|
|
43
|
+
try {
|
|
44
|
+
child.kill("SIGKILL");
|
|
45
|
+
} catch {
|
|
46
|
+
}
|
|
47
|
+
reject(new Error(`${cmd} timed out after ${timeoutMs}ms`));
|
|
48
|
+
}, timeoutMs);
|
|
49
|
+
});
|
|
50
|
+
var activeRunner = defaultRunner;
|
|
51
|
+
function runCmd(cmd, args, opts = {}) {
|
|
52
|
+
return activeRunner(cmd, args, opts);
|
|
53
|
+
}
|
|
54
|
+
function buildMuxAudioArgs(videoPath, audioPath, outPath) {
|
|
55
|
+
return [
|
|
56
|
+
"-y",
|
|
57
|
+
"-i",
|
|
58
|
+
videoPath,
|
|
59
|
+
"-i",
|
|
60
|
+
audioPath,
|
|
61
|
+
"-map",
|
|
62
|
+
"0:v",
|
|
63
|
+
"-map",
|
|
64
|
+
"1:a",
|
|
65
|
+
"-c:v",
|
|
66
|
+
"copy",
|
|
67
|
+
"-c:a",
|
|
68
|
+
"aac",
|
|
69
|
+
"-shortest",
|
|
70
|
+
outPath
|
|
71
|
+
];
|
|
72
|
+
}
|
|
73
|
+
async function muxAudio(videoPath, audioPath, outPath, opts = {}) {
|
|
74
|
+
const args = buildMuxAudioArgs(videoPath, audioPath, outPath);
|
|
75
|
+
const r = await runCmd("ffmpeg", args, opts);
|
|
76
|
+
if (r.code !== 0) {
|
|
77
|
+
throw new Error(
|
|
78
|
+
`ffmpeg mux failed (code ${r.code}): ${r.stderr.split("\n").slice(-5).join(" ")}`
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
function buildConcatArgs(manifestPath, outPath) {
|
|
83
|
+
return [
|
|
84
|
+
"-y",
|
|
85
|
+
"-f",
|
|
86
|
+
"concat",
|
|
87
|
+
"-safe",
|
|
88
|
+
"0",
|
|
89
|
+
"-i",
|
|
90
|
+
manifestPath,
|
|
91
|
+
"-c",
|
|
92
|
+
"copy",
|
|
93
|
+
outPath
|
|
94
|
+
];
|
|
95
|
+
}
|
|
96
|
+
async function concatScenes(scenePaths, outPath, opts = {}) {
|
|
97
|
+
if (scenePaths.length === 0) {
|
|
98
|
+
throw new Error("concatScenes: at least one scene required");
|
|
99
|
+
}
|
|
100
|
+
if (scenePaths.length === 1) {
|
|
101
|
+
fs.copyFileSync(scenePaths[0], outPath);
|
|
102
|
+
return outPath;
|
|
103
|
+
}
|
|
104
|
+
const manifestPath = path.join(path.dirname(outPath), `concat_${path.basename(outPath)}.txt`);
|
|
105
|
+
const manifest = scenePaths.map((p) => `file '${p.replace(/'/g, "'\\''")}'`).join("\n") + "\n";
|
|
106
|
+
fs.writeFileSync(manifestPath, manifest);
|
|
107
|
+
try {
|
|
108
|
+
const args = buildConcatArgs(manifestPath, outPath);
|
|
109
|
+
const r = await runCmd("ffmpeg", args, opts);
|
|
110
|
+
if (r.code !== 0) {
|
|
111
|
+
throw new Error(
|
|
112
|
+
`ffmpeg concat failed (code ${r.code}): ${r.stderr.split("\n").slice(-5).join(" ")}`
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
} finally {
|
|
116
|
+
try {
|
|
117
|
+
fs.unlinkSync(manifestPath);
|
|
118
|
+
} catch {
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return outPath;
|
|
122
|
+
}
|
|
123
|
+
function buildNormalizeClipArgs(videoPath, outPath, opts) {
|
|
124
|
+
const { audioPath, targetWidth, targetHeight, fps = 30 } = opts;
|
|
125
|
+
const vf = `scale=${targetWidth}:${targetHeight}:force_original_aspect_ratio=decrease,pad=${targetWidth}:${targetHeight}:(ow-iw)/2:(oh-ih)/2:black,fps=${fps},setpts=PTS-STARTPTS`;
|
|
126
|
+
const af = "loudnorm=I=-14:TP=-1.5:LRA=11,asetpts=PTS-STARTPTS,aresample=44100";
|
|
127
|
+
const args = ["-y", "-i", videoPath];
|
|
128
|
+
if (audioPath) args.push("-i", audioPath);
|
|
129
|
+
args.push(
|
|
130
|
+
...audioPath ? ["-map", "0:v", "-map", "1:a"] : [],
|
|
131
|
+
"-c:v",
|
|
132
|
+
"libx264",
|
|
133
|
+
"-preset",
|
|
134
|
+
"medium",
|
|
135
|
+
"-crf",
|
|
136
|
+
"18",
|
|
137
|
+
"-pix_fmt",
|
|
138
|
+
"yuv420p",
|
|
139
|
+
"-vf",
|
|
140
|
+
vf,
|
|
141
|
+
"-c:a",
|
|
142
|
+
"aac",
|
|
143
|
+
"-b:a",
|
|
144
|
+
"192k",
|
|
145
|
+
"-ar",
|
|
146
|
+
"44100",
|
|
147
|
+
"-ac",
|
|
148
|
+
"2",
|
|
149
|
+
"-af",
|
|
150
|
+
af,
|
|
151
|
+
"-shortest",
|
|
152
|
+
outPath
|
|
153
|
+
);
|
|
154
|
+
return args;
|
|
155
|
+
}
|
|
156
|
+
function buildFinalConcatArgs(opts) {
|
|
157
|
+
const {
|
|
158
|
+
manifestPath,
|
|
159
|
+
outPath,
|
|
160
|
+
watermarkPath,
|
|
161
|
+
brandAudioPath,
|
|
162
|
+
brandAudioVolume = 0.1
|
|
163
|
+
} = opts;
|
|
164
|
+
const vol = brandAudioVolume.toFixed(3);
|
|
165
|
+
const encoderTail = [
|
|
166
|
+
"-c:v",
|
|
167
|
+
"libx264",
|
|
168
|
+
"-preset",
|
|
169
|
+
"slow",
|
|
170
|
+
"-crf",
|
|
171
|
+
"8",
|
|
172
|
+
"-pix_fmt",
|
|
173
|
+
"yuv420p",
|
|
174
|
+
"-colorspace",
|
|
175
|
+
"bt709",
|
|
176
|
+
"-color_primaries",
|
|
177
|
+
"bt709",
|
|
178
|
+
"-color_trc",
|
|
179
|
+
"bt709",
|
|
180
|
+
"-c:a",
|
|
181
|
+
"aac",
|
|
182
|
+
"-b:a",
|
|
183
|
+
"192k",
|
|
184
|
+
outPath
|
|
185
|
+
];
|
|
186
|
+
if (watermarkPath && brandAudioPath) {
|
|
187
|
+
return [
|
|
188
|
+
"-y",
|
|
189
|
+
"-f",
|
|
190
|
+
"concat",
|
|
191
|
+
"-safe",
|
|
192
|
+
"0",
|
|
193
|
+
"-i",
|
|
194
|
+
manifestPath,
|
|
195
|
+
"-i",
|
|
196
|
+
watermarkPath,
|
|
197
|
+
"-i",
|
|
198
|
+
brandAudioPath,
|
|
199
|
+
"-filter_complex",
|
|
200
|
+
`[0:v][1:v]overlay=W-w-20:H-h-20,format=yuv420p[vout];[2:a]volume=${vol}[bgm];[0:a][bgm]amix=inputs=2:duration=first:dropout_transition=2[aout]`,
|
|
201
|
+
"-map",
|
|
202
|
+
"[vout]",
|
|
203
|
+
"-map",
|
|
204
|
+
"[aout]",
|
|
205
|
+
...encoderTail
|
|
206
|
+
];
|
|
207
|
+
}
|
|
208
|
+
if (watermarkPath) {
|
|
209
|
+
return [
|
|
210
|
+
"-y",
|
|
211
|
+
"-f",
|
|
212
|
+
"concat",
|
|
213
|
+
"-safe",
|
|
214
|
+
"0",
|
|
215
|
+
"-i",
|
|
216
|
+
manifestPath,
|
|
217
|
+
"-i",
|
|
218
|
+
watermarkPath,
|
|
219
|
+
"-filter_complex",
|
|
220
|
+
`[0:v][1:v]overlay=W-w-20:H-h-20,format=yuv420p[vout]`,
|
|
221
|
+
"-map",
|
|
222
|
+
"[vout]",
|
|
223
|
+
"-map",
|
|
224
|
+
"0:a",
|
|
225
|
+
...encoderTail
|
|
226
|
+
];
|
|
227
|
+
}
|
|
228
|
+
if (brandAudioPath) {
|
|
229
|
+
return [
|
|
230
|
+
"-y",
|
|
231
|
+
"-f",
|
|
232
|
+
"concat",
|
|
233
|
+
"-safe",
|
|
234
|
+
"0",
|
|
235
|
+
"-i",
|
|
236
|
+
manifestPath,
|
|
237
|
+
"-i",
|
|
238
|
+
brandAudioPath,
|
|
239
|
+
"-filter_complex",
|
|
240
|
+
`[1:a]volume=${vol}[bgm];[0:a][bgm]amix=inputs=2:duration=first:dropout_transition=2[aout]`,
|
|
241
|
+
"-map",
|
|
242
|
+
"0:v",
|
|
243
|
+
"-map",
|
|
244
|
+
"[aout]",
|
|
245
|
+
...encoderTail
|
|
246
|
+
];
|
|
247
|
+
}
|
|
248
|
+
return [
|
|
249
|
+
"-y",
|
|
250
|
+
"-f",
|
|
251
|
+
"concat",
|
|
252
|
+
"-safe",
|
|
253
|
+
"0",
|
|
254
|
+
"-i",
|
|
255
|
+
manifestPath,
|
|
256
|
+
...encoderTail
|
|
257
|
+
];
|
|
258
|
+
}
|
|
259
|
+
function buildCrossfadeArgs(prevPath, nextPath, outPath, opts = {}) {
|
|
260
|
+
const { transitionSec = 0.4, fps = 30 } = opts;
|
|
261
|
+
return [
|
|
262
|
+
"-y",
|
|
263
|
+
"-i",
|
|
264
|
+
prevPath,
|
|
265
|
+
"-i",
|
|
266
|
+
nextPath,
|
|
267
|
+
"-filter_complex",
|
|
268
|
+
`[0:v][1:v]xfade=transition=fade:duration=${transitionSec}:offset=0[v];[0:a][1:a]acrossfade=d=${transitionSec}[a]`,
|
|
269
|
+
"-map",
|
|
270
|
+
"[v]",
|
|
271
|
+
"-map",
|
|
272
|
+
"[a]",
|
|
273
|
+
"-c:v",
|
|
274
|
+
"libx264",
|
|
275
|
+
"-preset",
|
|
276
|
+
"medium",
|
|
277
|
+
"-crf",
|
|
278
|
+
"18",
|
|
279
|
+
"-pix_fmt",
|
|
280
|
+
"yuv420p",
|
|
281
|
+
"-r",
|
|
282
|
+
String(fps),
|
|
283
|
+
"-c:a",
|
|
284
|
+
"aac",
|
|
285
|
+
"-b:a",
|
|
286
|
+
"192k",
|
|
287
|
+
outPath
|
|
288
|
+
];
|
|
289
|
+
}
|
|
290
|
+
async function probeDuration(mediaPath, opts = {}) {
|
|
291
|
+
try {
|
|
292
|
+
const r = await runCmd(
|
|
293
|
+
"ffprobe",
|
|
294
|
+
["-v", "error", "-show_entries", "format=duration", "-of", "csv=p=0", mediaPath],
|
|
295
|
+
opts
|
|
296
|
+
);
|
|
297
|
+
if (r.code !== 0) return null;
|
|
298
|
+
const parsed = parseFloat(r.stdout.trim());
|
|
299
|
+
if (!Number.isFinite(parsed)) return null;
|
|
300
|
+
return parsed;
|
|
301
|
+
} catch {
|
|
302
|
+
return null;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
export {
|
|
307
|
+
runCmd,
|
|
308
|
+
muxAudio,
|
|
309
|
+
concatScenes,
|
|
310
|
+
buildNormalizeClipArgs,
|
|
311
|
+
buildFinalConcatArgs,
|
|
312
|
+
buildCrossfadeArgs,
|
|
313
|
+
probeDuration
|
|
314
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
9
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
+
};
|
|
11
|
+
var __export = (target, all) => {
|
|
12
|
+
for (var name in all)
|
|
13
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
14
|
+
};
|
|
15
|
+
var __copyProps = (to, from, except, desc) => {
|
|
16
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
|
+
for (let key of __getOwnPropNames(from))
|
|
18
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
19
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
22
|
+
};
|
|
23
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
24
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
25
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
26
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
27
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
28
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
29
|
+
mod
|
|
30
|
+
));
|
|
31
|
+
|
|
32
|
+
export {
|
|
33
|
+
__commonJS,
|
|
34
|
+
__export,
|
|
35
|
+
__toESM
|
|
36
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// ../../node_modules/@smithy/protocol-http/dist-es/httpRequest.js
|
|
4
|
+
var HttpRequest = class _HttpRequest {
|
|
5
|
+
method;
|
|
6
|
+
protocol;
|
|
7
|
+
hostname;
|
|
8
|
+
port;
|
|
9
|
+
path;
|
|
10
|
+
query;
|
|
11
|
+
headers;
|
|
12
|
+
username;
|
|
13
|
+
password;
|
|
14
|
+
fragment;
|
|
15
|
+
body;
|
|
16
|
+
constructor(options) {
|
|
17
|
+
this.method = options.method || "GET";
|
|
18
|
+
this.hostname = options.hostname || "localhost";
|
|
19
|
+
this.port = options.port;
|
|
20
|
+
this.query = options.query || {};
|
|
21
|
+
this.headers = options.headers || {};
|
|
22
|
+
this.body = options.body;
|
|
23
|
+
this.protocol = options.protocol ? options.protocol.slice(-1) !== ":" ? `${options.protocol}:` : options.protocol : "https:";
|
|
24
|
+
this.path = options.path ? options.path.charAt(0) !== "/" ? `/${options.path}` : options.path : "/";
|
|
25
|
+
this.username = options.username;
|
|
26
|
+
this.password = options.password;
|
|
27
|
+
this.fragment = options.fragment;
|
|
28
|
+
}
|
|
29
|
+
static clone(request) {
|
|
30
|
+
const cloned = new _HttpRequest({
|
|
31
|
+
...request,
|
|
32
|
+
headers: { ...request.headers }
|
|
33
|
+
});
|
|
34
|
+
if (cloned.query) {
|
|
35
|
+
cloned.query = cloneQuery(cloned.query);
|
|
36
|
+
}
|
|
37
|
+
return cloned;
|
|
38
|
+
}
|
|
39
|
+
static isInstance(request) {
|
|
40
|
+
if (!request) {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
const req = request;
|
|
44
|
+
return "method" in req && "protocol" in req && "hostname" in req && "path" in req && typeof req["query"] === "object" && typeof req["headers"] === "object";
|
|
45
|
+
}
|
|
46
|
+
clone() {
|
|
47
|
+
return _HttpRequest.clone(this);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
function cloneQuery(query) {
|
|
51
|
+
return Object.keys(query).reduce((carry, paramName) => {
|
|
52
|
+
const param = query[paramName];
|
|
53
|
+
return {
|
|
54
|
+
...carry,
|
|
55
|
+
[paramName]: Array.isArray(param) ? [...param] : param
|
|
56
|
+
};
|
|
57
|
+
}, {});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export {
|
|
61
|
+
HttpRequest
|
|
62
|
+
};
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
chain
|
|
4
|
+
} from "./chunk-56OB3EDN.js";
|
|
5
|
+
import {
|
|
6
|
+
getProfileName,
|
|
7
|
+
loadSharedConfigFiles
|
|
8
|
+
} from "./chunk-C5KB4UV6.js";
|
|
9
|
+
import {
|
|
10
|
+
CredentialsProviderError
|
|
11
|
+
} from "./chunk-YLY3P6CS.js";
|
|
12
|
+
|
|
13
|
+
// ../../node_modules/@smithy/querystring-parser/dist-es/index.js
|
|
14
|
+
function parseQueryString(querystring) {
|
|
15
|
+
const query = {};
|
|
16
|
+
querystring = querystring.replace(/^\?/, "");
|
|
17
|
+
if (querystring) {
|
|
18
|
+
for (const pair of querystring.split("&")) {
|
|
19
|
+
let [key, value = null] = pair.split("=");
|
|
20
|
+
key = decodeURIComponent(key);
|
|
21
|
+
if (value) {
|
|
22
|
+
value = decodeURIComponent(value);
|
|
23
|
+
}
|
|
24
|
+
if (!(key in query)) {
|
|
25
|
+
query[key] = value;
|
|
26
|
+
} else if (Array.isArray(query[key])) {
|
|
27
|
+
query[key].push(value);
|
|
28
|
+
} else {
|
|
29
|
+
query[key] = [query[key], value];
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return query;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// ../../node_modules/@smithy/url-parser/dist-es/index.js
|
|
37
|
+
var parseUrl = (url) => {
|
|
38
|
+
if (typeof url === "string") {
|
|
39
|
+
return parseUrl(new URL(url));
|
|
40
|
+
}
|
|
41
|
+
const { hostname, pathname, port, protocol, search } = url;
|
|
42
|
+
let query;
|
|
43
|
+
if (search) {
|
|
44
|
+
query = parseQueryString(search);
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
hostname,
|
|
48
|
+
port: port ? parseInt(port) : void 0,
|
|
49
|
+
protocol,
|
|
50
|
+
path: pathname,
|
|
51
|
+
query
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
// ../../node_modules/@smithy/property-provider/dist-es/fromStatic.js
|
|
56
|
+
var fromStatic = (staticValue) => () => Promise.resolve(staticValue);
|
|
57
|
+
|
|
58
|
+
// ../../node_modules/@smithy/property-provider/dist-es/memoize.js
|
|
59
|
+
var memoize = (provider, isExpired, requiresRefresh) => {
|
|
60
|
+
let resolved;
|
|
61
|
+
let pending;
|
|
62
|
+
let hasResult;
|
|
63
|
+
let isConstant = false;
|
|
64
|
+
const coalesceProvider = async () => {
|
|
65
|
+
if (!pending) {
|
|
66
|
+
pending = provider();
|
|
67
|
+
}
|
|
68
|
+
try {
|
|
69
|
+
resolved = await pending;
|
|
70
|
+
hasResult = true;
|
|
71
|
+
isConstant = false;
|
|
72
|
+
} finally {
|
|
73
|
+
pending = void 0;
|
|
74
|
+
}
|
|
75
|
+
return resolved;
|
|
76
|
+
};
|
|
77
|
+
if (isExpired === void 0) {
|
|
78
|
+
return async (options) => {
|
|
79
|
+
if (!hasResult || options?.forceRefresh) {
|
|
80
|
+
resolved = await coalesceProvider();
|
|
81
|
+
}
|
|
82
|
+
return resolved;
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
return async (options) => {
|
|
86
|
+
if (!hasResult || options?.forceRefresh) {
|
|
87
|
+
resolved = await coalesceProvider();
|
|
88
|
+
}
|
|
89
|
+
if (isConstant) {
|
|
90
|
+
return resolved;
|
|
91
|
+
}
|
|
92
|
+
if (requiresRefresh && !requiresRefresh(resolved)) {
|
|
93
|
+
isConstant = true;
|
|
94
|
+
return resolved;
|
|
95
|
+
}
|
|
96
|
+
if (isExpired(resolved)) {
|
|
97
|
+
await coalesceProvider();
|
|
98
|
+
return resolved;
|
|
99
|
+
}
|
|
100
|
+
return resolved;
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
// ../../node_modules/@smithy/node-config-provider/dist-es/getSelectorName.js
|
|
105
|
+
function getSelectorName(functionString) {
|
|
106
|
+
try {
|
|
107
|
+
const constants = new Set(Array.from(functionString.match(/([A-Z_]){3,}/g) ?? []));
|
|
108
|
+
constants.delete("CONFIG");
|
|
109
|
+
constants.delete("CONFIG_PREFIX_SEPARATOR");
|
|
110
|
+
constants.delete("ENV");
|
|
111
|
+
return [...constants].join(", ");
|
|
112
|
+
} catch (e) {
|
|
113
|
+
return functionString;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// ../../node_modules/@smithy/node-config-provider/dist-es/fromEnv.js
|
|
118
|
+
var fromEnv = (envVarSelector, options) => async () => {
|
|
119
|
+
try {
|
|
120
|
+
const config = envVarSelector(process.env, options);
|
|
121
|
+
if (config === void 0) {
|
|
122
|
+
throw new Error();
|
|
123
|
+
}
|
|
124
|
+
return config;
|
|
125
|
+
} catch (e) {
|
|
126
|
+
throw new CredentialsProviderError(e.message || `Not found in ENV: ${getSelectorName(envVarSelector.toString())}`, { logger: options?.logger });
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
// ../../node_modules/@smithy/node-config-provider/dist-es/fromSharedConfigFiles.js
|
|
131
|
+
var fromSharedConfigFiles = (configSelector, { preferredFile = "config", ...init } = {}) => async () => {
|
|
132
|
+
const profile = getProfileName(init);
|
|
133
|
+
const { configFile, credentialsFile } = await loadSharedConfigFiles(init);
|
|
134
|
+
const profileFromCredentials = credentialsFile[profile] || {};
|
|
135
|
+
const profileFromConfig = configFile[profile] || {};
|
|
136
|
+
const mergedProfile = preferredFile === "config" ? { ...profileFromCredentials, ...profileFromConfig } : { ...profileFromConfig, ...profileFromCredentials };
|
|
137
|
+
try {
|
|
138
|
+
const cfgFile = preferredFile === "config" ? configFile : credentialsFile;
|
|
139
|
+
const configValue = configSelector(mergedProfile, cfgFile);
|
|
140
|
+
if (configValue === void 0) {
|
|
141
|
+
throw new Error();
|
|
142
|
+
}
|
|
143
|
+
return configValue;
|
|
144
|
+
} catch (e) {
|
|
145
|
+
throw new CredentialsProviderError(e.message || `Not found in config files w/ profile [${profile}]: ${getSelectorName(configSelector.toString())}`, { logger: init.logger });
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
// ../../node_modules/@smithy/node-config-provider/dist-es/fromStatic.js
|
|
150
|
+
var isFunction = (func) => typeof func === "function";
|
|
151
|
+
var fromStatic2 = (defaultValue) => isFunction(defaultValue) ? async () => await defaultValue() : fromStatic(defaultValue);
|
|
152
|
+
|
|
153
|
+
// ../../node_modules/@smithy/node-config-provider/dist-es/configLoader.js
|
|
154
|
+
var loadConfig = ({ environmentVariableSelector, configFileSelector, default: defaultValue }, configuration = {}) => {
|
|
155
|
+
const { signingName, logger } = configuration;
|
|
156
|
+
const envOptions = { signingName, logger };
|
|
157
|
+
return memoize(chain(fromEnv(environmentVariableSelector, envOptions), fromSharedConfigFiles(configFileSelector, configuration), fromStatic2(defaultValue)));
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
export {
|
|
161
|
+
parseUrl,
|
|
162
|
+
memoize,
|
|
163
|
+
loadConfig
|
|
164
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// ../../node_modules/@smithy/property-provider/dist-es/ProviderError.js
|
|
4
|
+
var ProviderError = class _ProviderError extends Error {
|
|
5
|
+
name = "ProviderError";
|
|
6
|
+
tryNextLink;
|
|
7
|
+
constructor(message, options = true) {
|
|
8
|
+
let logger;
|
|
9
|
+
let tryNextLink = true;
|
|
10
|
+
if (typeof options === "boolean") {
|
|
11
|
+
logger = void 0;
|
|
12
|
+
tryNextLink = options;
|
|
13
|
+
} else if (options != null && typeof options === "object") {
|
|
14
|
+
logger = options.logger;
|
|
15
|
+
tryNextLink = options.tryNextLink ?? true;
|
|
16
|
+
}
|
|
17
|
+
super(message);
|
|
18
|
+
this.tryNextLink = tryNextLink;
|
|
19
|
+
Object.setPrototypeOf(this, _ProviderError.prototype);
|
|
20
|
+
logger?.debug?.(`@smithy/property-provider ${tryNextLink ? "->" : "(!)"} ${message}`);
|
|
21
|
+
}
|
|
22
|
+
static from(error, options = true) {
|
|
23
|
+
return Object.assign(new this(error.message, options), error);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
// ../../node_modules/@smithy/property-provider/dist-es/CredentialsProviderError.js
|
|
28
|
+
var CredentialsProviderError = class _CredentialsProviderError extends ProviderError {
|
|
29
|
+
name = "CredentialsProviderError";
|
|
30
|
+
constructor(message, options = true) {
|
|
31
|
+
super(message, options);
|
|
32
|
+
Object.setPrototypeOf(this, _CredentialsProviderError.prototype);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export {
|
|
37
|
+
ProviderError,
|
|
38
|
+
CredentialsProviderError
|
|
39
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// ../../node_modules/@smithy/is-array-buffer/dist-es/index.js
|
|
4
|
+
var isArrayBuffer = (arg) => typeof ArrayBuffer === "function" && arg instanceof ArrayBuffer || Object.prototype.toString.call(arg) === "[object ArrayBuffer]";
|
|
5
|
+
|
|
6
|
+
// ../../node_modules/@smithy/util-buffer-from/dist-es/index.js
|
|
7
|
+
import { Buffer } from "buffer";
|
|
8
|
+
var fromArrayBuffer = (input, offset = 0, length = input.byteLength - offset) => {
|
|
9
|
+
if (!isArrayBuffer(input)) {
|
|
10
|
+
throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof input} (${input})`);
|
|
11
|
+
}
|
|
12
|
+
return Buffer.from(input, offset, length);
|
|
13
|
+
};
|
|
14
|
+
var fromString = (input, encoding) => {
|
|
15
|
+
if (typeof input !== "string") {
|
|
16
|
+
throw new TypeError(`The "input" argument must be of type string. Received type ${typeof input} (${input})`);
|
|
17
|
+
}
|
|
18
|
+
return encoding ? Buffer.from(input, encoding) : Buffer.from(input);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
// ../../node_modules/@smithy/util-utf8/dist-es/fromUtf8.js
|
|
22
|
+
var fromUtf8 = (input) => {
|
|
23
|
+
const buf = fromString(input, "utf8");
|
|
24
|
+
return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength / Uint8Array.BYTES_PER_ELEMENT);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
// ../../node_modules/@smithy/util-utf8/dist-es/toUtf8.js
|
|
28
|
+
var toUtf8 = (input) => {
|
|
29
|
+
if (typeof input === "string") {
|
|
30
|
+
return input;
|
|
31
|
+
}
|
|
32
|
+
if (typeof input !== "object" || typeof input.byteOffset !== "number" || typeof input.byteLength !== "number") {
|
|
33
|
+
throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");
|
|
34
|
+
}
|
|
35
|
+
return fromArrayBuffer(input.buffer, input.byteOffset, input.byteLength).toString("utf8");
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export {
|
|
39
|
+
isArrayBuffer,
|
|
40
|
+
fromArrayBuffer,
|
|
41
|
+
fromString,
|
|
42
|
+
fromUtf8,
|
|
43
|
+
toUtf8
|
|
44
|
+
};
|