@microwiseai/snapshot 0.5.0 → 0.5.2
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/commands/install.d.ts.map +1 -1
- package/dist/commands/install.js +195 -34
- package/dist/commands/install.js.map +1 -1
- package/dist/commands/preflight.d.ts +31 -0
- package/dist/commands/preflight.d.ts.map +1 -0
- package/dist/commands/preflight.js +83 -0
- package/dist/commands/preflight.js.map +1 -0
- package/dist/commands/publish.d.ts +4 -0
- package/dist/commands/publish.d.ts.map +1 -1
- package/dist/commands/publish.js +35 -1
- package/dist/commands/publish.js.map +1 -1
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/distkit-closure-bridge.d.ts +102 -0
- package/dist/lib/distkit-closure-bridge.d.ts.map +1 -0
- package/dist/lib/distkit-closure-bridge.js +177 -0
- package/dist/lib/distkit-closure-bridge.js.map +1 -0
- package/dist/lib/distkit-closure-parity.d.ts +110 -0
- package/dist/lib/distkit-closure-parity.d.ts.map +1 -0
- package/dist/lib/distkit-closure-parity.js +134 -0
- package/dist/lib/distkit-closure-parity.js.map +1 -0
- package/dist/lib/distkit-routing-port.d.ts +37 -0
- package/dist/lib/distkit-routing-port.d.ts.map +1 -0
- package/dist/lib/distkit-routing-port.js +72 -0
- package/dist/lib/distkit-routing-port.js.map +1 -0
- package/dist/lib/install-timeline.d.ts +81 -0
- package/dist/lib/install-timeline.d.ts.map +1 -0
- package/dist/lib/install-timeline.js +243 -0
- package/dist/lib/install-timeline.js.map +1 -0
- package/dist/lib/preflight-adapter.d.ts +52 -0
- package/dist/lib/preflight-adapter.d.ts.map +1 -0
- package/dist/lib/preflight-adapter.js +224 -0
- package/dist/lib/preflight-adapter.js.map +1 -0
- package/dist/lib/transitive-resolver.d.ts +121 -0
- package/dist/lib/transitive-resolver.d.ts.map +1 -1
- package/dist/lib/transitive-resolver.js +190 -0
- package/dist/lib/transitive-resolver.js.map +1 -1
- package/node_modules/@gitdot/clone-lib/README.md +117 -0
- package/node_modules/@gitdot/clone-lib/dist/bin/gitdot-resolve.d.ts +9 -0
- package/node_modules/@gitdot/clone-lib/dist/bin/gitdot-resolve.d.ts.map +1 -0
- package/node_modules/@gitdot/clone-lib/dist/bin/gitdot-resolve.js +154 -0
- package/node_modules/@gitdot/clone-lib/dist/bin/gitdot-resolve.js.map +1 -0
- package/node_modules/@gitdot/clone-lib/dist/clone.d.ts +21 -0
- package/node_modules/@gitdot/clone-lib/dist/clone.d.ts.map +1 -0
- package/node_modules/@gitdot/clone-lib/dist/clone.js +228 -0
- package/node_modules/@gitdot/clone-lib/dist/clone.js.map +1 -0
- package/node_modules/@gitdot/clone-lib/dist/dotpath.d.ts +10 -0
- package/node_modules/@gitdot/clone-lib/dist/dotpath.d.ts.map +1 -0
- package/node_modules/@gitdot/clone-lib/dist/dotpath.js +27 -0
- package/node_modules/@gitdot/clone-lib/dist/dotpath.js.map +1 -0
- package/node_modules/@gitdot/clone-lib/dist/git.d.ts +23 -0
- package/node_modules/@gitdot/clone-lib/dist/git.d.ts.map +1 -0
- package/node_modules/@gitdot/clone-lib/dist/git.js +134 -0
- package/node_modules/@gitdot/clone-lib/dist/git.js.map +1 -0
- package/node_modules/@gitdot/clone-lib/dist/index.d.ts +17 -0
- package/node_modules/@gitdot/clone-lib/dist/index.d.ts.map +1 -0
- package/node_modules/@gitdot/clone-lib/dist/index.js +35 -0
- package/node_modules/@gitdot/clone-lib/dist/index.js.map +1 -0
- package/node_modules/@gitdot/clone-lib/dist/lock.d.ts +24 -0
- package/node_modules/@gitdot/clone-lib/dist/lock.d.ts.map +1 -0
- package/node_modules/@gitdot/clone-lib/dist/lock.js +97 -0
- package/node_modules/@gitdot/clone-lib/dist/lock.js.map +1 -0
- package/node_modules/@gitdot/clone-lib/dist/resolve/gitlab.d.ts +15 -0
- package/node_modules/@gitdot/clone-lib/dist/resolve/gitlab.d.ts.map +1 -0
- package/node_modules/@gitdot/clone-lib/dist/resolve/gitlab.js +124 -0
- package/node_modules/@gitdot/clone-lib/dist/resolve/gitlab.js.map +1 -0
- package/node_modules/@gitdot/clone-lib/dist/resolve/index.d.ts +12 -0
- package/node_modules/@gitdot/clone-lib/dist/resolve/index.d.ts.map +1 -0
- package/node_modules/@gitdot/clone-lib/dist/resolve/index.js +31 -0
- package/node_modules/@gitdot/clone-lib/dist/resolve/index.js.map +1 -0
- package/node_modules/@gitdot/clone-lib/dist/resolve/manifest.d.ts +32 -0
- package/node_modules/@gitdot/clone-lib/dist/resolve/manifest.d.ts.map +1 -0
- package/node_modules/@gitdot/clone-lib/dist/resolve/manifest.js +159 -0
- package/node_modules/@gitdot/clone-lib/dist/resolve/manifest.js.map +1 -0
- package/node_modules/@gitdot/clone-lib/dist/resolve/member.d.ts +44 -0
- package/node_modules/@gitdot/clone-lib/dist/resolve/member.d.ts.map +1 -0
- package/node_modules/@gitdot/clone-lib/dist/resolve/member.js +163 -0
- package/node_modules/@gitdot/clone-lib/dist/resolve/member.js.map +1 -0
- package/node_modules/@gitdot/clone-lib/dist/resolve/resolve.d.ts +18 -0
- package/node_modules/@gitdot/clone-lib/dist/resolve/resolve.d.ts.map +1 -0
- package/node_modules/@gitdot/clone-lib/dist/resolve/resolve.js +155 -0
- package/node_modules/@gitdot/clone-lib/dist/resolve/resolve.js.map +1 -0
- package/node_modules/@gitdot/clone-lib/dist/types.d.ts +225 -0
- package/node_modules/@gitdot/clone-lib/dist/types.d.ts.map +1 -0
- package/node_modules/@gitdot/clone-lib/dist/types.js +9 -0
- package/node_modules/@gitdot/clone-lib/dist/types.js.map +1 -0
- package/node_modules/@gitdot/clone-lib/package.json +53 -0
- package/node_modules/@microwiseai/install-preflight/dist/index.d.ts +27 -0
- package/node_modules/@microwiseai/install-preflight/dist/index.d.ts.map +1 -0
- package/node_modules/@microwiseai/install-preflight/dist/index.js +26 -0
- package/node_modules/@microwiseai/install-preflight/dist/index.js.map +1 -0
- package/node_modules/@microwiseai/install-preflight/dist/policy.d.ts +42 -0
- package/node_modules/@microwiseai/install-preflight/dist/policy.d.ts.map +1 -0
- package/node_modules/@microwiseai/install-preflight/dist/policy.js +79 -0
- package/node_modules/@microwiseai/install-preflight/dist/policy.js.map +1 -0
- package/node_modules/@microwiseai/install-preflight/dist/preflight.d.ts +18 -0
- package/node_modules/@microwiseai/install-preflight/dist/preflight.d.ts.map +1 -0
- package/node_modules/@microwiseai/install-preflight/dist/preflight.js +0 -0
- package/node_modules/@microwiseai/install-preflight/dist/preflight.js.map +1 -0
- package/node_modules/@microwiseai/install-preflight/dist/resolvers.d.ts +26 -0
- package/node_modules/@microwiseai/install-preflight/dist/resolvers.d.ts.map +1 -0
- package/node_modules/@microwiseai/install-preflight/dist/resolvers.js +63 -0
- package/node_modules/@microwiseai/install-preflight/dist/resolvers.js.map +1 -0
- package/node_modules/@microwiseai/install-preflight/dist/semver.d.ts +45 -0
- package/node_modules/@microwiseai/install-preflight/dist/semver.d.ts.map +1 -0
- package/node_modules/@microwiseai/install-preflight/dist/semver.js +195 -0
- package/node_modules/@microwiseai/install-preflight/dist/semver.js.map +1 -0
- package/node_modules/@microwiseai/install-preflight/dist/types.d.ts +136 -0
- package/node_modules/@microwiseai/install-preflight/dist/types.d.ts.map +1 -0
- package/node_modules/@microwiseai/install-preflight/dist/types.js +11 -0
- package/node_modules/@microwiseai/install-preflight/dist/types.js.map +1 -0
- package/node_modules/@microwiseai/install-preflight/package.json +49 -0
- package/package.json +12 -4
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dotToTreePath = dotToTreePath;
|
|
4
|
+
/**
|
|
5
|
+
* dotToTreePath — the pure identity->path function reused from SUBSET-MANIFEST.
|
|
6
|
+
* A gitdot dot-identity ("ist.tda", "microwiseai.skit") maps 1:1 to a tree path
|
|
7
|
+
* ("ist/tda", "microwiseai/skit"). Pure, deterministic, no I/O.
|
|
8
|
+
*
|
|
9
|
+
* @param id declared dot-identity
|
|
10
|
+
* @returns POSIX-style relative tree path
|
|
11
|
+
*/
|
|
12
|
+
function dotToTreePath(id) {
|
|
13
|
+
if (typeof id !== 'string' || id.length === 0) {
|
|
14
|
+
throw new Error('dotToTreePath: id must be a non-empty string');
|
|
15
|
+
}
|
|
16
|
+
// Segments are separated by dots. Reject empty segments (".."/leading/trailing dot)
|
|
17
|
+
// so a malformed id can never escape the workspace root.
|
|
18
|
+
const segments = id.split('.');
|
|
19
|
+
if (segments.some((s) => s.length === 0)) {
|
|
20
|
+
throw new Error(`dotToTreePath: malformed id "${id}" (empty segment)`);
|
|
21
|
+
}
|
|
22
|
+
if (segments.some((s) => s === '.' || s === '..' || s.includes('/') || s.includes('\\'))) {
|
|
23
|
+
throw new Error(`dotToTreePath: unsafe segment in id "${id}"`);
|
|
24
|
+
}
|
|
25
|
+
return segments.join('/');
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=dotpath.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dotpath.js","sourceRoot":"","sources":["../src/dotpath.ts"],"names":[],"mappings":";;AAQA,sCAcC;AAtBD;;;;;;;GAOG;AACH,SAAgB,aAAa,CAAC,EAAU;IACtC,IAAI,OAAO,EAAE,KAAK,QAAQ,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC9C,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;IAClE,CAAC;IACD,oFAAoF;IACpF,yDAAyD;IACzD,MAAM,QAAQ,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC/B,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,EAAE,CAAC;QACzC,MAAM,IAAI,KAAK,CAAC,gCAAgC,EAAE,mBAAmB,CAAC,CAAC;IACzE,CAAC;IACD,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;QACzF,MAAM,IAAI,KAAK,CAAC,wCAAwC,EAAE,GAAG,CAAC,CAAC;IACjE,CAAC;IACD,OAAO,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Git runner — the ONLY place that shells out to `git`. Injectable (DI) so the
|
|
3
|
+
* clone core can be unit-tested deterministically with an in-memory fake.
|
|
4
|
+
*
|
|
5
|
+
* clone()/checkout() classify failures into a `.kind`
|
|
6
|
+
* ('not-found' | 'no-access' | 'failed') so the core can route each member into
|
|
7
|
+
* the correct report bucket without re-parsing git stderr itself.
|
|
8
|
+
*/
|
|
9
|
+
import type { GitRunner, GitErrorKind } from './types';
|
|
10
|
+
export declare class GitError extends Error {
|
|
11
|
+
kind: GitErrorKind;
|
|
12
|
+
constructor(message: string, kind: GitErrorKind);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Map raw git stderr to a structured kind. Heuristic but covers the common
|
|
16
|
+
* GitLab/https + ssh failure phrasings.
|
|
17
|
+
*/
|
|
18
|
+
export declare function classifyGitError(stderr: string): GitErrorKind;
|
|
19
|
+
export interface GitRunnerOptions {
|
|
20
|
+
timeout?: number;
|
|
21
|
+
}
|
|
22
|
+
export declare function createGitRunner(opts?: GitRunnerOptions): GitRunner;
|
|
23
|
+
//# sourceMappingURL=git.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvD,qBAAa,QAAS,SAAQ,KAAK;IACjC,IAAI,EAAE,YAAY,CAAC;gBACP,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY;CAKhD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,CAuB7D;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,eAAe,CAAC,IAAI,GAAE,gBAAqB,GAAG,SAAS,CAiDtE"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Git runner — the ONLY place that shells out to `git`. Injectable (DI) so the
|
|
4
|
+
* clone core can be unit-tested deterministically with an in-memory fake.
|
|
5
|
+
*
|
|
6
|
+
* clone()/checkout() classify failures into a `.kind`
|
|
7
|
+
* ('not-found' | 'no-access' | 'failed') so the core can route each member into
|
|
8
|
+
* the correct report bucket without re-parsing git stderr itself.
|
|
9
|
+
*/
|
|
10
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
13
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
14
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
15
|
+
}
|
|
16
|
+
Object.defineProperty(o, k2, desc);
|
|
17
|
+
}) : (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
o[k2] = m[k];
|
|
20
|
+
}));
|
|
21
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
22
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
23
|
+
}) : function(o, v) {
|
|
24
|
+
o["default"] = v;
|
|
25
|
+
});
|
|
26
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
27
|
+
var ownKeys = function(o) {
|
|
28
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
29
|
+
var ar = [];
|
|
30
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
31
|
+
return ar;
|
|
32
|
+
};
|
|
33
|
+
return ownKeys(o);
|
|
34
|
+
};
|
|
35
|
+
return function (mod) {
|
|
36
|
+
if (mod && mod.__esModule) return mod;
|
|
37
|
+
var result = {};
|
|
38
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
39
|
+
__setModuleDefault(result, mod);
|
|
40
|
+
return result;
|
|
41
|
+
};
|
|
42
|
+
})();
|
|
43
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
+
exports.GitError = void 0;
|
|
45
|
+
exports.classifyGitError = classifyGitError;
|
|
46
|
+
exports.createGitRunner = createGitRunner;
|
|
47
|
+
const child_process_1 = require("child_process");
|
|
48
|
+
const fs = __importStar(require("fs"));
|
|
49
|
+
const path = __importStar(require("path"));
|
|
50
|
+
class GitError extends Error {
|
|
51
|
+
kind;
|
|
52
|
+
constructor(message, kind) {
|
|
53
|
+
super(message);
|
|
54
|
+
this.name = 'GitError';
|
|
55
|
+
this.kind = kind;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.GitError = GitError;
|
|
59
|
+
/**
|
|
60
|
+
* Map raw git stderr to a structured kind. Heuristic but covers the common
|
|
61
|
+
* GitLab/https + ssh failure phrasings.
|
|
62
|
+
*/
|
|
63
|
+
function classifyGitError(stderr) {
|
|
64
|
+
const s = String(stderr || '').toLowerCase();
|
|
65
|
+
if (s.includes('repository not found') ||
|
|
66
|
+
s.includes('not found') ||
|
|
67
|
+
s.includes('does not exist') ||
|
|
68
|
+
s.includes('404')) {
|
|
69
|
+
return 'not-found';
|
|
70
|
+
}
|
|
71
|
+
if (s.includes('authentication failed') ||
|
|
72
|
+
s.includes('access denied') ||
|
|
73
|
+
s.includes('permission denied') ||
|
|
74
|
+
s.includes('403') ||
|
|
75
|
+
s.includes('could not read username') ||
|
|
76
|
+
s.includes('could not read password') ||
|
|
77
|
+
s.includes('terminal prompts disabled') ||
|
|
78
|
+
s.includes('403 forbidden')) {
|
|
79
|
+
return 'no-access';
|
|
80
|
+
}
|
|
81
|
+
return 'failed';
|
|
82
|
+
}
|
|
83
|
+
function createGitRunner(opts = {}) {
|
|
84
|
+
const timeout = opts.timeout || 300000; // 5 min
|
|
85
|
+
const run = (args, cwd) => {
|
|
86
|
+
try {
|
|
87
|
+
return (0, child_process_1.execFileSync)('git', args, {
|
|
88
|
+
cwd,
|
|
89
|
+
encoding: 'utf8',
|
|
90
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
91
|
+
timeout,
|
|
92
|
+
env: {
|
|
93
|
+
...process.env,
|
|
94
|
+
// Never let git block on an interactive credential prompt: a missing
|
|
95
|
+
// credential must surface as a deterministic no-access failure.
|
|
96
|
+
GIT_TERMINAL_PROMPT: '0',
|
|
97
|
+
GCM_INTERACTIVE: 'never',
|
|
98
|
+
},
|
|
99
|
+
}).trim();
|
|
100
|
+
}
|
|
101
|
+
catch (e) {
|
|
102
|
+
const err = e;
|
|
103
|
+
const stderr = err.stderr ? err.stderr.toString() : err.message || String(e);
|
|
104
|
+
throw new GitError(stderr.trim(), classifyGitError(stderr));
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
return {
|
|
108
|
+
exists(absPath) {
|
|
109
|
+
return fs.existsSync(absPath);
|
|
110
|
+
},
|
|
111
|
+
isRepo(absPath) {
|
|
112
|
+
if (!fs.existsSync(path.join(absPath, '.git')))
|
|
113
|
+
return false;
|
|
114
|
+
try {
|
|
115
|
+
run(['rev-parse', '--is-inside-work-tree'], absPath);
|
|
116
|
+
return true;
|
|
117
|
+
}
|
|
118
|
+
catch {
|
|
119
|
+
return false;
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
clone(cloneUrl, absPath) {
|
|
123
|
+
fs.mkdirSync(path.dirname(absPath), { recursive: true });
|
|
124
|
+
run(['clone', '--quiet', cloneUrl, absPath]);
|
|
125
|
+
},
|
|
126
|
+
checkout(absPath, sha) {
|
|
127
|
+
run(['checkout', '--quiet', sha], absPath);
|
|
128
|
+
},
|
|
129
|
+
headSha(absPath) {
|
|
130
|
+
return run(['rev-parse', 'HEAD'], absPath);
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
//# sourceMappingURL=git.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.js","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBH,4CAuBC;AAMD,0CAiDC;AAhGD,iDAA6C;AAC7C,uCAAyB;AACzB,2CAA6B;AAG7B,MAAa,QAAS,SAAQ,KAAK;IACjC,IAAI,CAAe;IACnB,YAAY,OAAe,EAAE,IAAkB;QAC7C,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAPD,4BAOC;AAED;;;GAGG;AACH,SAAgB,gBAAgB,CAAC,MAAc;IAC7C,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;IAC7C,IACE,CAAC,CAAC,QAAQ,CAAC,sBAAsB,CAAC;QAClC,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC;QACvB,CAAC,CAAC,QAAQ,CAAC,gBAAgB,CAAC;QAC5B,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EACjB,CAAC;QACD,OAAO,WAAW,CAAC;IACrB,CAAC;IACD,IACE,CAAC,CAAC,QAAQ,CAAC,uBA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
* Public surface:
|
|
6
|
+
* resolveLock (B1) package-lock.json -> resolved-lock
|
|
7
|
+
* resolveFromManifest (B2) snapshot.json manifest -> resolved-lock
|
|
8
|
+
* cloneFromLock (S3) resolved-lock -> cloned closure + report
|
|
9
|
+
* loadLock / writeLock (S2) filename-agnostic sidecar schema I/O
|
|
10
|
+
*/
|
|
11
|
+
export { cloneFromLock } from './clone';
|
|
12
|
+
export { createGitRunner, GitError, classifyGitError } from './git';
|
|
13
|
+
export { loadLock, writeLock, validateLock, KNOWN_SIDECARS } from './lock';
|
|
14
|
+
export { resolveLock, resolveFromManifest, createGitLabApi } from './resolve/index';
|
|
15
|
+
export { dotToTreePath } from './dotpath';
|
|
16
|
+
export type { CloneMode, Visibility, Provenance, MemberType, GitErrorKind, RepoCoordinate, Ref, Member, LockSource, ResolvedLock, ClonedEntry, SkippedEntry, NoAccessEntry, BucketEntry, CloneReport, GitRunner, GitLabProject, GitLabTag, PackumentVersion, Packument, GitLabApi, RegistryMap, InstallBlock, Manifest, NpmDependencySpec, SkitManifest, CloneFromLockOptions, ReadInstalledManifest, ResolveLockOptions, ResolveFromManifestOptions, ResolveResult, } from './types';
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAGpE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAG3E,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGpF,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAG1C,YAAY,EACV,SAAS,EACT,UAAU,EACV,UAAU,EACV,UAAU,EACV,YAAY,EACZ,cAAc,EACd,GAAG,EACH,MAAM,EACN,UAAU,EACV,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,aAAa,EACb,WAAW,EACX,WAAW,EACX,SAAS,EACT,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,SAAS,EACT,SAAS,EACT,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,iBAAiB,EACjB,YAAY,EACZ,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EAClB,0BAA0B,EAC1B,aAAa,GACd,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @gitdot/clone-lib — shared resolved-lock resolve + clone library
|
|
4
|
+
* (RESOLVED-LOCK-SPEC S2/S3/S4). Dependency-free, deterministic, --json first.
|
|
5
|
+
*
|
|
6
|
+
* Public surface:
|
|
7
|
+
* resolveLock (B1) package-lock.json -> resolved-lock
|
|
8
|
+
* resolveFromManifest (B2) snapshot.json manifest -> resolved-lock
|
|
9
|
+
* cloneFromLock (S3) resolved-lock -> cloned closure + report
|
|
10
|
+
* loadLock / writeLock (S2) filename-agnostic sidecar schema I/O
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.dotToTreePath = exports.createGitLabApi = exports.resolveFromManifest = exports.resolveLock = exports.KNOWN_SIDECARS = exports.validateLock = exports.writeLock = exports.loadLock = exports.classifyGitError = exports.GitError = exports.createGitRunner = exports.cloneFromLock = void 0;
|
|
14
|
+
// clone (S3)
|
|
15
|
+
var clone_1 = require("./clone");
|
|
16
|
+
Object.defineProperty(exports, "cloneFromLock", { enumerable: true, get: function () { return clone_1.cloneFromLock; } });
|
|
17
|
+
var git_1 = require("./git");
|
|
18
|
+
Object.defineProperty(exports, "createGitRunner", { enumerable: true, get: function () { return git_1.createGitRunner; } });
|
|
19
|
+
Object.defineProperty(exports, "GitError", { enumerable: true, get: function () { return git_1.GitError; } });
|
|
20
|
+
Object.defineProperty(exports, "classifyGitError", { enumerable: true, get: function () { return git_1.classifyGitError; } });
|
|
21
|
+
// sidecar schema (S2)
|
|
22
|
+
var lock_1 = require("./lock");
|
|
23
|
+
Object.defineProperty(exports, "loadLock", { enumerable: true, get: function () { return lock_1.loadLock; } });
|
|
24
|
+
Object.defineProperty(exports, "writeLock", { enumerable: true, get: function () { return lock_1.writeLock; } });
|
|
25
|
+
Object.defineProperty(exports, "validateLock", { enumerable: true, get: function () { return lock_1.validateLock; } });
|
|
26
|
+
Object.defineProperty(exports, "KNOWN_SIDECARS", { enumerable: true, get: function () { return lock_1.KNOWN_SIDECARS; } });
|
|
27
|
+
// resolve (S4)
|
|
28
|
+
var index_1 = require("./resolve/index");
|
|
29
|
+
Object.defineProperty(exports, "resolveLock", { enumerable: true, get: function () { return index_1.resolveLock; } });
|
|
30
|
+
Object.defineProperty(exports, "resolveFromManifest", { enumerable: true, get: function () { return index_1.resolveFromManifest; } });
|
|
31
|
+
Object.defineProperty(exports, "createGitLabApi", { enumerable: true, get: function () { return index_1.createGitLabApi; } });
|
|
32
|
+
// utilities
|
|
33
|
+
var dotpath_1 = require("./dotpath");
|
|
34
|
+
Object.defineProperty(exports, "dotToTreePath", { enumerable: true, get: function () { return dotpath_1.dotToTreePath; } });
|
|
35
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;AAEH,aAAa;AACb,iCAAwC;AAA/B,sGAAA,aAAa,OAAA;AACtB,6BAAoE;AAA3D,sGAAA,eAAe,OAAA;AAAE,+FAAA,QAAQ,OAAA;AAAE,uGAAA,gBAAgB,OAAA;AAEpD,sBAAsB;AACtB,+BAA2E;AAAlE,gGAAA,QAAQ,OAAA;AAAE,iGAAA,SAAS,OAAA;AAAE,oGAAA,YAAY,OAAA;AAAE,sGAAA,cAAc,OAAA;AAE1D,eAAe;AACf,yCAAoF;AAA3E,oGAAA,WAAW,OAAA;AAAE,4GAAA,mBAAmB,OAAA;AAAE,wGAAA,eAAe,OAAA;AAE1D,YAAY;AACZ,qCAA0C;AAAjC,wGAAA,aAAa,OAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sidecar lock schema (RESOLVED-LOCK-SPEC S2).
|
|
3
|
+
*
|
|
4
|
+
* skit.lock.json, snapshot.lock.json and glpkg.lock.json are ALL instances of
|
|
5
|
+
* the ONE resolved-lock schema — same file shape, differing only in the `source`
|
|
6
|
+
* block. Readers load them FILENAME-AGNOSTICALLY: the filename is a label, never
|
|
7
|
+
* a schema selector.
|
|
8
|
+
*/
|
|
9
|
+
import type { ResolvedLock } from './types';
|
|
10
|
+
/** Distributions known to emit this schema; informational only (not a gate). */
|
|
11
|
+
export declare const KNOWN_SIDECARS: readonly string[];
|
|
12
|
+
/**
|
|
13
|
+
* Validate a parsed object against the resolved-lock schema. Returns it typed.
|
|
14
|
+
* @throws on a shape that clone/consumer code cannot safely read.
|
|
15
|
+
*/
|
|
16
|
+
export declare function validateLock(lock: unknown, label?: string): ResolvedLock;
|
|
17
|
+
/**
|
|
18
|
+
* Load a resolved-lock from disk, filename-agnostically. The same function reads
|
|
19
|
+
* skit.lock.json / snapshot.lock.json / glpkg.lock.json — they are one schema.
|
|
20
|
+
*/
|
|
21
|
+
export declare function loadLock(lockPath: string): ResolvedLock;
|
|
22
|
+
/** Write a resolved-lock deterministically (2-space indent + trailing newline). */
|
|
23
|
+
export declare function writeLock(lockPath: string, lock: ResolvedLock): void;
|
|
24
|
+
//# sourceMappingURL=lock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lock.d.ts","sourceRoot":"","sources":["../src/lock.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,gFAAgF;AAChF,eAAO,MAAM,cAAc,EAAE,SAAS,MAAM,EAI3C,CAAC;AAEF;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,SAAS,GAAG,YAAY,CAexE;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,YAAY,CAWvD;AAED,mFAAmF;AACnF,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,GAAG,IAAI,CAGpE"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Sidecar lock schema (RESOLVED-LOCK-SPEC S2).
|
|
4
|
+
*
|
|
5
|
+
* skit.lock.json, snapshot.lock.json and glpkg.lock.json are ALL instances of
|
|
6
|
+
* the ONE resolved-lock schema — same file shape, differing only in the `source`
|
|
7
|
+
* block. Readers load them FILENAME-AGNOSTICALLY: the filename is a label, never
|
|
8
|
+
* a schema selector.
|
|
9
|
+
*/
|
|
10
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
13
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
14
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
15
|
+
}
|
|
16
|
+
Object.defineProperty(o, k2, desc);
|
|
17
|
+
}) : (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
o[k2] = m[k];
|
|
20
|
+
}));
|
|
21
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
22
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
23
|
+
}) : function(o, v) {
|
|
24
|
+
o["default"] = v;
|
|
25
|
+
});
|
|
26
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
27
|
+
var ownKeys = function(o) {
|
|
28
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
29
|
+
var ar = [];
|
|
30
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
31
|
+
return ar;
|
|
32
|
+
};
|
|
33
|
+
return ownKeys(o);
|
|
34
|
+
};
|
|
35
|
+
return function (mod) {
|
|
36
|
+
if (mod && mod.__esModule) return mod;
|
|
37
|
+
var result = {};
|
|
38
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
39
|
+
__setModuleDefault(result, mod);
|
|
40
|
+
return result;
|
|
41
|
+
};
|
|
42
|
+
})();
|
|
43
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
+
exports.KNOWN_SIDECARS = void 0;
|
|
45
|
+
exports.validateLock = validateLock;
|
|
46
|
+
exports.loadLock = loadLock;
|
|
47
|
+
exports.writeLock = writeLock;
|
|
48
|
+
const fs = __importStar(require("fs"));
|
|
49
|
+
/** Distributions known to emit this schema; informational only (not a gate). */
|
|
50
|
+
exports.KNOWN_SIDECARS = [
|
|
51
|
+
'skit.lock.json',
|
|
52
|
+
'snapshot.lock.json',
|
|
53
|
+
'glpkg.lock.json',
|
|
54
|
+
];
|
|
55
|
+
/**
|
|
56
|
+
* Validate a parsed object against the resolved-lock schema. Returns it typed.
|
|
57
|
+
* @throws on a shape that clone/consumer code cannot safely read.
|
|
58
|
+
*/
|
|
59
|
+
function validateLock(lock, label = 'lock') {
|
|
60
|
+
if (!lock || typeof lock !== 'object') {
|
|
61
|
+
throw new Error(`${label}: not an object`);
|
|
62
|
+
}
|
|
63
|
+
const l = lock;
|
|
64
|
+
if (l.kind !== 'resolved-lock') {
|
|
65
|
+
throw new Error(`${label}: not a resolved-lock (kind=${JSON.stringify(l.kind)})`);
|
|
66
|
+
}
|
|
67
|
+
if (l.lockVersion !== 1) {
|
|
68
|
+
throw new Error(`${label}: unsupported lockVersion ${JSON.stringify(l.lockVersion)} (expected 1)`);
|
|
69
|
+
}
|
|
70
|
+
if (!Array.isArray(l.members)) {
|
|
71
|
+
throw new Error(`${label}: missing members[]`);
|
|
72
|
+
}
|
|
73
|
+
return lock;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Load a resolved-lock from disk, filename-agnostically. The same function reads
|
|
77
|
+
* skit.lock.json / snapshot.lock.json / glpkg.lock.json — they are one schema.
|
|
78
|
+
*/
|
|
79
|
+
function loadLock(lockPath) {
|
|
80
|
+
if (!fs.existsSync(lockPath)) {
|
|
81
|
+
throw new Error(`loadLock: lock not found: ${lockPath}`);
|
|
82
|
+
}
|
|
83
|
+
let parsed;
|
|
84
|
+
try {
|
|
85
|
+
parsed = JSON.parse(fs.readFileSync(lockPath, 'utf8'));
|
|
86
|
+
}
|
|
87
|
+
catch (e) {
|
|
88
|
+
throw new Error(`loadLock: invalid JSON in ${lockPath}: ${e.message}`);
|
|
89
|
+
}
|
|
90
|
+
return validateLock(parsed, lockPath);
|
|
91
|
+
}
|
|
92
|
+
/** Write a resolved-lock deterministically (2-space indent + trailing newline). */
|
|
93
|
+
function writeLock(lockPath, lock) {
|
|
94
|
+
validateLock(lock, lockPath);
|
|
95
|
+
fs.writeFileSync(lockPath, JSON.stringify(lock, null, 2) + '\n');
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=lock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lock.js","sourceRoot":"","sources":["../src/lock.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBH,oCAeC;AAMD,4BAWC;AAGD,8BAGC;AApDD,uCAAyB;AAGzB,gFAAgF;AACnE,QAAA,cAAc,GAAsB;IAC/C,gBAAgB;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IAAI,KAAK,CAAC,6BAA6B,QAAQ,KAAM,CAAW,CAAC,OAAO,EAAE,CAAC,CAAC;IACpF,CAAC;IACD,OAAO,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AACxC,CAAC;AAED,mFAAmF;AACnF,SAAgB,SAAS,CAAC,QAAgB,EAAE,IAAkB;IAC5D,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC7B,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;AACnE,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read-only GitLab API client for the resolve step (RESOLVED-LOCK-SPEC S4).
|
|
3
|
+
*
|
|
4
|
+
* Dependency-free (Node built-in https). Injectable at a higher level: the
|
|
5
|
+
* resolvers accept a {@link GitLabApi}, so unit tests pass a fake and never touch
|
|
6
|
+
* the network. Results are cached per key within one client.
|
|
7
|
+
*/
|
|
8
|
+
import type { GitLabApi } from '../types';
|
|
9
|
+
export declare function httpsGetJson<T = unknown>(host: string, pathname: string, token?: string, timeout?: number): Promise<T>;
|
|
10
|
+
export interface GitLabApiOptions {
|
|
11
|
+
token?: string | null;
|
|
12
|
+
host?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function createGitLabApi(opts?: GitLabApiOptions): GitLabApi;
|
|
15
|
+
//# sourceMappingURL=gitlab.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitlab.d.ts","sourceRoot":"","sources":["../../src/resolve/gitlab.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAuC,MAAM,UAAU,CAAC;AAE/E,wBAAgB,YAAY,CAAC,CAAC,GAAG,OAAO,EACtC,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,KAAK,CAAC,EAAE,MAAM,EACd,OAAO,SAAQ,GACd,OAAO,CAAC,CAAC,CAAC,CAoCZ;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,eAAe,CAAC,IAAI,GAAE,gBAAqB,GAAG,SAAS,CA+CtE"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Read-only GitLab API client for the resolve step (RESOLVED-LOCK-SPEC S4).
|
|
4
|
+
*
|
|
5
|
+
* Dependency-free (Node built-in https). Injectable at a higher level: the
|
|
6
|
+
* resolvers accept a {@link GitLabApi}, so unit tests pass a fake and never touch
|
|
7
|
+
* the network. Results are cached per key within one client.
|
|
8
|
+
*/
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
16
|
+
}) : (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
o[k2] = m[k];
|
|
19
|
+
}));
|
|
20
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
+
}) : function(o, v) {
|
|
23
|
+
o["default"] = v;
|
|
24
|
+
});
|
|
25
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
26
|
+
var ownKeys = function(o) {
|
|
27
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
28
|
+
var ar = [];
|
|
29
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
30
|
+
return ar;
|
|
31
|
+
};
|
|
32
|
+
return ownKeys(o);
|
|
33
|
+
};
|
|
34
|
+
return function (mod) {
|
|
35
|
+
if (mod && mod.__esModule) return mod;
|
|
36
|
+
var result = {};
|
|
37
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
38
|
+
__setModuleDefault(result, mod);
|
|
39
|
+
return result;
|
|
40
|
+
};
|
|
41
|
+
})();
|
|
42
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
|
+
exports.httpsGetJson = httpsGetJson;
|
|
44
|
+
exports.createGitLabApi = createGitLabApi;
|
|
45
|
+
const https = __importStar(require("https"));
|
|
46
|
+
function httpsGetJson(host, pathname, token, timeout = 30000) {
|
|
47
|
+
return new Promise((resolve, reject) => {
|
|
48
|
+
const req = https.request({
|
|
49
|
+
host,
|
|
50
|
+
path: pathname,
|
|
51
|
+
method: 'GET',
|
|
52
|
+
headers: token
|
|
53
|
+
? { 'PRIVATE-TOKEN': token, Accept: 'application/json' }
|
|
54
|
+
: { Accept: 'application/json' },
|
|
55
|
+
timeout,
|
|
56
|
+
}, (res) => {
|
|
57
|
+
let body = '';
|
|
58
|
+
res.on('data', (d) => (body += d));
|
|
59
|
+
res.on('end', () => {
|
|
60
|
+
const status = res.statusCode || 0;
|
|
61
|
+
if (status === 404)
|
|
62
|
+
return reject(Object.assign(new Error('not-found'), { status: 404 }));
|
|
63
|
+
if (status === 401 || status === 403) {
|
|
64
|
+
return reject(Object.assign(new Error('no-access'), { status }));
|
|
65
|
+
}
|
|
66
|
+
if (status >= 400) {
|
|
67
|
+
return reject(Object.assign(new Error(`http ${status}`), { status }));
|
|
68
|
+
}
|
|
69
|
+
try {
|
|
70
|
+
resolve(JSON.parse(body));
|
|
71
|
+
}
|
|
72
|
+
catch (e) {
|
|
73
|
+
reject(new Error(`bad JSON from ${pathname}: ${e.message}`));
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
req.on('timeout', () => req.destroy(new Error('timeout')));
|
|
78
|
+
req.on('error', reject);
|
|
79
|
+
req.end();
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
function createGitLabApi(opts = {}) {
|
|
83
|
+
const host = opts.host || 'gitlab.com';
|
|
84
|
+
const token = opts.token || undefined;
|
|
85
|
+
const projectCache = new Map();
|
|
86
|
+
const tagsCache = new Map();
|
|
87
|
+
const packumentCache = new Map();
|
|
88
|
+
return {
|
|
89
|
+
async getProject(projectId) {
|
|
90
|
+
const key = String(projectId);
|
|
91
|
+
const cached = projectCache.get(key);
|
|
92
|
+
if (cached)
|
|
93
|
+
return cached;
|
|
94
|
+
const p = await httpsGetJson(host, `/api/v4/projects/${encodeURIComponent(String(projectId))}`, token);
|
|
95
|
+
projectCache.set(key, p);
|
|
96
|
+
return p;
|
|
97
|
+
},
|
|
98
|
+
async getTags(projectId) {
|
|
99
|
+
const key = String(projectId);
|
|
100
|
+
const cached = tagsCache.get(key);
|
|
101
|
+
if (cached)
|
|
102
|
+
return cached;
|
|
103
|
+
// per_page=100: enough to find a released version tag for MVP scope.
|
|
104
|
+
const t = await httpsGetJson(host, `/api/v4/projects/${encodeURIComponent(String(projectId))}/repository/tags?per_page=100`, token);
|
|
105
|
+
tagsCache.set(key, t);
|
|
106
|
+
return t;
|
|
107
|
+
},
|
|
108
|
+
async getPackument(name, packOpts = {}) {
|
|
109
|
+
const key = `${packOpts.group || ''}::${name}`;
|
|
110
|
+
const cached = packumentCache.get(key);
|
|
111
|
+
if (cached)
|
|
112
|
+
return cached;
|
|
113
|
+
// npm metadata convention: encode only the scope slash as %2f, keep the leading @.
|
|
114
|
+
const enc = name.replace(/\//g, '%2f');
|
|
115
|
+
const pathname = packOpts.group
|
|
116
|
+
? `/api/v4/groups/${encodeURIComponent(packOpts.group)}/-/packages/npm/${enc}`
|
|
117
|
+
: `/api/v4/packages/npm/${enc}`;
|
|
118
|
+
const p = await httpsGetJson(host, pathname, token);
|
|
119
|
+
packumentCache.set(key, p);
|
|
120
|
+
return p;
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
//# sourceMappingURL=gitlab.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitlab.js","sourceRoot":"","sources":["../../src/resolve/gitlab.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKH,oCAyCC;AAOD,0CA+CC;AAlGD,6CAA+B;AAG/B,SAAgB,YAAY,CAC1B,IAAY,EACZ,QAAgB,EAChB,KAAc,EACd,OAAO,GAAG,KAAK;IAEf,OAAO,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACxC,MAAM,GAAG,GAAG,KAAK,CAAC,OAAO,CACvB;YACE,IAAI;YACJ,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,KAAK;YACb,OAAO,EAAE,KAAK;gBACZ,CAAC,CAAC,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE;gBACxD,CAAC,CAAC,EAAE,MAAM,EAAE,kBAAkB,EAAE;YAClC,OAAO;SACR,EACD,CAAC,GAAG,EAAE,EAAE;YACN,IAAI,IAAI,GAAG,EAAE,CAAC;YACd,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC;YACnC,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE;gBACjB,MAAM,MAAM,GAAG,GAAG,CAAC,UAAU,IAAI,CAAC,CAAC;gBACnC,IAAI,MAAM,KAAK,GAAG;oBAAE,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,WAAW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YAC1B,mFAAmF;YACnF,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;YACvC,MAAM,QAAQ,GAAG,QAAQ,CAAC,KAAK;gBAC7B,CAAC,CAAC,kBAAkB,kBAAkB,CAAC,QAAQ,CAAC,KAAK,CAAC,mBAAmB,GAAG,EAAE;gBAC9E,CAAC,CAAC,wBAAwB,GAAG,EAAE,CAAC;YAClC,MAAM,CAAC,GAAG,MAAM,YAAY,CAAY,IAAI,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;YAC/D,cAAc,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;YAC3B,OAAO,CAAC,CAAC;QACX,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* resolve/ — the resolve step (RESOLVED-LOCK-SPEC S4). Two resolvers over ONE
|
|
3
|
+
* shared member core (member.ts), both emitting the same resolved-lock:
|
|
4
|
+
*
|
|
5
|
+
* B1 resolveLock(package-lock) — from an installed project's package-lock.json
|
|
6
|
+
* B2 resolveFromManifest(json) — from a snapshot.json-like install manifest
|
|
7
|
+
*/
|
|
8
|
+
export { resolveLock, DEFAULT_SCOPES, npmNameFromKey } from './resolve';
|
|
9
|
+
export { resolveFromManifest, flattenInstall, scopeOf, pickVersionEntry } from './manifest';
|
|
10
|
+
export { resolveMember, projectIdFromResolved, repositoryToCloneUrl, projectPathFromUrl, idFromProjectPath, groupFromProjectPath, findCommitSha, } from './member';
|
|
11
|
+
export { createGitLabApi, httpsGetJson } from './gitlab';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resolve/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC5F,OAAO,EACL,aAAa,EACb,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,aAAa,GACd,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* resolve/ — the resolve step (RESOLVED-LOCK-SPEC S4). Two resolvers over ONE
|
|
4
|
+
* shared member core (member.ts), both emitting the same resolved-lock:
|
|
5
|
+
*
|
|
6
|
+
* B1 resolveLock(package-lock) — from an installed project's package-lock.json
|
|
7
|
+
* B2 resolveFromManifest(json) — from a snapshot.json-like install manifest
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.httpsGetJson = exports.createGitLabApi = exports.findCommitSha = exports.groupFromProjectPath = exports.idFromProjectPath = exports.projectPathFromUrl = exports.repositoryToCloneUrl = exports.projectIdFromResolved = exports.resolveMember = exports.pickVersionEntry = exports.scopeOf = exports.flattenInstall = exports.resolveFromManifest = exports.npmNameFromKey = exports.DEFAULT_SCOPES = exports.resolveLock = void 0;
|
|
11
|
+
var resolve_1 = require("./resolve");
|
|
12
|
+
Object.defineProperty(exports, "resolveLock", { enumerable: true, get: function () { return resolve_1.resolveLock; } });
|
|
13
|
+
Object.defineProperty(exports, "DEFAULT_SCOPES", { enumerable: true, get: function () { return resolve_1.DEFAULT_SCOPES; } });
|
|
14
|
+
Object.defineProperty(exports, "npmNameFromKey", { enumerable: true, get: function () { return resolve_1.npmNameFromKey; } });
|
|
15
|
+
var manifest_1 = require("./manifest");
|
|
16
|
+
Object.defineProperty(exports, "resolveFromManifest", { enumerable: true, get: function () { return manifest_1.resolveFromManifest; } });
|
|
17
|
+
Object.defineProperty(exports, "flattenInstall", { enumerable: true, get: function () { return manifest_1.flattenInstall; } });
|
|
18
|
+
Object.defineProperty(exports, "scopeOf", { enumerable: true, get: function () { return manifest_1.scopeOf; } });
|
|
19
|
+
Object.defineProperty(exports, "pickVersionEntry", { enumerable: true, get: function () { return manifest_1.pickVersionEntry; } });
|
|
20
|
+
var member_1 = require("./member");
|
|
21
|
+
Object.defineProperty(exports, "resolveMember", { enumerable: true, get: function () { return member_1.resolveMember; } });
|
|
22
|
+
Object.defineProperty(exports, "projectIdFromResolved", { enumerable: true, get: function () { return member_1.projectIdFromResolved; } });
|
|
23
|
+
Object.defineProperty(exports, "repositoryToCloneUrl", { enumerable: true, get: function () { return member_1.repositoryToCloneUrl; } });
|
|
24
|
+
Object.defineProperty(exports, "projectPathFromUrl", { enumerable: true, get: function () { return member_1.projectPathFromUrl; } });
|
|
25
|
+
Object.defineProperty(exports, "idFromProjectPath", { enumerable: true, get: function () { return member_1.idFromProjectPath; } });
|
|
26
|
+
Object.defineProperty(exports, "groupFromProjectPath", { enumerable: true, get: function () { return member_1.groupFromProjectPath; } });
|
|
27
|
+
Object.defineProperty(exports, "findCommitSha", { enumerable: true, get: function () { return member_1.findCommitSha; } });
|
|
28
|
+
var gitlab_1 = require("./gitlab");
|
|
29
|
+
Object.defineProperty(exports, "createGitLabApi", { enumerable: true, get: function () { return gitlab_1.createGitLabApi; } });
|
|
30
|
+
Object.defineProperty(exports, "httpsGetJson", { enumerable: true, get: function () { return gitlab_1.httpsGetJson; } });
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resolve/index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,qCAAwE;AAA/D,sGAAA,WAAW,OAAA;AAAE,yGAAA,cAAc,OAAA;AAAE,yGAAA,cAAc,OAAA;AACpD,uCAA4F;AAAnF,+GAAA,mBAAmB,OAAA;AAAE,0GAAA,cAAc,OAAA;AAAE,mGAAA,OAAO,OAAA;AAAE,4GAAA,gBAAgB,OAAA;AACvE,mCAQkB;AAPhB,uGAAA,aAAa,OAAA;AACb,+GAAA,qBAAqB,OAAA;AACrB,8GAAA,oBAAoB,OAAA;AACpB,4GAAA,kBAAkB,OAAA;AAClB,2GAAA,iBAAiB,OAAA;AACjB,8GAAA,oBAAoB,OAAA;AACpB,uGAAA,aAAa,OAAA;AAEf,mCAAyD;AAAhD,yGAAA,eAAe,OAAA;AAAE,sGAAA,YAAY,OAAA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* resolveFromManifest (B2) — the manifest-driven resolver (RESOLVED-LOCK-SPEC S4).
|
|
3
|
+
*
|
|
4
|
+
* Input: a snapshot.json-like {@link Manifest} (install set + registry scope→group).
|
|
5
|
+
* B2 discovers each package's projectId by fetching the GitLab npm **packument**
|
|
6
|
+
* and mining the version's `dist.tarball` URL — the same coordinate signal B1
|
|
7
|
+
* mines from a package-lock `resolved` URL. From "npmName + version + projectId"
|
|
8
|
+
* onward it reuses the shared member core, so resolution is IDENTICAL to B1.
|
|
9
|
+
*
|
|
10
|
+
* Output: the SAME resolved-lock schema (S2); only `source.derivedFrom` differs.
|
|
11
|
+
* READ-ONLY: registry GETs only.
|
|
12
|
+
*/
|
|
13
|
+
import type { InstallBlock, Manifest, Packument, PackumentVersion, ResolveFromManifestOptions, ResolveResult } from '../types';
|
|
14
|
+
export interface InstallEntry {
|
|
15
|
+
npmName: string;
|
|
16
|
+
version: string;
|
|
17
|
+
installer: string;
|
|
18
|
+
}
|
|
19
|
+
/** scope of an npm name: "@ist/tda" -> "@ist"; unscoped -> null. */
|
|
20
|
+
export declare function scopeOf(name: string): string | null;
|
|
21
|
+
/**
|
|
22
|
+
* Flatten an install block into entries. Accepts the channelled shape
|
|
23
|
+
* ({channel:{name:version}}) or a flat map. De-dups by npmName (first wins).
|
|
24
|
+
*/
|
|
25
|
+
export declare function flattenInstall(install: InstallBlock | undefined, doWarn: (msg: string) => void): InstallEntry[];
|
|
26
|
+
/** Pick the packument version entry for an exact version, else dist-tags.latest. */
|
|
27
|
+
export declare function pickVersionEntry(packument: Packument | undefined, version: string, doWarn: (msg: string) => void, npmName: string): {
|
|
28
|
+
entry: PackumentVersion | null;
|
|
29
|
+
version: string;
|
|
30
|
+
};
|
|
31
|
+
export declare function resolveFromManifest(manifestObj: Manifest, options: ResolveFromManifestOptions): Promise<ResolveResult>;
|
|
32
|
+
//# sourceMappingURL=manifest.d.ts.map
|