@napi-rs/cli 2.0.0-alpha.4 → 2.0.0-alpha.5

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@napi-rs/cli",
3
- "version": "2.0.0-alpha.4",
3
+ "version": "2.0.0-alpha.5",
4
4
  "description": "Cli tools for napi-rs",
5
5
  "keywords": ["cli", "rust", "napi", "n-api", "neon"],
6
6
  "author": "LongYinan <lynweklm@gmail.com>",
package/scripts/index.js CHANGED
@@ -10573,18 +10573,18 @@ var require_register = __commonJS({
10573
10573
  var require_add = __commonJS({
10574
10574
  "node_modules/before-after-hook/lib/add.js"(exports2, module2) {
10575
10575
  module2.exports = addHook;
10576
- function addHook(state, kind, name, hook3) {
10577
- var orig = hook3;
10576
+ function addHook(state, kind, name, hook2) {
10577
+ var orig = hook2;
10578
10578
  if (!state.registry[name]) {
10579
10579
  state.registry[name] = [];
10580
10580
  }
10581
10581
  if (kind === "before") {
10582
- hook3 = function(method, options) {
10582
+ hook2 = function(method, options) {
10583
10583
  return Promise.resolve().then(orig.bind(null, options)).then(method.bind(null, options));
10584
10584
  };
10585
10585
  }
10586
10586
  if (kind === "after") {
10587
- hook3 = function(method, options) {
10587
+ hook2 = function(method, options) {
10588
10588
  var result;
10589
10589
  return Promise.resolve().then(method.bind(null, options)).then(function(result_) {
10590
10590
  result = result_;
@@ -10595,14 +10595,14 @@ var require_add = __commonJS({
10595
10595
  };
10596
10596
  }
10597
10597
  if (kind === "error") {
10598
- hook3 = function(method, options) {
10598
+ hook2 = function(method, options) {
10599
10599
  return Promise.resolve().then(method.bind(null, options)).catch(function(error) {
10600
10600
  return orig(error, options);
10601
10601
  });
10602
10602
  };
10603
10603
  }
10604
10604
  state.registry[name].push({
10605
- hook: hook3,
10605
+ hook: hook2,
10606
10606
  orig
10607
10607
  });
10608
10608
  }
@@ -10636,13 +10636,13 @@ var require_before_after_hook = __commonJS({
10636
10636
  var removeHook = require_remove();
10637
10637
  var bind = Function.bind;
10638
10638
  var bindable = bind.bind(bind);
10639
- function bindApi(hook3, state, name) {
10639
+ function bindApi(hook2, state, name) {
10640
10640
  var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state]);
10641
- hook3.api = { remove: removeHookRef };
10642
- hook3.remove = removeHookRef;
10641
+ hook2.api = { remove: removeHookRef };
10642
+ hook2.remove = removeHookRef;
10643
10643
  ["before", "error", "after", "wrap"].forEach(function(kind) {
10644
10644
  var args = name ? [state, kind, name] : [state, kind];
10645
- hook3[kind] = hook3.api[kind] = bindable(addHook, null).apply(null, args);
10645
+ hook2[kind] = hook2.api[kind] = bindable(addHook, null).apply(null, args);
10646
10646
  });
10647
10647
  }
10648
10648
  function HookSingular() {
@@ -10658,9 +10658,9 @@ var require_before_after_hook = __commonJS({
10658
10658
  var state = {
10659
10659
  registry: {}
10660
10660
  };
10661
- var hook3 = register.bind(null, state);
10662
- bindApi(hook3, state);
10663
- return hook3;
10661
+ var hook2 = register.bind(null, state);
10662
+ bindApi(hook2, state);
10663
+ return hook2;
10664
10664
  }
10665
10665
  var collectionHookDeprecationMessageDisplayed = false;
10666
10666
  function Hook() {
@@ -13072,13 +13072,13 @@ function getHeaders(headers) {
13072
13072
  });
13073
13073
  }
13074
13074
  function createHeadersIterator(target, kind) {
13075
- const iterator3 = Object.create(HeadersIteratorPrototype);
13076
- iterator3[INTERNAL] = {
13075
+ const iterator2 = Object.create(HeadersIteratorPrototype);
13076
+ iterator2[INTERNAL] = {
13077
13077
  target,
13078
13078
  kind,
13079
13079
  index: 0
13080
13080
  };
13081
- return iterator3;
13081
+ return iterator2;
13082
13082
  }
13083
13083
  function exportNodeCompatibleHeaders(headers) {
13084
13084
  const obj = Object.assign({ __proto__: null }, headers[MAP]);
@@ -14139,66 +14139,25 @@ var init_dist_web5 = __esm({
14139
14139
  }
14140
14140
  });
14141
14141
 
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
- });
14157
- }
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>";
14142
+ // node_modules/@octokit/graphql/dist-web/index.js
14143
+ function _buildMessageForResponseErrors(data) {
14144
+ return `Request failed due to following response errors:
14145
+ ` + data.errors.map((e) => ` - ${e.message}`).join("\n");
14188
14146
  }
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`));
14147
+ function graphql(request2, query, options) {
14148
+ if (options) {
14149
+ if (typeof query === "string" && "query" in options) {
14150
+ return Promise.reject(new Error(`[@octokit/graphql] "query" cannot be used as variable name`));
14151
+ }
14152
+ for (const key in options) {
14153
+ if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key))
14154
+ continue;
14155
+ return Promise.reject(new Error(`[@octokit/graphql] "${key}" cannot be used as variable name`));
14156
+ }
14198
14157
  }
14199
14158
  const parsedOptions = typeof query === "string" ? Object.assign({ query }, options) : query;
14200
14159
  const requestOptions = Object.keys(parsedOptions).reduce((result, key) => {
14201
- if (NON_VARIABLE_OPTIONS2.includes(key)) {
14160
+ if (NON_VARIABLE_OPTIONS.includes(key)) {
14202
14161
  result[key] = parsedOptions[key];
14203
14162
  return result;
14204
14163
  }
@@ -14209,8 +14168,8 @@ function graphql2(request2, query, options) {
14209
14168
  return result;
14210
14169
  }, {});
14211
14170
  const baseUrl = parsedOptions.baseUrl || request2.endpoint.DEFAULTS.baseUrl;
14212
- if (GHES_V3_SUFFIX_REGEX2.test(baseUrl)) {
14213
- requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX2, "/api/graphql");
14171
+ if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) {
14172
+ requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql");
14214
14173
  }
14215
14174
  return request2(requestOptions).then((response) => {
14216
14175
  if (response.data.errors) {
@@ -14218,50 +14177,48 @@ function graphql2(request2, query, options) {
14218
14177
  for (const key of Object.keys(response.headers)) {
14219
14178
  headers[key] = response.headers[key];
14220
14179
  }
14221
- throw new GraphqlError(requestOptions, {
14222
- headers,
14223
- data: response.data
14224
- });
14180
+ throw new GraphqlResponseError(requestOptions, headers, response.data);
14225
14181
  }
14226
14182
  return response.data.data;
14227
14183
  });
14228
14184
  }
14229
- function withDefaults4(request$1, newDefaults) {
14185
+ function withDefaults3(request$1, newDefaults) {
14230
14186
  const newRequest = request$1.defaults(newDefaults);
14231
14187
  const newApi = (query, options) => {
14232
- return graphql2(newRequest, query, options);
14188
+ return graphql(newRequest, query, options);
14233
14189
  };
14234
14190
  return Object.assign(newApi, {
14235
- defaults: withDefaults4.bind(null, newRequest),
14191
+ defaults: withDefaults3.bind(null, newRequest),
14236
14192
  endpoint: request.endpoint
14237
14193
  });
14238
14194
  }
14239
- function withCustomRequest2(customRequest) {
14240
- return withDefaults4(customRequest, {
14195
+ function withCustomRequest(customRequest) {
14196
+ return withDefaults3(customRequest, {
14241
14197
  method: "POST",
14242
14198
  url: "/graphql"
14243
14199
  });
14244
14200
  }
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"() {
14201
+ var VERSION3, GraphqlResponseError, NON_VARIABLE_OPTIONS, FORBIDDEN_VARIABLE_OPTIONS, GHES_V3_SUFFIX_REGEX, graphql$1;
14202
+ var init_dist_web6 = __esm({
14203
+ "node_modules/@octokit/graphql/dist-web/index.js"() {
14248
14204
  init_dist_web5();
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";
14205
+ init_dist_web();
14206
+ VERSION3 = "4.8.0";
14207
+ GraphqlResponseError = class extends Error {
14208
+ constructor(request2, headers, response) {
14209
+ super(_buildMessageForResponseErrors(response));
14258
14210
  this.request = request2;
14211
+ this.headers = headers;
14212
+ this.response = response;
14213
+ this.name = "GraphqlResponseError";
14214
+ this.errors = response.errors;
14215
+ this.data = response.data;
14259
14216
  if (Error.captureStackTrace) {
14260
14217
  Error.captureStackTrace(this, this.constructor);
14261
14218
  }
14262
14219
  }
14263
14220
  };
14264
- NON_VARIABLE_OPTIONS2 = [
14221
+ NON_VARIABLE_OPTIONS = [
14265
14222
  "method",
14266
14223
  "baseUrl",
14267
14224
  "url",
@@ -14270,10 +14227,11 @@ var init_dist_web9 = __esm({
14270
14227
  "query",
14271
14228
  "mediaType"
14272
14229
  ];
14273
- GHES_V3_SUFFIX_REGEX2 = /\/api\/v3\/?$/;
14274
- graphql$12 = withDefaults4(request, {
14230
+ FORBIDDEN_VARIABLE_OPTIONS = ["query", "method", "url"];
14231
+ GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/;
14232
+ graphql$1 = withDefaults3(request, {
14275
14233
  headers: {
14276
- "user-agent": `octokit-graphql.js/${VERSION9} ${getUserAgent3()}`
14234
+ "user-agent": `octokit-graphql.js/${VERSION3} ${getUserAgent()}`
14277
14235
  },
14278
14236
  method: "POST",
14279
14237
  url: "/graphql"
@@ -14281,11 +14239,11 @@ var init_dist_web9 = __esm({
14281
14239
  }
14282
14240
  });
14283
14241
 
14284
- // node_modules/putasset/node_modules/@octokit/auth-token/dist-web/index.js
14285
- async function auth2(token) {
14242
+ // node_modules/@octokit/auth-token/dist-web/index.js
14243
+ async function auth(token) {
14286
14244
  const isApp = token.split(/\./).length === 3;
14287
- const isInstallation = REGEX_IS_INSTALLATION_LEGACY2.test(token) || REGEX_IS_INSTALLATION2.test(token);
14288
- const isUserToServer = REGEX_IS_USER_TO_SERVER2.test(token);
14245
+ const isInstallation = REGEX_IS_INSTALLATION_LEGACY.test(token) || REGEX_IS_INSTALLATION.test(token);
14246
+ const isUserToServer = REGEX_IS_USER_TO_SERVER.test(token);
14289
14247
  const tokenType = isApp ? "app" : isInstallation ? "installation" : isUserToServer ? "user-to-server" : "oauth";
14290
14248
  return {
14291
14249
  type: "token",
@@ -14293,24 +14251,24 @@ async function auth2(token) {
14293
14251
  tokenType
14294
14252
  };
14295
14253
  }
14296
- function withAuthorizationPrefix2(token) {
14254
+ function withAuthorizationPrefix(token) {
14297
14255
  if (token.split(/\./).length === 3) {
14298
14256
  return `bearer ${token}`;
14299
14257
  }
14300
14258
  return `token ${token}`;
14301
14259
  }
14302
- async function hook2(token, request2, route, parameters) {
14260
+ async function hook(token, request2, route, parameters) {
14303
14261
  const endpoint2 = request2.endpoint.merge(route, parameters);
14304
- endpoint2.headers.authorization = withAuthorizationPrefix2(token);
14262
+ endpoint2.headers.authorization = withAuthorizationPrefix(token);
14305
14263
  return request2(endpoint2);
14306
14264
  }
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) {
14265
+ var REGEX_IS_INSTALLATION_LEGACY, REGEX_IS_INSTALLATION, REGEX_IS_USER_TO_SERVER, createTokenAuth;
14266
+ var init_dist_web7 = __esm({
14267
+ "node_modules/@octokit/auth-token/dist-web/index.js"() {
14268
+ REGEX_IS_INSTALLATION_LEGACY = /^v1\./;
14269
+ REGEX_IS_INSTALLATION = /^ghs_/;
14270
+ REGEX_IS_USER_TO_SERVER = /^ghu_/;
14271
+ createTokenAuth = function createTokenAuth2(token) {
14314
14272
  if (!token) {
14315
14273
  throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
14316
14274
  }
@@ -14318,31 +14276,170 @@ var init_dist_web10 = __esm({
14318
14276
  throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");
14319
14277
  }
14320
14278
  token = token.replace(/^(token|bearer) +/i, "");
14321
- return Object.assign(auth2.bind(null, token), {
14322
- hook: hook2.bind(null, token)
14279
+ return Object.assign(auth.bind(null, token), {
14280
+ hook: hook.bind(null, token)
14323
14281
  });
14324
14282
  };
14325
14283
  }
14326
14284
  });
14327
14285
 
14286
+ // node_modules/@octokit/plugin-request-log/dist-web/index.js
14287
+ function requestLog(octokit) {
14288
+ octokit.hook.wrap("request", (request2, options) => {
14289
+ octokit.log.debug("request", options);
14290
+ const start = Date.now();
14291
+ const requestOptions = octokit.request.endpoint.parse(options);
14292
+ const path = requestOptions.url.replace(options.baseUrl, "");
14293
+ return request2(options).then((response) => {
14294
+ octokit.log.info(`${requestOptions.method} ${path} - ${response.status} in ${Date.now() - start}ms`);
14295
+ return response;
14296
+ }).catch((error) => {
14297
+ octokit.log.info(`${requestOptions.method} ${path} - ${error.status} in ${Date.now() - start}ms`);
14298
+ throw error;
14299
+ });
14300
+ });
14301
+ }
14302
+ var VERSION5;
14303
+ var init_dist_web8 = __esm({
14304
+ "node_modules/@octokit/plugin-request-log/dist-web/index.js"() {
14305
+ VERSION5 = "1.0.4";
14306
+ requestLog.VERSION = VERSION5;
14307
+ }
14308
+ });
14309
+
14310
+ // node_modules/@octokit/plugin-paginate-rest/dist-web/index.js
14311
+ function normalizePaginatedListResponse(response) {
14312
+ if (!response.data) {
14313
+ return {
14314
+ ...response,
14315
+ data: []
14316
+ };
14317
+ }
14318
+ const responseNeedsNormalization = "total_count" in response.data && !("url" in response.data);
14319
+ if (!responseNeedsNormalization)
14320
+ return response;
14321
+ const incompleteResults = response.data.incomplete_results;
14322
+ const repositorySelection = response.data.repository_selection;
14323
+ const totalCount = response.data.total_count;
14324
+ delete response.data.incomplete_results;
14325
+ delete response.data.repository_selection;
14326
+ delete response.data.total_count;
14327
+ const namespaceKey = Object.keys(response.data)[0];
14328
+ const data = response.data[namespaceKey];
14329
+ response.data = data;
14330
+ if (typeof incompleteResults !== "undefined") {
14331
+ response.data.incomplete_results = incompleteResults;
14332
+ }
14333
+ if (typeof repositorySelection !== "undefined") {
14334
+ response.data.repository_selection = repositorySelection;
14335
+ }
14336
+ response.data.total_count = totalCount;
14337
+ return response;
14338
+ }
14339
+ function iterator(octokit, route, parameters) {
14340
+ const options = typeof route === "function" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters);
14341
+ const requestMethod = typeof route === "function" ? route : octokit.request;
14342
+ const method = options.method;
14343
+ const headers = options.headers;
14344
+ let url = options.url;
14345
+ return {
14346
+ [Symbol.asyncIterator]: () => ({
14347
+ async next() {
14348
+ if (!url)
14349
+ return { done: true };
14350
+ try {
14351
+ const response = await requestMethod({ method, url, headers });
14352
+ const normalizedResponse = normalizePaginatedListResponse(response);
14353
+ url = ((normalizedResponse.headers.link || "").match(/<([^>]+)>;\s*rel="next"/) || [])[1];
14354
+ return { value: normalizedResponse };
14355
+ } catch (error) {
14356
+ if (error.status !== 409)
14357
+ throw error;
14358
+ url = "";
14359
+ return {
14360
+ value: {
14361
+ status: 200,
14362
+ headers: {},
14363
+ data: []
14364
+ }
14365
+ };
14366
+ }
14367
+ }
14368
+ })
14369
+ };
14370
+ }
14371
+ function paginate(octokit, route, parameters, mapFn) {
14372
+ if (typeof parameters === "function") {
14373
+ mapFn = parameters;
14374
+ parameters = void 0;
14375
+ }
14376
+ return gather(octokit, [], iterator(octokit, route, parameters)[Symbol.asyncIterator](), mapFn);
14377
+ }
14378
+ function gather(octokit, results, iterator2, mapFn) {
14379
+ return iterator2.next().then((result) => {
14380
+ if (result.done) {
14381
+ return results;
14382
+ }
14383
+ let earlyExit = false;
14384
+ function done() {
14385
+ earlyExit = true;
14386
+ }
14387
+ results = results.concat(mapFn ? mapFn(result.value, done) : result.value.data);
14388
+ if (earlyExit) {
14389
+ return results;
14390
+ }
14391
+ return gather(octokit, results, iterator2, mapFn);
14392
+ });
14393
+ }
14394
+ function paginateRest(octokit) {
14395
+ return {
14396
+ paginate: Object.assign(paginate.bind(null, octokit), {
14397
+ iterator: iterator.bind(null, octokit)
14398
+ })
14399
+ };
14400
+ }
14401
+ var VERSION6, composePaginateRest;
14402
+ var init_dist_web9 = __esm({
14403
+ "node_modules/@octokit/plugin-paginate-rest/dist-web/index.js"() {
14404
+ VERSION6 = "2.17.0";
14405
+ composePaginateRest = Object.assign(paginate, {
14406
+ iterator
14407
+ });
14408
+ paginateRest.VERSION = VERSION6;
14409
+ }
14410
+ });
14411
+
14412
+ // node_modules/putasset/node_modules/universal-user-agent/dist-web/index.js
14413
+ function getUserAgent2() {
14414
+ try {
14415
+ return navigator.userAgent;
14416
+ } catch (e) {
14417
+ return "<environment undetectable>";
14418
+ }
14419
+ }
14420
+ var init_dist_web10 = __esm({
14421
+ "node_modules/putasset/node_modules/universal-user-agent/dist-web/index.js"() {
14422
+ }
14423
+ });
14424
+
14328
14425
  // node_modules/putasset/node_modules/@octokit/core/dist-web/index.js
14329
- var import_before_after_hook2, VERSION10, Octokit3;
14426
+ var import_before_after_hook2, VERSION9, Octokit3;
14330
14427
  var init_dist_web11 = __esm({
14331
14428
  "node_modules/putasset/node_modules/@octokit/core/dist-web/index.js"() {
14332
- init_dist_web7();
14429
+ init_dist_web10();
14333
14430
  import_before_after_hook2 = __toModule(require_before_after_hook());
14334
14431
  init_dist_web5();
14335
- init_dist_web9();
14336
- init_dist_web10();
14337
- VERSION10 = "2.5.4";
14432
+ init_dist_web6();
14433
+ init_dist_web7();
14434
+ VERSION9 = "2.5.4";
14338
14435
  Octokit3 = class {
14339
14436
  constructor(options = {}) {
14340
- const hook3 = new import_before_after_hook2.Collection();
14437
+ const hook2 = new import_before_after_hook2.Collection();
14341
14438
  const requestDefaults = {
14342
14439
  baseUrl: request.endpoint.DEFAULTS.baseUrl,
14343
14440
  headers: {},
14344
14441
  request: Object.assign({}, options.request, {
14345
- hook: hook3.bind(null, "request")
14442
+ hook: hook2.bind(null, "request")
14346
14443
  }),
14347
14444
  mediaType: {
14348
14445
  previews: [],
@@ -14351,7 +14448,7 @@ var init_dist_web11 = __esm({
14351
14448
  };
14352
14449
  requestDefaults.headers["user-agent"] = [
14353
14450
  options.userAgent,
14354
- `octokit-core.js/${VERSION10} ${getUserAgent2()}`
14451
+ `octokit-core.js/${VERSION9} ${getUserAgent2()}`
14355
14452
  ].filter(Boolean).join(" ");
14356
14453
  if (options.baseUrl) {
14357
14454
  requestDefaults.baseUrl = options.baseUrl;
@@ -14363,7 +14460,7 @@ var init_dist_web11 = __esm({
14363
14460
  requestDefaults.headers["time-zone"] = options.timeZone;
14364
14461
  }
14365
14462
  this.request = request.defaults(requestDefaults);
14366
- this.graphql = withCustomRequest2(this.request).defaults({
14463
+ this.graphql = withCustomRequest(this.request).defaults({
14367
14464
  ...requestDefaults,
14368
14465
  baseUrl: requestDefaults.baseUrl.replace(/\/api\/v3$/, "/api")
14369
14466
  });
@@ -14375,23 +14472,23 @@ var init_dist_web11 = __esm({
14375
14472
  warn: console.warn.bind(console),
14376
14473
  error: console.error.bind(console)
14377
14474
  }, options.log);
14378
- this.hook = hook3;
14475
+ this.hook = hook2;
14379
14476
  if (!options.authStrategy) {
14380
14477
  if (!options.auth) {
14381
14478
  this.auth = async () => ({
14382
14479
  type: "unauthenticated"
14383
14480
  });
14384
14481
  } else {
14385
- const auth3 = createTokenAuth3(options.auth);
14386
- hook3.wrap("request", auth3.hook);
14387
- this.auth = auth3;
14482
+ const auth2 = createTokenAuth(options.auth);
14483
+ hook2.wrap("request", auth2.hook);
14484
+ this.auth = auth2;
14388
14485
  }
14389
14486
  } else {
14390
- const auth3 = options.authStrategy(Object.assign({
14487
+ const auth2 = options.authStrategy(Object.assign({
14391
14488
  request: this.request
14392
14489
  }, options.auth));
14393
- hook3.wrap("request", auth3.hook);
14394
- this.auth = auth3;
14490
+ hook2.wrap("request", auth2.hook);
14491
+ this.auth = auth2;
14395
14492
  }
14396
14493
  const classConstructor = this.constructor;
14397
14494
  classConstructor.plugins.forEach((plugin) => {
@@ -14430,113 +14527,11 @@ var init_dist_web11 = __esm({
14430
14527
  return NewOctokit;
14431
14528
  }
14432
14529
  };
14433
- Octokit3.VERSION = VERSION10;
14530
+ Octokit3.VERSION = VERSION9;
14434
14531
  Octokit3.plugins = [];
14435
14532
  }
14436
14533
  });
14437
14534
 
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
14535
  // node_modules/putasset/node_modules/@octokit/plugin-rest-endpoint-methods/dist-web/index.js
14541
14536
  function endpointsToMethods2(octokit, endpointsMap) {
14542
14537
  const newMethods = {};
@@ -14596,8 +14591,8 @@ function decorate2(octokit, scope, methodName, defaults, decorations) {
14596
14591
  function restEndpointMethods2(octokit) {
14597
14592
  return endpointsToMethods2(octokit, Endpoints2);
14598
14593
  }
14599
- var Endpoints2, VERSION12;
14600
- var init_dist_web13 = __esm({
14594
+ var Endpoints2, VERSION10;
14595
+ var init_dist_web12 = __esm({
14601
14596
  "node_modules/putasset/node_modules/@octokit/plugin-rest-endpoint-methods/dist-web/index.js"() {
14602
14597
  Endpoints2 = {
14603
14598
  actions: {
@@ -16589,8 +16584,8 @@ var init_dist_web13 = __esm({
16589
16584
  updateAuthenticated: ["PATCH /user"]
16590
16585
  }
16591
16586
  };
16592
- VERSION12 = "3.17.0";
16593
- restEndpointMethods2.VERSION = VERSION12;
16587
+ VERSION10 = "3.17.0";
16588
+ restEndpointMethods2.VERSION = VERSION10;
16594
16589
  }
16595
16590
  });
16596
16591
 
@@ -16599,16 +16594,16 @@ var dist_web_exports = {};
16599
16594
  __export(dist_web_exports, {
16600
16595
  Octokit: () => Octokit4
16601
16596
  });
16602
- var VERSION13, Octokit4;
16603
- var init_dist_web14 = __esm({
16597
+ var VERSION11, Octokit4;
16598
+ var init_dist_web13 = __esm({
16604
16599
  "node_modules/putasset/node_modules/@octokit/rest/dist-web/index.js"() {
16605
16600
  init_dist_web11();
16606
- init_dist_web6();
16601
+ init_dist_web8();
16602
+ init_dist_web9();
16607
16603
  init_dist_web12();
16608
- init_dist_web13();
16609
- VERSION13 = "17.11.2";
16610
- Octokit4 = Octokit3.plugin(requestLog, restEndpointMethods2, paginateRest2).defaults({
16611
- userAgent: `octokit-rest.js/${VERSION13}`
16604
+ VERSION11 = "17.11.2";
16605
+ Octokit4 = Octokit3.plugin(requestLog, restEndpointMethods2, paginateRest).defaults({
16606
+ userAgent: `octokit-rest.js/${VERSION11}`
16612
16607
  });
16613
16608
  }
16614
16609
  });
@@ -25236,7 +25231,7 @@ var require_putasset = __commonJS({
25236
25231
  promises
25237
25232
  } = require("fs");
25238
25233
  var { stat } = promises;
25239
- var { Octokit: Octokit5 } = (init_dist_web14(), dist_web_exports);
25234
+ var { Octokit: Octokit5 } = (init_dist_web13(), dist_web_exports);
25240
25235
  var mime = require_mime_types();
25241
25236
  var tryToCatch = require_try_to_catch();
25242
25237
  var removeAsset = require_remove_asset();
@@ -25356,7 +25351,7 @@ var require_package = __commonJS({
25356
25351
  "cli/package.json"(exports2, module2) {
25357
25352
  module2.exports = {
25358
25353
  name: "@napi-rs/cli",
25359
- version: "2.0.0-alpha.4",
25354
+ version: "2.0.0-alpha.5",
25360
25355
  description: "Cli tools for napi-rs",
25361
25356
  keywords: ["cli", "rust", "napi", "n-api", "neon"],
25362
25357
  author: "LongYinan <lynweklm@gmail.com>",
@@ -25844,6 +25839,9 @@ var BuildCommand = class extends import_clipanion2.Command {
25844
25839
  this.cargoCwd = import_clipanion2.Option.String("--cargo-cwd", {
25845
25840
  description: `The cwd of ${chalk2.underline(chalk2.yellow("Cargo.toml"))} file`
25846
25841
  });
25842
+ this.pipe = import_clipanion2.Option.String("--pipe", {
25843
+ description: `Pipe [${chalk2.green(".js/.ts")}] files to this command, eg ${chalk2.green("prettier -w")}`
25844
+ });
25847
25845
  this.destDir = import_clipanion2.Option.String({
25848
25846
  required: false
25849
25847
  });
@@ -25946,8 +25944,28 @@ var BuildCommand = class extends import_clipanion2.Command {
25946
25944
  }
25947
25945
  debug3(`Write binary content to [${chalk2.yellowBright(distModulePath)}]`);
25948
25946
  yield copyFileAsync(sourcePath, distModulePath);
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);
25947
+ const dtsFilePath = (0, import_path3.join)(process.cwd(), (_f = this.destDir) != null ? _f : ".", (_g = this.dts) != null ? _g : "index.d.ts");
25948
+ const idents = yield processIntermediateTypeFile(intermediateTypeFile, dtsFilePath);
25949
+ if (this.pipe) {
25950
+ const pipeCommand = `${this.pipe} ${dtsFilePath}`;
25951
+ console.info(`Run ${chalk2.green(pipeCommand)}`);
25952
+ try {
25953
+ (0, import_child_process2.execSync)(pipeCommand, { stdio: "inherit", env: process.env });
25954
+ } catch (e) {
25955
+ console.warn(chalk2.bgYellowBright("Pipe the dts file to command failed"), e);
25956
+ }
25957
+ }
25958
+ const jsBindingFilePath = this.jsBinding && this.jsBinding !== "false" ? (0, import_path3.join)(process.cwd(), this.jsBinding) : null;
25959
+ yield writeJsBinding(binaryName, packageName, jsBindingFilePath, idents);
25960
+ if (this.pipe && jsBindingFilePath) {
25961
+ const pipeCommand = `${this.pipe} ${jsBindingFilePath}`;
25962
+ console.info(`Run ${chalk2.green(pipeCommand)}`);
25963
+ try {
25964
+ (0, import_child_process2.execSync)(pipeCommand, { stdio: "inherit", env: process.env });
25965
+ } catch (e) {
25966
+ console.warn(chalk2.bgYellowBright("Pipe the js binding file to command failed"), e);
25967
+ }
25968
+ }
25951
25969
  });
25952
25970
  }
25953
25971
  };
@@ -26030,7 +26048,7 @@ function writeJsBinding(localName, packageName, distFileName, idents) {
26030
26048
  return `${acc}
26031
26049
  module.exports.${cur} = ${cur}`;
26032
26050
  }, "");
26033
- yield writeFileAsync(distFileName, template + declareCodes + exportsCode, "utf8");
26051
+ yield writeFileAsync(distFileName, template + declareCodes + exportsCode + "\n", "utf8");
26034
26052
  }
26035
26053
  });
26036
26054
  }
@@ -28099,17 +28117,17 @@ function loadDocuments(input, options) {
28099
28117
  }
28100
28118
  return state.documents;
28101
28119
  }
28102
- function loadAll$1(input, iterator3, options) {
28103
- if (iterator3 !== null && typeof iterator3 === "object" && typeof options === "undefined") {
28104
- options = iterator3;
28105
- iterator3 = null;
28120
+ function loadAll$1(input, iterator2, options) {
28121
+ if (iterator2 !== null && typeof iterator2 === "object" && typeof options === "undefined") {
28122
+ options = iterator2;
28123
+ iterator2 = null;
28106
28124
  }
28107
28125
  var documents = loadDocuments(input, options);
28108
- if (typeof iterator3 !== "function") {
28126
+ if (typeof iterator2 !== "function") {
28109
28127
  return documents;
28110
28128
  }
28111
28129
  for (var index = 0, length = documents.length; index < length; index += 1) {
28112
- iterator3(documents[index]);
28130
+ iterator2(documents[index]);
28113
28131
  }
28114
28132
  }
28115
28133
  function load$1(input, options) {
@@ -29622,151 +29640,17 @@ var import_path7 = __toModule(require("path"));
29622
29640
  init_dist_web();
29623
29641
  var import_before_after_hook = __toModule(require_before_after_hook());
29624
29642
  init_dist_web5();
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
29643
+ init_dist_web6();
29644
+ init_dist_web7();
29761
29645
  var VERSION4 = "3.5.1";
29762
29646
  var Octokit = class {
29763
29647
  constructor(options = {}) {
29764
- const hook3 = new import_before_after_hook.Collection();
29648
+ const hook2 = new import_before_after_hook.Collection();
29765
29649
  const requestDefaults = {
29766
29650
  baseUrl: request.endpoint.DEFAULTS.baseUrl,
29767
29651
  headers: {},
29768
29652
  request: Object.assign({}, options.request, {
29769
- hook: hook3.bind(null, "request")
29653
+ hook: hook2.bind(null, "request")
29770
29654
  }),
29771
29655
  mediaType: {
29772
29656
  previews: [],
@@ -29796,27 +29680,27 @@ var Octokit = class {
29796
29680
  warn: console.warn.bind(console),
29797
29681
  error: console.error.bind(console)
29798
29682
  }, options.log);
29799
- this.hook = hook3;
29683
+ this.hook = hook2;
29800
29684
  if (!options.authStrategy) {
29801
29685
  if (!options.auth) {
29802
29686
  this.auth = async () => ({
29803
29687
  type: "unauthenticated"
29804
29688
  });
29805
29689
  } else {
29806
- const auth3 = createTokenAuth(options.auth);
29807
- hook3.wrap("request", auth3.hook);
29808
- this.auth = auth3;
29690
+ const auth2 = createTokenAuth(options.auth);
29691
+ hook2.wrap("request", auth2.hook);
29692
+ this.auth = auth2;
29809
29693
  }
29810
29694
  } else {
29811
29695
  const { authStrategy, ...otherOptions } = options;
29812
- const auth3 = authStrategy(Object.assign({
29696
+ const auth2 = authStrategy(Object.assign({
29813
29697
  request: this.request,
29814
29698
  log: this.log,
29815
29699
  octokit: this,
29816
29700
  octokitOptions: otherOptions
29817
29701
  }, options.auth));
29818
- hook3.wrap("request", auth3.hook);
29819
- this.auth = auth3;
29702
+ hook2.wrap("request", auth2.hook);
29703
+ this.auth = auth2;
29820
29704
  }
29821
29705
  const classConstructor = this.constructor;
29822
29706
  classConstructor.plugins.forEach((plugin) => {
@@ -29850,104 +29734,8 @@ Octokit.VERSION = VERSION4;
29850
29734
  Octokit.plugins = [];
29851
29735
 
29852
29736
  // node_modules/@octokit/rest/dist-web/index.js
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;
29737
+ init_dist_web8();
29738
+ init_dist_web9();
29951
29739
 
29952
29740
  // node_modules/@octokit/plugin-rest-endpoint-methods/dist-web/index.js
29953
29741
  var Endpoints = {
@@ -1,2 +0,0 @@
1
- {"kind": "struct", "name": "Context", "def": ""}
2
- {"kind": "impl", "name": "Context", "def": " constructor()\n method(): string"}