@napi-rs/cli 2.0.0-alpha.3 → 2.0.0-alpha.4
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/package.json +1 -1
- package/scripts/index.js +1103 -420
- package/scripts/type_def.1636206185632.tmp +2 -0
package/scripts/index.js
CHANGED
|
@@ -249,7 +249,41 @@ var require_lib = __commonJS({
|
|
|
249
249
|
var makeTrait = (value) => () => {
|
|
250
250
|
return value;
|
|
251
251
|
};
|
|
252
|
-
|
|
252
|
+
var TypeAssertionError = class extends Error {
|
|
253
|
+
constructor({ errors } = {}) {
|
|
254
|
+
let errorMessage = `Type mismatch`;
|
|
255
|
+
if (errors && errors.length > 0) {
|
|
256
|
+
errorMessage += `
|
|
257
|
+
`;
|
|
258
|
+
for (const error of errors) {
|
|
259
|
+
errorMessage += `
|
|
260
|
+
- ${error}`;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
super(errorMessage);
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
function assert(val, validator) {
|
|
267
|
+
if (!validator(val)) {
|
|
268
|
+
throw new TypeAssertionError();
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
function assertWithErrors(val, validator) {
|
|
272
|
+
const errors = [];
|
|
273
|
+
if (!validator(val, { errors })) {
|
|
274
|
+
throw new TypeAssertionError({ errors });
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
function softAssert(val, validator) {
|
|
278
|
+
}
|
|
279
|
+
function fn(validators, fn2) {
|
|
280
|
+
const isValidArgList = isTuple(validators);
|
|
281
|
+
return (...args) => {
|
|
282
|
+
const check = isValidArgList(args);
|
|
283
|
+
if (!check)
|
|
284
|
+
throw new Error(`Invalid arguments`);
|
|
285
|
+
return fn2(...args);
|
|
286
|
+
};
|
|
253
287
|
}
|
|
254
288
|
function makeValidator({ test }) {
|
|
255
289
|
return makeTrait(test)();
|
|
@@ -261,8 +295,22 @@ var require_lib = __commonJS({
|
|
|
261
295
|
return `undefined`;
|
|
262
296
|
if (value === ``)
|
|
263
297
|
return `an empty string`;
|
|
298
|
+
if (typeof value === "symbol")
|
|
299
|
+
return `<${value.toString()}>`;
|
|
300
|
+
if (Array.isArray(value))
|
|
301
|
+
return `an array`;
|
|
264
302
|
return JSON.stringify(value);
|
|
265
303
|
}
|
|
304
|
+
function getPrintableArray(value, conjunction) {
|
|
305
|
+
if (value.length === 0)
|
|
306
|
+
return `nothing`;
|
|
307
|
+
if (value.length === 1)
|
|
308
|
+
return getPrintable(value[0]);
|
|
309
|
+
const rest = value.slice(0, -1);
|
|
310
|
+
const trailing = value[value.length - 1];
|
|
311
|
+
const separator = value.length > 2 ? `, ${conjunction} ` : ` ${conjunction} `;
|
|
312
|
+
return `${rest.map((value2) => getPrintable(value2)).join(`, `)}${separator}${getPrintable(trailing)}`;
|
|
313
|
+
}
|
|
266
314
|
function computeKey(state, key) {
|
|
267
315
|
var _a2, _b, _c;
|
|
268
316
|
if (typeof key === `number`) {
|
|
@@ -280,13 +328,13 @@ var require_lib = __commonJS({
|
|
|
280
328
|
return makeCoercionFn(target, key).bind(null, previous);
|
|
281
329
|
};
|
|
282
330
|
}
|
|
283
|
-
function makeLazyCoercionFn(
|
|
331
|
+
function makeLazyCoercionFn(fn2, orig, generator) {
|
|
284
332
|
const commit = () => {
|
|
285
|
-
|
|
333
|
+
fn2(generator());
|
|
286
334
|
return revert;
|
|
287
335
|
};
|
|
288
336
|
const revert = () => {
|
|
289
|
-
|
|
337
|
+
fn2(orig);
|
|
290
338
|
return commit;
|
|
291
339
|
};
|
|
292
340
|
return commit;
|
|
@@ -312,7 +360,7 @@ var require_lib = __commonJS({
|
|
|
312
360
|
return makeValidator({
|
|
313
361
|
test: (value, state) => {
|
|
314
362
|
if (value !== expected)
|
|
315
|
-
return pushError(state, `Expected
|
|
363
|
+
return pushError(state, `Expected ${getPrintable(expected)} (got ${getPrintable(value)})`);
|
|
316
364
|
return true;
|
|
317
365
|
}
|
|
318
366
|
});
|
|
@@ -326,11 +374,19 @@ var require_lib = __commonJS({
|
|
|
326
374
|
});
|
|
327
375
|
function isEnum(enumSpec) {
|
|
328
376
|
const valuesArray = Array.isArray(enumSpec) ? enumSpec : Object.values(enumSpec);
|
|
377
|
+
const isAlphaNum = valuesArray.every((item) => typeof item === "string" || typeof item === "number");
|
|
329
378
|
const values = new Set(valuesArray);
|
|
379
|
+
if (values.size === 1)
|
|
380
|
+
return isLiteral([...values][0]);
|
|
330
381
|
return makeValidator({
|
|
331
382
|
test: (value, state) => {
|
|
332
|
-
if (!values.has(value))
|
|
333
|
-
|
|
383
|
+
if (!values.has(value)) {
|
|
384
|
+
if (isAlphaNum) {
|
|
385
|
+
return pushError(state, `Expected one of ${getPrintableArray(valuesArray, `or`)} (got ${getPrintable(value)})`);
|
|
386
|
+
} else {
|
|
387
|
+
return pushError(state, `Expected a valid enumeration value (got ${getPrintable(value)})`);
|
|
388
|
+
}
|
|
389
|
+
}
|
|
334
390
|
return true;
|
|
335
391
|
}
|
|
336
392
|
});
|
|
@@ -881,7 +937,7 @@ var require_lib = __commonJS({
|
|
|
881
937
|
if (!keys.has(key))
|
|
882
938
|
problems.push(key);
|
|
883
939
|
if (problems.length > 0)
|
|
884
|
-
return pushError(state, `Missing required ${plural(problems.length, `property`, `properties`)} ${problems
|
|
940
|
+
return pushError(state, `Missing required ${plural(problems.length, `property`, `properties`)} ${getPrintableArray(problems, `and`)}`);
|
|
885
941
|
return true;
|
|
886
942
|
}
|
|
887
943
|
});
|
|
@@ -896,7 +952,7 @@ var require_lib = __commonJS({
|
|
|
896
952
|
if (keys.has(key))
|
|
897
953
|
problems.push(key);
|
|
898
954
|
if (problems.length > 0)
|
|
899
|
-
return pushError(state, `Forbidden ${plural(problems.length, `property`, `properties`)} ${problems
|
|
955
|
+
return pushError(state, `Forbidden ${plural(problems.length, `property`, `properties`)} ${getPrintableArray(problems, `and`)}`);
|
|
900
956
|
return true;
|
|
901
957
|
}
|
|
902
958
|
});
|
|
@@ -911,7 +967,7 @@ var require_lib = __commonJS({
|
|
|
911
967
|
if (keys.has(key))
|
|
912
968
|
used.push(key);
|
|
913
969
|
if (used.length > 1)
|
|
914
|
-
return pushError(state, `Mutually exclusive properties ${used
|
|
970
|
+
return pushError(state, `Mutually exclusive properties ${getPrintableArray(used, `and`)}`);
|
|
915
971
|
return true;
|
|
916
972
|
}
|
|
917
973
|
});
|
|
@@ -934,6 +990,7 @@ var require_lib = __commonJS({
|
|
|
934
990
|
const skipped = new Set(ignore);
|
|
935
991
|
const otherSet = new Set(others);
|
|
936
992
|
const spec = keyRelationships[relationship];
|
|
993
|
+
const conjunction = relationship === exports2.KeyRelationship.Forbids ? `or` : `and`;
|
|
937
994
|
return makeValidator({
|
|
938
995
|
test: (value, state) => {
|
|
939
996
|
const keys = new Set(Object.keys(value));
|
|
@@ -944,17 +1001,22 @@ var require_lib = __commonJS({
|
|
|
944
1001
|
if ((keys.has(key) && !skipped.has(value[key])) !== spec.expect)
|
|
945
1002
|
problems.push(key);
|
|
946
1003
|
if (problems.length >= 1)
|
|
947
|
-
return pushError(state, `Property "${subject}" ${spec.message} ${plural(problems.length, `property`, `properties`)} ${problems
|
|
1004
|
+
return pushError(state, `Property "${subject}" ${spec.message} ${plural(problems.length, `property`, `properties`)} ${getPrintableArray(problems, conjunction)}`);
|
|
948
1005
|
return true;
|
|
949
1006
|
}
|
|
950
1007
|
});
|
|
951
1008
|
};
|
|
1009
|
+
exports2.TypeAssertionError = TypeAssertionError;
|
|
952
1010
|
exports2.applyCascade = applyCascade;
|
|
1011
|
+
exports2.assert = assert;
|
|
1012
|
+
exports2.assertWithErrors = assertWithErrors;
|
|
953
1013
|
exports2.base64RegExp = base64RegExp;
|
|
954
1014
|
exports2.colorStringAlphaRegExp = colorStringAlphaRegExp;
|
|
955
1015
|
exports2.colorStringRegExp = colorStringRegExp;
|
|
956
1016
|
exports2.computeKey = computeKey;
|
|
1017
|
+
exports2.fn = fn;
|
|
957
1018
|
exports2.getPrintable = getPrintable;
|
|
1019
|
+
exports2.getPrintableArray = getPrintableArray;
|
|
958
1020
|
exports2.hasExactLength = hasExactLength;
|
|
959
1021
|
exports2.hasForbiddenKeys = hasForbiddenKeys;
|
|
960
1022
|
exports2.hasKeyRelationship = hasKeyRelationship;
|
|
@@ -10511,18 +10573,18 @@ var require_register = __commonJS({
|
|
|
10511
10573
|
var require_add = __commonJS({
|
|
10512
10574
|
"node_modules/before-after-hook/lib/add.js"(exports2, module2) {
|
|
10513
10575
|
module2.exports = addHook;
|
|
10514
|
-
function addHook(state, kind, name,
|
|
10515
|
-
var orig =
|
|
10576
|
+
function addHook(state, kind, name, hook3) {
|
|
10577
|
+
var orig = hook3;
|
|
10516
10578
|
if (!state.registry[name]) {
|
|
10517
10579
|
state.registry[name] = [];
|
|
10518
10580
|
}
|
|
10519
10581
|
if (kind === "before") {
|
|
10520
|
-
|
|
10582
|
+
hook3 = function(method, options) {
|
|
10521
10583
|
return Promise.resolve().then(orig.bind(null, options)).then(method.bind(null, options));
|
|
10522
10584
|
};
|
|
10523
10585
|
}
|
|
10524
10586
|
if (kind === "after") {
|
|
10525
|
-
|
|
10587
|
+
hook3 = function(method, options) {
|
|
10526
10588
|
var result;
|
|
10527
10589
|
return Promise.resolve().then(method.bind(null, options)).then(function(result_) {
|
|
10528
10590
|
result = result_;
|
|
@@ -10533,14 +10595,14 @@ var require_add = __commonJS({
|
|
|
10533
10595
|
};
|
|
10534
10596
|
}
|
|
10535
10597
|
if (kind === "error") {
|
|
10536
|
-
|
|
10598
|
+
hook3 = function(method, options) {
|
|
10537
10599
|
return Promise.resolve().then(method.bind(null, options)).catch(function(error) {
|
|
10538
10600
|
return orig(error, options);
|
|
10539
10601
|
});
|
|
10540
10602
|
};
|
|
10541
10603
|
}
|
|
10542
10604
|
state.registry[name].push({
|
|
10543
|
-
hook:
|
|
10605
|
+
hook: hook3,
|
|
10544
10606
|
orig
|
|
10545
10607
|
});
|
|
10546
10608
|
}
|
|
@@ -10574,13 +10636,13 @@ var require_before_after_hook = __commonJS({
|
|
|
10574
10636
|
var removeHook = require_remove();
|
|
10575
10637
|
var bind = Function.bind;
|
|
10576
10638
|
var bindable = bind.bind(bind);
|
|
10577
|
-
function bindApi(
|
|
10639
|
+
function bindApi(hook3, state, name) {
|
|
10578
10640
|
var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state]);
|
|
10579
|
-
|
|
10580
|
-
|
|
10641
|
+
hook3.api = { remove: removeHookRef };
|
|
10642
|
+
hook3.remove = removeHookRef;
|
|
10581
10643
|
["before", "error", "after", "wrap"].forEach(function(kind) {
|
|
10582
10644
|
var args = name ? [state, kind, name] : [state, kind];
|
|
10583
|
-
|
|
10645
|
+
hook3[kind] = hook3.api[kind] = bindable(addHook, null).apply(null, args);
|
|
10584
10646
|
});
|
|
10585
10647
|
}
|
|
10586
10648
|
function HookSingular() {
|
|
@@ -10596,9 +10658,9 @@ var require_before_after_hook = __commonJS({
|
|
|
10596
10658
|
var state = {
|
|
10597
10659
|
registry: {}
|
|
10598
10660
|
};
|
|
10599
|
-
var
|
|
10600
|
-
bindApi(
|
|
10601
|
-
return
|
|
10661
|
+
var hook3 = register.bind(null, state);
|
|
10662
|
+
bindApi(hook3, state);
|
|
10663
|
+
return hook3;
|
|
10602
10664
|
}
|
|
10603
10665
|
var collectionHookDeprecationMessageDisplayed = false;
|
|
10604
10666
|
function Hook() {
|
|
@@ -13010,13 +13072,13 @@ function getHeaders(headers) {
|
|
|
13010
13072
|
});
|
|
13011
13073
|
}
|
|
13012
13074
|
function createHeadersIterator(target, kind) {
|
|
13013
|
-
const
|
|
13014
|
-
|
|
13075
|
+
const iterator3 = Object.create(HeadersIteratorPrototype);
|
|
13076
|
+
iterator3[INTERNAL] = {
|
|
13015
13077
|
target,
|
|
13016
13078
|
kind,
|
|
13017
13079
|
index: 0
|
|
13018
13080
|
};
|
|
13019
|
-
return
|
|
13081
|
+
return iterator3;
|
|
13020
13082
|
}
|
|
13021
13083
|
function exportNodeCompatibleHeaders(headers) {
|
|
13022
13084
|
const obj = Object.assign({ __proto__: null }, headers[MAP]);
|
|
@@ -13691,7 +13753,7 @@ var init_lib = __esm({
|
|
|
13691
13753
|
configurable: true
|
|
13692
13754
|
});
|
|
13693
13755
|
INTERNALS$2 = Symbol("Request internals");
|
|
13694
|
-
URL = import_whatwg_url.default.URL;
|
|
13756
|
+
URL = import_url.default.URL || import_whatwg_url.default.URL;
|
|
13695
13757
|
parse_url = import_url.default.parse;
|
|
13696
13758
|
format_url = import_url.default.format;
|
|
13697
13759
|
streamDestructionSupported = "destroy" in import_stream.default.Readable.prototype;
|
|
@@ -14068,7 +14130,7 @@ var init_dist_web5 = __esm({
|
|
|
14068
14130
|
init_is_plain_object();
|
|
14069
14131
|
init_lib();
|
|
14070
14132
|
init_dist_web4();
|
|
14071
|
-
VERSION2 = "5.6.
|
|
14133
|
+
VERSION2 = "5.6.2";
|
|
14072
14134
|
request = withDefaults2(endpoint, {
|
|
14073
14135
|
headers: {
|
|
14074
14136
|
"user-agent": `octokit-request.js/${VERSION2} ${getUserAgent()}`
|
|
@@ -14077,25 +14139,66 @@ var init_dist_web5 = __esm({
|
|
|
14077
14139
|
}
|
|
14078
14140
|
});
|
|
14079
14141
|
|
|
14080
|
-
// node_modules/@octokit/
|
|
14081
|
-
function
|
|
14082
|
-
|
|
14083
|
-
|
|
14142
|
+
// node_modules/@octokit/plugin-request-log/dist-web/index.js
|
|
14143
|
+
function requestLog(octokit) {
|
|
14144
|
+
octokit.hook.wrap("request", (request2, options) => {
|
|
14145
|
+
octokit.log.debug("request", options);
|
|
14146
|
+
const start = Date.now();
|
|
14147
|
+
const requestOptions = octokit.request.endpoint.parse(options);
|
|
14148
|
+
const path = requestOptions.url.replace(options.baseUrl, "");
|
|
14149
|
+
return request2(options).then((response) => {
|
|
14150
|
+
octokit.log.info(`${requestOptions.method} ${path} - ${response.status} in ${Date.now() - start}ms`);
|
|
14151
|
+
return response;
|
|
14152
|
+
}).catch((error) => {
|
|
14153
|
+
octokit.log.info(`${requestOptions.method} ${path} - ${error.status} in ${Date.now() - start}ms`);
|
|
14154
|
+
throw error;
|
|
14155
|
+
});
|
|
14156
|
+
});
|
|
14084
14157
|
}
|
|
14085
|
-
|
|
14086
|
-
|
|
14087
|
-
|
|
14088
|
-
|
|
14089
|
-
|
|
14090
|
-
|
|
14091
|
-
|
|
14092
|
-
|
|
14093
|
-
|
|
14094
|
-
|
|
14158
|
+
var VERSION5;
|
|
14159
|
+
var init_dist_web6 = __esm({
|
|
14160
|
+
"node_modules/@octokit/plugin-request-log/dist-web/index.js"() {
|
|
14161
|
+
VERSION5 = "1.0.4";
|
|
14162
|
+
requestLog.VERSION = VERSION5;
|
|
14163
|
+
}
|
|
14164
|
+
});
|
|
14165
|
+
|
|
14166
|
+
// node_modules/putasset/node_modules/universal-user-agent/dist-web/index.js
|
|
14167
|
+
function getUserAgent2() {
|
|
14168
|
+
try {
|
|
14169
|
+
return navigator.userAgent;
|
|
14170
|
+
} catch (e) {
|
|
14171
|
+
return "<environment undetectable>";
|
|
14172
|
+
}
|
|
14173
|
+
}
|
|
14174
|
+
var init_dist_web7 = __esm({
|
|
14175
|
+
"node_modules/putasset/node_modules/universal-user-agent/dist-web/index.js"() {
|
|
14176
|
+
}
|
|
14177
|
+
});
|
|
14178
|
+
|
|
14179
|
+
// node_modules/putasset/node_modules/@octokit/graphql/node_modules/universal-user-agent/dist-web/index.js
|
|
14180
|
+
function getUserAgent3() {
|
|
14181
|
+
if (typeof navigator === "object" && "userAgent" in navigator) {
|
|
14182
|
+
return navigator.userAgent;
|
|
14183
|
+
}
|
|
14184
|
+
if (typeof process === "object" && "version" in process) {
|
|
14185
|
+
return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`;
|
|
14186
|
+
}
|
|
14187
|
+
return "<environment undetectable>";
|
|
14188
|
+
}
|
|
14189
|
+
var init_dist_web8 = __esm({
|
|
14190
|
+
"node_modules/putasset/node_modules/@octokit/graphql/node_modules/universal-user-agent/dist-web/index.js"() {
|
|
14191
|
+
}
|
|
14192
|
+
});
|
|
14193
|
+
|
|
14194
|
+
// node_modules/putasset/node_modules/@octokit/graphql/dist-web/index.js
|
|
14195
|
+
function graphql2(request2, query, options) {
|
|
14196
|
+
if (typeof query === "string" && options && "query" in options) {
|
|
14197
|
+
return Promise.reject(new Error(`[@octokit/graphql] "query" cannot be used as variable name`));
|
|
14095
14198
|
}
|
|
14096
14199
|
const parsedOptions = typeof query === "string" ? Object.assign({ query }, options) : query;
|
|
14097
14200
|
const requestOptions = Object.keys(parsedOptions).reduce((result, key) => {
|
|
14098
|
-
if (
|
|
14201
|
+
if (NON_VARIABLE_OPTIONS2.includes(key)) {
|
|
14099
14202
|
result[key] = parsedOptions[key];
|
|
14100
14203
|
return result;
|
|
14101
14204
|
}
|
|
@@ -14106,8 +14209,8 @@ function graphql(request2, query, options) {
|
|
|
14106
14209
|
return result;
|
|
14107
14210
|
}, {});
|
|
14108
14211
|
const baseUrl = parsedOptions.baseUrl || request2.endpoint.DEFAULTS.baseUrl;
|
|
14109
|
-
if (
|
|
14110
|
-
requestOptions.url = baseUrl.replace(
|
|
14212
|
+
if (GHES_V3_SUFFIX_REGEX2.test(baseUrl)) {
|
|
14213
|
+
requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX2, "/api/graphql");
|
|
14111
14214
|
}
|
|
14112
14215
|
return request2(requestOptions).then((response) => {
|
|
14113
14216
|
if (response.data.errors) {
|
|
@@ -14115,48 +14218,50 @@ function graphql(request2, query, options) {
|
|
|
14115
14218
|
for (const key of Object.keys(response.headers)) {
|
|
14116
14219
|
headers[key] = response.headers[key];
|
|
14117
14220
|
}
|
|
14118
|
-
throw new
|
|
14221
|
+
throw new GraphqlError(requestOptions, {
|
|
14222
|
+
headers,
|
|
14223
|
+
data: response.data
|
|
14224
|
+
});
|
|
14119
14225
|
}
|
|
14120
14226
|
return response.data.data;
|
|
14121
14227
|
});
|
|
14122
14228
|
}
|
|
14123
|
-
function
|
|
14229
|
+
function withDefaults4(request$1, newDefaults) {
|
|
14124
14230
|
const newRequest = request$1.defaults(newDefaults);
|
|
14125
14231
|
const newApi = (query, options) => {
|
|
14126
|
-
return
|
|
14232
|
+
return graphql2(newRequest, query, options);
|
|
14127
14233
|
};
|
|
14128
14234
|
return Object.assign(newApi, {
|
|
14129
|
-
defaults:
|
|
14235
|
+
defaults: withDefaults4.bind(null, newRequest),
|
|
14130
14236
|
endpoint: request.endpoint
|
|
14131
14237
|
});
|
|
14132
14238
|
}
|
|
14133
|
-
function
|
|
14134
|
-
return
|
|
14239
|
+
function withCustomRequest2(customRequest) {
|
|
14240
|
+
return withDefaults4(customRequest, {
|
|
14135
14241
|
method: "POST",
|
|
14136
14242
|
url: "/graphql"
|
|
14137
14243
|
});
|
|
14138
14244
|
}
|
|
14139
|
-
var
|
|
14140
|
-
var
|
|
14141
|
-
"node_modules/@octokit/graphql/dist-web/index.js"() {
|
|
14245
|
+
var VERSION9, GraphqlError, NON_VARIABLE_OPTIONS2, GHES_V3_SUFFIX_REGEX2, graphql$12;
|
|
14246
|
+
var init_dist_web9 = __esm({
|
|
14247
|
+
"node_modules/putasset/node_modules/@octokit/graphql/dist-web/index.js"() {
|
|
14142
14248
|
init_dist_web5();
|
|
14143
|
-
|
|
14144
|
-
|
|
14145
|
-
|
|
14146
|
-
constructor(request2,
|
|
14147
|
-
|
|
14249
|
+
init_dist_web8();
|
|
14250
|
+
VERSION9 = "4.5.7";
|
|
14251
|
+
GraphqlError = class extends Error {
|
|
14252
|
+
constructor(request2, response) {
|
|
14253
|
+
const message = response.data.errors[0].message;
|
|
14254
|
+
super(message);
|
|
14255
|
+
Object.assign(this, response.data);
|
|
14256
|
+
Object.assign(this, { headers: response.headers });
|
|
14257
|
+
this.name = "GraphqlError";
|
|
14148
14258
|
this.request = request2;
|
|
14149
|
-
this.headers = headers;
|
|
14150
|
-
this.response = response;
|
|
14151
|
-
this.name = "GraphqlResponseError";
|
|
14152
|
-
this.errors = response.errors;
|
|
14153
|
-
this.data = response.data;
|
|
14154
14259
|
if (Error.captureStackTrace) {
|
|
14155
14260
|
Error.captureStackTrace(this, this.constructor);
|
|
14156
14261
|
}
|
|
14157
14262
|
}
|
|
14158
14263
|
};
|
|
14159
|
-
|
|
14264
|
+
NON_VARIABLE_OPTIONS2 = [
|
|
14160
14265
|
"method",
|
|
14161
14266
|
"baseUrl",
|
|
14162
14267
|
"url",
|
|
@@ -14165,11 +14270,10 @@ var init_dist_web6 = __esm({
|
|
|
14165
14270
|
"query",
|
|
14166
14271
|
"mediaType"
|
|
14167
14272
|
];
|
|
14168
|
-
|
|
14169
|
-
|
|
14170
|
-
graphql$1 = withDefaults3(request, {
|
|
14273
|
+
GHES_V3_SUFFIX_REGEX2 = /\/api\/v3\/?$/;
|
|
14274
|
+
graphql$12 = withDefaults4(request, {
|
|
14171
14275
|
headers: {
|
|
14172
|
-
"user-agent": `octokit-graphql.js/${
|
|
14276
|
+
"user-agent": `octokit-graphql.js/${VERSION9} ${getUserAgent3()}`
|
|
14173
14277
|
},
|
|
14174
14278
|
method: "POST",
|
|
14175
14279
|
url: "/graphql"
|
|
@@ -14177,11 +14281,11 @@ var init_dist_web6 = __esm({
|
|
|
14177
14281
|
}
|
|
14178
14282
|
});
|
|
14179
14283
|
|
|
14180
|
-
// node_modules/@octokit/auth-token/dist-web/index.js
|
|
14181
|
-
async function
|
|
14284
|
+
// node_modules/putasset/node_modules/@octokit/auth-token/dist-web/index.js
|
|
14285
|
+
async function auth2(token) {
|
|
14182
14286
|
const isApp = token.split(/\./).length === 3;
|
|
14183
|
-
const isInstallation =
|
|
14184
|
-
const isUserToServer =
|
|
14287
|
+
const isInstallation = REGEX_IS_INSTALLATION_LEGACY2.test(token) || REGEX_IS_INSTALLATION2.test(token);
|
|
14288
|
+
const isUserToServer = REGEX_IS_USER_TO_SERVER2.test(token);
|
|
14185
14289
|
const tokenType = isApp ? "app" : isInstallation ? "installation" : isUserToServer ? "user-to-server" : "oauth";
|
|
14186
14290
|
return {
|
|
14187
14291
|
type: "token",
|
|
@@ -14189,24 +14293,24 @@ async function auth(token) {
|
|
|
14189
14293
|
tokenType
|
|
14190
14294
|
};
|
|
14191
14295
|
}
|
|
14192
|
-
function
|
|
14296
|
+
function withAuthorizationPrefix2(token) {
|
|
14193
14297
|
if (token.split(/\./).length === 3) {
|
|
14194
14298
|
return `bearer ${token}`;
|
|
14195
14299
|
}
|
|
14196
14300
|
return `token ${token}`;
|
|
14197
14301
|
}
|
|
14198
|
-
async function
|
|
14302
|
+
async function hook2(token, request2, route, parameters) {
|
|
14199
14303
|
const endpoint2 = request2.endpoint.merge(route, parameters);
|
|
14200
|
-
endpoint2.headers.authorization =
|
|
14304
|
+
endpoint2.headers.authorization = withAuthorizationPrefix2(token);
|
|
14201
14305
|
return request2(endpoint2);
|
|
14202
14306
|
}
|
|
14203
|
-
var
|
|
14204
|
-
var
|
|
14205
|
-
"node_modules/@octokit/auth-token/dist-web/index.js"() {
|
|
14206
|
-
|
|
14207
|
-
|
|
14208
|
-
|
|
14209
|
-
|
|
14307
|
+
var REGEX_IS_INSTALLATION_LEGACY2, REGEX_IS_INSTALLATION2, REGEX_IS_USER_TO_SERVER2, createTokenAuth3;
|
|
14308
|
+
var init_dist_web10 = __esm({
|
|
14309
|
+
"node_modules/putasset/node_modules/@octokit/auth-token/dist-web/index.js"() {
|
|
14310
|
+
REGEX_IS_INSTALLATION_LEGACY2 = /^v1\./;
|
|
14311
|
+
REGEX_IS_INSTALLATION2 = /^ghs_/;
|
|
14312
|
+
REGEX_IS_USER_TO_SERVER2 = /^ghu_/;
|
|
14313
|
+
createTokenAuth3 = function createTokenAuth4(token) {
|
|
14210
14314
|
if (!token) {
|
|
14211
14315
|
throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
|
|
14212
14316
|
}
|
|
@@ -14214,170 +14318,31 @@ var init_dist_web7 = __esm({
|
|
|
14214
14318
|
throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");
|
|
14215
14319
|
}
|
|
14216
14320
|
token = token.replace(/^(token|bearer) +/i, "");
|
|
14217
|
-
return Object.assign(
|
|
14218
|
-
hook:
|
|
14321
|
+
return Object.assign(auth2.bind(null, token), {
|
|
14322
|
+
hook: hook2.bind(null, token)
|
|
14219
14323
|
});
|
|
14220
14324
|
};
|
|
14221
14325
|
}
|
|
14222
14326
|
});
|
|
14223
14327
|
|
|
14224
|
-
// node_modules/@octokit/plugin-request-log/dist-web/index.js
|
|
14225
|
-
function requestLog(octokit) {
|
|
14226
|
-
octokit.hook.wrap("request", (request2, options) => {
|
|
14227
|
-
octokit.log.debug("request", options);
|
|
14228
|
-
const start = Date.now();
|
|
14229
|
-
const requestOptions = octokit.request.endpoint.parse(options);
|
|
14230
|
-
const path = requestOptions.url.replace(options.baseUrl, "");
|
|
14231
|
-
return request2(options).then((response) => {
|
|
14232
|
-
octokit.log.info(`${requestOptions.method} ${path} - ${response.status} in ${Date.now() - start}ms`);
|
|
14233
|
-
return response;
|
|
14234
|
-
}).catch((error) => {
|
|
14235
|
-
octokit.log.info(`${requestOptions.method} ${path} - ${error.status} in ${Date.now() - start}ms`);
|
|
14236
|
-
throw error;
|
|
14237
|
-
});
|
|
14238
|
-
});
|
|
14239
|
-
}
|
|
14240
|
-
var VERSION5;
|
|
14241
|
-
var init_dist_web8 = __esm({
|
|
14242
|
-
"node_modules/@octokit/plugin-request-log/dist-web/index.js"() {
|
|
14243
|
-
VERSION5 = "1.0.4";
|
|
14244
|
-
requestLog.VERSION = VERSION5;
|
|
14245
|
-
}
|
|
14246
|
-
});
|
|
14247
|
-
|
|
14248
|
-
// node_modules/@octokit/plugin-paginate-rest/dist-web/index.js
|
|
14249
|
-
function normalizePaginatedListResponse(response) {
|
|
14250
|
-
if (!response.data) {
|
|
14251
|
-
return {
|
|
14252
|
-
...response,
|
|
14253
|
-
data: []
|
|
14254
|
-
};
|
|
14255
|
-
}
|
|
14256
|
-
const responseNeedsNormalization = "total_count" in response.data && !("url" in response.data);
|
|
14257
|
-
if (!responseNeedsNormalization)
|
|
14258
|
-
return response;
|
|
14259
|
-
const incompleteResults = response.data.incomplete_results;
|
|
14260
|
-
const repositorySelection = response.data.repository_selection;
|
|
14261
|
-
const totalCount = response.data.total_count;
|
|
14262
|
-
delete response.data.incomplete_results;
|
|
14263
|
-
delete response.data.repository_selection;
|
|
14264
|
-
delete response.data.total_count;
|
|
14265
|
-
const namespaceKey = Object.keys(response.data)[0];
|
|
14266
|
-
const data = response.data[namespaceKey];
|
|
14267
|
-
response.data = data;
|
|
14268
|
-
if (typeof incompleteResults !== "undefined") {
|
|
14269
|
-
response.data.incomplete_results = incompleteResults;
|
|
14270
|
-
}
|
|
14271
|
-
if (typeof repositorySelection !== "undefined") {
|
|
14272
|
-
response.data.repository_selection = repositorySelection;
|
|
14273
|
-
}
|
|
14274
|
-
response.data.total_count = totalCount;
|
|
14275
|
-
return response;
|
|
14276
|
-
}
|
|
14277
|
-
function iterator(octokit, route, parameters) {
|
|
14278
|
-
const options = typeof route === "function" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters);
|
|
14279
|
-
const requestMethod = typeof route === "function" ? route : octokit.request;
|
|
14280
|
-
const method = options.method;
|
|
14281
|
-
const headers = options.headers;
|
|
14282
|
-
let url = options.url;
|
|
14283
|
-
return {
|
|
14284
|
-
[Symbol.asyncIterator]: () => ({
|
|
14285
|
-
async next() {
|
|
14286
|
-
if (!url)
|
|
14287
|
-
return { done: true };
|
|
14288
|
-
try {
|
|
14289
|
-
const response = await requestMethod({ method, url, headers });
|
|
14290
|
-
const normalizedResponse = normalizePaginatedListResponse(response);
|
|
14291
|
-
url = ((normalizedResponse.headers.link || "").match(/<([^>]+)>;\s*rel="next"/) || [])[1];
|
|
14292
|
-
return { value: normalizedResponse };
|
|
14293
|
-
} catch (error) {
|
|
14294
|
-
if (error.status !== 409)
|
|
14295
|
-
throw error;
|
|
14296
|
-
url = "";
|
|
14297
|
-
return {
|
|
14298
|
-
value: {
|
|
14299
|
-
status: 200,
|
|
14300
|
-
headers: {},
|
|
14301
|
-
data: []
|
|
14302
|
-
}
|
|
14303
|
-
};
|
|
14304
|
-
}
|
|
14305
|
-
}
|
|
14306
|
-
})
|
|
14307
|
-
};
|
|
14308
|
-
}
|
|
14309
|
-
function paginate(octokit, route, parameters, mapFn) {
|
|
14310
|
-
if (typeof parameters === "function") {
|
|
14311
|
-
mapFn = parameters;
|
|
14312
|
-
parameters = void 0;
|
|
14313
|
-
}
|
|
14314
|
-
return gather(octokit, [], iterator(octokit, route, parameters)[Symbol.asyncIterator](), mapFn);
|
|
14315
|
-
}
|
|
14316
|
-
function gather(octokit, results, iterator2, mapFn) {
|
|
14317
|
-
return iterator2.next().then((result) => {
|
|
14318
|
-
if (result.done) {
|
|
14319
|
-
return results;
|
|
14320
|
-
}
|
|
14321
|
-
let earlyExit = false;
|
|
14322
|
-
function done() {
|
|
14323
|
-
earlyExit = true;
|
|
14324
|
-
}
|
|
14325
|
-
results = results.concat(mapFn ? mapFn(result.value, done) : result.value.data);
|
|
14326
|
-
if (earlyExit) {
|
|
14327
|
-
return results;
|
|
14328
|
-
}
|
|
14329
|
-
return gather(octokit, results, iterator2, mapFn);
|
|
14330
|
-
});
|
|
14331
|
-
}
|
|
14332
|
-
function paginateRest(octokit) {
|
|
14333
|
-
return {
|
|
14334
|
-
paginate: Object.assign(paginate.bind(null, octokit), {
|
|
14335
|
-
iterator: iterator.bind(null, octokit)
|
|
14336
|
-
})
|
|
14337
|
-
};
|
|
14338
|
-
}
|
|
14339
|
-
var VERSION6, composePaginateRest;
|
|
14340
|
-
var init_dist_web9 = __esm({
|
|
14341
|
-
"node_modules/@octokit/plugin-paginate-rest/dist-web/index.js"() {
|
|
14342
|
-
VERSION6 = "2.16.5";
|
|
14343
|
-
composePaginateRest = Object.assign(paginate, {
|
|
14344
|
-
iterator
|
|
14345
|
-
});
|
|
14346
|
-
paginateRest.VERSION = VERSION6;
|
|
14347
|
-
}
|
|
14348
|
-
});
|
|
14349
|
-
|
|
14350
|
-
// node_modules/putasset/node_modules/universal-user-agent/dist-web/index.js
|
|
14351
|
-
function getUserAgent2() {
|
|
14352
|
-
try {
|
|
14353
|
-
return navigator.userAgent;
|
|
14354
|
-
} catch (e) {
|
|
14355
|
-
return "<environment undetectable>";
|
|
14356
|
-
}
|
|
14357
|
-
}
|
|
14358
|
-
var init_dist_web10 = __esm({
|
|
14359
|
-
"node_modules/putasset/node_modules/universal-user-agent/dist-web/index.js"() {
|
|
14360
|
-
}
|
|
14361
|
-
});
|
|
14362
|
-
|
|
14363
14328
|
// node_modules/putasset/node_modules/@octokit/core/dist-web/index.js
|
|
14364
|
-
var import_before_after_hook2,
|
|
14329
|
+
var import_before_after_hook2, VERSION10, Octokit3;
|
|
14365
14330
|
var init_dist_web11 = __esm({
|
|
14366
14331
|
"node_modules/putasset/node_modules/@octokit/core/dist-web/index.js"() {
|
|
14367
|
-
|
|
14332
|
+
init_dist_web7();
|
|
14368
14333
|
import_before_after_hook2 = __toModule(require_before_after_hook());
|
|
14369
14334
|
init_dist_web5();
|
|
14370
|
-
|
|
14371
|
-
|
|
14372
|
-
|
|
14335
|
+
init_dist_web9();
|
|
14336
|
+
init_dist_web10();
|
|
14337
|
+
VERSION10 = "2.5.4";
|
|
14373
14338
|
Octokit3 = class {
|
|
14374
14339
|
constructor(options = {}) {
|
|
14375
|
-
const
|
|
14340
|
+
const hook3 = new import_before_after_hook2.Collection();
|
|
14376
14341
|
const requestDefaults = {
|
|
14377
14342
|
baseUrl: request.endpoint.DEFAULTS.baseUrl,
|
|
14378
14343
|
headers: {},
|
|
14379
14344
|
request: Object.assign({}, options.request, {
|
|
14380
|
-
hook:
|
|
14345
|
+
hook: hook3.bind(null, "request")
|
|
14381
14346
|
}),
|
|
14382
14347
|
mediaType: {
|
|
14383
14348
|
previews: [],
|
|
@@ -14386,7 +14351,7 @@ var init_dist_web11 = __esm({
|
|
|
14386
14351
|
};
|
|
14387
14352
|
requestDefaults.headers["user-agent"] = [
|
|
14388
14353
|
options.userAgent,
|
|
14389
|
-
`octokit-core.js/${
|
|
14354
|
+
`octokit-core.js/${VERSION10} ${getUserAgent2()}`
|
|
14390
14355
|
].filter(Boolean).join(" ");
|
|
14391
14356
|
if (options.baseUrl) {
|
|
14392
14357
|
requestDefaults.baseUrl = options.baseUrl;
|
|
@@ -14398,7 +14363,7 @@ var init_dist_web11 = __esm({
|
|
|
14398
14363
|
requestDefaults.headers["time-zone"] = options.timeZone;
|
|
14399
14364
|
}
|
|
14400
14365
|
this.request = request.defaults(requestDefaults);
|
|
14401
|
-
this.graphql =
|
|
14366
|
+
this.graphql = withCustomRequest2(this.request).defaults({
|
|
14402
14367
|
...requestDefaults,
|
|
14403
14368
|
baseUrl: requestDefaults.baseUrl.replace(/\/api\/v3$/, "/api")
|
|
14404
14369
|
});
|
|
@@ -14410,23 +14375,23 @@ var init_dist_web11 = __esm({
|
|
|
14410
14375
|
warn: console.warn.bind(console),
|
|
14411
14376
|
error: console.error.bind(console)
|
|
14412
14377
|
}, options.log);
|
|
14413
|
-
this.hook =
|
|
14378
|
+
this.hook = hook3;
|
|
14414
14379
|
if (!options.authStrategy) {
|
|
14415
14380
|
if (!options.auth) {
|
|
14416
14381
|
this.auth = async () => ({
|
|
14417
14382
|
type: "unauthenticated"
|
|
14418
14383
|
});
|
|
14419
14384
|
} else {
|
|
14420
|
-
const
|
|
14421
|
-
|
|
14422
|
-
this.auth =
|
|
14385
|
+
const auth3 = createTokenAuth3(options.auth);
|
|
14386
|
+
hook3.wrap("request", auth3.hook);
|
|
14387
|
+
this.auth = auth3;
|
|
14423
14388
|
}
|
|
14424
14389
|
} else {
|
|
14425
|
-
const
|
|
14390
|
+
const auth3 = options.authStrategy(Object.assign({
|
|
14426
14391
|
request: this.request
|
|
14427
14392
|
}, options.auth));
|
|
14428
|
-
|
|
14429
|
-
this.auth =
|
|
14393
|
+
hook3.wrap("request", auth3.hook);
|
|
14394
|
+
this.auth = auth3;
|
|
14430
14395
|
}
|
|
14431
14396
|
const classConstructor = this.constructor;
|
|
14432
14397
|
classConstructor.plugins.forEach((plugin) => {
|
|
@@ -14465,29 +14430,131 @@ var init_dist_web11 = __esm({
|
|
|
14465
14430
|
return NewOctokit;
|
|
14466
14431
|
}
|
|
14467
14432
|
};
|
|
14468
|
-
Octokit3.VERSION =
|
|
14433
|
+
Octokit3.VERSION = VERSION10;
|
|
14469
14434
|
Octokit3.plugins = [];
|
|
14470
14435
|
}
|
|
14471
14436
|
});
|
|
14472
14437
|
|
|
14473
|
-
// node_modules/putasset/node_modules/@octokit/plugin-rest
|
|
14474
|
-
function
|
|
14475
|
-
|
|
14476
|
-
|
|
14477
|
-
|
|
14478
|
-
|
|
14479
|
-
|
|
14480
|
-
|
|
14481
|
-
|
|
14482
|
-
|
|
14483
|
-
|
|
14484
|
-
|
|
14485
|
-
|
|
14486
|
-
|
|
14487
|
-
|
|
14488
|
-
|
|
14489
|
-
|
|
14490
|
-
|
|
14438
|
+
// node_modules/putasset/node_modules/@octokit/plugin-paginate-rest/dist-web/index.js
|
|
14439
|
+
function normalizePaginatedListResponse2(response) {
|
|
14440
|
+
if (!response.data) {
|
|
14441
|
+
return {
|
|
14442
|
+
...response,
|
|
14443
|
+
data: []
|
|
14444
|
+
};
|
|
14445
|
+
}
|
|
14446
|
+
const responseNeedsNormalization = "total_count" in response.data && !("url" in response.data);
|
|
14447
|
+
if (!responseNeedsNormalization)
|
|
14448
|
+
return response;
|
|
14449
|
+
const incompleteResults = response.data.incomplete_results;
|
|
14450
|
+
const repositorySelection = response.data.repository_selection;
|
|
14451
|
+
const totalCount = response.data.total_count;
|
|
14452
|
+
delete response.data.incomplete_results;
|
|
14453
|
+
delete response.data.repository_selection;
|
|
14454
|
+
delete response.data.total_count;
|
|
14455
|
+
const namespaceKey = Object.keys(response.data)[0];
|
|
14456
|
+
const data = response.data[namespaceKey];
|
|
14457
|
+
response.data = data;
|
|
14458
|
+
if (typeof incompleteResults !== "undefined") {
|
|
14459
|
+
response.data.incomplete_results = incompleteResults;
|
|
14460
|
+
}
|
|
14461
|
+
if (typeof repositorySelection !== "undefined") {
|
|
14462
|
+
response.data.repository_selection = repositorySelection;
|
|
14463
|
+
}
|
|
14464
|
+
response.data.total_count = totalCount;
|
|
14465
|
+
return response;
|
|
14466
|
+
}
|
|
14467
|
+
function iterator2(octokit, route, parameters) {
|
|
14468
|
+
const options = typeof route === "function" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters);
|
|
14469
|
+
const requestMethod = typeof route === "function" ? route : octokit.request;
|
|
14470
|
+
const method = options.method;
|
|
14471
|
+
const headers = options.headers;
|
|
14472
|
+
let url = options.url;
|
|
14473
|
+
return {
|
|
14474
|
+
[Symbol.asyncIterator]: () => ({
|
|
14475
|
+
async next() {
|
|
14476
|
+
if (!url)
|
|
14477
|
+
return { done: true };
|
|
14478
|
+
try {
|
|
14479
|
+
const response = await requestMethod({ method, url, headers });
|
|
14480
|
+
const normalizedResponse = normalizePaginatedListResponse2(response);
|
|
14481
|
+
url = ((normalizedResponse.headers.link || "").match(/<([^>]+)>;\s*rel="next"/) || [])[1];
|
|
14482
|
+
return { value: normalizedResponse };
|
|
14483
|
+
} catch (error) {
|
|
14484
|
+
if (error.status !== 409)
|
|
14485
|
+
throw error;
|
|
14486
|
+
url = "";
|
|
14487
|
+
return {
|
|
14488
|
+
value: {
|
|
14489
|
+
status: 200,
|
|
14490
|
+
headers: {},
|
|
14491
|
+
data: []
|
|
14492
|
+
}
|
|
14493
|
+
};
|
|
14494
|
+
}
|
|
14495
|
+
}
|
|
14496
|
+
})
|
|
14497
|
+
};
|
|
14498
|
+
}
|
|
14499
|
+
function paginate2(octokit, route, parameters, mapFn) {
|
|
14500
|
+
if (typeof parameters === "function") {
|
|
14501
|
+
mapFn = parameters;
|
|
14502
|
+
parameters = void 0;
|
|
14503
|
+
}
|
|
14504
|
+
return gather2(octokit, [], iterator2(octokit, route, parameters)[Symbol.asyncIterator](), mapFn);
|
|
14505
|
+
}
|
|
14506
|
+
function gather2(octokit, results, iterator3, mapFn) {
|
|
14507
|
+
return iterator3.next().then((result) => {
|
|
14508
|
+
if (result.done) {
|
|
14509
|
+
return results;
|
|
14510
|
+
}
|
|
14511
|
+
let earlyExit = false;
|
|
14512
|
+
function done() {
|
|
14513
|
+
earlyExit = true;
|
|
14514
|
+
}
|
|
14515
|
+
results = results.concat(mapFn ? mapFn(result.value, done) : result.value.data);
|
|
14516
|
+
if (earlyExit) {
|
|
14517
|
+
return results;
|
|
14518
|
+
}
|
|
14519
|
+
return gather2(octokit, results, iterator3, mapFn);
|
|
14520
|
+
});
|
|
14521
|
+
}
|
|
14522
|
+
function paginateRest2(octokit) {
|
|
14523
|
+
return {
|
|
14524
|
+
paginate: Object.assign(paginate2.bind(null, octokit), {
|
|
14525
|
+
iterator: iterator2.bind(null, octokit)
|
|
14526
|
+
})
|
|
14527
|
+
};
|
|
14528
|
+
}
|
|
14529
|
+
var VERSION11, composePaginateRest2;
|
|
14530
|
+
var init_dist_web12 = __esm({
|
|
14531
|
+
"node_modules/putasset/node_modules/@octokit/plugin-paginate-rest/dist-web/index.js"() {
|
|
14532
|
+
VERSION11 = "2.16.3";
|
|
14533
|
+
composePaginateRest2 = Object.assign(paginate2, {
|
|
14534
|
+
iterator: iterator2
|
|
14535
|
+
});
|
|
14536
|
+
paginateRest2.VERSION = VERSION11;
|
|
14537
|
+
}
|
|
14538
|
+
});
|
|
14539
|
+
|
|
14540
|
+
// node_modules/putasset/node_modules/@octokit/plugin-rest-endpoint-methods/dist-web/index.js
|
|
14541
|
+
function endpointsToMethods2(octokit, endpointsMap) {
|
|
14542
|
+
const newMethods = {};
|
|
14543
|
+
for (const [scope, endpoints] of Object.entries(endpointsMap)) {
|
|
14544
|
+
for (const [methodName, endpoint2] of Object.entries(endpoints)) {
|
|
14545
|
+
const [route, defaults, decorations] = endpoint2;
|
|
14546
|
+
const [method, url] = route.split(/ /);
|
|
14547
|
+
const endpointDefaults = Object.assign({ method, url }, defaults);
|
|
14548
|
+
if (!newMethods[scope]) {
|
|
14549
|
+
newMethods[scope] = {};
|
|
14550
|
+
}
|
|
14551
|
+
const scopeMethods = newMethods[scope];
|
|
14552
|
+
if (decorations) {
|
|
14553
|
+
scopeMethods[methodName] = decorate2(octokit, scope, methodName, endpointDefaults, decorations);
|
|
14554
|
+
continue;
|
|
14555
|
+
}
|
|
14556
|
+
scopeMethods[methodName] = octokit.request.defaults(endpointDefaults);
|
|
14557
|
+
}
|
|
14491
14558
|
}
|
|
14492
14559
|
return newMethods;
|
|
14493
14560
|
}
|
|
@@ -14529,8 +14596,8 @@ function decorate2(octokit, scope, methodName, defaults, decorations) {
|
|
|
14529
14596
|
function restEndpointMethods2(octokit) {
|
|
14530
14597
|
return endpointsToMethods2(octokit, Endpoints2);
|
|
14531
14598
|
}
|
|
14532
|
-
var Endpoints2,
|
|
14533
|
-
var
|
|
14599
|
+
var Endpoints2, VERSION12;
|
|
14600
|
+
var init_dist_web13 = __esm({
|
|
14534
14601
|
"node_modules/putasset/node_modules/@octokit/plugin-rest-endpoint-methods/dist-web/index.js"() {
|
|
14535
14602
|
Endpoints2 = {
|
|
14536
14603
|
actions: {
|
|
@@ -16522,8 +16589,8 @@ var init_dist_web12 = __esm({
|
|
|
16522
16589
|
updateAuthenticated: ["PATCH /user"]
|
|
16523
16590
|
}
|
|
16524
16591
|
};
|
|
16525
|
-
|
|
16526
|
-
restEndpointMethods2.VERSION =
|
|
16592
|
+
VERSION12 = "3.17.0";
|
|
16593
|
+
restEndpointMethods2.VERSION = VERSION12;
|
|
16527
16594
|
}
|
|
16528
16595
|
});
|
|
16529
16596
|
|
|
@@ -16532,16 +16599,16 @@ var dist_web_exports = {};
|
|
|
16532
16599
|
__export(dist_web_exports, {
|
|
16533
16600
|
Octokit: () => Octokit4
|
|
16534
16601
|
});
|
|
16535
|
-
var
|
|
16536
|
-
var
|
|
16602
|
+
var VERSION13, Octokit4;
|
|
16603
|
+
var init_dist_web14 = __esm({
|
|
16537
16604
|
"node_modules/putasset/node_modules/@octokit/rest/dist-web/index.js"() {
|
|
16538
16605
|
init_dist_web11();
|
|
16539
|
-
|
|
16540
|
-
init_dist_web9();
|
|
16606
|
+
init_dist_web6();
|
|
16541
16607
|
init_dist_web12();
|
|
16542
|
-
|
|
16543
|
-
|
|
16544
|
-
|
|
16608
|
+
init_dist_web13();
|
|
16609
|
+
VERSION13 = "17.11.2";
|
|
16610
|
+
Octokit4 = Octokit3.plugin(requestLog, restEndpointMethods2, paginateRest2).defaults({
|
|
16611
|
+
userAgent: `octokit-rest.js/${VERSION13}`
|
|
16545
16612
|
});
|
|
16546
16613
|
}
|
|
16547
16614
|
});
|
|
@@ -16573,6 +16640,9 @@ var require_db = __commonJS({
|
|
|
16573
16640
|
"application/a2l": {
|
|
16574
16641
|
source: "iana"
|
|
16575
16642
|
},
|
|
16643
|
+
"application/ace+cbor": {
|
|
16644
|
+
source: "iana"
|
|
16645
|
+
},
|
|
16576
16646
|
"application/activemessage": {
|
|
16577
16647
|
source: "iana"
|
|
16578
16648
|
},
|
|
@@ -16642,6 +16712,9 @@ var require_db = __commonJS({
|
|
|
16642
16712
|
source: "apache",
|
|
16643
16713
|
extensions: ["aw"]
|
|
16644
16714
|
},
|
|
16715
|
+
"application/at+jwt": {
|
|
16716
|
+
source: "iana"
|
|
16717
|
+
},
|
|
16645
16718
|
"application/atf": {
|
|
16646
16719
|
source: "iana"
|
|
16647
16720
|
},
|
|
@@ -17042,6 +17115,10 @@ var require_db = __commonJS({
|
|
|
17042
17115
|
source: "iana",
|
|
17043
17116
|
compressible: true
|
|
17044
17117
|
},
|
|
17118
|
+
"application/express": {
|
|
17119
|
+
source: "iana",
|
|
17120
|
+
extensions: ["exp"]
|
|
17121
|
+
},
|
|
17045
17122
|
"application/fastinfoset": {
|
|
17046
17123
|
source: "iana"
|
|
17047
17124
|
},
|
|
@@ -17617,6 +17694,9 @@ var require_db = __commonJS({
|
|
|
17617
17694
|
source: "iana",
|
|
17618
17695
|
extensions: ["oxps"]
|
|
17619
17696
|
},
|
|
17697
|
+
"application/p21": {
|
|
17698
|
+
source: "iana"
|
|
17699
|
+
},
|
|
17620
17700
|
"application/p21+zip": {
|
|
17621
17701
|
source: "iana",
|
|
17622
17702
|
compressible: false
|
|
@@ -18074,6 +18154,10 @@ var require_db = __commonJS({
|
|
|
18074
18154
|
compressible: true,
|
|
18075
18155
|
extensions: ["srx"]
|
|
18076
18156
|
},
|
|
18157
|
+
"application/spdx+json": {
|
|
18158
|
+
source: "iana",
|
|
18159
|
+
compressible: true
|
|
18160
|
+
},
|
|
18077
18161
|
"application/spirits-event+xml": {
|
|
18078
18162
|
source: "iana",
|
|
18079
18163
|
compressible: true
|
|
@@ -18191,6 +18275,9 @@ var require_db = __commonJS({
|
|
|
18191
18275
|
"application/tnauthlist": {
|
|
18192
18276
|
source: "iana"
|
|
18193
18277
|
},
|
|
18278
|
+
"application/token-introspection+jwt": {
|
|
18279
|
+
source: "iana"
|
|
18280
|
+
},
|
|
18194
18281
|
"application/toml": {
|
|
18195
18282
|
compressible: true,
|
|
18196
18283
|
extensions: ["toml"]
|
|
@@ -18552,6 +18639,10 @@ var require_db = __commonJS({
|
|
|
18552
18639
|
"application/vnd.afpc.modca-pagesegment": {
|
|
18553
18640
|
source: "iana"
|
|
18554
18641
|
},
|
|
18642
|
+
"application/vnd.age": {
|
|
18643
|
+
source: "iana",
|
|
18644
|
+
extensions: ["age"]
|
|
18645
|
+
},
|
|
18555
18646
|
"application/vnd.ah-barcode": {
|
|
18556
18647
|
source: "iana"
|
|
18557
18648
|
},
|
|
@@ -20393,6 +20484,10 @@ var require_db = __commonJS({
|
|
|
20393
20484
|
source: "iana",
|
|
20394
20485
|
extensions: ["taglet"]
|
|
20395
20486
|
},
|
|
20487
|
+
"application/vnd.nacamar.ybrid+json": {
|
|
20488
|
+
source: "iana",
|
|
20489
|
+
compressible: true
|
|
20490
|
+
},
|
|
20396
20491
|
"application/vnd.ncd.control": {
|
|
20397
20492
|
source: "iana"
|
|
20398
20493
|
},
|
|
@@ -22346,6 +22441,15 @@ var require_db = __commonJS({
|
|
|
22346
22441
|
source: "apache",
|
|
22347
22442
|
extensions: ["iso"]
|
|
22348
22443
|
},
|
|
22444
|
+
"application/x-iwork-keynote-sffkey": {
|
|
22445
|
+
extensions: ["key"]
|
|
22446
|
+
},
|
|
22447
|
+
"application/x-iwork-numbers-sffnumbers": {
|
|
22448
|
+
extensions: ["numbers"]
|
|
22449
|
+
},
|
|
22450
|
+
"application/x-iwork-pages-sffpages": {
|
|
22451
|
+
extensions: ["pages"]
|
|
22452
|
+
},
|
|
22349
22453
|
"application/x-java-archive-diff": {
|
|
22350
22454
|
source: "nginx",
|
|
22351
22455
|
extensions: ["jardiff"]
|
|
@@ -23718,6 +23822,7 @@ var require_db = __commonJS({
|
|
|
23718
23822
|
},
|
|
23719
23823
|
"image/vnd.microsoft.icon": {
|
|
23720
23824
|
source: "iana",
|
|
23825
|
+
compressible: true,
|
|
23721
23826
|
extensions: ["ico"]
|
|
23722
23827
|
},
|
|
23723
23828
|
"image/vnd.mix": {
|
|
@@ -23727,6 +23832,7 @@ var require_db = __commonJS({
|
|
|
23727
23832
|
source: "iana"
|
|
23728
23833
|
},
|
|
23729
23834
|
"image/vnd.ms-dds": {
|
|
23835
|
+
compressible: true,
|
|
23730
23836
|
extensions: ["dds"]
|
|
23731
23837
|
},
|
|
23732
23838
|
"image/vnd.ms-modi": {
|
|
@@ -23977,6 +24083,14 @@ var require_db = __commonJS({
|
|
|
23977
24083
|
source: "iana",
|
|
23978
24084
|
extensions: ["obj"]
|
|
23979
24085
|
},
|
|
24086
|
+
"model/step": {
|
|
24087
|
+
source: "iana"
|
|
24088
|
+
},
|
|
24089
|
+
"model/step+xml": {
|
|
24090
|
+
source: "iana",
|
|
24091
|
+
compressible: true,
|
|
24092
|
+
extensions: ["stpx"]
|
|
24093
|
+
},
|
|
23980
24094
|
"model/step+zip": {
|
|
23981
24095
|
source: "iana",
|
|
23982
24096
|
compressible: false,
|
|
@@ -24408,6 +24522,10 @@ var require_db = __commonJS({
|
|
|
24408
24522
|
source: "iana",
|
|
24409
24523
|
charset: "UTF-8"
|
|
24410
24524
|
},
|
|
24525
|
+
"text/vnd.familysearch.gedcom": {
|
|
24526
|
+
source: "iana",
|
|
24527
|
+
extensions: ["ged"]
|
|
24528
|
+
},
|
|
24411
24529
|
"text/vnd.ficlab.flt": {
|
|
24412
24530
|
source: "iana"
|
|
24413
24531
|
},
|
|
@@ -24677,6 +24795,9 @@ var require_db = __commonJS({
|
|
|
24677
24795
|
source: "apache",
|
|
24678
24796
|
extensions: ["jpm", "jpgm"]
|
|
24679
24797
|
},
|
|
24798
|
+
"video/jxsv": {
|
|
24799
|
+
source: "iana"
|
|
24800
|
+
},
|
|
24680
24801
|
"video/mj2": {
|
|
24681
24802
|
source: "iana",
|
|
24682
24803
|
extensions: ["mj2", "mjp2"]
|
|
@@ -25115,7 +25236,7 @@ var require_putasset = __commonJS({
|
|
|
25115
25236
|
promises
|
|
25116
25237
|
} = require("fs");
|
|
25117
25238
|
var { stat } = promises;
|
|
25118
|
-
var { Octokit: Octokit5 } = (
|
|
25239
|
+
var { Octokit: Octokit5 } = (init_dist_web14(), dist_web_exports);
|
|
25119
25240
|
var mime = require_mime_types();
|
|
25120
25241
|
var tryToCatch = require_try_to_catch();
|
|
25121
25242
|
var removeAsset = require_remove_asset();
|
|
@@ -25235,7 +25356,7 @@ var require_package = __commonJS({
|
|
|
25235
25356
|
"cli/package.json"(exports2, module2) {
|
|
25236
25357
|
module2.exports = {
|
|
25237
25358
|
name: "@napi-rs/cli",
|
|
25238
|
-
version: "2.0.0-alpha.
|
|
25359
|
+
version: "2.0.0-alpha.4",
|
|
25239
25360
|
description: "Cli tools for napi-rs",
|
|
25240
25361
|
keywords: ["cli", "rust", "napi", "n-api", "neon"],
|
|
25241
25362
|
author: "LongYinan <lynweklm@gmail.com>",
|
|
@@ -25470,20 +25591,259 @@ var import_path3 = __toModule(require("path"));
|
|
|
25470
25591
|
var import_chalk2 = __toModule(require_source());
|
|
25471
25592
|
var import_clipanion2 = __toModule(require_advanced());
|
|
25472
25593
|
var import_toml = __toModule(require_toml());
|
|
25594
|
+
|
|
25595
|
+
// cli/src/js-binding-template.ts
|
|
25596
|
+
var createJsBinding = (localName, pkgName) => `const { existsSync, readFileSync } = require('fs')
|
|
25597
|
+
const { join } = require('path')
|
|
25598
|
+
|
|
25599
|
+
const { platform, arch } = process
|
|
25600
|
+
|
|
25601
|
+
let nativeBinding = null
|
|
25602
|
+
let localFileExisted = false
|
|
25603
|
+
let isMusl = false
|
|
25604
|
+
let loadError = null
|
|
25605
|
+
|
|
25606
|
+
switch (platform) {
|
|
25607
|
+
case 'android':
|
|
25608
|
+
if (arch !== 'arm64') {
|
|
25609
|
+
throw new Error(\`Unsupported architecture on Android \${arch}\`)
|
|
25610
|
+
}
|
|
25611
|
+
localFileExisted = existsSync(join(__dirname, '${localName}.android-arm64.node'))
|
|
25612
|
+
try {
|
|
25613
|
+
if (localFileExisted) {
|
|
25614
|
+
nativeBinding = require('./${localName}.android-arm64.node')
|
|
25615
|
+
} else {
|
|
25616
|
+
nativeBinding = require('${pkgName}-android-arm64')
|
|
25617
|
+
}
|
|
25618
|
+
} catch (e) {
|
|
25619
|
+
loadError = e
|
|
25620
|
+
}
|
|
25621
|
+
break
|
|
25622
|
+
case 'win32':
|
|
25623
|
+
switch (arch) {
|
|
25624
|
+
case 'x64':
|
|
25625
|
+
localFileExisted = existsSync(
|
|
25626
|
+
join(__dirname, '${localName}.win32-x64-msvc.node')
|
|
25627
|
+
)
|
|
25628
|
+
try {
|
|
25629
|
+
if (localFileExisted) {
|
|
25630
|
+
nativeBinding = require('./${localName}.win32-x64-msvc.node')
|
|
25631
|
+
} else {
|
|
25632
|
+
nativeBinding = require('${pkgName}-win32-x64-msvc')
|
|
25633
|
+
}
|
|
25634
|
+
} catch (e) {
|
|
25635
|
+
loadError = e
|
|
25636
|
+
}
|
|
25637
|
+
break
|
|
25638
|
+
case 'ia32':
|
|
25639
|
+
localFileExisted = existsSync(
|
|
25640
|
+
join(__dirname, '${localName}.win32-ia32-msvc.node')
|
|
25641
|
+
)
|
|
25642
|
+
try {
|
|
25643
|
+
if (localFileExisted) {
|
|
25644
|
+
nativeBinding = require('./${localName}.win32-ia32-msvc.node')
|
|
25645
|
+
} else {
|
|
25646
|
+
nativeBinding = require('${pkgName}-win32-ia32-msvc')
|
|
25647
|
+
}
|
|
25648
|
+
} catch (e) {
|
|
25649
|
+
loadError = e
|
|
25650
|
+
}
|
|
25651
|
+
break
|
|
25652
|
+
case 'arm64':
|
|
25653
|
+
localFileExisted = existsSync(
|
|
25654
|
+
join(__dirname, '${localName}.win32-arm64-msvc.node')
|
|
25655
|
+
)
|
|
25656
|
+
try {
|
|
25657
|
+
if (localFileExisted) {
|
|
25658
|
+
nativeBinding = require('./${localName}.win32-arm64-msvc.node')
|
|
25659
|
+
} else {
|
|
25660
|
+
nativeBinding = require('${pkgName}-win32-arm64-msvc')
|
|
25661
|
+
}
|
|
25662
|
+
} catch (e) {
|
|
25663
|
+
loadError = e
|
|
25664
|
+
}
|
|
25665
|
+
break
|
|
25666
|
+
default:
|
|
25667
|
+
throw new Error(\`Unsupported architecture on Windows: \${arch}\`)
|
|
25668
|
+
}
|
|
25669
|
+
break
|
|
25670
|
+
case 'darwin':
|
|
25671
|
+
switch (arch) {
|
|
25672
|
+
case 'x64':
|
|
25673
|
+
localFileExisted = existsSync(join(__dirname, '${localName}.darwin-x64.node'))
|
|
25674
|
+
try {
|
|
25675
|
+
if (localFileExisted) {
|
|
25676
|
+
nativeBinding = require('./${localName}.darwin-x64.node')
|
|
25677
|
+
} else {
|
|
25678
|
+
nativeBinding = require('${pkgName}-darwin-x64')
|
|
25679
|
+
}
|
|
25680
|
+
} catch (e) {
|
|
25681
|
+
loadError = e
|
|
25682
|
+
}
|
|
25683
|
+
break
|
|
25684
|
+
case 'arm64':
|
|
25685
|
+
localFileExisted = existsSync(
|
|
25686
|
+
join(__dirname, '${localName}.darwin-arm64.node')
|
|
25687
|
+
)
|
|
25688
|
+
try {
|
|
25689
|
+
if (localFileExisted) {
|
|
25690
|
+
nativeBinding = require('./${localName}.darwin-arm64.node')
|
|
25691
|
+
} else {
|
|
25692
|
+
nativeBinding = require('${pkgName}-darwin-arm64')
|
|
25693
|
+
}
|
|
25694
|
+
} catch (e) {
|
|
25695
|
+
loadError = e
|
|
25696
|
+
}
|
|
25697
|
+
break
|
|
25698
|
+
default:
|
|
25699
|
+
throw new Error(\`Unsupported architecture on macOS: \${arch}\`)
|
|
25700
|
+
}
|
|
25701
|
+
break
|
|
25702
|
+
case 'freebsd':
|
|
25703
|
+
if (arch !== 'x64') {
|
|
25704
|
+
throw new Error(\`Unsupported architecture on FreeBSD: \${arch}\`)
|
|
25705
|
+
}
|
|
25706
|
+
localFileExisted = existsSync(join(__dirname, '${localName}.freebsd-x64.node'))
|
|
25707
|
+
try {
|
|
25708
|
+
if (localFileExisted) {
|
|
25709
|
+
nativeBinding = require('./${localName}.freebsd-x64.node')
|
|
25710
|
+
} else {
|
|
25711
|
+
nativeBinding = require('${pkgName}-freebsd-x64')
|
|
25712
|
+
}
|
|
25713
|
+
} catch (e) {
|
|
25714
|
+
loadError = e
|
|
25715
|
+
}
|
|
25716
|
+
break
|
|
25717
|
+
case 'linux':
|
|
25718
|
+
switch (arch) {
|
|
25719
|
+
case 'x64':
|
|
25720
|
+
isMusl = readFileSync('/usr/bin/ldd', 'utf8').includes('musl')
|
|
25721
|
+
if (isMusl) {
|
|
25722
|
+
localFileExisted = existsSync(
|
|
25723
|
+
join(__dirname, '${localName}.linux-x64-musl.node')
|
|
25724
|
+
)
|
|
25725
|
+
try {
|
|
25726
|
+
if (localFileExisted) {
|
|
25727
|
+
nativeBinding = require('./${localName}.linux-x64-musl.node')
|
|
25728
|
+
} else {
|
|
25729
|
+
nativeBinding = require('${pkgName}-linux-x64-musl')
|
|
25730
|
+
}
|
|
25731
|
+
} catch (e) {
|
|
25732
|
+
loadError = e
|
|
25733
|
+
}
|
|
25734
|
+
} else {
|
|
25735
|
+
localFileExisted = existsSync(
|
|
25736
|
+
join(__dirname, '${localName}.linux-x64-gnu.node')
|
|
25737
|
+
)
|
|
25738
|
+
try {
|
|
25739
|
+
if (localFileExisted) {
|
|
25740
|
+
nativeBinding = require('./${localName}.linux-x64-gnu.node')
|
|
25741
|
+
} else {
|
|
25742
|
+
nativeBinding = require('${pkgName}-linux-x64-gnu')
|
|
25743
|
+
}
|
|
25744
|
+
} catch (e) {
|
|
25745
|
+
loadError = e
|
|
25746
|
+
}
|
|
25747
|
+
}
|
|
25748
|
+
break
|
|
25749
|
+
case 'arm64':
|
|
25750
|
+
isMusl = readFileSync('/usr/bin/ldd', 'utf8').includes('musl')
|
|
25751
|
+
if (isMusl) {
|
|
25752
|
+
localFileExisted = existsSync(
|
|
25753
|
+
join(__dirname, '${localName}.linux-arm64-musl.node')
|
|
25754
|
+
)
|
|
25755
|
+
try {
|
|
25756
|
+
if (localFileExisted) {
|
|
25757
|
+
nativeBinding = require('./${localName}.linux-arm64-musl.node')
|
|
25758
|
+
} else {
|
|
25759
|
+
nativeBinding = require('${pkgName}-linux-arm64-musl')
|
|
25760
|
+
}
|
|
25761
|
+
} catch (e) {
|
|
25762
|
+
loadError = e
|
|
25763
|
+
}
|
|
25764
|
+
} else {
|
|
25765
|
+
localFileExisted = existsSync(
|
|
25766
|
+
join(__dirname, '${localName}.linux-arm64-gnu.node')
|
|
25767
|
+
)
|
|
25768
|
+
try {
|
|
25769
|
+
if (localFileExisted) {
|
|
25770
|
+
nativeBinding = require('./${localName}.linux-arm64-gnu.node')
|
|
25771
|
+
} else {
|
|
25772
|
+
nativeBinding = require('${pkgName}-linux-arm64-gnu')
|
|
25773
|
+
}
|
|
25774
|
+
} catch (e) {
|
|
25775
|
+
loadError = e
|
|
25776
|
+
}
|
|
25777
|
+
}
|
|
25778
|
+
break
|
|
25779
|
+
case 'arm':
|
|
25780
|
+
localFileExisted = existsSync(
|
|
25781
|
+
join(__dirname, '${localName}.linux-arm-gnueabihf.node')
|
|
25782
|
+
)
|
|
25783
|
+
try {
|
|
25784
|
+
if (localFileExisted) {
|
|
25785
|
+
nativeBinding = require('./${localName}.linux-arm-gnueabihf.node')
|
|
25786
|
+
} else {
|
|
25787
|
+
nativeBinding = require('${pkgName}-linux-arm-gnueabihf')
|
|
25788
|
+
}
|
|
25789
|
+
} catch (e) {
|
|
25790
|
+
loadError = e
|
|
25791
|
+
}
|
|
25792
|
+
break
|
|
25793
|
+
default:
|
|
25794
|
+
throw new Error(\`Unsupported architecture on Linux: \${arch}\`)
|
|
25795
|
+
}
|
|
25796
|
+
break
|
|
25797
|
+
default:
|
|
25798
|
+
throw new Error(\`Unsupported OS: \${platform}, architecture: \${arch}\`)
|
|
25799
|
+
}
|
|
25800
|
+
|
|
25801
|
+
if (!nativeBinding) {
|
|
25802
|
+
if (loadError) {
|
|
25803
|
+
throw loadError
|
|
25804
|
+
}
|
|
25805
|
+
throw new Error(\`Failed to load native binding\`)
|
|
25806
|
+
}
|
|
25807
|
+
|
|
25808
|
+
`;
|
|
25809
|
+
|
|
25810
|
+
// cli/src/build.ts
|
|
25473
25811
|
var debug3 = debugFactory("build");
|
|
25812
|
+
var chalk2 = new import_chalk2.Instance({ level: 1 });
|
|
25474
25813
|
var _a;
|
|
25475
25814
|
var BuildCommand = class extends import_clipanion2.Command {
|
|
25476
25815
|
constructor() {
|
|
25477
25816
|
super(...arguments);
|
|
25478
|
-
this.appendPlatformToFilename = import_clipanion2.Option.Boolean(`--platform`, false
|
|
25479
|
-
|
|
25480
|
-
|
|
25481
|
-
this.
|
|
25482
|
-
|
|
25483
|
-
|
|
25484
|
-
this.
|
|
25485
|
-
|
|
25486
|
-
|
|
25817
|
+
this.appendPlatformToFilename = import_clipanion2.Option.Boolean(`--platform`, false, {
|
|
25818
|
+
description: `Add platform triple to the .node file. ${chalk2.green("[name].linux-x64-gnu.node")} for example`
|
|
25819
|
+
});
|
|
25820
|
+
this.isRelease = import_clipanion2.Option.Boolean(`--release`, false, {
|
|
25821
|
+
description: `Bypass to ${chalk2.green("cargo --release")}`
|
|
25822
|
+
});
|
|
25823
|
+
this.configFileName = import_clipanion2.Option.String("--config,-c", {
|
|
25824
|
+
description: `napi config path, only JSON format accepted. Default to ${chalk2.underline(chalk2.green("package.json"))}`
|
|
25825
|
+
});
|
|
25826
|
+
this.cargoName = import_clipanion2.Option.String("--cargo-name", {
|
|
25827
|
+
description: `Override the ${chalk2.green("name")} field in ${chalk2.underline(chalk2.yellowBright("Cargo.toml"))}`
|
|
25828
|
+
});
|
|
25829
|
+
this.targetTripleDir = import_clipanion2.Option.String("--target", (_a = process.env.RUST_TARGET) != null ? _a : "", {
|
|
25830
|
+
description: `Bypass to ${chalk2.green("cargo --target")}`
|
|
25831
|
+
});
|
|
25832
|
+
this.features = import_clipanion2.Option.String("--features", {
|
|
25833
|
+
description: `Bypass to ${chalk2.green("cargo --features")}`
|
|
25834
|
+
});
|
|
25835
|
+
this.dts = import_clipanion2.Option.String("--dts", "index.d.ts", {
|
|
25836
|
+
description: `The filename and path of ${chalk2.green(".d.ts")} file, relative to cwd`
|
|
25837
|
+
});
|
|
25838
|
+
this.cargoFlags = import_clipanion2.Option.String("--cargo-flags", "", {
|
|
25839
|
+
description: `All the others flag passed to ${chalk2.yellow("cargo")}`
|
|
25840
|
+
});
|
|
25841
|
+
this.jsBinding = import_clipanion2.Option.String("--js", "index.js", {
|
|
25842
|
+
description: `Path to the JS binding file, pass ${chalk2.underline(chalk2.yellow("false"))} to disable it`
|
|
25843
|
+
});
|
|
25844
|
+
this.cargoCwd = import_clipanion2.Option.String("--cargo-cwd", {
|
|
25845
|
+
description: `The cwd of ${chalk2.underline(chalk2.yellow("Cargo.toml"))} file`
|
|
25846
|
+
});
|
|
25487
25847
|
this.destDir = import_clipanion2.Option.String({
|
|
25488
25848
|
required: false
|
|
25489
25849
|
});
|
|
@@ -25498,7 +25858,7 @@ var BuildCommand = class extends import_clipanion2.Command {
|
|
|
25498
25858
|
const triple = this.targetTripleDir ? parseTriple(this.targetTripleDir) : getDefaultTargetTriple((0, import_child_process2.execSync)("rustup show active-toolchain", {
|
|
25499
25859
|
env: process.env
|
|
25500
25860
|
}).toString("utf8"));
|
|
25501
|
-
debug3(`Current triple is: ${
|
|
25861
|
+
debug3(`Current triple is: ${chalk2.green(triple.raw)}`);
|
|
25502
25862
|
const externalFlags = [
|
|
25503
25863
|
releaseFlag,
|
|
25504
25864
|
targetFlag,
|
|
@@ -25507,7 +25867,7 @@ var BuildCommand = class extends import_clipanion2.Command {
|
|
|
25507
25867
|
].filter((flag) => Boolean(flag)).join(" ");
|
|
25508
25868
|
const cargoCommand = `cargo build ${externalFlags}`;
|
|
25509
25869
|
const intermediateTypeFile = (0, import_path3.join)(__dirname, `type_def.${Date.now()}.tmp`);
|
|
25510
|
-
debug3(`Run ${
|
|
25870
|
+
debug3(`Run ${chalk2.green(cargoCommand)}`);
|
|
25511
25871
|
(0, import_child_process2.execSync)(cargoCommand, {
|
|
25512
25872
|
env: __spreadProps(__spreadValues({}, process.env), {
|
|
25513
25873
|
TYPE_DEF_TMP_PATH: intermediateTypeFile
|
|
@@ -25515,7 +25875,7 @@ var BuildCommand = class extends import_clipanion2.Command {
|
|
|
25515
25875
|
stdio: "inherit",
|
|
25516
25876
|
cwd
|
|
25517
25877
|
});
|
|
25518
|
-
const { binaryName } = getNapiConfig(this.configFileName);
|
|
25878
|
+
const { binaryName, packageName } = getNapiConfig(this.configFileName);
|
|
25519
25879
|
let dylibName = this.cargoName;
|
|
25520
25880
|
if (!dylibName) {
|
|
25521
25881
|
let tomlContentString;
|
|
@@ -25538,13 +25898,13 @@ var BuildCommand = class extends import_clipanion2.Command {
|
|
|
25538
25898
|
throw new TypeError("No package.name field in Cargo.toml");
|
|
25539
25899
|
}
|
|
25540
25900
|
if (!((_d = (_c = (_b = tomlContent.lib) == null ? void 0 : _b["crate-type"]) == null ? void 0 : _c.includes) == null ? void 0 : _d.call(_c, "cdylib"))) {
|
|
25541
|
-
throw new TypeError(`Missing ${
|
|
25901
|
+
throw new TypeError(`Missing ${chalk2.green('create-type = ["cdylib"]')} in ${chalk2.green("[lib]")}`);
|
|
25542
25902
|
}
|
|
25543
25903
|
}
|
|
25544
|
-
debug3(`Dylib name: ${
|
|
25904
|
+
debug3(`Dylib name: ${chalk2.greenBright(dylibName)}`);
|
|
25545
25905
|
const platform = triple.platform;
|
|
25546
25906
|
let libExt;
|
|
25547
|
-
debug3(`Platform: ${
|
|
25907
|
+
debug3(`Platform: ${chalk2.greenBright(platform)}`);
|
|
25548
25908
|
switch (platform) {
|
|
25549
25909
|
case "darwin":
|
|
25550
25910
|
libExt = ".dylib";
|
|
@@ -25570,23 +25930,24 @@ var BuildCommand = class extends import_clipanion2.Command {
|
|
|
25570
25930
|
}
|
|
25571
25931
|
const targetDir = (0, import_path3.join)(this.targetTripleDir, this.isRelease ? "release" : "debug");
|
|
25572
25932
|
const platformName = this.appendPlatformToFilename ? `.${triple.platformArchABI}` : "";
|
|
25573
|
-
debug3(`Platform name: ${platformName ||
|
|
25933
|
+
debug3(`Platform name: ${platformName || chalk2.green("[Empty]")}`);
|
|
25574
25934
|
const distFileName = `${binaryName}${platformName}.node`;
|
|
25575
25935
|
const distModulePath = (0, import_path3.join)((_e = this.destDir) != null ? _e : ".", distFileName);
|
|
25576
25936
|
const parsedDist = (0, import_path3.parse)(distModulePath);
|
|
25577
25937
|
if (parsedDist.dir && !(yield existsAsync(parsedDist.dir))) {
|
|
25578
25938
|
yield mkdirAsync(parsedDist.dir, { recursive: true }).catch((e) => {
|
|
25579
|
-
console.warn(
|
|
25939
|
+
console.warn(chalk2.bgYellowBright(`Create dir [${parsedDist.dir}] failed, reason: ${e.message}`));
|
|
25580
25940
|
});
|
|
25581
25941
|
}
|
|
25582
25942
|
const sourcePath = (0, import_path3.join)(targetRootDir, "target", targetDir, `${dylibName}${libExt}`);
|
|
25583
25943
|
if (yield existsAsync(distModulePath)) {
|
|
25584
|
-
debug3(`remove old binary [${
|
|
25944
|
+
debug3(`remove old binary [${chalk2.yellowBright(distModulePath)}]`);
|
|
25585
25945
|
yield unlinkAsync(distModulePath);
|
|
25586
25946
|
}
|
|
25587
|
-
debug3(`Write binary content to [${
|
|
25947
|
+
debug3(`Write binary content to [${chalk2.yellowBright(distModulePath)}]`);
|
|
25588
25948
|
yield copyFileAsync(sourcePath, distModulePath);
|
|
25589
|
-
yield processIntermediateTypeFile(intermediateTypeFile, (0, import_path3.join)((_f = this.destDir) != null ? _f : ".", (_g = this.dts) != null ? _g : "index.d.ts"));
|
|
25949
|
+
const idents = yield processIntermediateTypeFile(intermediateTypeFile, (0, import_path3.join)((_f = this.destDir) != null ? _f : ".", (_g = this.dts) != null ? _g : "index.d.ts"));
|
|
25950
|
+
yield writeJsBinding(binaryName, packageName, this.jsBinding && this.jsBinding !== "false" ? (0, import_path3.join)(process.cwd(), this.jsBinding) : null, idents);
|
|
25590
25951
|
});
|
|
25591
25952
|
}
|
|
25592
25953
|
};
|
|
@@ -25610,9 +25971,10 @@ function findUp() {
|
|
|
25610
25971
|
}
|
|
25611
25972
|
function processIntermediateTypeFile(source, target) {
|
|
25612
25973
|
return __async(this, null, function* () {
|
|
25974
|
+
const idents = [];
|
|
25613
25975
|
if (!(yield existsAsync(source))) {
|
|
25614
25976
|
debug3(`do not find tmp type file. skip type generation`);
|
|
25615
|
-
return;
|
|
25977
|
+
return idents;
|
|
25616
25978
|
}
|
|
25617
25979
|
const tmpFile = yield readFileAsync(source, "utf8");
|
|
25618
25980
|
const lines = tmpFile.split("\n").map((line) => line.trim()).filter(Boolean);
|
|
@@ -25623,6 +25985,7 @@ function processIntermediateTypeFile(source, target) {
|
|
|
25623
25985
|
const def = JSON.parse(line);
|
|
25624
25986
|
switch (def.kind) {
|
|
25625
25987
|
case "struct":
|
|
25988
|
+
idents.push(def.name);
|
|
25626
25989
|
classes.set(def.name, def.def);
|
|
25627
25990
|
break;
|
|
25628
25991
|
case "impl":
|
|
@@ -25635,6 +25998,7 @@ ${indentLines(def.def, 2)}
|
|
|
25635
25998
|
`;
|
|
25636
25999
|
break;
|
|
25637
26000
|
default:
|
|
26001
|
+
idents.push(def.name);
|
|
25638
26002
|
dts += def.def + "\n";
|
|
25639
26003
|
}
|
|
25640
26004
|
});
|
|
@@ -25650,11 +26014,26 @@ ${indentLines(implDef, 2)}`;
|
|
|
25650
26014
|
}
|
|
25651
26015
|
yield unlinkAsync(source);
|
|
25652
26016
|
yield writeFileAsync(target, dts, "utf8");
|
|
26017
|
+
return idents;
|
|
25653
26018
|
});
|
|
25654
26019
|
}
|
|
25655
26020
|
function indentLines(input, spaces) {
|
|
25656
26021
|
return input.split("\n").map((line) => "".padEnd(spaces, " ") + line.trim()).join("\n");
|
|
25657
26022
|
}
|
|
26023
|
+
function writeJsBinding(localName, packageName, distFileName, idents) {
|
|
26024
|
+
return __async(this, null, function* () {
|
|
26025
|
+
if (distFileName) {
|
|
26026
|
+
const template = createJsBinding(localName, packageName);
|
|
26027
|
+
const declareCodes = `const { ${idents.join(", ")} } = nativeBinding
|
|
26028
|
+
`;
|
|
26029
|
+
const exportsCode = idents.reduce((acc, cur) => {
|
|
26030
|
+
return `${acc}
|
|
26031
|
+
module.exports.${cur} = ${cur}`;
|
|
26032
|
+
}, "");
|
|
26033
|
+
yield writeFileAsync(distFileName, template + declareCodes + exportsCode, "utf8");
|
|
26034
|
+
}
|
|
26035
|
+
});
|
|
26036
|
+
}
|
|
25658
26037
|
|
|
25659
26038
|
// cli/src/create-npm-dir.ts
|
|
25660
26039
|
var import_fs2 = __toModule(require("fs"));
|
|
@@ -25763,7 +26142,7 @@ linker = "arm-linux-gnueabihf-gcc"
|
|
|
25763
26142
|
return result;
|
|
25764
26143
|
};
|
|
25765
26144
|
|
|
25766
|
-
//
|
|
26145
|
+
// node_modules/js-yaml/dist/js-yaml.mjs
|
|
25767
26146
|
function isNothing(subject) {
|
|
25768
26147
|
return typeof subject === "undefined" || subject === null;
|
|
25769
26148
|
}
|
|
@@ -27720,17 +28099,17 @@ function loadDocuments(input, options) {
|
|
|
27720
28099
|
}
|
|
27721
28100
|
return state.documents;
|
|
27722
28101
|
}
|
|
27723
|
-
function loadAll$1(input,
|
|
27724
|
-
if (
|
|
27725
|
-
options =
|
|
27726
|
-
|
|
28102
|
+
function loadAll$1(input, iterator3, options) {
|
|
28103
|
+
if (iterator3 !== null && typeof iterator3 === "object" && typeof options === "undefined") {
|
|
28104
|
+
options = iterator3;
|
|
28105
|
+
iterator3 = null;
|
|
27727
28106
|
}
|
|
27728
28107
|
var documents = loadDocuments(input, options);
|
|
27729
|
-
if (typeof
|
|
28108
|
+
if (typeof iterator3 !== "function") {
|
|
27730
28109
|
return documents;
|
|
27731
28110
|
}
|
|
27732
28111
|
for (var index = 0, length = documents.length; index < length; index += 1) {
|
|
27733
|
-
|
|
28112
|
+
iterator3(documents[index]);
|
|
27734
28113
|
}
|
|
27735
28114
|
}
|
|
27736
28115
|
function load$1(input, options) {
|
|
@@ -28390,6 +28769,12 @@ on:
|
|
|
28390
28769
|
- main
|
|
28391
28770
|
tags-ignore:
|
|
28392
28771
|
- '**'
|
|
28772
|
+
paths-ignore:
|
|
28773
|
+
- '**/*.md'
|
|
28774
|
+
- 'LICENSE'
|
|
28775
|
+
- '**/*.gitignore'
|
|
28776
|
+
- '.editorconfig'
|
|
28777
|
+
- 'docs/**'
|
|
28393
28778
|
pull_request:
|
|
28394
28779
|
|
|
28395
28780
|
jobs:
|
|
@@ -28410,7 +28795,7 @@ jobs:
|
|
|
28410
28795
|
target: 'x86_64-pc-windows-msvc'
|
|
28411
28796
|
- host: windows-latest
|
|
28412
28797
|
build: |
|
|
28413
|
-
export CARGO_PROFILE_RELEASE_CODEGEN_UNITS=
|
|
28798
|
+
export CARGO_PROFILE_RELEASE_CODEGEN_UNITS=64;
|
|
28414
28799
|
export CARGO_PROFILE_RELEASE_LTO=false
|
|
28415
28800
|
yarn build --target i686-pc-windows-msvc
|
|
28416
28801
|
yarn test
|
|
@@ -28758,6 +29143,7 @@ jobs:
|
|
|
28758
29143
|
image: ghcr.io/napi-rs/napi-rs/nodejs:aarch64-\${{ matrix.node }}
|
|
28759
29144
|
options: -v \${{ github.workspace }}:/build -w /build
|
|
28760
29145
|
run: |
|
|
29146
|
+
set -e
|
|
28761
29147
|
yarn test
|
|
28762
29148
|
ls -la
|
|
28763
29149
|
|
|
@@ -28798,6 +29184,7 @@ jobs:
|
|
|
28798
29184
|
image: multiarch/alpine:aarch64-latest-stable
|
|
28799
29185
|
options: -v \${{ github.workspace }}:/build -w /build
|
|
28800
29186
|
run: |
|
|
29187
|
+
set -e
|
|
28801
29188
|
apk add nodejs npm yarn
|
|
28802
29189
|
yarn test
|
|
28803
29190
|
|
|
@@ -28841,6 +29228,7 @@ jobs:
|
|
|
28841
29228
|
image: ghcr.io/napi-rs/napi-rs/nodejs:armhf-\${{ matrix.node }}
|
|
28842
29229
|
options: -v \${{ github.workspace }}:/build -w /build
|
|
28843
29230
|
run: |
|
|
29231
|
+
set -e
|
|
28844
29232
|
yarn test
|
|
28845
29233
|
ls -la
|
|
28846
29234
|
|
|
@@ -28972,20 +29360,6 @@ var createGithubActionsCIYml = (binaryName, targets) => {
|
|
|
28972
29360
|
});
|
|
28973
29361
|
};
|
|
28974
29362
|
|
|
28975
|
-
// cli/src/new/indexjs.ts
|
|
28976
|
-
var createIndexJs = (pkgName, name) => `const { loadBinding } = require('@node-rs/helper')
|
|
28977
|
-
|
|
28978
|
-
/**
|
|
28979
|
-
* __dirname means load native addon from current dir
|
|
28980
|
-
* '${name}' is the name of native addon
|
|
28981
|
-
* the second arguments was decided by \`napi.name\` field in \`package.json\`
|
|
28982
|
-
* the third arguments was decided by \`name\` field in \`package.json\`
|
|
28983
|
-
* \`loadBinding\` helper will load \`${name}.[PLATFORM].node\` from \`__dirname\` first
|
|
28984
|
-
* If failed to load addon, it will fallback to load from \`${pkgName}-[PLATFORM]\`
|
|
28985
|
-
*/
|
|
28986
|
-
module.exports = loadBinding(__dirname, '${name}', '${pkgName}')
|
|
28987
|
-
`;
|
|
28988
|
-
|
|
28989
29363
|
// cli/src/new/lib-rs.ts
|
|
28990
29364
|
var LibRs = `#![deny(clippy::all)]
|
|
28991
29365
|
|
|
@@ -29185,7 +29559,6 @@ var NewProjectCommand = class extends import_clipanion4.Command {
|
|
|
29185
29559
|
this.writeFile("Cargo.toml", createCargoContent(this.name));
|
|
29186
29560
|
this.writeFile(".npmignore", NPMIgnoreFiles);
|
|
29187
29561
|
this.writeFile("build.rs", BUILD_RS);
|
|
29188
|
-
this.writeFile("index.js", createIndexJs(this.name, binaryName));
|
|
29189
29562
|
this.writeFile("package.json", JSON.stringify(createPackageJson(this.name, binaryName, this.targets), null, 2));
|
|
29190
29563
|
this.writeFile("src/lib.rs", LibRs);
|
|
29191
29564
|
if (this.enableGithubActions) {
|
|
@@ -29249,17 +29622,151 @@ var import_path7 = __toModule(require("path"));
|
|
|
29249
29622
|
init_dist_web();
|
|
29250
29623
|
var import_before_after_hook = __toModule(require_before_after_hook());
|
|
29251
29624
|
init_dist_web5();
|
|
29252
|
-
|
|
29253
|
-
|
|
29625
|
+
|
|
29626
|
+
// node_modules/@octokit/graphql/dist-web/index.js
|
|
29627
|
+
init_dist_web5();
|
|
29628
|
+
init_dist_web();
|
|
29629
|
+
var VERSION3 = "4.8.0";
|
|
29630
|
+
function _buildMessageForResponseErrors(data) {
|
|
29631
|
+
return `Request failed due to following response errors:
|
|
29632
|
+
` + data.errors.map((e) => ` - ${e.message}`).join("\n");
|
|
29633
|
+
}
|
|
29634
|
+
var GraphqlResponseError = class extends Error {
|
|
29635
|
+
constructor(request2, headers, response) {
|
|
29636
|
+
super(_buildMessageForResponseErrors(response));
|
|
29637
|
+
this.request = request2;
|
|
29638
|
+
this.headers = headers;
|
|
29639
|
+
this.response = response;
|
|
29640
|
+
this.name = "GraphqlResponseError";
|
|
29641
|
+
this.errors = response.errors;
|
|
29642
|
+
this.data = response.data;
|
|
29643
|
+
if (Error.captureStackTrace) {
|
|
29644
|
+
Error.captureStackTrace(this, this.constructor);
|
|
29645
|
+
}
|
|
29646
|
+
}
|
|
29647
|
+
};
|
|
29648
|
+
var NON_VARIABLE_OPTIONS = [
|
|
29649
|
+
"method",
|
|
29650
|
+
"baseUrl",
|
|
29651
|
+
"url",
|
|
29652
|
+
"headers",
|
|
29653
|
+
"request",
|
|
29654
|
+
"query",
|
|
29655
|
+
"mediaType"
|
|
29656
|
+
];
|
|
29657
|
+
var FORBIDDEN_VARIABLE_OPTIONS = ["query", "method", "url"];
|
|
29658
|
+
var GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/;
|
|
29659
|
+
function graphql(request2, query, options) {
|
|
29660
|
+
if (options) {
|
|
29661
|
+
if (typeof query === "string" && "query" in options) {
|
|
29662
|
+
return Promise.reject(new Error(`[@octokit/graphql] "query" cannot be used as variable name`));
|
|
29663
|
+
}
|
|
29664
|
+
for (const key in options) {
|
|
29665
|
+
if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key))
|
|
29666
|
+
continue;
|
|
29667
|
+
return Promise.reject(new Error(`[@octokit/graphql] "${key}" cannot be used as variable name`));
|
|
29668
|
+
}
|
|
29669
|
+
}
|
|
29670
|
+
const parsedOptions = typeof query === "string" ? Object.assign({ query }, options) : query;
|
|
29671
|
+
const requestOptions = Object.keys(parsedOptions).reduce((result, key) => {
|
|
29672
|
+
if (NON_VARIABLE_OPTIONS.includes(key)) {
|
|
29673
|
+
result[key] = parsedOptions[key];
|
|
29674
|
+
return result;
|
|
29675
|
+
}
|
|
29676
|
+
if (!result.variables) {
|
|
29677
|
+
result.variables = {};
|
|
29678
|
+
}
|
|
29679
|
+
result.variables[key] = parsedOptions[key];
|
|
29680
|
+
return result;
|
|
29681
|
+
}, {});
|
|
29682
|
+
const baseUrl = parsedOptions.baseUrl || request2.endpoint.DEFAULTS.baseUrl;
|
|
29683
|
+
if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) {
|
|
29684
|
+
requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql");
|
|
29685
|
+
}
|
|
29686
|
+
return request2(requestOptions).then((response) => {
|
|
29687
|
+
if (response.data.errors) {
|
|
29688
|
+
const headers = {};
|
|
29689
|
+
for (const key of Object.keys(response.headers)) {
|
|
29690
|
+
headers[key] = response.headers[key];
|
|
29691
|
+
}
|
|
29692
|
+
throw new GraphqlResponseError(requestOptions, headers, response.data);
|
|
29693
|
+
}
|
|
29694
|
+
return response.data.data;
|
|
29695
|
+
});
|
|
29696
|
+
}
|
|
29697
|
+
function withDefaults3(request$1, newDefaults) {
|
|
29698
|
+
const newRequest = request$1.defaults(newDefaults);
|
|
29699
|
+
const newApi = (query, options) => {
|
|
29700
|
+
return graphql(newRequest, query, options);
|
|
29701
|
+
};
|
|
29702
|
+
return Object.assign(newApi, {
|
|
29703
|
+
defaults: withDefaults3.bind(null, newRequest),
|
|
29704
|
+
endpoint: request.endpoint
|
|
29705
|
+
});
|
|
29706
|
+
}
|
|
29707
|
+
var graphql$1 = withDefaults3(request, {
|
|
29708
|
+
headers: {
|
|
29709
|
+
"user-agent": `octokit-graphql.js/${VERSION3} ${getUserAgent()}`
|
|
29710
|
+
},
|
|
29711
|
+
method: "POST",
|
|
29712
|
+
url: "/graphql"
|
|
29713
|
+
});
|
|
29714
|
+
function withCustomRequest(customRequest) {
|
|
29715
|
+
return withDefaults3(customRequest, {
|
|
29716
|
+
method: "POST",
|
|
29717
|
+
url: "/graphql"
|
|
29718
|
+
});
|
|
29719
|
+
}
|
|
29720
|
+
|
|
29721
|
+
// node_modules/@octokit/auth-token/dist-web/index.js
|
|
29722
|
+
var REGEX_IS_INSTALLATION_LEGACY = /^v1\./;
|
|
29723
|
+
var REGEX_IS_INSTALLATION = /^ghs_/;
|
|
29724
|
+
var REGEX_IS_USER_TO_SERVER = /^ghu_/;
|
|
29725
|
+
async function auth(token) {
|
|
29726
|
+
const isApp = token.split(/\./).length === 3;
|
|
29727
|
+
const isInstallation = REGEX_IS_INSTALLATION_LEGACY.test(token) || REGEX_IS_INSTALLATION.test(token);
|
|
29728
|
+
const isUserToServer = REGEX_IS_USER_TO_SERVER.test(token);
|
|
29729
|
+
const tokenType = isApp ? "app" : isInstallation ? "installation" : isUserToServer ? "user-to-server" : "oauth";
|
|
29730
|
+
return {
|
|
29731
|
+
type: "token",
|
|
29732
|
+
token,
|
|
29733
|
+
tokenType
|
|
29734
|
+
};
|
|
29735
|
+
}
|
|
29736
|
+
function withAuthorizationPrefix(token) {
|
|
29737
|
+
if (token.split(/\./).length === 3) {
|
|
29738
|
+
return `bearer ${token}`;
|
|
29739
|
+
}
|
|
29740
|
+
return `token ${token}`;
|
|
29741
|
+
}
|
|
29742
|
+
async function hook(token, request2, route, parameters) {
|
|
29743
|
+
const endpoint2 = request2.endpoint.merge(route, parameters);
|
|
29744
|
+
endpoint2.headers.authorization = withAuthorizationPrefix(token);
|
|
29745
|
+
return request2(endpoint2);
|
|
29746
|
+
}
|
|
29747
|
+
var createTokenAuth = function createTokenAuth2(token) {
|
|
29748
|
+
if (!token) {
|
|
29749
|
+
throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
|
|
29750
|
+
}
|
|
29751
|
+
if (typeof token !== "string") {
|
|
29752
|
+
throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");
|
|
29753
|
+
}
|
|
29754
|
+
token = token.replace(/^(token|bearer) +/i, "");
|
|
29755
|
+
return Object.assign(auth.bind(null, token), {
|
|
29756
|
+
hook: hook.bind(null, token)
|
|
29757
|
+
});
|
|
29758
|
+
};
|
|
29759
|
+
|
|
29760
|
+
// node_modules/@octokit/core/dist-web/index.js
|
|
29254
29761
|
var VERSION4 = "3.5.1";
|
|
29255
29762
|
var Octokit = class {
|
|
29256
29763
|
constructor(options = {}) {
|
|
29257
|
-
const
|
|
29764
|
+
const hook3 = new import_before_after_hook.Collection();
|
|
29258
29765
|
const requestDefaults = {
|
|
29259
29766
|
baseUrl: request.endpoint.DEFAULTS.baseUrl,
|
|
29260
29767
|
headers: {},
|
|
29261
29768
|
request: Object.assign({}, options.request, {
|
|
29262
|
-
hook:
|
|
29769
|
+
hook: hook3.bind(null, "request")
|
|
29263
29770
|
}),
|
|
29264
29771
|
mediaType: {
|
|
29265
29772
|
previews: [],
|
|
@@ -29289,27 +29796,27 @@ var Octokit = class {
|
|
|
29289
29796
|
warn: console.warn.bind(console),
|
|
29290
29797
|
error: console.error.bind(console)
|
|
29291
29798
|
}, options.log);
|
|
29292
|
-
this.hook =
|
|
29799
|
+
this.hook = hook3;
|
|
29293
29800
|
if (!options.authStrategy) {
|
|
29294
29801
|
if (!options.auth) {
|
|
29295
29802
|
this.auth = async () => ({
|
|
29296
29803
|
type: "unauthenticated"
|
|
29297
29804
|
});
|
|
29298
29805
|
} else {
|
|
29299
|
-
const
|
|
29300
|
-
|
|
29301
|
-
this.auth =
|
|
29806
|
+
const auth3 = createTokenAuth(options.auth);
|
|
29807
|
+
hook3.wrap("request", auth3.hook);
|
|
29808
|
+
this.auth = auth3;
|
|
29302
29809
|
}
|
|
29303
29810
|
} else {
|
|
29304
29811
|
const { authStrategy, ...otherOptions } = options;
|
|
29305
|
-
const
|
|
29812
|
+
const auth3 = authStrategy(Object.assign({
|
|
29306
29813
|
request: this.request,
|
|
29307
29814
|
log: this.log,
|
|
29308
29815
|
octokit: this,
|
|
29309
29816
|
octokitOptions: otherOptions
|
|
29310
29817
|
}, options.auth));
|
|
29311
|
-
|
|
29312
|
-
this.auth =
|
|
29818
|
+
hook3.wrap("request", auth3.hook);
|
|
29819
|
+
this.auth = auth3;
|
|
29313
29820
|
}
|
|
29314
29821
|
const classConstructor = this.constructor;
|
|
29315
29822
|
classConstructor.plugins.forEach((plugin) => {
|
|
@@ -29343,8 +29850,104 @@ Octokit.VERSION = VERSION4;
|
|
|
29343
29850
|
Octokit.plugins = [];
|
|
29344
29851
|
|
|
29345
29852
|
// node_modules/@octokit/rest/dist-web/index.js
|
|
29346
|
-
|
|
29347
|
-
|
|
29853
|
+
init_dist_web6();
|
|
29854
|
+
|
|
29855
|
+
// node_modules/@octokit/plugin-paginate-rest/dist-web/index.js
|
|
29856
|
+
var VERSION6 = "2.17.0";
|
|
29857
|
+
function normalizePaginatedListResponse(response) {
|
|
29858
|
+
if (!response.data) {
|
|
29859
|
+
return {
|
|
29860
|
+
...response,
|
|
29861
|
+
data: []
|
|
29862
|
+
};
|
|
29863
|
+
}
|
|
29864
|
+
const responseNeedsNormalization = "total_count" in response.data && !("url" in response.data);
|
|
29865
|
+
if (!responseNeedsNormalization)
|
|
29866
|
+
return response;
|
|
29867
|
+
const incompleteResults = response.data.incomplete_results;
|
|
29868
|
+
const repositorySelection = response.data.repository_selection;
|
|
29869
|
+
const totalCount = response.data.total_count;
|
|
29870
|
+
delete response.data.incomplete_results;
|
|
29871
|
+
delete response.data.repository_selection;
|
|
29872
|
+
delete response.data.total_count;
|
|
29873
|
+
const namespaceKey = Object.keys(response.data)[0];
|
|
29874
|
+
const data = response.data[namespaceKey];
|
|
29875
|
+
response.data = data;
|
|
29876
|
+
if (typeof incompleteResults !== "undefined") {
|
|
29877
|
+
response.data.incomplete_results = incompleteResults;
|
|
29878
|
+
}
|
|
29879
|
+
if (typeof repositorySelection !== "undefined") {
|
|
29880
|
+
response.data.repository_selection = repositorySelection;
|
|
29881
|
+
}
|
|
29882
|
+
response.data.total_count = totalCount;
|
|
29883
|
+
return response;
|
|
29884
|
+
}
|
|
29885
|
+
function iterator(octokit, route, parameters) {
|
|
29886
|
+
const options = typeof route === "function" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters);
|
|
29887
|
+
const requestMethod = typeof route === "function" ? route : octokit.request;
|
|
29888
|
+
const method = options.method;
|
|
29889
|
+
const headers = options.headers;
|
|
29890
|
+
let url = options.url;
|
|
29891
|
+
return {
|
|
29892
|
+
[Symbol.asyncIterator]: () => ({
|
|
29893
|
+
async next() {
|
|
29894
|
+
if (!url)
|
|
29895
|
+
return { done: true };
|
|
29896
|
+
try {
|
|
29897
|
+
const response = await requestMethod({ method, url, headers });
|
|
29898
|
+
const normalizedResponse = normalizePaginatedListResponse(response);
|
|
29899
|
+
url = ((normalizedResponse.headers.link || "").match(/<([^>]+)>;\s*rel="next"/) || [])[1];
|
|
29900
|
+
return { value: normalizedResponse };
|
|
29901
|
+
} catch (error) {
|
|
29902
|
+
if (error.status !== 409)
|
|
29903
|
+
throw error;
|
|
29904
|
+
url = "";
|
|
29905
|
+
return {
|
|
29906
|
+
value: {
|
|
29907
|
+
status: 200,
|
|
29908
|
+
headers: {},
|
|
29909
|
+
data: []
|
|
29910
|
+
}
|
|
29911
|
+
};
|
|
29912
|
+
}
|
|
29913
|
+
}
|
|
29914
|
+
})
|
|
29915
|
+
};
|
|
29916
|
+
}
|
|
29917
|
+
function paginate(octokit, route, parameters, mapFn) {
|
|
29918
|
+
if (typeof parameters === "function") {
|
|
29919
|
+
mapFn = parameters;
|
|
29920
|
+
parameters = void 0;
|
|
29921
|
+
}
|
|
29922
|
+
return gather(octokit, [], iterator(octokit, route, parameters)[Symbol.asyncIterator](), mapFn);
|
|
29923
|
+
}
|
|
29924
|
+
function gather(octokit, results, iterator3, mapFn) {
|
|
29925
|
+
return iterator3.next().then((result) => {
|
|
29926
|
+
if (result.done) {
|
|
29927
|
+
return results;
|
|
29928
|
+
}
|
|
29929
|
+
let earlyExit = false;
|
|
29930
|
+
function done() {
|
|
29931
|
+
earlyExit = true;
|
|
29932
|
+
}
|
|
29933
|
+
results = results.concat(mapFn ? mapFn(result.value, done) : result.value.data);
|
|
29934
|
+
if (earlyExit) {
|
|
29935
|
+
return results;
|
|
29936
|
+
}
|
|
29937
|
+
return gather(octokit, results, iterator3, mapFn);
|
|
29938
|
+
});
|
|
29939
|
+
}
|
|
29940
|
+
var composePaginateRest = Object.assign(paginate, {
|
|
29941
|
+
iterator
|
|
29942
|
+
});
|
|
29943
|
+
function paginateRest(octokit) {
|
|
29944
|
+
return {
|
|
29945
|
+
paginate: Object.assign(paginate.bind(null, octokit), {
|
|
29946
|
+
iterator: iterator.bind(null, octokit)
|
|
29947
|
+
})
|
|
29948
|
+
};
|
|
29949
|
+
}
|
|
29950
|
+
paginateRest.VERSION = VERSION6;
|
|
29348
29951
|
|
|
29349
29952
|
// node_modules/@octokit/plugin-rest-endpoint-methods/dist-web/index.js
|
|
29350
29953
|
var Endpoints = {
|
|
@@ -29410,6 +30013,9 @@ var Endpoints = {
|
|
|
29410
30013
|
downloadJobLogsForWorkflowRun: [
|
|
29411
30014
|
"GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs"
|
|
29412
30015
|
],
|
|
30016
|
+
downloadWorkflowRunAttemptLogs: [
|
|
30017
|
+
"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs"
|
|
30018
|
+
],
|
|
29413
30019
|
downloadWorkflowRunLogs: [
|
|
29414
30020
|
"GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs"
|
|
29415
30021
|
],
|
|
@@ -29460,6 +30066,9 @@ var Endpoints = {
|
|
|
29460
30066
|
],
|
|
29461
30067
|
getWorkflow: ["GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}"],
|
|
29462
30068
|
getWorkflowRun: ["GET /repos/{owner}/{repo}/actions/runs/{run_id}"],
|
|
30069
|
+
getWorkflowRunAttempt: [
|
|
30070
|
+
"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}"
|
|
30071
|
+
],
|
|
29463
30072
|
getWorkflowRunUsage: [
|
|
29464
30073
|
"GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing"
|
|
29465
30074
|
],
|
|
@@ -29473,6 +30082,9 @@ var Endpoints = {
|
|
|
29473
30082
|
listJobsForWorkflowRun: [
|
|
29474
30083
|
"GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs"
|
|
29475
30084
|
],
|
|
30085
|
+
listJobsForWorkflowRunAttempt: [
|
|
30086
|
+
"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs"
|
|
30087
|
+
],
|
|
29476
30088
|
listOrgSecrets: ["GET /orgs/{org}/actions/secrets"],
|
|
29477
30089
|
listRepoSecrets: ["GET /repos/{owner}/{repo}/actions/secrets"],
|
|
29478
30090
|
listRepoWorkflows: ["GET /repos/{owner}/{repo}/actions/workflows"],
|
|
@@ -29498,7 +30110,6 @@ var Endpoints = {
|
|
|
29498
30110
|
removeSelectedRepoFromOrgSecret: [
|
|
29499
30111
|
"DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}"
|
|
29500
30112
|
],
|
|
29501
|
-
retryWorkflow: ["POST /repos/{owner}/{repo}/actions/runs/{run_id}/retry"],
|
|
29502
30113
|
reviewPendingDeploymentsForRun: [
|
|
29503
30114
|
"POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments"
|
|
29504
30115
|
],
|
|
@@ -29568,6 +30179,11 @@ var Endpoints = {
|
|
|
29568
30179
|
},
|
|
29569
30180
|
apps: {
|
|
29570
30181
|
addRepoToInstallation: [
|
|
30182
|
+
"PUT /user/installations/{installation_id}/repositories/{repository_id}",
|
|
30183
|
+
{},
|
|
30184
|
+
{ renamed: ["apps", "addRepoToInstallationForAuthenticatedUser"] }
|
|
30185
|
+
],
|
|
30186
|
+
addRepoToInstallationForAuthenticatedUser: [
|
|
29571
30187
|
"PUT /user/installations/{installation_id}/repositories/{repository_id}"
|
|
29572
30188
|
],
|
|
29573
30189
|
checkToken: ["POST /applications/{client_id}/token"],
|
|
@@ -29621,6 +30237,11 @@ var Endpoints = {
|
|
|
29621
30237
|
"POST /app/hook/deliveries/{delivery_id}/attempts"
|
|
29622
30238
|
],
|
|
29623
30239
|
removeRepoFromInstallation: [
|
|
30240
|
+
"DELETE /user/installations/{installation_id}/repositories/{repository_id}",
|
|
30241
|
+
{},
|
|
30242
|
+
{ renamed: ["apps", "removeRepoFromInstallationForAuthenticatedUser"] }
|
|
30243
|
+
],
|
|
30244
|
+
removeRepoFromInstallationForAuthenticatedUser: [
|
|
29624
30245
|
"DELETE /user/installations/{installation_id}/repositories/{repository_id}"
|
|
29625
30246
|
],
|
|
29626
30247
|
resetToken: ["PATCH /applications/{client_id}/token"],
|
|
@@ -29661,6 +30282,9 @@ var Endpoints = {
|
|
|
29661
30282
|
"GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs"
|
|
29662
30283
|
],
|
|
29663
30284
|
listSuitesForRef: ["GET /repos/{owner}/{repo}/commits/{ref}/check-suites"],
|
|
30285
|
+
rerequestRun: [
|
|
30286
|
+
"POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest"
|
|
30287
|
+
],
|
|
29664
30288
|
rerequestSuite: [
|
|
29665
30289
|
"POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest"
|
|
29666
30290
|
],
|
|
@@ -29699,11 +30323,7 @@ var Endpoints = {
|
|
|
29699
30323
|
},
|
|
29700
30324
|
codesOfConduct: {
|
|
29701
30325
|
getAllCodesOfConduct: ["GET /codes_of_conduct"],
|
|
29702
|
-
getConductCode: ["GET /codes_of_conduct/{key}"]
|
|
29703
|
-
getForRepo: [
|
|
29704
|
-
"GET /repos/{owner}/{repo}/community/code_of_conduct",
|
|
29705
|
-
{ mediaType: { previews: ["scarlet-witch"] } }
|
|
29706
|
-
]
|
|
30326
|
+
getConductCode: ["GET /codes_of_conduct/{key}"]
|
|
29707
30327
|
},
|
|
29708
30328
|
emojis: { get: ["GET /emojis"] },
|
|
29709
30329
|
enterpriseAdmin: {
|
|
@@ -29903,8 +30523,15 @@ var Endpoints = {
|
|
|
29903
30523
|
getStatusForOrg: ["GET /orgs/{org}/migrations/{migration_id}"],
|
|
29904
30524
|
listForAuthenticatedUser: ["GET /user/migrations"],
|
|
29905
30525
|
listForOrg: ["GET /orgs/{org}/migrations"],
|
|
30526
|
+
listReposForAuthenticatedUser: [
|
|
30527
|
+
"GET /user/migrations/{migration_id}/repositories"
|
|
30528
|
+
],
|
|
29906
30529
|
listReposForOrg: ["GET /orgs/{org}/migrations/{migration_id}/repositories"],
|
|
29907
|
-
listReposForUser: [
|
|
30530
|
+
listReposForUser: [
|
|
30531
|
+
"GET /user/migrations/{migration_id}/repositories",
|
|
30532
|
+
{},
|
|
30533
|
+
{ renamed: ["migrations", "listReposForAuthenticatedUser"] }
|
|
30534
|
+
],
|
|
29908
30535
|
mapCommitAuthor: ["PATCH /repos/{owner}/{repo}/import/authors/{author_id}"],
|
|
29909
30536
|
setLfsPreference: ["PATCH /repos/{owner}/{repo}/import/lfs"],
|
|
29910
30537
|
startForAuthenticatedUser: ["POST /user/migrations"],
|
|
@@ -30152,91 +30779,70 @@ var Endpoints = {
|
|
|
30152
30779
|
rateLimit: { get: ["GET /rate_limit"] },
|
|
30153
30780
|
reactions: {
|
|
30154
30781
|
createForCommitComment: [
|
|
30155
|
-
"POST /repos/{owner}/{repo}/comments/{comment_id}/reactions"
|
|
30156
|
-
{ mediaType: { previews: ["squirrel-girl"] } }
|
|
30782
|
+
"POST /repos/{owner}/{repo}/comments/{comment_id}/reactions"
|
|
30157
30783
|
],
|
|
30158
30784
|
createForIssue: [
|
|
30159
|
-
"POST /repos/{owner}/{repo}/issues/{issue_number}/reactions"
|
|
30160
|
-
{ mediaType: { previews: ["squirrel-girl"] } }
|
|
30785
|
+
"POST /repos/{owner}/{repo}/issues/{issue_number}/reactions"
|
|
30161
30786
|
],
|
|
30162
30787
|
createForIssueComment: [
|
|
30163
|
-
"POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"
|
|
30164
|
-
{ mediaType: { previews: ["squirrel-girl"] } }
|
|
30788
|
+
"POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"
|
|
30165
30789
|
],
|
|
30166
30790
|
createForPullRequestReviewComment: [
|
|
30167
|
-
"POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"
|
|
30168
|
-
{ mediaType: { previews: ["squirrel-girl"] } }
|
|
30791
|
+
"POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"
|
|
30169
30792
|
],
|
|
30170
30793
|
createForRelease: [
|
|
30171
|
-
"POST /repos/{owner}/{repo}/releases/{release_id}/reactions"
|
|
30172
|
-
{ mediaType: { previews: ["squirrel-girl"] } }
|
|
30794
|
+
"POST /repos/{owner}/{repo}/releases/{release_id}/reactions"
|
|
30173
30795
|
],
|
|
30174
30796
|
createForTeamDiscussionCommentInOrg: [
|
|
30175
|
-
"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"
|
|
30176
|
-
{ mediaType: { previews: ["squirrel-girl"] } }
|
|
30797
|
+
"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"
|
|
30177
30798
|
],
|
|
30178
30799
|
createForTeamDiscussionInOrg: [
|
|
30179
|
-
"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"
|
|
30180
|
-
{ mediaType: { previews: ["squirrel-girl"] } }
|
|
30800
|
+
"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"
|
|
30181
30801
|
],
|
|
30182
30802
|
deleteForCommitComment: [
|
|
30183
|
-
"DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}"
|
|
30184
|
-
{ mediaType: { previews: ["squirrel-girl"] } }
|
|
30803
|
+
"DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}"
|
|
30185
30804
|
],
|
|
30186
30805
|
deleteForIssue: [
|
|
30187
|
-
"DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}"
|
|
30188
|
-
{ mediaType: { previews: ["squirrel-girl"] } }
|
|
30806
|
+
"DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}"
|
|
30189
30807
|
],
|
|
30190
30808
|
deleteForIssueComment: [
|
|
30191
|
-
"DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}"
|
|
30192
|
-
{ mediaType: { previews: ["squirrel-girl"] } }
|
|
30809
|
+
"DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}"
|
|
30193
30810
|
],
|
|
30194
30811
|
deleteForPullRequestComment: [
|
|
30195
|
-
"DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}"
|
|
30196
|
-
{ mediaType: { previews: ["squirrel-girl"] } }
|
|
30812
|
+
"DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}"
|
|
30197
30813
|
],
|
|
30198
30814
|
deleteForTeamDiscussion: [
|
|
30199
|
-
"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}"
|
|
30200
|
-
{ mediaType: { previews: ["squirrel-girl"] } }
|
|
30815
|
+
"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}"
|
|
30201
30816
|
],
|
|
30202
30817
|
deleteForTeamDiscussionComment: [
|
|
30203
|
-
"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}"
|
|
30204
|
-
{ mediaType: { previews: ["squirrel-girl"] } }
|
|
30205
|
-
],
|
|
30206
|
-
deleteLegacy: [
|
|
30207
|
-
"DELETE /reactions/{reaction_id}",
|
|
30208
|
-
{ mediaType: { previews: ["squirrel-girl"] } },
|
|
30209
|
-
{
|
|
30210
|
-
deprecated: "octokit.rest.reactions.deleteLegacy() is deprecated, see https://docs.github.com/rest/reference/reactions/#delete-a-reaction-legacy"
|
|
30211
|
-
}
|
|
30818
|
+
"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}"
|
|
30212
30819
|
],
|
|
30213
30820
|
listForCommitComment: [
|
|
30214
|
-
"GET /repos/{owner}/{repo}/comments/{comment_id}/reactions"
|
|
30215
|
-
{ mediaType: { previews: ["squirrel-girl"] } }
|
|
30216
|
-
],
|
|
30217
|
-
listForIssue: [
|
|
30218
|
-
"GET /repos/{owner}/{repo}/issues/{issue_number}/reactions",
|
|
30219
|
-
{ mediaType: { previews: ["squirrel-girl"] } }
|
|
30821
|
+
"GET /repos/{owner}/{repo}/comments/{comment_id}/reactions"
|
|
30220
30822
|
],
|
|
30823
|
+
listForIssue: ["GET /repos/{owner}/{repo}/issues/{issue_number}/reactions"],
|
|
30221
30824
|
listForIssueComment: [
|
|
30222
|
-
"GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"
|
|
30223
|
-
{ mediaType: { previews: ["squirrel-girl"] } }
|
|
30825
|
+
"GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions"
|
|
30224
30826
|
],
|
|
30225
30827
|
listForPullRequestReviewComment: [
|
|
30226
|
-
"GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"
|
|
30227
|
-
{ mediaType: { previews: ["squirrel-girl"] } }
|
|
30828
|
+
"GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions"
|
|
30228
30829
|
],
|
|
30229
30830
|
listForTeamDiscussionCommentInOrg: [
|
|
30230
|
-
"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"
|
|
30231
|
-
{ mediaType: { previews: ["squirrel-girl"] } }
|
|
30831
|
+
"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions"
|
|
30232
30832
|
],
|
|
30233
30833
|
listForTeamDiscussionInOrg: [
|
|
30234
|
-
"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"
|
|
30235
|
-
{ mediaType: { previews: ["squirrel-girl"] } }
|
|
30834
|
+
"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions"
|
|
30236
30835
|
]
|
|
30237
30836
|
},
|
|
30238
30837
|
repos: {
|
|
30239
|
-
acceptInvitation: [
|
|
30838
|
+
acceptInvitation: [
|
|
30839
|
+
"PATCH /user/repository_invitations/{invitation_id}",
|
|
30840
|
+
{},
|
|
30841
|
+
{ renamed: ["repos", "acceptInvitationForAuthenticatedUser"] }
|
|
30842
|
+
],
|
|
30843
|
+
acceptInvitationForAuthenticatedUser: [
|
|
30844
|
+
"PATCH /user/repository_invitations/{invitation_id}"
|
|
30845
|
+
],
|
|
30240
30846
|
addAppAccessRestrictions: [
|
|
30241
30847
|
"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps",
|
|
30242
30848
|
{},
|
|
@@ -30271,8 +30877,7 @@ var Endpoints = {
|
|
|
30271
30877
|
"POST /repos/{owner}/{repo}/commits/{commit_sha}/comments"
|
|
30272
30878
|
],
|
|
30273
30879
|
createCommitSignatureProtection: [
|
|
30274
|
-
"POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
|
|
30275
|
-
{ mediaType: { previews: ["zzzax"] } }
|
|
30880
|
+
"POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
|
|
30276
30881
|
],
|
|
30277
30882
|
createCommitStatus: ["POST /repos/{owner}/{repo}/statuses/{sha}"],
|
|
30278
30883
|
createDeployKey: ["POST /repos/{owner}/{repo}/keys"],
|
|
@@ -30288,17 +30893,20 @@ var Endpoints = {
|
|
|
30288
30893
|
"PUT /repos/{owner}/{repo}/environments/{environment_name}"
|
|
30289
30894
|
],
|
|
30290
30895
|
createOrUpdateFileContents: ["PUT /repos/{owner}/{repo}/contents/{path}"],
|
|
30291
|
-
createPagesSite: [
|
|
30292
|
-
"POST /repos/{owner}/{repo}/pages",
|
|
30293
|
-
{ mediaType: { previews: ["switcheroo"] } }
|
|
30294
|
-
],
|
|
30896
|
+
createPagesSite: ["POST /repos/{owner}/{repo}/pages"],
|
|
30295
30897
|
createRelease: ["POST /repos/{owner}/{repo}/releases"],
|
|
30296
30898
|
createUsingTemplate: [
|
|
30297
|
-
"POST /repos/{template_owner}/{template_repo}/generate"
|
|
30298
|
-
{ mediaType: { previews: ["baptiste"] } }
|
|
30899
|
+
"POST /repos/{template_owner}/{template_repo}/generate"
|
|
30299
30900
|
],
|
|
30300
30901
|
createWebhook: ["POST /repos/{owner}/{repo}/hooks"],
|
|
30301
|
-
declineInvitation: [
|
|
30902
|
+
declineInvitation: [
|
|
30903
|
+
"DELETE /user/repository_invitations/{invitation_id}",
|
|
30904
|
+
{},
|
|
30905
|
+
{ renamed: ["repos", "declineInvitationForAuthenticatedUser"] }
|
|
30906
|
+
],
|
|
30907
|
+
declineInvitationForAuthenticatedUser: [
|
|
30908
|
+
"DELETE /user/repository_invitations/{invitation_id}"
|
|
30909
|
+
],
|
|
30302
30910
|
delete: ["DELETE /repos/{owner}/{repo}"],
|
|
30303
30911
|
deleteAccessRestrictions: [
|
|
30304
30912
|
"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"
|
|
@@ -30315,8 +30923,7 @@ var Endpoints = {
|
|
|
30315
30923
|
],
|
|
30316
30924
|
deleteCommitComment: ["DELETE /repos/{owner}/{repo}/comments/{comment_id}"],
|
|
30317
30925
|
deleteCommitSignatureProtection: [
|
|
30318
|
-
"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
|
|
30319
|
-
{ mediaType: { previews: ["zzzax"] } }
|
|
30926
|
+
"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
|
|
30320
30927
|
],
|
|
30321
30928
|
deleteDeployKey: ["DELETE /repos/{owner}/{repo}/keys/{key_id}"],
|
|
30322
30929
|
deleteDeployment: [
|
|
@@ -30326,10 +30933,7 @@ var Endpoints = {
|
|
|
30326
30933
|
deleteInvitation: [
|
|
30327
30934
|
"DELETE /repos/{owner}/{repo}/invitations/{invitation_id}"
|
|
30328
30935
|
],
|
|
30329
|
-
deletePagesSite: [
|
|
30330
|
-
"DELETE /repos/{owner}/{repo}/pages",
|
|
30331
|
-
{ mediaType: { previews: ["switcheroo"] } }
|
|
30332
|
-
],
|
|
30936
|
+
deletePagesSite: ["DELETE /repos/{owner}/{repo}/pages"],
|
|
30333
30937
|
deletePullRequestReviewProtection: [
|
|
30334
30938
|
"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews"
|
|
30335
30939
|
],
|
|
@@ -30359,6 +30963,9 @@ var Endpoints = {
|
|
|
30359
30963
|
enableVulnerabilityAlerts: [
|
|
30360
30964
|
"PUT /repos/{owner}/{repo}/vulnerability-alerts"
|
|
30361
30965
|
],
|
|
30966
|
+
generateReleaseNotes: [
|
|
30967
|
+
"POST /repos/{owner}/{repo}/releases/generate-notes"
|
|
30968
|
+
],
|
|
30362
30969
|
get: ["GET /repos/{owner}/{repo}"],
|
|
30363
30970
|
getAccessRestrictions: [
|
|
30364
30971
|
"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions"
|
|
@@ -30392,8 +30999,7 @@ var Endpoints = {
|
|
|
30392
30999
|
getCommitActivityStats: ["GET /repos/{owner}/{repo}/stats/commit_activity"],
|
|
30393
31000
|
getCommitComment: ["GET /repos/{owner}/{repo}/comments/{comment_id}"],
|
|
30394
31001
|
getCommitSignatureProtection: [
|
|
30395
|
-
"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
|
|
30396
|
-
{ mediaType: { previews: ["zzzax"] } }
|
|
31002
|
+
"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures"
|
|
30397
31003
|
],
|
|
30398
31004
|
getCommunityProfileMetrics: ["GET /repos/{owner}/{repo}/community/profile"],
|
|
30399
31005
|
getContent: ["GET /repos/{owner}/{repo}/contents/{path}"],
|
|
@@ -30580,7 +31186,7 @@ var Endpoints = {
|
|
|
30580
31186
|
},
|
|
30581
31187
|
search: {
|
|
30582
31188
|
code: ["GET /search/code"],
|
|
30583
|
-
commits: ["GET /search/commits"
|
|
31189
|
+
commits: ["GET /search/commits"],
|
|
30584
31190
|
issuesAndPullRequests: ["GET /search/issues"],
|
|
30585
31191
|
labels: ["GET /search/labels"],
|
|
30586
31192
|
repos: ["GET /search/repositories"],
|
|
@@ -30666,41 +31272,118 @@ var Endpoints = {
|
|
|
30666
31272
|
updateInOrg: ["PATCH /orgs/{org}/teams/{team_slug}"]
|
|
30667
31273
|
},
|
|
30668
31274
|
users: {
|
|
30669
|
-
addEmailForAuthenticated: [
|
|
31275
|
+
addEmailForAuthenticated: [
|
|
31276
|
+
"POST /user/emails",
|
|
31277
|
+
{},
|
|
31278
|
+
{ renamed: ["users", "addEmailForAuthenticatedUser"] }
|
|
31279
|
+
],
|
|
31280
|
+
addEmailForAuthenticatedUser: ["POST /user/emails"],
|
|
30670
31281
|
block: ["PUT /user/blocks/{username}"],
|
|
30671
31282
|
checkBlocked: ["GET /user/blocks/{username}"],
|
|
30672
31283
|
checkFollowingForUser: ["GET /users/{username}/following/{target_user}"],
|
|
30673
31284
|
checkPersonIsFollowedByAuthenticated: ["GET /user/following/{username}"],
|
|
30674
|
-
createGpgKeyForAuthenticated: [
|
|
30675
|
-
|
|
30676
|
-
|
|
30677
|
-
|
|
30678
|
-
|
|
31285
|
+
createGpgKeyForAuthenticated: [
|
|
31286
|
+
"POST /user/gpg_keys",
|
|
31287
|
+
{},
|
|
31288
|
+
{ renamed: ["users", "createGpgKeyForAuthenticatedUser"] }
|
|
31289
|
+
],
|
|
31290
|
+
createGpgKeyForAuthenticatedUser: ["POST /user/gpg_keys"],
|
|
31291
|
+
createPublicSshKeyForAuthenticated: [
|
|
31292
|
+
"POST /user/keys",
|
|
31293
|
+
{},
|
|
31294
|
+
{ renamed: ["users", "createPublicSshKeyForAuthenticatedUser"] }
|
|
31295
|
+
],
|
|
31296
|
+
createPublicSshKeyForAuthenticatedUser: ["POST /user/keys"],
|
|
31297
|
+
deleteEmailForAuthenticated: [
|
|
31298
|
+
"DELETE /user/emails",
|
|
31299
|
+
{},
|
|
31300
|
+
{ renamed: ["users", "deleteEmailForAuthenticatedUser"] }
|
|
31301
|
+
],
|
|
31302
|
+
deleteEmailForAuthenticatedUser: ["DELETE /user/emails"],
|
|
31303
|
+
deleteGpgKeyForAuthenticated: [
|
|
31304
|
+
"DELETE /user/gpg_keys/{gpg_key_id}",
|
|
31305
|
+
{},
|
|
31306
|
+
{ renamed: ["users", "deleteGpgKeyForAuthenticatedUser"] }
|
|
31307
|
+
],
|
|
31308
|
+
deleteGpgKeyForAuthenticatedUser: ["DELETE /user/gpg_keys/{gpg_key_id}"],
|
|
31309
|
+
deletePublicSshKeyForAuthenticated: [
|
|
31310
|
+
"DELETE /user/keys/{key_id}",
|
|
31311
|
+
{},
|
|
31312
|
+
{ renamed: ["users", "deletePublicSshKeyForAuthenticatedUser"] }
|
|
31313
|
+
],
|
|
31314
|
+
deletePublicSshKeyForAuthenticatedUser: ["DELETE /user/keys/{key_id}"],
|
|
30679
31315
|
follow: ["PUT /user/following/{username}"],
|
|
30680
31316
|
getAuthenticated: ["GET /user"],
|
|
30681
31317
|
getByUsername: ["GET /users/{username}"],
|
|
30682
31318
|
getContextForUser: ["GET /users/{username}/hovercard"],
|
|
30683
|
-
getGpgKeyForAuthenticated: [
|
|
30684
|
-
|
|
31319
|
+
getGpgKeyForAuthenticated: [
|
|
31320
|
+
"GET /user/gpg_keys/{gpg_key_id}",
|
|
31321
|
+
{},
|
|
31322
|
+
{ renamed: ["users", "getGpgKeyForAuthenticatedUser"] }
|
|
31323
|
+
],
|
|
31324
|
+
getGpgKeyForAuthenticatedUser: ["GET /user/gpg_keys/{gpg_key_id}"],
|
|
31325
|
+
getPublicSshKeyForAuthenticated: [
|
|
31326
|
+
"GET /user/keys/{key_id}",
|
|
31327
|
+
{},
|
|
31328
|
+
{ renamed: ["users", "getPublicSshKeyForAuthenticatedUser"] }
|
|
31329
|
+
],
|
|
31330
|
+
getPublicSshKeyForAuthenticatedUser: ["GET /user/keys/{key_id}"],
|
|
30685
31331
|
list: ["GET /users"],
|
|
30686
|
-
listBlockedByAuthenticated: [
|
|
30687
|
-
|
|
30688
|
-
|
|
31332
|
+
listBlockedByAuthenticated: [
|
|
31333
|
+
"GET /user/blocks",
|
|
31334
|
+
{},
|
|
31335
|
+
{ renamed: ["users", "listBlockedByAuthenticatedUser"] }
|
|
31336
|
+
],
|
|
31337
|
+
listBlockedByAuthenticatedUser: ["GET /user/blocks"],
|
|
31338
|
+
listEmailsForAuthenticated: [
|
|
31339
|
+
"GET /user/emails",
|
|
31340
|
+
{},
|
|
31341
|
+
{ renamed: ["users", "listEmailsForAuthenticatedUser"] }
|
|
31342
|
+
],
|
|
31343
|
+
listEmailsForAuthenticatedUser: ["GET /user/emails"],
|
|
31344
|
+
listFollowedByAuthenticated: [
|
|
31345
|
+
"GET /user/following",
|
|
31346
|
+
{},
|
|
31347
|
+
{ renamed: ["users", "listFollowedByAuthenticatedUser"] }
|
|
31348
|
+
],
|
|
31349
|
+
listFollowedByAuthenticatedUser: ["GET /user/following"],
|
|
30689
31350
|
listFollowersForAuthenticatedUser: ["GET /user/followers"],
|
|
30690
31351
|
listFollowersForUser: ["GET /users/{username}/followers"],
|
|
30691
31352
|
listFollowingForUser: ["GET /users/{username}/following"],
|
|
30692
|
-
listGpgKeysForAuthenticated: [
|
|
31353
|
+
listGpgKeysForAuthenticated: [
|
|
31354
|
+
"GET /user/gpg_keys",
|
|
31355
|
+
{},
|
|
31356
|
+
{ renamed: ["users", "listGpgKeysForAuthenticatedUser"] }
|
|
31357
|
+
],
|
|
31358
|
+
listGpgKeysForAuthenticatedUser: ["GET /user/gpg_keys"],
|
|
30693
31359
|
listGpgKeysForUser: ["GET /users/{username}/gpg_keys"],
|
|
30694
|
-
listPublicEmailsForAuthenticated: [
|
|
31360
|
+
listPublicEmailsForAuthenticated: [
|
|
31361
|
+
"GET /user/public_emails",
|
|
31362
|
+
{},
|
|
31363
|
+
{ renamed: ["users", "listPublicEmailsForAuthenticatedUser"] }
|
|
31364
|
+
],
|
|
31365
|
+
listPublicEmailsForAuthenticatedUser: ["GET /user/public_emails"],
|
|
30695
31366
|
listPublicKeysForUser: ["GET /users/{username}/keys"],
|
|
30696
|
-
listPublicSshKeysForAuthenticated: [
|
|
30697
|
-
|
|
31367
|
+
listPublicSshKeysForAuthenticated: [
|
|
31368
|
+
"GET /user/keys",
|
|
31369
|
+
{},
|
|
31370
|
+
{ renamed: ["users", "listPublicSshKeysForAuthenticatedUser"] }
|
|
31371
|
+
],
|
|
31372
|
+
listPublicSshKeysForAuthenticatedUser: ["GET /user/keys"],
|
|
31373
|
+
setPrimaryEmailVisibilityForAuthenticated: [
|
|
31374
|
+
"PATCH /user/email/visibility",
|
|
31375
|
+
{},
|
|
31376
|
+
{ renamed: ["users", "setPrimaryEmailVisibilityForAuthenticatedUser"] }
|
|
31377
|
+
],
|
|
31378
|
+
setPrimaryEmailVisibilityForAuthenticatedUser: [
|
|
31379
|
+
"PATCH /user/email/visibility"
|
|
31380
|
+
],
|
|
30698
31381
|
unblock: ["DELETE /user/blocks/{username}"],
|
|
30699
31382
|
unfollow: ["DELETE /user/following/{username}"],
|
|
30700
31383
|
updateAuthenticated: ["PATCH /user"]
|
|
30701
31384
|
}
|
|
30702
31385
|
};
|
|
30703
|
-
var VERSION7 = "5.
|
|
31386
|
+
var VERSION7 = "5.13.0";
|
|
30704
31387
|
function endpointsToMethods(octokit, endpointsMap) {
|
|
30705
31388
|
const newMethods = {};
|
|
30706
31389
|
for (const [scope, endpoints] of Object.entries(endpointsMap)) {
|
|
@@ -30773,7 +31456,7 @@ function legacyRestEndpointMethods(octokit) {
|
|
|
30773
31456
|
legacyRestEndpointMethods.VERSION = VERSION7;
|
|
30774
31457
|
|
|
30775
31458
|
// node_modules/@octokit/rest/dist-web/index.js
|
|
30776
|
-
var VERSION8 = "18.
|
|
31459
|
+
var VERSION8 = "18.12.0";
|
|
30777
31460
|
var Octokit2 = Octokit.plugin(requestLog, legacyRestEndpointMethods, paginateRest).defaults({
|
|
30778
31461
|
userAgent: `octokit-rest.js/${VERSION8}`
|
|
30779
31462
|
});
|