swarm-deploy 0.1.0 → 0.3.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/CHANGELOG.md +60 -0
- package/README.md +780 -50
- package/RELEASING.md +2 -2
- package/SECURITY.md +2 -3
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +182 -25
- package/dist/cli.js.map +1 -1
- package/dist/client.d.ts +32 -27
- package/dist/client.js +103 -54
- package/dist/client.js.map +1 -1
- package/dist/errors.d.ts +6 -0
- package/dist/errors.js +6 -0
- package/dist/errors.js.map +1 -1
- package/dist/files.d.ts +13 -28
- package/dist/files.js +13 -78
- package/dist/files.js.map +1 -1
- package/dist/hooks-module.d.ts +9 -0
- package/dist/hooks-module.js +118 -0
- package/dist/hooks-module.js.map +1 -0
- package/dist/hooks.d.ts +69 -0
- package/dist/hooks.js +88 -0
- package/dist/hooks.js.map +1 -0
- package/dist/index.d.ts +8 -4
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/release.d.ts +26 -0
- package/dist/release.js +419 -0
- package/dist/release.js.map +1 -0
- package/dist/server.d.ts +97 -0
- package/dist/server.js +527 -53
- package/dist/server.js.map +1 -1
- package/dist/storage/commit-journal.d.ts +39 -2
- package/dist/storage/commit-journal.js +140 -2
- package/dist/storage/commit-journal.js.map +1 -1
- package/dist/storage/commit-store.d.ts +69 -8
- package/dist/storage/commit-store.js +374 -22
- package/dist/storage/commit-store.js.map +1 -1
- package/dist/storage/layout.js +7 -1
- package/dist/storage/layout.js.map +1 -1
- package/dist/storage/link-store.d.ts +88 -0
- package/dist/storage/link-store.js +448 -0
- package/dist/storage/link-store.js.map +1 -0
- package/dist/storage/recovery.d.ts +2 -1
- package/dist/storage/recovery.js +8 -1
- package/dist/storage/recovery.js.map +1 -1
- package/dist/storage/retention.d.ts +41 -21
- package/dist/storage/retention.js +162 -8
- package/dist/storage/retention.js.map +1 -1
- package/dist/storage/tar-session-store.d.ts +36 -5
- package/dist/storage/tar-session-store.js +283 -55
- package/dist/storage/tar-session-store.js.map +1 -1
- package/dist/storage/tree-fs.d.ts +44 -0
- package/dist/storage/tree-fs.js +580 -0
- package/dist/storage/tree-fs.js.map +1 -0
- package/dist/storage/tree-staging.d.ts +9 -0
- package/dist/storage/tree-staging.js +64 -0
- package/dist/storage/tree-staging.js.map +1 -0
- package/dist/storage/types.d.ts +15 -0
- package/dist/symlinks.d.ts +44 -0
- package/dist/symlinks.js +153 -0
- package/dist/symlinks.js.map +1 -0
- package/dist/tar-protocol/controls.d.ts +52 -0
- package/dist/tar-protocol/controls.js +160 -2
- package/dist/tar-protocol/controls.js.map +1 -1
- package/dist/tar-protocol/direct-wire.d.ts +8 -3
- package/dist/tar-protocol/direct-wire.js +14 -3
- package/dist/tar-protocol/direct-wire.js.map +1 -1
- package/dist/tar-protocol/manifest.d.ts +13 -1
- package/dist/tar-protocol/manifest.js +26 -1
- package/dist/tar-protocol/manifest.js.map +1 -1
- package/dist/tar-protocol/tree-extract.d.ts +37 -0
- package/dist/tar-protocol/tree-extract.js +240 -0
- package/dist/tar-protocol/tree-extract.js.map +1 -0
- package/dist/tar-protocol/tree-manifest.d.ts +45 -0
- package/dist/tar-protocol/tree-manifest.js +277 -0
- package/dist/tar-protocol/tree-manifest.js.map +1 -0
- package/dist/tar-protocol/tree-path.d.ts +15 -0
- package/dist/tar-protocol/tree-path.js +68 -0
- package/dist/tar-protocol/tree-path.js.map +1 -0
- package/dist/tar-protocol/tree.d.ts +68 -0
- package/dist/tar-protocol/tree.js +269 -0
- package/dist/tar-protocol/tree.js.map +1 -0
- package/dist/tar-protocol/ustar.d.ts +14 -0
- package/dist/tar-protocol/ustar.js +81 -1
- package/dist/tar-protocol/ustar.js.map +1 -1
- package/dist/types.d.ts +3 -0
- package/package.json +3 -1
package/dist/release.js
ADDED
|
@@ -0,0 +1,419 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ReleaseMatcher = exports.MAX_RELEASE_COMPONENT_BYTES = void 0;
|
|
7
|
+
exports.fixedSeriesKey = fixedSeriesKey;
|
|
8
|
+
exports.compareReleaseVersions = compareReleaseVersions;
|
|
9
|
+
exports.releaseVersionGroup = releaseVersionGroup;
|
|
10
|
+
const b4a_1 = __importDefault(require("b4a"));
|
|
11
|
+
const semver_1 = require("semver");
|
|
12
|
+
const files_js_1 = require("./files.js");
|
|
13
|
+
const hash_js_1 = require("./tar-protocol/hash.js");
|
|
14
|
+
const PLACEHOLDER_SERIES = '{series}';
|
|
15
|
+
const PLACEHOLDER_VERSION = '{version}';
|
|
16
|
+
/** Protocol: artifact basenames are one safe path component, max 100 UTF-8 bytes (`+` disallowed). */
|
|
17
|
+
exports.MAX_RELEASE_COMPONENT_BYTES = 100;
|
|
18
|
+
const SAFE_ARTIFACT = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
|
|
19
|
+
/** Immediate source parent: same 100-byte single-component rule; `+` allowed for SemVer build metadata. */
|
|
20
|
+
const SAFE_SOURCE_PARENT = /^[A-Za-z0-9][A-Za-z0-9._+-]*$/;
|
|
21
|
+
const FIXED_SERIES_PREFIX = 'fixed-';
|
|
22
|
+
/** The exact shape `fixedSeriesKey` produces; captures may not occupy it. */
|
|
23
|
+
const RESERVED_FIXED_SERIES = /^fixed-[0-9a-f]{64}$/;
|
|
24
|
+
/**
|
|
25
|
+
* The persisted series of a template that captures no `{series}`.
|
|
26
|
+
*
|
|
27
|
+
* The template text itself cannot be the key: braces and slashes fail the
|
|
28
|
+
* commit-record basename rules, so every version-only pattern would reject at
|
|
29
|
+
* commit time. Hashing gives a safe 70-byte basename that is stable across
|
|
30
|
+
* restarts and identical on Node and Bare, and distinct templates that happen
|
|
31
|
+
* to describe the same literals stay distinct releases.
|
|
32
|
+
*/
|
|
33
|
+
function fixedSeriesKey(template) {
|
|
34
|
+
return `${FIXED_SERIES_PREFIX}${b4a_1.default.toString((0, hash_js_1.sodiumSha256)(b4a_1.default.from(template)), 'hex')}`;
|
|
35
|
+
}
|
|
36
|
+
function placeholderCount(template, placeholder) {
|
|
37
|
+
let count = 0;
|
|
38
|
+
let index = 0;
|
|
39
|
+
while ((index = template.indexOf(placeholder, index)) !== -1) {
|
|
40
|
+
count++;
|
|
41
|
+
index += placeholder.length;
|
|
42
|
+
}
|
|
43
|
+
return count;
|
|
44
|
+
}
|
|
45
|
+
function assertPlaceholderLayout(template) {
|
|
46
|
+
if (template.includes(`${PLACEHOLDER_SERIES}${PLACEHOLDER_VERSION}`) ||
|
|
47
|
+
template.includes(`${PLACEHOLDER_VERSION}${PLACEHOLDER_SERIES}`)) {
|
|
48
|
+
throw new Error('Invalid release template: adjacent placeholder');
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/** Literal text is matched verbatim, so a stray brace is always a typo, not a literal. */
|
|
52
|
+
function assertNoResidualBraces(template) {
|
|
53
|
+
const literals = template.split(PLACEHOLDER_SERIES).join('').split(PLACEHOLDER_VERSION).join('');
|
|
54
|
+
if (literals.includes('{') || literals.includes('}')) {
|
|
55
|
+
throw new Error('Invalid release template: unexpected brace');
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function componentByteLength(value) {
|
|
59
|
+
return b4a_1.default.from(value).byteLength;
|
|
60
|
+
}
|
|
61
|
+
function isSafeArtifactName(value) {
|
|
62
|
+
return (typeof value === 'string' &&
|
|
63
|
+
value.length > 0 &&
|
|
64
|
+
SAFE_ARTIFACT.test(value) &&
|
|
65
|
+
componentByteLength(value) <= exports.MAX_RELEASE_COMPONENT_BYTES);
|
|
66
|
+
}
|
|
67
|
+
function isSafeSourceParent(value) {
|
|
68
|
+
return (typeof value === 'string' &&
|
|
69
|
+
value.length > 0 &&
|
|
70
|
+
SAFE_SOURCE_PARENT.test(value) &&
|
|
71
|
+
componentByteLength(value) <= exports.MAX_RELEASE_COMPONENT_BYTES &&
|
|
72
|
+
!value.includes('/') &&
|
|
73
|
+
!value.includes('\\'));
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* A captured `{series}` may not take the shape of a derived fixed-series key,
|
|
77
|
+
* so an upload cannot name itself into the rotation group of a version-only
|
|
78
|
+
* pattern. The namespace is reserved rather than escaped: a collision is a
|
|
79
|
+
* non-match, which fails closed as an unmatched offer.
|
|
80
|
+
*/
|
|
81
|
+
function isSafeSeriesCapture(value) {
|
|
82
|
+
return (SAFE_ARTIFACT.test(value) &&
|
|
83
|
+
componentByteLength(value) <= exports.MAX_RELEASE_COMPONENT_BYTES &&
|
|
84
|
+
!RESERVED_FIXED_SERIES.test(value));
|
|
85
|
+
}
|
|
86
|
+
function validateStrictReleaseVersion(raw) {
|
|
87
|
+
if (raw.length === 0 || componentByteLength(raw) > exports.MAX_RELEASE_COMPONENT_BYTES) {
|
|
88
|
+
return undefined;
|
|
89
|
+
}
|
|
90
|
+
if (raw.trim() !== raw)
|
|
91
|
+
return undefined;
|
|
92
|
+
if (/^[vV]/.test(raw))
|
|
93
|
+
return undefined;
|
|
94
|
+
if (/[/\\]/.test(raw))
|
|
95
|
+
return undefined;
|
|
96
|
+
try {
|
|
97
|
+
const parsed = new semver_1.SemVer(raw, { loose: false });
|
|
98
|
+
const core = raw.split('+', 1)[0];
|
|
99
|
+
if (core !== parsed.version)
|
|
100
|
+
return undefined;
|
|
101
|
+
return parsed;
|
|
102
|
+
}
|
|
103
|
+
catch {
|
|
104
|
+
return undefined;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
function normalizeCapturedVersion(raw) {
|
|
108
|
+
return validateStrictReleaseVersion(raw)?.version;
|
|
109
|
+
}
|
|
110
|
+
function parseReleaseVersion(raw) {
|
|
111
|
+
const parsed = validateStrictReleaseVersion(raw);
|
|
112
|
+
if (!parsed)
|
|
113
|
+
throw new Error('Invalid release version');
|
|
114
|
+
return parsed;
|
|
115
|
+
}
|
|
116
|
+
function parseSegmentParts(template) {
|
|
117
|
+
const parts = [];
|
|
118
|
+
let cursor = 0;
|
|
119
|
+
while (cursor < template.length) {
|
|
120
|
+
const seriesAt = template.indexOf(PLACEHOLDER_SERIES, cursor);
|
|
121
|
+
const versionAt = template.indexOf(PLACEHOLDER_VERSION, cursor);
|
|
122
|
+
let next = -1;
|
|
123
|
+
let kind = null;
|
|
124
|
+
if (seriesAt !== -1 && (versionAt === -1 || seriesAt < versionAt)) {
|
|
125
|
+
next = seriesAt;
|
|
126
|
+
kind = 'series';
|
|
127
|
+
}
|
|
128
|
+
else if (versionAt !== -1) {
|
|
129
|
+
next = versionAt;
|
|
130
|
+
kind = 'version';
|
|
131
|
+
}
|
|
132
|
+
if (next === -1) {
|
|
133
|
+
parts.push({ kind: 'literal', text: template.slice(cursor) });
|
|
134
|
+
break;
|
|
135
|
+
}
|
|
136
|
+
if (next > cursor) {
|
|
137
|
+
parts.push({ kind: 'literal', text: template.slice(cursor, next) });
|
|
138
|
+
}
|
|
139
|
+
parts.push({ kind: kind });
|
|
140
|
+
cursor = next + (kind === 'series' ? PLACEHOLDER_SERIES.length : PLACEHOLDER_VERSION.length);
|
|
141
|
+
}
|
|
142
|
+
return parts;
|
|
143
|
+
}
|
|
144
|
+
function compileSegmentPlan(template) {
|
|
145
|
+
const seriesCount = placeholderCount(template, PLACEHOLDER_SERIES);
|
|
146
|
+
const versionCount = placeholderCount(template, PLACEHOLDER_VERSION);
|
|
147
|
+
if (seriesCount > 1 || versionCount > 1) {
|
|
148
|
+
throw new Error('Invalid release template: repeated placeholder');
|
|
149
|
+
}
|
|
150
|
+
const parts = parseSegmentParts(template);
|
|
151
|
+
return {
|
|
152
|
+
plan: { parts },
|
|
153
|
+
hasSeries: seriesCount > 0,
|
|
154
|
+
hasVersion: versionCount > 0
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
function compileParentMatcher(parent) {
|
|
158
|
+
if (placeholderCount(parent, PLACEHOLDER_SERIES) === 0 &&
|
|
159
|
+
placeholderCount(parent, PLACEHOLDER_VERSION) === 0) {
|
|
160
|
+
return { literal: parent, plan: null, hasVersion: false };
|
|
161
|
+
}
|
|
162
|
+
const compiled = compileSegmentPlan(parent);
|
|
163
|
+
return { literal: null, plan: compiled.plan, hasVersion: compiled.hasVersion };
|
|
164
|
+
}
|
|
165
|
+
function compileTemplate(template) {
|
|
166
|
+
assertNoResidualBraces(template);
|
|
167
|
+
assertPlaceholderLayout(template);
|
|
168
|
+
const seriesCount = placeholderCount(template, PLACEHOLDER_SERIES);
|
|
169
|
+
const versionCount = placeholderCount(template, PLACEHOLDER_VERSION);
|
|
170
|
+
if (seriesCount === 0 && versionCount === 0) {
|
|
171
|
+
throw new Error('Invalid release template: missing placeholder');
|
|
172
|
+
}
|
|
173
|
+
if (seriesCount > 1 || versionCount > 1) {
|
|
174
|
+
throw new Error('Invalid release template: repeated placeholder');
|
|
175
|
+
}
|
|
176
|
+
const segments = template.split('/');
|
|
177
|
+
if (segments.some((segment) => segment.length === 0)) {
|
|
178
|
+
throw new Error('Invalid release template: empty segment');
|
|
179
|
+
}
|
|
180
|
+
if (segments.length > 2) {
|
|
181
|
+
throw new Error('Invalid release template: path separator outside parent boundary');
|
|
182
|
+
}
|
|
183
|
+
const fixedSeries = seriesCount === 0 ? fixedSeriesKey(template) : null;
|
|
184
|
+
if (fixedSeries !== null) {
|
|
185
|
+
try {
|
|
186
|
+
(0, files_js_1.validateBasename)(fixedSeries);
|
|
187
|
+
}
|
|
188
|
+
catch (error) {
|
|
189
|
+
throw new Error('Invalid release template: unusable fixed series key', { cause: error });
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
if (segments.length === 1) {
|
|
193
|
+
const basename = compileSegmentPlan(template);
|
|
194
|
+
return {
|
|
195
|
+
fixedSeries,
|
|
196
|
+
versionInParent: false,
|
|
197
|
+
versionInBasename: basename.hasVersion,
|
|
198
|
+
parent: null,
|
|
199
|
+
basename: basename.plan
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
const parentSegment = segments[0];
|
|
203
|
+
const basenameSegment = segments[1];
|
|
204
|
+
const parent = compileParentMatcher(parentSegment);
|
|
205
|
+
const basename = compileSegmentPlan(basenameSegment);
|
|
206
|
+
return {
|
|
207
|
+
fixedSeries,
|
|
208
|
+
versionInParent: parent.hasVersion,
|
|
209
|
+
versionInBasename: basename.hasVersion,
|
|
210
|
+
parent,
|
|
211
|
+
basename: basename.plan
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
function assignPlaceholderPair(first, second, left, right) {
|
|
215
|
+
if (first === 'series' && second === 'version') {
|
|
216
|
+
if (!isSafeSeriesCapture(left))
|
|
217
|
+
return null;
|
|
218
|
+
const version = normalizeCapturedVersion(right);
|
|
219
|
+
return version ? { series: left, version } : null;
|
|
220
|
+
}
|
|
221
|
+
if (first === 'version' && second === 'series') {
|
|
222
|
+
const version = normalizeCapturedVersion(left);
|
|
223
|
+
if (!version)
|
|
224
|
+
return null;
|
|
225
|
+
if (!isSafeSeriesCapture(right))
|
|
226
|
+
return null;
|
|
227
|
+
return { series: right, version };
|
|
228
|
+
}
|
|
229
|
+
return null;
|
|
230
|
+
}
|
|
231
|
+
function splitSeriesThenVersion(stem) {
|
|
232
|
+
for (let index = stem.lastIndexOf('-'); index > 0; index = stem.lastIndexOf('-', index - 1)) {
|
|
233
|
+
const groups = assignPlaceholderPair('series', 'version', stem.slice(0, index), stem.slice(index + 1));
|
|
234
|
+
if (groups)
|
|
235
|
+
return groups;
|
|
236
|
+
}
|
|
237
|
+
return null;
|
|
238
|
+
}
|
|
239
|
+
function splitVersionThenSeries(stem) {
|
|
240
|
+
for (let index = stem.indexOf('-'); index > 0; index = stem.indexOf('-', index + 1)) {
|
|
241
|
+
const groups = assignPlaceholderPair('version', 'series', stem.slice(0, index), stem.slice(index + 1));
|
|
242
|
+
if (groups)
|
|
243
|
+
return groups;
|
|
244
|
+
}
|
|
245
|
+
return null;
|
|
246
|
+
}
|
|
247
|
+
function tryLiteralSeparator(stem, separator, first, second) {
|
|
248
|
+
if (separator.length === 0)
|
|
249
|
+
return null;
|
|
250
|
+
let index = stem.indexOf(separator);
|
|
251
|
+
while (index !== -1) {
|
|
252
|
+
const left = stem.slice(0, index);
|
|
253
|
+
const right = stem.slice(index + separator.length);
|
|
254
|
+
const groups = assignPlaceholderPair(first, second, left, right);
|
|
255
|
+
if (groups)
|
|
256
|
+
return groups;
|
|
257
|
+
index = stem.indexOf(separator, index + 1);
|
|
258
|
+
}
|
|
259
|
+
return null;
|
|
260
|
+
}
|
|
261
|
+
function matchStem(middle, stem) {
|
|
262
|
+
if (middle.length === 1) {
|
|
263
|
+
const part = middle[0];
|
|
264
|
+
if (part.kind === 'series') {
|
|
265
|
+
return isSafeSeriesCapture(stem) ? { series: stem } : null;
|
|
266
|
+
}
|
|
267
|
+
const version = normalizeCapturedVersion(stem);
|
|
268
|
+
return version ? { version } : null;
|
|
269
|
+
}
|
|
270
|
+
if (middle.length === 3 &&
|
|
271
|
+
middle[0].kind !== 'literal' &&
|
|
272
|
+
middle[1].kind === 'literal' &&
|
|
273
|
+
middle[2].kind !== 'literal') {
|
|
274
|
+
const first = middle[0].kind;
|
|
275
|
+
const separator = middle[1].text;
|
|
276
|
+
const second = middle[2].kind;
|
|
277
|
+
if (first === 'series' && second === 'version' && separator === '-') {
|
|
278
|
+
const split = splitSeriesThenVersion(stem);
|
|
279
|
+
if (split)
|
|
280
|
+
return split;
|
|
281
|
+
}
|
|
282
|
+
if (first === 'version' && second === 'series' && separator === '-') {
|
|
283
|
+
const split = splitVersionThenSeries(stem);
|
|
284
|
+
if (split)
|
|
285
|
+
return split;
|
|
286
|
+
}
|
|
287
|
+
return tryLiteralSeparator(stem, separator, first, second);
|
|
288
|
+
}
|
|
289
|
+
return null;
|
|
290
|
+
}
|
|
291
|
+
function matchSegmentPlan(plan, value) {
|
|
292
|
+
const { parts } = plan;
|
|
293
|
+
if (parts.length === 0)
|
|
294
|
+
return null;
|
|
295
|
+
let prefix = '';
|
|
296
|
+
let start = 0;
|
|
297
|
+
while (start < parts.length && parts[start].kind === 'literal') {
|
|
298
|
+
prefix += parts[start].text;
|
|
299
|
+
start++;
|
|
300
|
+
}
|
|
301
|
+
let suffix = '';
|
|
302
|
+
let end = parts.length - 1;
|
|
303
|
+
while (end >= start && parts[end].kind === 'literal') {
|
|
304
|
+
suffix = parts[end].text + suffix;
|
|
305
|
+
end--;
|
|
306
|
+
}
|
|
307
|
+
if (!value.startsWith(prefix) || !value.endsWith(suffix))
|
|
308
|
+
return null;
|
|
309
|
+
const stem = value.slice(prefix.length, value.length - suffix.length);
|
|
310
|
+
if (componentByteLength(stem) > exports.MAX_RELEASE_COMPONENT_BYTES)
|
|
311
|
+
return null;
|
|
312
|
+
const middle = parts.slice(start, end + 1);
|
|
313
|
+
if (middle.length === 0) {
|
|
314
|
+
return stem.length === 0 ? {} : null;
|
|
315
|
+
}
|
|
316
|
+
return matchStem(middle, stem);
|
|
317
|
+
}
|
|
318
|
+
function matchWithParent(pattern, sourceParent, name) {
|
|
319
|
+
if (!isSafeArtifactName(name))
|
|
320
|
+
return null;
|
|
321
|
+
let parentGroups = {};
|
|
322
|
+
const parent = pattern.parent;
|
|
323
|
+
if (parent.literal !== null) {
|
|
324
|
+
if (parent.literal !== sourceParent)
|
|
325
|
+
return null;
|
|
326
|
+
}
|
|
327
|
+
else {
|
|
328
|
+
const matched = matchSegmentPlan(parent.plan, sourceParent);
|
|
329
|
+
if (matched === null)
|
|
330
|
+
return null;
|
|
331
|
+
parentGroups = matched;
|
|
332
|
+
}
|
|
333
|
+
const basenameGroups = matchSegmentPlan(pattern.basename, name);
|
|
334
|
+
if (basenameGroups === null)
|
|
335
|
+
return null;
|
|
336
|
+
return { ...parentGroups, ...basenameGroups };
|
|
337
|
+
}
|
|
338
|
+
function coordinatesFromGroups(pattern, groups, mode) {
|
|
339
|
+
const series = pattern.fixedSeries ??
|
|
340
|
+
(typeof groups.series === 'string' && groups.series.length > 0 ? groups.series : null);
|
|
341
|
+
if (series === null)
|
|
342
|
+
return null;
|
|
343
|
+
if (pattern.fixedSeries === null && !isSafeSeriesCapture(series))
|
|
344
|
+
return null;
|
|
345
|
+
const normalized = groups.version;
|
|
346
|
+
const requiresVersion = mode === 'basename'
|
|
347
|
+
? pattern.versionInBasename
|
|
348
|
+
: pattern.versionInBasename || pattern.versionInParent;
|
|
349
|
+
if (requiresVersion && normalized === undefined)
|
|
350
|
+
return null;
|
|
351
|
+
if (normalized !== undefined) {
|
|
352
|
+
return { series, version: normalized };
|
|
353
|
+
}
|
|
354
|
+
return { series };
|
|
355
|
+
}
|
|
356
|
+
class ReleaseMatcher {
|
|
357
|
+
#patterns;
|
|
358
|
+
constructor(patterns) {
|
|
359
|
+
const seen = new Set();
|
|
360
|
+
const compiled = [];
|
|
361
|
+
for (const template of patterns) {
|
|
362
|
+
if (typeof template !== 'string') {
|
|
363
|
+
throw new Error('Invalid release template');
|
|
364
|
+
}
|
|
365
|
+
if (seen.has(template)) {
|
|
366
|
+
throw new Error('Invalid release template: duplicate template');
|
|
367
|
+
}
|
|
368
|
+
seen.add(template);
|
|
369
|
+
compiled.push(compileTemplate(template));
|
|
370
|
+
}
|
|
371
|
+
this.#patterns = compiled;
|
|
372
|
+
}
|
|
373
|
+
get size() {
|
|
374
|
+
return this.#patterns.length;
|
|
375
|
+
}
|
|
376
|
+
get hasVersionPattern() {
|
|
377
|
+
return this.#patterns.some((pattern) => pattern.versionInBasename || pattern.versionInParent);
|
|
378
|
+
}
|
|
379
|
+
match(name, sourceParent) {
|
|
380
|
+
if (!isSafeArtifactName(name))
|
|
381
|
+
return null;
|
|
382
|
+
if (sourceParent !== undefined && !isSafeSourceParent(sourceParent))
|
|
383
|
+
return null;
|
|
384
|
+
for (const pattern of this.#patterns) {
|
|
385
|
+
if (pattern.parent !== null) {
|
|
386
|
+
if (sourceParent === undefined)
|
|
387
|
+
continue;
|
|
388
|
+
const groups = matchWithParent(pattern, sourceParent, name);
|
|
389
|
+
if (groups) {
|
|
390
|
+
const coords = coordinatesFromGroups(pattern, groups, 'full');
|
|
391
|
+
if (coords)
|
|
392
|
+
return coords;
|
|
393
|
+
}
|
|
394
|
+
continue;
|
|
395
|
+
}
|
|
396
|
+
const basenameGroups = matchSegmentPlan(pattern.basename, name);
|
|
397
|
+
if (basenameGroups) {
|
|
398
|
+
const coords = coordinatesFromGroups(pattern, basenameGroups, 'basename');
|
|
399
|
+
if (coords)
|
|
400
|
+
return coords;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
return null;
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
exports.ReleaseMatcher = ReleaseMatcher;
|
|
407
|
+
function compareReleaseVersions(left, right) {
|
|
408
|
+
return (0, semver_1.compare)(parseReleaseVersion(left), parseReleaseVersion(right));
|
|
409
|
+
}
|
|
410
|
+
function releaseVersionGroup(version, granularity) {
|
|
411
|
+
if (granularity !== 'major' && granularity !== 'minor') {
|
|
412
|
+
throw new Error('Invalid version granularity');
|
|
413
|
+
}
|
|
414
|
+
const parsed = parseReleaseVersion(version);
|
|
415
|
+
if (granularity === 'major')
|
|
416
|
+
return String(parsed.major);
|
|
417
|
+
return `${parsed.major}.${parsed.minor}`;
|
|
418
|
+
}
|
|
419
|
+
//# sourceMappingURL=release.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"release.js","sourceRoot":"","sources":["../src/release.ts"],"names":[],"mappings":";;;;;;;;;AAAA,8CAAqB;AACrB,mCAAwC;AACxC,yCAA6C;AAC7C,oDAAqD;AASrD,MAAM,kBAAkB,GAAG,UAAU,CAAA;AACrC,MAAM,mBAAmB,GAAG,WAAW,CAAA;AAEvC,sGAAsG;AACzF,QAAA,2BAA2B,GAAG,GAAG,CAAA;AAE9C,MAAM,aAAa,GAAG,8BAA8B,CAAA;AACpD,2GAA2G;AAC3G,MAAM,kBAAkB,GAAG,+BAA+B,CAAA;AA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cAAc,EAAE,UAAU,CAAC,CAAA;gBACzE,IAAI,MAAM;oBAAE,OAAO,MAAM,CAAA;YAC3B,CAAC;QACH,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;CACF;;AAED,gCAAuC,IAAY,EAAE,KAAa;IAChE,OAAO,IAAA,gBAAO,EAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,mBAAmB,CAAC,KAAK,CAAC,CAAC,CAAA;AACvE,CAAC;AAED,6BAAoC,OAAe,EAAE,WAA+B;IAClF,IAAI,WAAW,KAAK,OAAO,IAAI,WAAW,KAAK,OAAO,EAAE,CAAC;QACvD,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAA;IAChD,CAAC;IACD,MAAM,MAAM,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAA;IAC3C,IAAI,WAAW,KAAK,OAAO;QAAE,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IACxD,OAAO,GAAG,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,KAAK,EAAE,CAAA;AAC1C,CAAC"}
|
package/dist/server.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import events from '#events';
|
|
2
2
|
import { type DirectDhtFactory, type DirectDhtNode } from './direct-dht.js';
|
|
3
3
|
import { type ErrorCode } from './errors.js';
|
|
4
|
+
import { type ServerHooks } from './hooks.js';
|
|
5
|
+
import { type VersionGranularity } from './release.js';
|
|
4
6
|
import type { StorageAdapter } from './storage/types.js';
|
|
7
|
+
import { type CompiledSymlinkRule, type SymlinkRule } from './symlinks.js';
|
|
5
8
|
import type { AuthenticationEvent, FingerprintEvent, Logger, PublicKey, PublicKeyInput, SeedInput, ServerScheduler, TransferEvent, TransferLifecycleEvent } from './types.js';
|
|
6
9
|
declare const EventEmitter: typeof events;
|
|
7
10
|
declare const DEFAULT_MAX_CONNECTIONS = 64;
|
|
@@ -10,6 +13,15 @@ declare const DEFAULT_MIN_FREE_BYTES: number;
|
|
|
10
13
|
declare const MAX_CONNECTIONS = 1024;
|
|
11
14
|
declare const MAX_ACTIVE_UPLOADS = 1024;
|
|
12
15
|
declare const FINGERPRINT_LENGTH = 12;
|
|
16
|
+
/**
|
|
17
|
+
* How many transfers may owe a deferred post-commit retention pass at once.
|
|
18
|
+
*
|
|
19
|
+
* The set grows only when an `afterCommit` hook fails after a durable commit,
|
|
20
|
+
* and entries are removed as soon as a retry succeeds, so reaching the bound
|
|
21
|
+
* means a persistently failing hook. Capping it at the connection ceiling
|
|
22
|
+
* keeps a broken deployment step from growing server memory without limit.
|
|
23
|
+
*/
|
|
24
|
+
export declare const MAX_OWED_POST_COMMIT_RETENTION = 1024;
|
|
13
25
|
export type ServerLogger = Logger;
|
|
14
26
|
export type AllowlistKey = PublicKeyInput | string;
|
|
15
27
|
export interface ServerOptions {
|
|
@@ -26,12 +38,21 @@ export interface ServerOptions {
|
|
|
26
38
|
minFreeBytes?: number;
|
|
27
39
|
maxAge?: number;
|
|
28
40
|
maxStorageBytes?: number;
|
|
41
|
+
/** Ordered release templates; when non-empty every new offer must match one. */
|
|
42
|
+
artifactPatterns?: Iterable<string>;
|
|
43
|
+
maxCount?: number;
|
|
44
|
+
maxVersions?: number;
|
|
45
|
+
versionGranularity?: VersionGranularity;
|
|
29
46
|
dht?: DirectDhtNode;
|
|
30
47
|
dhtFactory?: DirectDhtFactory;
|
|
31
48
|
storage?: StorageAdapter;
|
|
32
49
|
scheduler?: ServerScheduler;
|
|
33
50
|
logger?: Logger | null;
|
|
34
51
|
replaceNames?: Iterable<string>;
|
|
52
|
+
/** Optional deployment lifecycle callbacks; snapshotted at construction. */
|
|
53
|
+
hooks?: ServerHooks | null;
|
|
54
|
+
/** Repeatable managed-symlink rules; snapshotted and validated at construction. */
|
|
55
|
+
symlinks?: Iterable<SymlinkRule>;
|
|
35
56
|
}
|
|
36
57
|
export interface ServerConnectionEvent extends FingerprintEvent {
|
|
37
58
|
connections: number;
|
|
@@ -64,11 +85,19 @@ export interface RetentionEvent {
|
|
|
64
85
|
expiredSessions?: number;
|
|
65
86
|
scrubbed?: number;
|
|
66
87
|
ageDeleted?: number;
|
|
88
|
+
countDeleted?: number;
|
|
89
|
+
versionDeleted?: number;
|
|
67
90
|
storageDeleted?: number;
|
|
68
91
|
}
|
|
69
92
|
export interface ServerCloseEvent {
|
|
70
93
|
status: 'closed' | 'failed';
|
|
71
94
|
}
|
|
95
|
+
export interface ServerLinkEvent extends FingerprintEvent {
|
|
96
|
+
target: string;
|
|
97
|
+
name: string;
|
|
98
|
+
status: 'linked' | 'unchanged' | 'rejected' | 'failed';
|
|
99
|
+
reason?: ErrorCode;
|
|
100
|
+
}
|
|
72
101
|
export interface ServerEventMap {
|
|
73
102
|
authentication: AuthenticationEvent;
|
|
74
103
|
connection: ServerConnectionEvent;
|
|
@@ -80,6 +109,7 @@ export interface ServerEventMap {
|
|
|
80
109
|
commit: ServerTransferLifecycleEvent;
|
|
81
110
|
recovery: RecoveryEvent;
|
|
82
111
|
retention: RetentionEvent;
|
|
112
|
+
link: ServerLinkEvent;
|
|
83
113
|
failure: FingerprintEvent & {
|
|
84
114
|
reason: ErrorCode;
|
|
85
115
|
};
|
|
@@ -108,6 +138,11 @@ export declare class Server extends EventEmitter {
|
|
|
108
138
|
readonly minFreeBytes: number;
|
|
109
139
|
readonly maxAge: number | undefined;
|
|
110
140
|
readonly maxStorageBytes: number | undefined;
|
|
141
|
+
readonly artifactPatterns: readonly string[];
|
|
142
|
+
readonly maxCount: number | undefined;
|
|
143
|
+
readonly maxVersions: number | undefined;
|
|
144
|
+
readonly versionGranularity: VersionGranularity | undefined;
|
|
145
|
+
private readonly releaseMatcher;
|
|
111
146
|
private readonly allowedKeySnapshot;
|
|
112
147
|
readonly logger: SafeLogger;
|
|
113
148
|
readonly dht: DirectDhtNode | undefined;
|
|
@@ -115,6 +150,11 @@ export declare class Server extends EventEmitter {
|
|
|
115
150
|
readonly storage: StorageAdapter;
|
|
116
151
|
readonly scheduler: ServerScheduler;
|
|
117
152
|
readonly replaceNames: ReadonlySet<string>;
|
|
153
|
+
readonly hooks: Readonly<ServerHooks>;
|
|
154
|
+
readonly symlinks: readonly CompiledSymlinkRule[];
|
|
155
|
+
readonly linkNames: ReadonlySet<string>;
|
|
156
|
+
private managedLinkNamesSnapshot;
|
|
157
|
+
private links;
|
|
118
158
|
listening: boolean;
|
|
119
159
|
closed: boolean;
|
|
120
160
|
private readonly keyPair;
|
|
@@ -122,6 +162,24 @@ export declare class Server extends EventEmitter {
|
|
|
122
162
|
private readonly abort;
|
|
123
163
|
private readonly active;
|
|
124
164
|
private readonly activeUploads;
|
|
165
|
+
/**
|
|
166
|
+
* Transfer IDs this process committed but whose deferred post-commit
|
|
167
|
+
* retention is still owed because `afterCommit` has not yet succeeded. Only
|
|
168
|
+
* these may start a retention pass from an already-committed retry, so an
|
|
169
|
+
* ordinary duplicate offer cannot be used to force repeated full passes.
|
|
170
|
+
* The set is in-memory only and bounded by `MAX_OWED_POST_COMMIT_RETENTION`;
|
|
171
|
+
* a restart or an eviction loses an entry, and the documented fallback is the
|
|
172
|
+
* next startup, scheduled, or commit-triggered pass.
|
|
173
|
+
*/
|
|
174
|
+
private readonly pendingAfterCommit;
|
|
175
|
+
/**
|
|
176
|
+
* Authenticated transfer IDs a connection currently owns. One connection
|
|
177
|
+
* holds at most one entry and releases it in a `finally`, so the set is
|
|
178
|
+
* bounded by `maxConnections`. A second connection offering the same
|
|
179
|
+
* transfer is rejected with `FILE_BUSY` rather than running the lifecycle
|
|
180
|
+
* and its hooks concurrently against one staging and commit identity.
|
|
181
|
+
*/
|
|
182
|
+
private readonly activeTransfers;
|
|
125
183
|
private readonly receives;
|
|
126
184
|
private layout;
|
|
127
185
|
private sessions;
|
|
@@ -132,10 +190,49 @@ export declare class Server extends EventEmitter {
|
|
|
132
190
|
private listenPromise;
|
|
133
191
|
private closePromise;
|
|
134
192
|
constructor(options: ServerOptions);
|
|
193
|
+
private artifactKind;
|
|
194
|
+
private payloadBytes;
|
|
195
|
+
private payloadDigest;
|
|
135
196
|
private emitSafe;
|
|
136
197
|
private allowed;
|
|
137
198
|
private transfer;
|
|
199
|
+
private rejectOffer;
|
|
200
|
+
private hookArtifact;
|
|
201
|
+
/**
|
|
202
|
+
* Computes and converges the desired links from durable commit records.
|
|
203
|
+
* Called with the root lease already held.
|
|
204
|
+
*/
|
|
205
|
+
private reconcileLinksUnlocked;
|
|
206
|
+
/** Pins link targets when reconciliation fails but retention must continue. */
|
|
207
|
+
private linkPinsFallbackUnlocked;
|
|
208
|
+
/** Reconciles after a durable commit; this is the only caller that leases the root. */
|
|
209
|
+
private reconcileAfterCommit;
|
|
210
|
+
private setManagedLinkNames;
|
|
211
|
+
private refreshManagedLinkNames;
|
|
212
|
+
private receiveLink;
|
|
213
|
+
/** Runs a gating callback; only callback exceptions become HOOK_FAILED. */
|
|
214
|
+
private runHook;
|
|
215
|
+
/** Runs onFailure once; its own failure is logged and never replaces the original. */
|
|
216
|
+
private runFailureHook;
|
|
138
217
|
private receive;
|
|
218
|
+
/**
|
|
219
|
+
* Records that a transfer still owes its deferred post-commit retention
|
|
220
|
+
* pass, keeping at most `MAX_OWED_POST_COMMIT_RETENTION` entries.
|
|
221
|
+
*
|
|
222
|
+
* `Set` preserves insertion order, so the oldest owed transfer is evicted
|
|
223
|
+
* first and eviction is deterministic. An evicted transfer loses nothing
|
|
224
|
+
* durable: its artifact is already committed and its rotation falls back to
|
|
225
|
+
* the next startup, scheduled, or commit-triggered pass.
|
|
226
|
+
*/
|
|
227
|
+
private owePostCommitRetention;
|
|
228
|
+
/**
|
|
229
|
+
* Runs the post-commit retention pass that a configured `afterCommit` hook
|
|
230
|
+
* deferred, only after that hook succeeded, and then stops owing it. The
|
|
231
|
+
* retention manager already reports its own failures as non-fatal, so
|
|
232
|
+
* nothing here can fail the upload; the pass is attempted exactly once per
|
|
233
|
+
* successful hook, which is why the transfer is cleared either way.
|
|
234
|
+
*/
|
|
235
|
+
private settleDeferredRetention;
|
|
139
236
|
/**
|
|
140
237
|
* Retires a committed session without letting cleanup undo a durable commit.
|
|
141
238
|
*
|