@poe-platform/safe-bash 0.1.530 → 0.1.531
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/safe-bash/chunks/chunk-2GV4WO7O.js +136 -0
- package/dist/safe-bash/chunks/chunk-2GV4WO7O.js.map +7 -0
- package/dist/safe-bash/chunks/chunk-54Z5EUCW.js +340 -0
- package/dist/safe-bash/chunks/chunk-54Z5EUCW.js.map +7 -0
- package/dist/safe-bash/chunks/{chunk-NYHAKXQ7.js → chunk-6MHYEBAJ.js} +16 -140
- package/dist/safe-bash/chunks/chunk-6MHYEBAJ.js.map +7 -0
- package/dist/safe-bash/chunks/{chunk-5MSOBYRG.js → chunk-IKATLB4I.js} +5 -3
- package/dist/safe-bash/chunks/{chunk-5MSOBYRG.js.map → chunk-IKATLB4I.js.map} +1 -1
- package/dist/safe-bash/chunks/{chunk-5OCQTFXT.js → chunk-LUJYX5H5.js} +6 -332
- package/dist/safe-bash/chunks/{chunk-5OCQTFXT.js.map → chunk-LUJYX5H5.js.map} +4 -4
- package/dist/safe-bash/chunks/chunk-UGMUVHIY.js +1603 -0
- package/dist/safe-bash/chunks/chunk-UGMUVHIY.js.map +7 -0
- package/dist/safe-bash/commands/network/args.d.ts +3 -0
- package/dist/safe-bash/commands/network/args.d.ts.map +1 -1
- package/dist/safe-bash/commands/network/args.js +1 -1
- package/dist/safe-bash/commands/network/args.js.map +1 -1
- package/dist/safe-bash/commands/network/body.js +2 -2
- package/dist/safe-bash/commands/network/body.js.map +1 -1
- package/dist/safe-bash/commands/network/curl.d.ts +12 -2
- package/dist/safe-bash/commands/network/curl.d.ts.map +1 -1
- package/dist/safe-bash/commands/network/curl.js +46 -27
- package/dist/safe-bash/commands/network/curl.js.map +1 -1
- package/dist/safe-bash/commands/network/index.browser.js +29 -0
- package/dist/safe-bash/commands/network/index.browser.js.map +7 -0
- package/dist/safe-bash/commands/network/index.d.ts +1 -10
- package/dist/safe-bash/commands/network/index.d.ts.map +1 -1
- package/dist/safe-bash/commands/network/index.js +1 -22
- package/dist/safe-bash/commands/network/index.js.map +1 -1
- package/dist/safe-bash/commands/network/platform.d.ts +4 -0
- package/dist/safe-bash/commands/network/platform.d.ts.map +1 -0
- package/dist/safe-bash/commands/network/platform.js +4 -0
- package/dist/safe-bash/commands/network/platform.js.map +1 -0
- package/dist/safe-bash/commands/network/public.d.ts +12 -0
- package/dist/safe-bash/commands/network/public.d.ts.map +1 -0
- package/dist/safe-bash/commands/network/public.js +27 -0
- package/dist/safe-bash/commands/network/public.js.map +1 -0
- package/dist/safe-bash/commands/network/shared.js +1 -1
- package/dist/safe-bash/commands/network/shared.js.map +1 -1
- package/dist/safe-bash/commands/network/wget.d.ts +4 -0
- package/dist/safe-bash/commands/network/wget.d.ts.map +1 -0
- package/dist/safe-bash/commands/network/wget.js +155 -0
- package/dist/safe-bash/commands/network/wget.js.map +1 -0
- package/dist/safe-bash/commands/xml/index.browser.js +3 -2
- package/dist/safe-bash/commands/yq/index.browser.js +4 -2
- package/dist/safe-bash/core.browser.js +42 -366
- package/dist/safe-bash/core.browser.js.map +4 -4
- package/dist/safe-bash/core.d.ts +1 -5
- package/dist/safe-bash/core.d.ts.map +1 -1
- package/dist/safe-bash/core.js +1 -3
- package/dist/safe-bash/core.js.map +1 -1
- package/package.json +9 -3
- package/dist/safe-bash/chunks/chunk-NYHAKXQ7.js.map +0 -7
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Budget,
|
|
3
3
|
Decimal,
|
|
4
|
-
FsError,
|
|
5
4
|
JqError,
|
|
6
5
|
JqLimitError,
|
|
7
6
|
compareNumbers,
|
|
8
7
|
copyObject,
|
|
9
8
|
decimalNumber,
|
|
10
|
-
escapeText,
|
|
11
|
-
getCommandArguments,
|
|
12
|
-
import_buffer,
|
|
13
|
-
init_platform,
|
|
14
9
|
interruptible,
|
|
15
10
|
isNumber,
|
|
16
11
|
isObject,
|
|
@@ -21,148 +16,30 @@ import {
|
|
|
21
16
|
objectKeyIterator,
|
|
22
17
|
objectKeys,
|
|
23
18
|
objectSize,
|
|
24
|
-
outputFailure,
|
|
25
|
-
pathOf,
|
|
26
19
|
put,
|
|
27
|
-
readBytes,
|
|
28
20
|
remove,
|
|
29
21
|
scalarJson,
|
|
30
|
-
shellValueByteLength,
|
|
31
22
|
truth,
|
|
32
|
-
wellFormed
|
|
33
|
-
|
|
23
|
+
wellFormed
|
|
24
|
+
} from "./chunk-54Z5EUCW.js";
|
|
25
|
+
import {
|
|
26
|
+
createOutputOperation
|
|
27
|
+
} from "./chunk-2GV4WO7O.js";
|
|
28
|
+
import {
|
|
29
|
+
FsError,
|
|
30
|
+
escapeText,
|
|
31
|
+
getCommandArguments,
|
|
32
|
+
import_buffer,
|
|
33
|
+
init_platform,
|
|
34
|
+
pathOf,
|
|
35
|
+
readBytes,
|
|
36
|
+
shellValueByteLength,
|
|
34
37
|
yieldTurn
|
|
35
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-LUJYX5H5.js";
|
|
36
39
|
|
|
37
40
|
// packages/safe-bash/src/commands/yq/index.ts
|
|
38
41
|
init_platform();
|
|
39
42
|
|
|
40
|
-
// packages/safe-bash/src/contracts/output.ts
|
|
41
|
-
init_platform();
|
|
42
|
-
function createOutputOperation(context, destination) {
|
|
43
|
-
const controller = new AbortController();
|
|
44
|
-
const signal = controller.signal;
|
|
45
|
-
const capability = destination.ownedOutput;
|
|
46
|
-
const callbacks = [];
|
|
47
|
-
const children = [];
|
|
48
|
-
const closedReason = new Error("Output operation is closed");
|
|
49
|
-
let accepting = true;
|
|
50
|
-
let drain;
|
|
51
|
-
const assertOpen = () => {
|
|
52
|
-
context.signal.throwIfAborted();
|
|
53
|
-
signal.throwIfAborted();
|
|
54
|
-
if (!accepting) throw closedReason;
|
|
55
|
-
};
|
|
56
|
-
const close = () => {
|
|
57
|
-
if (drain) return drain;
|
|
58
|
-
accepting = false;
|
|
59
|
-
drain = Promise.resolve().then(async () => {
|
|
60
|
-
try {
|
|
61
|
-
const results = await Promise.allSettled(callbacks.map(async (cleanup) => cleanup()));
|
|
62
|
-
const failures = results.filter((result) => result.status === "rejected").map((result) => result.reason);
|
|
63
|
-
if (failures.length === 1) throw failures[0];
|
|
64
|
-
if (failures.length) throw new AggregateError(failures, "Output operation cleanup failed");
|
|
65
|
-
} finally {
|
|
66
|
-
context.signal.removeEventListener("abort", callerAbort);
|
|
67
|
-
capability?.consumerClosed.removeEventListener("abort", outputAbort);
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
void drain.catch(() => {
|
|
71
|
-
});
|
|
72
|
-
for (const child of children) void child.close().catch(() => {
|
|
73
|
-
});
|
|
74
|
-
return drain;
|
|
75
|
-
};
|
|
76
|
-
const abort = (reason) => {
|
|
77
|
-
controller.abort(reason);
|
|
78
|
-
void close().catch(() => {
|
|
79
|
-
});
|
|
80
|
-
};
|
|
81
|
-
const callerAbort = () => abort(context.signal.reason);
|
|
82
|
-
const outputAbort = () => abort(capability?.consumerClosed.reason);
|
|
83
|
-
const registerCleanup = (cleanup) => {
|
|
84
|
-
assertOpen();
|
|
85
|
-
if (typeof cleanup !== "function") throw new TypeError("Cleanup must be callable");
|
|
86
|
-
callbacks.push(cleanup);
|
|
87
|
-
};
|
|
88
|
-
const wait = (pending) => new Promise((resolve, reject) => {
|
|
89
|
-
const aborted = () => reject(signal.reason);
|
|
90
|
-
if (signal.aborted) aborted();
|
|
91
|
-
else signal.addEventListener("abort", aborted, { once: true });
|
|
92
|
-
pending.then((value) => {
|
|
93
|
-
signal.removeEventListener("abort", aborted);
|
|
94
|
-
resolve(value);
|
|
95
|
-
}, (error) => {
|
|
96
|
-
signal.removeEventListener("abort", aborted);
|
|
97
|
-
reject(error);
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
context.registerCleanup?.(close);
|
|
101
|
-
if (context.signal.aborted) callerAbort();
|
|
102
|
-
else if (capability?.consumerClosed.aborted) outputAbort();
|
|
103
|
-
else {
|
|
104
|
-
context.signal.addEventListener("abort", callerAbort, { once: true });
|
|
105
|
-
capability?.consumerClosed.addEventListener("abort", outputAbort, { once: true });
|
|
106
|
-
}
|
|
107
|
-
return {
|
|
108
|
-
signal,
|
|
109
|
-
output: {
|
|
110
|
-
...destination[outputFailure] ? { [outputFailure]: destination[outputFailure] } : {},
|
|
111
|
-
async write(chunk) {
|
|
112
|
-
assertOpen();
|
|
113
|
-
await writeBytes(capability ?? destination, chunk, signal);
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
|
-
registerCleanup,
|
|
117
|
-
child(destination2) {
|
|
118
|
-
assertOpen();
|
|
119
|
-
const child = createOutputOperation({ signal, registerCleanup }, destination2);
|
|
120
|
-
children.push(child);
|
|
121
|
-
return child;
|
|
122
|
-
},
|
|
123
|
-
async acquire(start, release) {
|
|
124
|
-
assertOpen();
|
|
125
|
-
let resource;
|
|
126
|
-
let settled;
|
|
127
|
-
const admitted = new Promise((resolve) => {
|
|
128
|
-
settled = resolve;
|
|
129
|
-
});
|
|
130
|
-
let released;
|
|
131
|
-
const dispose = () => {
|
|
132
|
-
released ??= admitted.then(async () => {
|
|
133
|
-
if (resource) await release(resource.value);
|
|
134
|
-
});
|
|
135
|
-
return released;
|
|
136
|
-
};
|
|
137
|
-
registerCleanup(dispose);
|
|
138
|
-
let acquisition;
|
|
139
|
-
try {
|
|
140
|
-
acquisition = Promise.resolve(start(signal));
|
|
141
|
-
} catch (error) {
|
|
142
|
-
acquisition = Promise.reject(error);
|
|
143
|
-
}
|
|
144
|
-
const pending = acquisition.then(async (value) => {
|
|
145
|
-
resource = { value };
|
|
146
|
-
settled();
|
|
147
|
-
if (!accepting) {
|
|
148
|
-
await dispose();
|
|
149
|
-
throw signal.aborted ? signal.reason : closedReason;
|
|
150
|
-
}
|
|
151
|
-
return value;
|
|
152
|
-
}, (error) => {
|
|
153
|
-
settled();
|
|
154
|
-
throw error;
|
|
155
|
-
});
|
|
156
|
-
return wait(pending);
|
|
157
|
-
},
|
|
158
|
-
close,
|
|
159
|
-
abort(reason) {
|
|
160
|
-
abort(reason);
|
|
161
|
-
return close();
|
|
162
|
-
}
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
|
|
166
43
|
// packages/safe-bash/src/commands/structured/query-core.ts
|
|
167
44
|
init_platform();
|
|
168
45
|
|
|
@@ -5265,7 +5142,6 @@ function yqCommands(options = {}) {
|
|
|
5265
5142
|
}
|
|
5266
5143
|
|
|
5267
5144
|
export {
|
|
5268
|
-
createOutputOperation,
|
|
5269
5145
|
parseJson,
|
|
5270
5146
|
jsonValues,
|
|
5271
5147
|
rawValues,
|
|
@@ -5276,4 +5152,4 @@ export {
|
|
|
5276
5152
|
createYqCommands,
|
|
5277
5153
|
yqCommands
|
|
5278
5154
|
};
|
|
5279
|
-
//# sourceMappingURL=chunk-
|
|
5155
|
+
//# sourceMappingURL=chunk-6MHYEBAJ.js.map
|