From 21eff598017c705f0e1ddd89082e5246e8ce470b Mon Sep 17 00:00:00 2001 From: Aaron Goin Date: Fri, 9 May 2025 10:41:59 -0700 Subject: [PATCH 01/73] some cleanup and bringing over hidden files --- .eslintignore | 2 + .eslintrc.js | 5 + .gitignore | 3 + .npmignore | 5 + .prettierrc | 5 + build/api.js | 436 --------------- build/cli.js | 525 ------------------ build/commands/function.js | 124 ----- build/commands/generate/index.js | 527 ------------------ build/commands/generate/schemaTypes.js | 568 ------------------- build/commands/generate/types.js | 741 ------------------------- build/commands/model/generate.js | 385 ------------- build/commands/model/index.js | 19 - build/commands/model/train.js | 236 -------- build/commands/model/validate.js | 181 ------ build/commands/prepare.js | 209 ------- build/commands/setup.js | 311 ----------- build/commands/snippet.js | 121 ---- build/commands/sync.js | 261 --------- build/commands/tenant.js | 279 ---------- build/config.js | 29 - build/constants.js | 4 - build/deployables.js | 348 ------------ build/transpiler.js | 575 ------------------- build/types.js | 2 - build/utils.js | 259 --------- 26 files changed, 20 insertions(+), 6140 deletions(-) create mode 100644 .eslintignore create mode 100644 .eslintrc.js create mode 100644 .npmignore create mode 100644 .prettierrc delete mode 100644 build/api.js delete mode 100644 build/cli.js delete mode 100644 build/commands/function.js delete mode 100644 build/commands/generate/index.js delete mode 100644 build/commands/generate/schemaTypes.js delete mode 100644 build/commands/generate/types.js delete mode 100644 build/commands/model/generate.js delete mode 100644 build/commands/model/index.js delete mode 100644 build/commands/model/train.js delete mode 100644 build/commands/model/validate.js delete mode 100644 build/commands/prepare.js delete mode 100644 build/commands/setup.js delete mode 100644 build/commands/snippet.js delete mode 100644 build/commands/sync.js delete mode 100644 build/commands/tenant.js delete mode 100644 build/config.js delete mode 100644 build/constants.js delete mode 100644 build/deployables.js delete mode 100644 build/transpiler.js delete mode 100644 build/types.js delete mode 100644 build/utils.js diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..053082e --- /dev/null +++ b/.eslintignore @@ -0,0 +1,2 @@ +index.js +index.d.ts diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..bfa9662 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,5 @@ +module.exports = { + extends: [ + '../../.eslintrc.js', + ], +}; diff --git a/.gitignore b/.gitignore index 1170717..f04a890 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +build +.poly + # Logs logs *.log diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..a5f7989 --- /dev/null +++ b/.npmignore @@ -0,0 +1,5 @@ +src +tsconfig.json +tslint.json +.prettierrc +README_INTERNAL.md \ No newline at end of file diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..4510dc5 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,5 @@ +{ + "singleQuote": true, + "trailingComma": "all", + "endOfLine": "auto" +} diff --git a/build/api.js b/build/api.js deleted file mode 100644 index 86086f0..0000000 --- a/build/api.js +++ /dev/null @@ -1,436 +0,0 @@ -"use strict"; -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.deleteWebhook = exports.getWebhookByName = exports.createOrUpdateWebhook = exports.getProjectTemplatesConfig = exports.getAuthData = exports.getWebhookHandleDescription = exports.upsertSnippet = exports.getApiFunctionDescription = exports.getClientFunctionDescription = exports.getServerFunctionDescription = exports.validateWebhookHandleDto = exports.validateApiFunctionDto = exports.translateSpecification = exports.upsertSchema = exports.upsertWebhookHandle = exports.upsertApiFunction = exports.getLastTos = exports.resendVerificationCode = exports.verifyTenantSignUp = exports.createTenantSignUp = exports.deleteClientFunction = exports.getClientFunctionByName = exports.createOrUpdateClientFunction = exports.deleteServerFunction = exports.getServerFunctionByName = exports.createOrUpdateServerFunction = exports.getSpecs = void 0; -var axios_1 = require("axios"); -var http_proxy_agent_1 = require("http-proxy-agent"); -var https_proxy_agent_1 = require("https-proxy-agent"); -var https_1 = require("https"); -var dotenv_1 = require("dotenv"); -var utils_1 = require("@poly/common/utils"); -var constants_1 = require("@poly/common/constants"); -dotenv_1.default.config(); -var httpProxy = process.env.HTTP_PROXY || process.env.http_proxy || process.env.npm_config_proxy; -var httpsProxy = process.env.HTTPS_PROXY || process.env.https_proxy || process.env.npm_config_https_proxy; -var nodeEnv = process.env.NODE_ENV; -var isDevEnv = nodeEnv === 'development'; -var getApiBaseURL = function () { - if (isDevEnv) { - return process.env.POLY_API_BASE_URL; - } - else { - return process.env.POLY_API_BASE_URL.replace(/^http:/, 'https://'); - } -}; -var getApiHeaders = function () { - var _a; - return (_a = { - Authorization: "Bearer ".concat(process.env.POLY_API_KEY || '') - }, - _a[constants_1.POLY_API_VERSION_HEADER] = process.env.POLY_API_VERSION || '', - _a); -}; -var axios = axios_1.default.create({ - httpAgent: httpProxy - ? new http_proxy_agent_1.HttpProxyAgent(httpProxy) - : undefined, - httpsAgent: httpsProxy - ? new https_proxy_agent_1.HttpsProxyAgent(httpsProxy, { - rejectUnauthorized: !isDevEnv, - }) - : isDevEnv - ? new https_1.default.Agent({ rejectUnauthorized: false }) - : undefined, - proxy: false, -}); -var getSpecs = function (contexts, names, ids, noTypes) { return __awaiter(void 0, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, axios.get("".concat(getApiBaseURL(), "/specs"), { - headers: getApiHeaders(), - params: { - contexts: contexts, - names: names, - ids: ids, - noTypes: noTypes, - }, - })]; - case 1: return [2 /*return*/, (_a.sent()).data]; - } - }); -}); }; -exports.getSpecs = getSpecs; -var createOrUpdateServerFunction = function (context, name, description, code, typeSchemas, requirements, other, executionApiKey) { return __awaiter(void 0, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, axios.post("".concat(getApiBaseURL(), "/functions/server"), __assign({ context: context, name: name, description: description, code: code, typeSchemas: typeSchemas, requirements: requirements, executionApiKey: executionApiKey }, other), { - headers: __assign({ 'Content-Type': 'application/json' }, getApiHeaders()), - })]; - case 1: return [2 /*return*/, (_a.sent()).data]; - } - }); -}); }; -exports.createOrUpdateServerFunction = createOrUpdateServerFunction; -var getServerFunctionByName = function (context, name) { return __awaiter(void 0, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, axios.get("".concat(getApiBaseURL(), "/functions/server"), { - headers: __assign({ 'Content-Type': 'application/json' }, getApiHeaders()), - })]; - case 1: return [2 /*return*/, (_a.sent()).data.find(function (fn) { return fn.name === name && fn.context === context; })]; - } - }); -}); }; -exports.getServerFunctionByName = getServerFunctionByName; -var deleteServerFunction = function (id) { return __awaiter(void 0, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, axios.delete("".concat(getApiBaseURL(), "/functions/server/").concat(id), { - headers: __assign({ 'Content-Type': 'application/json' }, getApiHeaders()), - })]; - case 1: return [2 /*return*/, (_a.sent())]; - } - }); -}); }; -exports.deleteServerFunction = deleteServerFunction; -var createOrUpdateClientFunction = function (context, name, description, code, typeSchemas, other) { return __awaiter(void 0, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, axios.post("".concat(getApiBaseURL(), "/functions/client"), __assign({ context: context, name: name, description: description, code: code, typeSchemas: typeSchemas }, other), { - headers: __assign({ 'Content-Type': 'application/json' }, getApiHeaders()), - })]; - case 1: return [2 /*return*/, (_a.sent()).data]; - } - }); -}); }; -exports.createOrUpdateClientFunction = createOrUpdateClientFunction; -var getClientFunctionByName = function (context, name) { return __awaiter(void 0, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, axios.get("".concat(getApiBaseURL(), "/functions/client"), { - headers: __assign({ 'Content-Type': 'application/json' }, getApiHeaders()), - })]; - case 1: return [2 /*return*/, (_a.sent()).data.find(function (fn) { return fn.name === name && fn.context === context; })]; - } - }); -}); }; -exports.getClientFunctionByName = getClientFunctionByName; -var deleteClientFunction = function (id) { return __awaiter(void 0, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, axios.delete("".concat(getApiBaseURL(), "/functions/client/").concat(id), { - headers: __assign({ 'Content-Type': 'application/json' }, getApiHeaders()), - })]; - case 1: return [2 /*return*/, (_a.sent())]; - } - }); -}); }; -exports.deleteClientFunction = deleteClientFunction; -var createTenantSignUp = function (instance, email, tenantName) { - if (tenantName === void 0) { tenantName = null; } - return __awaiter(void 0, void 0, void 0, function () { - var _a; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: return [4 /*yield*/, axios.post("".concat((0, utils_1.getInstanceUrl)(instance), "/tenants/sign-up"), { - email: email, - tenantName: tenantName, - }, { - headers: (_a = { - 'Content-Type': 'application/json' - }, - _a[constants_1.POLY_API_VERSION_HEADER] = process.env.POLY_API_VERSION || '', - _a), - })]; - case 1: return [2 /*return*/, (_b.sent()).data]; - } - }); - }); -}; -exports.createTenantSignUp = createTenantSignUp; -var verifyTenantSignUp = function (instance, email, code) { return __awaiter(void 0, void 0, void 0, function () { - var _a; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: return [4 /*yield*/, axios.post("".concat((0, utils_1.getInstanceUrl)(instance), "/tenants/sign-up/verify"), { - code: code, - email: email, - }, { - headers: (_a = { - 'Content-Type': 'application/json' - }, - _a[constants_1.POLY_API_VERSION_HEADER] = process.env.POLY_API_VERSION || '', - _a), - })]; - case 1: return [2 /*return*/, (_b.sent()).data]; - } - }); -}); }; -exports.verifyTenantSignUp = verifyTenantSignUp; -var resendVerificationCode = function (instance, email) { - var _a; - return axios.post("".concat((0, utils_1.getInstanceUrl)(instance), "/tenants/sign-up/resend-verification-code"), { - email: email, - }, { - headers: (_a = {}, - _a[constants_1.POLY_API_VERSION_HEADER] = process.env.POLY_API_VERSION || '', - _a), - }); -}; -exports.resendVerificationCode = resendVerificationCode; -var getLastTos = function (instance) { return __awaiter(void 0, void 0, void 0, function () { - var _a; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: return [4 /*yield*/, axios.get("".concat((0, utils_1.getInstanceUrl)(instance), "/tos"), { - headers: (_a = {}, - _a[constants_1.POLY_API_VERSION_HEADER] = process.env.POLY_API_VERSION || '', - _a), - })]; - case 1: return [2 /*return*/, (_b.sent()).data]; - } - }); -}); }; -exports.getLastTos = getLastTos; -var upsertApiFunction = function (data) { return __awaiter(void 0, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, axios.put("".concat(getApiBaseURL(), "/functions/api"), data, { - headers: getApiHeaders(), - })]; - case 1: return [2 /*return*/, (_a.sent()).data]; - } - }); -}); }; -exports.upsertApiFunction = upsertApiFunction; -var upsertWebhookHandle = function (data) { return __awaiter(void 0, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, axios.put("".concat(getApiBaseURL(), "/webhooks"), data, { - headers: getApiHeaders(), - })]; - case 1: return [2 /*return*/, (_a.sent()).data]; - } - }); -}); }; -exports.upsertWebhookHandle = upsertWebhookHandle; -var upsertSchema = function (data) { return __awaiter(void 0, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, axios.put("".concat(getApiBaseURL(), "/schemas"), data, { - headers: getApiHeaders(), - })]; - case 1: return [2 /*return*/, (_a.sent()).data]; - } - }); -}); }; -exports.upsertSchema = upsertSchema; -var translateSpecification = function (contents, context, hostUrl, hostUrlAsArgument) { return __awaiter(void 0, void 0, void 0, function () { - var params, url; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - params = new URLSearchParams(); - if (context) - params.append('context', context); - if (hostUrl) - params.append('hostUrl', hostUrl); - if (hostUrlAsArgument) - params.append('hostUrlAsArgument', hostUrlAsArgument); - url = "".concat(getApiBaseURL(), "/specification-input/oas?").concat(params.toString()); - return [4 /*yield*/, axios.post(url, contents, { - headers: __assign({ 'Content-Type': 'text/plain' }, getApiHeaders()), - })]; - case 1: return [2 /*return*/, (_a.sent()).data]; - } - }); -}); }; -exports.translateSpecification = translateSpecification; -var validateApiFunctionDto = function (data) { return __awaiter(void 0, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, axios.post("".concat(getApiBaseURL(), "/specification-input/validation/api-function"), data, { - headers: getApiHeaders(), - })]; - case 1: return [2 /*return*/, (_a.sent()).data]; - } - }); -}); }; -exports.validateApiFunctionDto = validateApiFunctionDto; -var validateWebhookHandleDto = function (data) { return __awaiter(void 0, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, axios.post("".concat(getApiBaseURL(), "/specification-input/validation/webhook-handle"), data, { - headers: getApiHeaders(), - })]; - case 1: return [2 /*return*/, (_a.sent()).data]; - } - }); -}); }; -exports.validateWebhookHandleDto = validateWebhookHandleDto; -var getServerFunctionDescription = function (data) { return __awaiter(void 0, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, axios.post("".concat(getApiBaseURL(), "/functions/server/description-generation"), data, { - headers: getApiHeaders(), - })]; - case 1: return [2 /*return*/, (_a.sent()).data]; - } - }); -}); }; -exports.getServerFunctionDescription = getServerFunctionDescription; -var getClientFunctionDescription = function (data) { return __awaiter(void 0, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, axios.post("".concat(getApiBaseURL(), "/functions/client/description-generation"), data, { - headers: getApiHeaders(), - })]; - case 1: return [2 /*return*/, (_a.sent()).data]; - } - }); -}); }; -exports.getClientFunctionDescription = getClientFunctionDescription; -var getApiFunctionDescription = function (data) { return __awaiter(void 0, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, axios.post("".concat(getApiBaseURL(), "/functions/api/description-generation"), data, { - headers: getApiHeaders(), - })]; - case 1: return [2 /*return*/, (_a.sent()).data]; - } - }); -}); }; -exports.getApiFunctionDescription = getApiFunctionDescription; -var upsertSnippet = function (data) { return __awaiter(void 0, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, axios.put("".concat(getApiBaseURL(), "/snippets"), data, { - headers: getApiHeaders(), - })]; - case 1: return [2 /*return*/, (_a.sent())]; - } - }); -}); }; -exports.upsertSnippet = upsertSnippet; -var getWebhookHandleDescription = function (data) { return __awaiter(void 0, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, axios.post("".concat(getApiBaseURL(), "/webhooks/description-generation"), data, { - headers: getApiHeaders(), - })]; - case 1: return [2 /*return*/, (_a.sent()).data]; - } - }); -}); }; -exports.getWebhookHandleDescription = getWebhookHandleDescription; -var getAuthData = function (baseUrl, apiKey) { return __awaiter(void 0, void 0, void 0, function () { - var _a; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: return [4 /*yield*/, axios.get("".concat(baseUrl, "/auth"), { - headers: (_a = { - Authorization: "Bearer ".concat(apiKey) - }, - _a[constants_1.POLY_API_VERSION_HEADER] = process.env.POLY_API_VERSION || '', - _a), - })]; - case 1: return [2 /*return*/, (_b.sent()).data]; - } - }); -}); }; -exports.getAuthData = getAuthData; -var getProjectTemplatesConfig = function (baseUrl, apiKey, tenantId, environmentId) { return __awaiter(void 0, void 0, void 0, function () { - var _a; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: return [4 /*yield*/, axios.get("".concat(baseUrl, "/tenants/").concat(tenantId, "/environments/").concat(environmentId, "/config-variables/ProjectTemplates"), { - headers: (_a = { - Authorization: "Bearer ".concat(apiKey) - }, - _a[constants_1.POLY_API_VERSION_HEADER] = process.env.POLY_API_VERSION || '', - _a), - })]; - case 1: return [2 /*return*/, (_b.sent()).data.value]; - } - }); -}); }; -exports.getProjectTemplatesConfig = getProjectTemplatesConfig; -var createOrUpdateWebhook = function (context, name, description, config) { return __awaiter(void 0, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, axios.put("".concat(getApiBaseURL(), "/webhooks"), __assign({ context: context, name: name, description: description }, config), { - headers: __assign({ 'Content-Type': 'application/json' }, getApiHeaders()), - })]; - case 1: return [2 /*return*/, (_a.sent()).data]; - } - }); -}); }; -exports.createOrUpdateWebhook = createOrUpdateWebhook; -var getWebhookByName = function (context, name) { return __awaiter(void 0, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, axios.get("".concat(getApiBaseURL(), "/webhooks"), { - headers: __assign({ 'Content-Type': 'application/json' }, getApiHeaders()), - })]; - case 1: return [2 /*return*/, (_a.sent()).data.find(function (webhook) { return webhook.name === name && webhook.context === context; })]; - } - }); -}); }; -exports.getWebhookByName = getWebhookByName; -var deleteWebhook = function (webhookId) { return __awaiter(void 0, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, axios.delete("".concat(getApiBaseURL(), "/webhooks/").concat(webhookId), { - headers: __assign({ 'Content-Type': 'application/json' }, getApiHeaders()), - })]; - case 1: return [2 /*return*/, (_a.sent())]; - } - }); -}); }; -exports.deleteWebhook = deleteWebhook; diff --git a/build/cli.js b/build/cli.js deleted file mode 100644 index 027ab13..0000000 --- a/build/cli.js +++ /dev/null @@ -1,525 +0,0 @@ -#!/usr/bin/env node -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -/* tslint:disable:no-shadowed-variable */ -var yargs_1 = require("yargs"); -var shelljs_1 = require("shelljs"); -var chalk_1 = require("chalk"); -var uuid_1 = require("uuid"); -var config_1 = require("./config"); -var constants_1 = require("./constants"); -var utils_1 = require("./utils"); -if (process.env.NO_COLOR) { - // Support NO_COLOR env variable https://no-color.org/ - chalk_1.default.level = 0; -} -var checkPolyConfig = function (polyPath) { - (0, config_1.loadConfig)(polyPath); - if (!process.env.POLY_API_KEY) { - return false; - } - return true; -}; -void yargs_1.default - .usage('$0 [args]') - .command('setup [baseUrl] [apiKey]', 'Setups your Poly connection', function (yargs) { - return yargs - .positional('baseUrl', { - describe: 'The base URL for the Poly connection', - type: 'string', - }) - .positional('apiKey', { - describe: 'Your Poly API key for authentication', - type: 'string', - }) - .option('apiVersion', { - describe: 'The version of the API to use.', - type: 'string', - choices: ['1', '2'], - default: '1', - }); -}, function (argv) { return __awaiter(void 0, void 0, void 0, function () { - var setup; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, Promise.resolve().then(function () { return require('./commands/setup'); })]; - case 1: - setup = (_a.sent()).default; - return [4 /*yield*/, setup(constants_1.DEFAULT_POLY_PATH, argv.baseUrl, argv.apiKey, argv.apiVersion)]; - case 2: - _a.sent(); - return [2 /*return*/]; - } - }); -}); }) - .command('generate [options]', 'Generates Poly library', function (yargs) { - return yargs.parserConfiguration({ 'boolean-negation': false }).options({ - contexts: { - describe: 'Contexts to generate', - demandOption: false, - type: 'string', - }, - names: { - describe: 'Names to generate', - demandOption: false, - type: 'string', - }, - functionIds: { - describe: 'Function IDs to generate', - demandOption: false, - type: 'string', - }, - customPath: { - describe: 'Custom path to .poly directory (internal use only)', - demandOption: false, - type: 'string', - }, - noTypes: { - describe: 'Skip generating type definitions', - demandOption: false, - type: 'boolean', - alias: 'no-types', - }, - }); -}, function (_a) { - var exitWhenNoConfig = _a.exitWhenNoConfig, contexts = _a.contexts, names = _a.names, functionIds = _a.functionIds, _b = _a.customPath, customPath = _b === void 0 ? constants_1.DEFAULT_POLY_PATH : _b, _c = _a.noTypes, noTypes = _c === void 0 ? false : _c; - return __awaiter(void 0, void 0, void 0, function () { - var setup, generate; - return __generator(this, function (_d) { - switch (_d.label) { - case 0: - if (!!checkPolyConfig(customPath)) return [3 /*break*/, 3]; - if (exitWhenNoConfig) { - shelljs_1.default.echo('Poly is not configured. Please run `poly generate` manually.'); - return [2 /*return*/]; - } - return [4 /*yield*/, Promise.resolve().then(function () { return require('./commands/setup'); })]; - case 1: - setup = (_d.sent()).default; - return [4 /*yield*/, setup(customPath)]; - case 2: - _d.sent(); - _d.label = 3; - case 3: return [4 /*yield*/, Promise.resolve().then(function () { return require('./commands/generate'); })]; - case 4: - generate = (_d.sent()).generate; - return [4 /*yield*/, generate({ - polyPath: customPath, - contexts: contexts === null || contexts === void 0 ? void 0 : contexts.split(','), - names: names === null || names === void 0 ? void 0 : names.split(','), - functionIds: functionIds === null || functionIds === void 0 ? void 0 : functionIds.split(','), - noTypes: noTypes, - })]; - case 5: - _d.sent(); - return [2 /*return*/]; - } - }); - }); -}) - .command('prepare [options]', 'Find and prepare all Poly deployables', function (yargs) { - return yargs - .usage('$0 prepare [options]') - .option('lazy', { - describe: 'Skip prepare work if the cache is up to date. (Relies on `git`)', - type: 'boolean', - default: false, - }) - .option('disable-docs', { - describe: 'Don\'t write any JSDocs into the deployable files.', - type: 'boolean', - default: false, - }) - .option('disable-ai', { - describe: 'Don\'t use AI to fill in any missing descriptions.', - type: 'boolean', - default: false, - }); -}, function (_a) { - var disableDocs = _a.disableDocs, disableAi = _a.disableAi, lazy = _a.lazy; - return __awaiter(void 0, void 0, void 0, function () { - var prepareDeployables; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - if (!checkPolyConfig(constants_1.DEFAULT_POLY_PATH)) { - return [2 /*return*/, shelljs_1.default.echo('Poly is not configured. Please run `poly setup` to configure it.')]; - } - disableAi = disableAi || process.env.DISABLE_AI === 'true'; - return [4 /*yield*/, Promise.resolve().then(function () { return require('./commands/prepare'); })]; - case 1: - prepareDeployables = (_b.sent()).prepareDeployables; - return [4 /*yield*/, prepareDeployables(lazy, disableDocs, disableAi)]; - case 2: - _b.sent(); - return [2 /*return*/]; - } - }); - }); -}) - .command('sync [options]', 'Find and sync all Poly deployables', function (yargs) { - return yargs - .usage('$0 sync [options]') - .option('dry-run', { - describe: 'Run through sync steps with logging but don\'t make any changes.', - type: 'boolean', - default: false, - }) - .option('custom-path', { - describe: 'Custom path to .poly directory (internal use only)', - default: constants_1.DEFAULT_POLY_PATH, - type: 'string', - }); -}, function (_a) { - var dryRun = _a.dryRun, _b = _a.customPath, customPath = _b === void 0 ? constants_1.DEFAULT_POLY_PATH : _b; - return __awaiter(void 0, void 0, void 0, function () { - var prepareDeployables, syncDeployables; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - if (!checkPolyConfig(customPath)) { - return [2 /*return*/, shelljs_1.default.echo('Poly is not configured. Please run `poly setup` to configure it.')]; - } - return [4 /*yield*/, Promise.resolve().then(function () { return require('./commands/prepare'); })]; - case 1: - prepareDeployables = (_c.sent()).prepareDeployables; - // At this point everything should already be prepared - // So we're not going to add anything other than deployment receipts - return [4 /*yield*/, prepareDeployables(true, // lazy! - true, // don't write JSDocs - true)]; - case 2: - // At this point everything should already be prepared - // So we're not going to add anything other than deployment receipts - _c.sent(); - shelljs_1.default.echo('Syncing Poly deployments...'); - return [4 /*yield*/, Promise.resolve().then(function () { return require('./commands/sync'); })]; - case 3: - syncDeployables = (_c.sent()).syncDeployables; - return [4 /*yield*/, syncDeployables(dryRun)]; - case 4: - _c.sent(); - shelljs_1.default.echo('Poly deployments synced.'); - return [2 /*return*/]; - } - }); - }); -}) - .command('function ', 'Manages functions', function (yargs) { - yargs.command('add [options]', 'Adds a custom function', function (yargs) { - return yargs - .usage('$0 function add (--server | --client) [options]') - .default('context', '') - .positional('name', { - describe: 'Name of the function', - type: 'string', - }) - .positional('file', { - describe: 'Path to the function TS file', - type: 'string', - }) - .option('context', { - describe: 'Context of the function', - type: 'string', - }) - .option('description', { - describe: 'Description of the function', - type: 'string', - }) - .option('client', { - describe: 'Marks the function as a client function', - type: 'boolean', - }) - .option('server', { - describe: 'Marks the function as a server function', - type: 'boolean', - }) - .option('logs', { - describe: 'Server function only - `--logs=enabled` or `--logs=disabled` to enable to disable logging respectively', - type: 'string', - }) - .option('generateContexts', { - describe: 'Server function only - only include certain contexts to speed up function execution', - type: 'string', - }) - .option('execution-api-key', { - describe: 'Optional API key for server functions', - type: 'string', - }); - }, function (_a) { - var name = _a.name, description = _a.description, file = _a.file, context = _a.context, client = _a.client, server = _a.server, logs = _a.logs, generateContexts = _a.generateContexts, executionApiKey = _a.executionApiKey; - return __awaiter(void 0, void 0, void 0, function () { - var logsEnabled, err, addOrUpdateCustomFunction; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - logsEnabled = logs === 'enabled' ? true : logs === 'disabled' ? false : undefined; - err = !name - ? 'Missing function name.' - : !file - ? 'Missing function file path.' - : (!client && !server) - ? 'You must specify `--server` or `--client`.`' - : (client && server) - ? 'Specify either `--server` or `--client`. Found both.' - : (generateContexts && !server) - ? 'Option `generateContexts` is only for server functions (--server).' - : (logs && !server) - ? 'Option `logs` is only for server functions (--server).' - : (logs && logsEnabled === undefined) - ? 'Invalid value for `logs` option.' - : (executionApiKey && !(0, uuid_1.validate)(executionApiKey)) - ? 'Invalid value for `execution-api-key`. Must be a valid PolyAPI Key.' - : ''; - if (err) { - shelljs_1.default.echo(chalk_1.default.redBright('ERROR:'), err); - yargs.showHelp(); - return [2 /*return*/]; - } - return [4 /*yield*/, Promise.resolve().then(function () { return require('./commands/function'); })]; - case 1: - addOrUpdateCustomFunction = (_b.sent()).addOrUpdateCustomFunction; - return [4 /*yield*/, addOrUpdateCustomFunction(constants_1.DEFAULT_POLY_PATH, context, name, description, file, server, logsEnabled, generateContexts, executionApiKey)]; - case 2: - _b.sent(); - return [2 /*return*/]; - } - }); - }); - }); -}) - .command('tenant ', 'Manages tenants', function (yargs) { - yargs.command('create [options]', 'Creates a new tenant', { - instance: { - describe: 'Instance where you want to create tenant (develop | na1 | local)', - demandOption: false, - type: 'string', - }, - }, function (_a) { - var _b = _a.instance, instance = _b === void 0 ? 'na1' : _b; - return __awaiter(void 0, void 0, void 0, function () { - var create; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: return [4 /*yield*/, Promise.resolve().then(function () { return require('./commands/tenant'); })]; - case 1: - create = (_c.sent()).create; - return [4 /*yield*/, create(instance)]; - case 2: - _c.sent(); - return [2 /*return*/]; - } - }); - }); - }); -}) - .command('model ', 'Manages models.', function (yargs) { return __awaiter(void 0, void 0, void 0, function () { - return __generator(this, function (_a) { - yargs.command('generate [destination] [options]', 'Generates a new model.', function (yargs) { return yargs.positional('path', { - type: 'string', - demandOption: true, - describe: 'Path to open api specification file.', - }).positional('destination', { - type: 'string', - describe: 'Path to destination poly schema file.', - demandOption: false, - }).option('context', { - describe: 'Context for all api functions.', - type: 'string', - }).option('hostUrl', { - describe: 'Hardcode the hostUrl to use for all api functions. Leave undefined to use the server url specified in the specification file, if one is specified.', - type: 'string', - }).option('hostUrlAsArgument', { - describe: 'Require the host url as an argument to be passed in when calling an api function. Value passed in will be used as the argument name, or if left empty will default to "hostUrl".', - type: 'string', - }).options('disable-ai', { - describe: 'Disable ai generation.', - boolean: true, - }) - .options('rename', { - describe: 'List of name mappings, ex. `--rename foo:bar "Old key:New key"` would rename all instances of "foo" with "bar" and "Old key" with "New key".', - type: 'array', - }); }, function (_a) { - var path = _a.path, destination = _a.destination, context = _a.context, hostUrl = _a.hostUrl, hostUrlAsArgument = _a.hostUrlAsArgument, disableAi = _a.disableAi, _b = _a.rename, rename = _b === void 0 ? [] : _b; - return __awaiter(void 0, void 0, void 0, function () { - var preparedRenames, _i, rename_1, mappings, _c, _d, prevName, _e, newName, generateModel; - return __generator(this, function (_f) { - switch (_f.label) { - case 0: - if (!checkPolyConfig(constants_1.DEFAULT_POLY_PATH)) { - return [2 /*return*/, shelljs_1.default.echo('Poly is not configured. Please run `poly setup` to configure it.')]; - } - if (!path) { - yargs.showHelp(); - return [2 /*return*/]; - } - if (hostUrl && !(0, utils_1.isValidHttpUrl)(hostUrl)) { - return [2 /*return*/, shelljs_1.default.echo("".concat(hostUrl, " is not a valid url"))]; - } - preparedRenames = []; - for (_i = 0, rename_1 = rename; _i < rename_1.length; _i++) { - mappings = rename_1[_i]; - _c = "".concat(mappings).split(':'), _d = _c[0], prevName = _d === void 0 ? '' : _d, _e = _c[1], newName = _e === void 0 ? '' : _e; - if (!prevName || !newName) { - shelljs_1.default.echo(chalk_1.default.redBright('ERROR:'), "Invalid rename mapping from \"".concat(prevName, "\" to \"").concat(newName, "\".")); - yargs.showHelp(); - return [2 /*return*/]; - } - preparedRenames.push([prevName, newName]); - } - return [4 /*yield*/, Promise.resolve().then(function () { return require('./commands/model'); })]; - case 1: - generateModel = (_f.sent()).generateModel; - return [4 /*yield*/, generateModel(path, destination, context, hostUrl, hostUrlAsArgument, !!disableAi, preparedRenames)]; - case 2: - _f.sent(); - return [2 /*return*/]; - } - }); - }); - }).command('validate ', 'Validates a Poly model', { - path: { - type: 'string', - demandOption: true, - describe: 'Path to Poly model file.', - }, - }, function (_a) { - var path = _a.path; - return __awaiter(void 0, void 0, void 0, function () { - var validateModel; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - if (!checkPolyConfig(constants_1.DEFAULT_POLY_PATH)) { - return [2 /*return*/, shelljs_1.default.echo('Poly is not configured. Please run `poly setup` to configure it.')]; - } - if (!path) { - yargs.showHelp(); - return [2 /*return*/]; - } - return [4 /*yield*/, Promise.resolve().then(function () { return require('./commands/model'); })]; - case 1: - validateModel = (_b.sent()).validateModel; - validateModel(path); - return [2 /*return*/]; - } - }); - }); - }).command('train ', 'Train generated Poly model.', { - path: { - type: 'string', - demandOption: true, - describe: 'Path to Poly model file.', - }, - }, function (_a) { - var path = _a.path; - return __awaiter(void 0, void 0, void 0, function () { - var train; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - if (!checkPolyConfig(constants_1.DEFAULT_POLY_PATH)) { - return [2 /*return*/, shelljs_1.default.echo('Poly is not configured. Please run `poly setup` to configure it.')]; - } - if (!path) { - yargs.showHelp(); - return [2 /*return*/]; - } - return [4 /*yield*/, Promise.resolve().then(function () { return require('./commands/model'); })]; - case 1: - train = (_b.sent()).train; - return [4 /*yield*/, train(constants_1.DEFAULT_POLY_PATH, path)]; - case 2: - _b.sent(); - return [2 /*return*/]; - } - }); - }); - }); - return [2 /*return*/]; - }); -}); }) - .command('snippet ', 'Manage snippets.', function (yargs) { return __awaiter(void 0, void 0, void 0, function () { - return __generator(this, function (_a) { - yargs.command('add [options]', 'Adds a new snippet.', function (yargs) { return yargs.positional('name', { - type: 'string', - demandOption: true, - describe: 'Snippet name.', - }).positional('path', { - type: 'string', - demandOption: true, - describe: 'Path to destination that contains snippet.', - }).option('context', { - type: 'string', - describe: 'Assign a context to this snippet', - }).option('description', { - type: 'string', - describe: 'Assign a description to this snippet', - }); }, function (_a) { - var name = _a.name, path = _a.path, context = _a.context, description = _a.description; - return __awaiter(void 0, void 0, void 0, function () { - var addSnippet; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - if (!checkPolyConfig(constants_1.DEFAULT_POLY_PATH)) { - return [2 /*return*/, shelljs_1.default.echo('Poly is not configured. Please run `poly setup` to configure it.')]; - } - if (!path) { - yargs.showHelp(); - return [2 /*return*/]; - } - return [4 /*yield*/, Promise.resolve().then(function () { return require('./commands/snippet'); })]; - case 1: - addSnippet = (_b.sent()).addSnippet; - return [4 /*yield*/, addSnippet(constants_1.DEFAULT_POLY_PATH, name, path, context || '', description || '')]; - case 2: - _b.sent(); - return [2 /*return*/]; - } - }); - }); - }); - return [2 /*return*/]; - }); -}); }) - // Use strict parsing so unrecognized commands or options will raise an error rather than fail silently - .strict(true) - .showHelpOnFail(true, 'Specify --help for available commands and options.') - .help(true).argv; diff --git a/build/commands/function.js b/build/commands/function.js deleted file mode 100644 index 5b3016a..0000000 --- a/build/commands/function.js +++ /dev/null @@ -1,124 +0,0 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.addOrUpdateCustomFunction = void 0; -/* eslint-disable @typescript-eslint/ban-ts-comment */ -var fs_1 = require("fs"); -var chalk_1 = require("chalk"); -var shelljs_1 = require("shelljs"); -var api_1 = require("../api"); -var config_1 = require("../config"); -var generate_1 = require("./generate"); -var transpiler_1 = require("../transpiler"); -var deployables_1 = require("../deployables"); -var addOrUpdateCustomFunction = function (polyPath, context, name, description, file, server, logsEnabled, generateContexts, executionApiKey) { return __awaiter(void 0, void 0, void 0, function () { - var code, tsConfigBaseUrl, customFunction, specs, functionSpec, updating, typeSchemas, dependencies, other, traceId, e_1; - var _a, _b; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - (0, config_1.loadConfig)(polyPath); - code = ''; - try { - code = fs_1.default.readFileSync(file, 'utf8'); - } - catch (err) { - // Handle various file-system related issues, or silly errors like the file not existing - shelljs_1.default.echo(chalk_1.default.redBright('ERROR:'), err); - return [2 /*return*/]; - } - tsConfigBaseUrl = (0, transpiler_1.getTSBaseUrl)(); - _c.label = 1; - case 1: - _c.trys.push([1, 8, , 9]); - customFunction = void 0; - return [4 /*yield*/, (0, api_1.getSpecs)([context], [name])]; - case 2: - specs = _c.sent(); - functionSpec = specs.find(function (spec) { return spec.name === name && spec.context === context; }); - updating = !!functionSpec; - if (server === undefined && updating) { - server = functionSpec.type === 'serverFunction'; - } - else { - server = server !== null && server !== void 0 ? server : false; - } - typeSchemas = (0, transpiler_1.generateTypeSchemas)(file, tsConfigBaseUrl, deployables_1.DeployableTypeEntries.map(function (d) { return d[0]; })); - if (!server) return [3 /*break*/, 4]; - shelljs_1.default.echo('-n', "".concat(updating ? 'Updating' : 'Adding', " custom server side function...")); - dependencies = (0, transpiler_1.getDependencies)(code, file, tsConfigBaseUrl); - if (dependencies.length) { - shelljs_1.default.echo(chalk_1.default.yellow('Please note that deploying your functions will take a few minutes because it makes use of libraries other than polyapi.')); - } - other = {}; - if (generateContexts) - other.generateContexts = generateContexts.split(','); - if (logsEnabled !== undefined) - other.logsEnabled = logsEnabled; - return [4 /*yield*/, (0, api_1.createOrUpdateServerFunction)(context, name, description, code, typeSchemas, dependencies, other, executionApiKey)]; - case 3: - customFunction = _c.sent(); - traceId = customFunction.traceId; - if (traceId) { - shelljs_1.default.echo(chalk_1.default.yellow('\nWarning:'), 'Failed to generate descriptions while deploying the server function, trace id:', chalk_1.default.bold(traceId)); - } - shelljs_1.default.echo(chalk_1.default.green('DEPLOYED')); - shelljs_1.default.echo("Function ID: ".concat(customFunction.id)); - return [3 /*break*/, 6]; - case 4: - shelljs_1.default.echo('-n', "".concat(updating ? 'Updating' : 'Adding', " Client Function to PolyAPI Catalog...")); - return [4 /*yield*/, (0, api_1.createOrUpdateClientFunction)(context, name, description, code, typeSchemas)]; - case 5: - customFunction = _c.sent(); - shelljs_1.default.echo(chalk_1.default.green('DONE')); - shelljs_1.default.echo("Client Function ID: ".concat(customFunction.id)); - _c.label = 6; - case 6: return [4 /*yield*/, (0, generate_1.generateSingleCustomFunction)(polyPath, customFunction.id, updating)]; - case 7: - _c.sent(); - return [3 /*break*/, 9]; - case 8: - e_1 = _c.sent(); - shelljs_1.default.echo(chalk_1.default.red('ERROR\n')); - shelljs_1.default.echo("".concat(((_b = (_a = e_1.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.message) || e_1.message)); - return [3 /*break*/, 9]; - case 9: return [2 /*return*/]; - } - }); -}); }; -exports.addOrUpdateCustomFunction = addOrUpdateCustomFunction; diff --git a/build/commands/generate/index.js b/build/commands/generate/index.js deleted file mode 100644 index cb61df7..0000000 --- a/build/commands/generate/index.js +++ /dev/null @@ -1,527 +0,0 @@ -"use strict"; -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.generateSingleCustomFunction = exports.generate = exports.generateSpecs = void 0; -var fs_1 = require("fs"); -var handlebars_1 = require("handlebars"); -var chalk_1 = require("chalk"); -var shelljs_1 = require("shelljs"); -var uuid_1 = require("uuid"); -var utils_1 = require("@poly/common/utils"); -var specs_1 = require("@poly/common/specs"); -var api_1 = require("../../api"); -var config_1 = require("../../config"); -var utils_2 = require("../../utils"); -var constants_1 = require("../../constants"); -var types_1 = require("./types"); -var schemaTypes_1 = require("./schemaTypes"); -var fsWriteAsync = function (file, data) { - return new Promise(function (resolve, reject) { - fs_1.default.writeFile(file, data, function (err) { return err ? reject(err) : resolve(); }); - }); -}; -var getApiBaseUrl = function () { return process.env.POLY_API_BASE_URL || 'http://localhost:8000'; }; -var getApiKey = function () { return process.env.POLY_API_KEY; }; -var prepareDir = function (polyPath) { return __awaiter(void 0, void 0, void 0, function () { - var libPath, err_1; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - libPath = (0, utils_2.getPolyLibPath)(polyPath); - fs_1.default.rmSync(libPath, { recursive: true, force: true }); - fs_1.default.mkdirSync(libPath, { recursive: true }); - fs_1.default.mkdirSync("".concat(libPath, "/api")); - fs_1.default.mkdirSync("".concat(libPath, "/client")); - fs_1.default.mkdirSync("".concat(libPath, "/auth")); - fs_1.default.mkdirSync("".concat(libPath, "/webhooks")); - fs_1.default.mkdirSync("".concat(libPath, "/server")); - fs_1.default.mkdirSync("".concat(libPath, "/vari")); - fs_1.default.mkdirSync("".concat(libPath, "/schemas")); - if (!(polyPath !== constants_1.DEFAULT_POLY_PATH)) return [3 /*break*/, 4]; - _a.label = 1; - case 1: - _a.trys.push([1, 3, , 4]); - return [4 /*yield*/, generateRedirectIndexFiles(polyPath)]; - case 2: - _a.sent(); - return [3 /*break*/, 4]; - case 3: - err_1 = _a.sent(); - shelljs_1.default.echo(chalk_1.default.red("Could not generate redirect index files: ".concat(err_1.message, ", continuing..."))); - return [3 /*break*/, 4]; - case 4: return [2 /*return*/]; - } - }); -}); }; -var generateRedirectIndexFiles = function (polyPath) { return __awaiter(void 0, void 0, void 0, function () { - var defaultPolyLib, indexRedirectJSTemplate, indexTSRedirectJSTemplate; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - defaultPolyLib = (0, utils_2.getPolyLibPath)(constants_1.DEFAULT_POLY_PATH); - polyPath = polyPath.startsWith('/') ? polyPath : "../../../".concat(polyPath); - fs_1.default.rmSync(defaultPolyLib, { recursive: true, force: true }); - fs_1.default.mkdirSync(defaultPolyLib, { recursive: true }); - indexRedirectJSTemplate = handlebars_1.default.compile((0, utils_2.loadTemplate)('index-redirect.js.hbs')); - indexTSRedirectJSTemplate = handlebars_1.default.compile((0, utils_2.loadTemplate)('index-redirect.d.ts.hbs')); - return [4 /*yield*/, Promise.all([ - fsWriteAsync("".concat(defaultPolyLib, "/index.js"), indexRedirectJSTemplate({ polyPath: polyPath })), - fsWriteAsync("".concat(defaultPolyLib, "/index.d.ts"), indexTSRedirectJSTemplate({ polyPath: polyPath })), - ])]; - case 1: - _a.sent(); - return [2 /*return*/]; - } - }); -}); }; -var generateJSFiles = function (libPath, specs) { return __awaiter(void 0, void 0, void 0, function () { - var apiFunctions, customFunctions, webhookHandles, authFunctions, serverFunctions, serverVariables, customFnCodeGenerationErrors; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - apiFunctions = specs.filter(function (spec) { return spec.type === 'apiFunction'; }); - customFunctions = specs - .filter(function (spec) { return spec.type === 'customFunction'; }) - .filter(function (spec) { return spec.language === 'javascript'; }); - webhookHandles = specs.filter(function (spec) { return spec.type === 'webhookHandle'; }); - authFunctions = specs.filter(function (spec) { return spec.type === 'authFunction'; }); - serverFunctions = specs.filter(function (spec) { return spec.type === 'serverFunction'; }); - serverVariables = specs.filter(function (spec) { return spec.type === 'serverVariable'; }); - return [4 /*yield*/, generateIndexJSFile(libPath)]; - case 1: - _a.sent(); - return [4 /*yield*/, generatePolyCustomJSFile(libPath)]; - case 2: - _a.sent(); - return [4 /*yield*/, generateAxiosJSFile(libPath)]; - case 3: - _a.sent(); - return [4 /*yield*/, generateErrorHandlerFile(libPath)]; - case 4: - _a.sent(); - return [4 /*yield*/, tryAsync(generateApiFunctionJSFiles(libPath, apiFunctions), 'api functions')]; - case 5: - _a.sent(); - return [4 /*yield*/, tryAsync(generateCustomFunctionJSFiles(libPath, customFunctions), 'custom functions')]; - case 6: - customFnCodeGenerationErrors = _a.sent(); - return [4 /*yield*/, tryAsync(generateWebhooksJSFiles(libPath, webhookHandles), 'webhooks')]; - case 7: - _a.sent(); - return [4 /*yield*/, tryAsync(generateAuthFunctionJSFiles(libPath, authFunctions), 'auth functions')]; - case 8: - _a.sent(); - return [4 /*yield*/, tryAsync(generateServerFunctionJSFiles(libPath, serverFunctions), 'server functions')]; - case 9: - _a.sent(); - return [4 /*yield*/, tryAsync(generateServerVariableJSFiles(libPath, serverVariables), 'variables')]; - case 10: - _a.sent(); - return [2 /*return*/, customFnCodeGenerationErrors]; - } - }); -}); }; -var generateIndexJSFile = function (libPath) { return __awaiter(void 0, void 0, void 0, function () { - var indexJSTemplate; - return __generator(this, function (_a) { - indexJSTemplate = handlebars_1.default.compile((0, utils_2.loadTemplate)('index.js.hbs')); - fs_1.default.writeFileSync("".concat(libPath, "/index.js"), indexJSTemplate({ - clientID: (0, uuid_1.v4)(), - apiBaseUrl: getApiBaseUrl(), - apiKey: getApiKey(), - })); - return [2 /*return*/]; - }); -}); }; -var generatePolyCustomJSFile = function (libPath) { return __awaiter(void 0, void 0, void 0, function () { - var polyCustomJSTemplate; - return __generator(this, function (_a) { - polyCustomJSTemplate = handlebars_1.default.compile((0, utils_2.loadTemplate)('poly-custom.js.hbs')); - fs_1.default.writeFileSync("".concat(libPath, "/poly-custom.js"), polyCustomJSTemplate({ - apiBaseUrl: getApiBaseUrl(), - apiKey: getApiKey(), - })); - return [2 /*return*/]; - }); -}); }; -var generateAxiosJSFile = function (libPath) { return __awaiter(void 0, void 0, void 0, function () { - var axiosJSTemplate; - return __generator(this, function (_a) { - axiosJSTemplate = handlebars_1.default.compile((0, utils_2.loadTemplate)('axios.js.hbs')); - fs_1.default.writeFileSync("".concat(libPath, "/axios.js"), axiosJSTemplate({ - apiBaseUrl: getApiBaseUrl(), - apiKey: getApiKey(), - })); - return [2 /*return*/]; - }); -}); }; -var generateErrorHandlerFile = function (libPath) { return __awaiter(void 0, void 0, void 0, function () { - var errorHandlerJSTemplate; - return __generator(this, function (_a) { - errorHandlerJSTemplate = handlebars_1.default.compile((0, utils_2.loadTemplate)('error-handler.js.hbs')); - fs_1.default.writeFileSync("".concat(libPath, "/error-handler.js"), errorHandlerJSTemplate({})); - return [2 /*return*/]; - }); -}); }; -var generateApiFunctionJSFiles = function (libPath, specifications) { return __awaiter(void 0, void 0, void 0, function () { - var template; - return __generator(this, function (_a) { - template = handlebars_1.default.compile((0, utils_2.loadTemplate)('api-index.js.hbs')); - fs_1.default.writeFileSync("".concat(libPath, "/api/index.js"), template({ - specifications: specifications, - })); - return [2 /*return*/]; - }); -}); }; -var generateCustomFunctionJSFiles = function (libPath, specifications) { return __awaiter(void 0, void 0, void 0, function () { - var codeGenerationErrors, customFunctionJSTemplate_1, customIndexJSTemplate; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - codeGenerationErrors = {}; - if (!specifications.length) return [3 /*break*/, 2]; - customFunctionJSTemplate_1 = handlebars_1.default.compile((0, utils_2.loadTemplate)('custom-function.js.hbs')); - return [4 /*yield*/, Promise.all(specifications.map(function (spec) { - return fsWriteAsync("".concat(libPath, "/client/").concat(spec.context ? "".concat(spec.context, "-") : '').concat(spec.name, ".js"), customFunctionJSTemplate_1(spec)) - .catch(function (error) { - codeGenerationErrors[spec.id] = { - stack: error.stack, - specification: spec, - }; - }); - }))]; - case 1: - _a.sent(); - _a.label = 2; - case 2: - customIndexJSTemplate = handlebars_1.default.compile((0, utils_2.loadTemplate)('custom-index.js.hbs')); - fs_1.default.writeFileSync("".concat(libPath, "/client/index.js"), customIndexJSTemplate({ - specifications: specifications.filter(function (spec) { return !codeGenerationErrors[spec.id]; }), - })); - return [2 /*return*/, Array.from(Object.values(codeGenerationErrors))]; - } - }); -}); }; -var generateWebhooksJSFiles = function (libPath, specifications) { return __awaiter(void 0, void 0, void 0, function () { - var template; - return __generator(this, function (_a) { - template = handlebars_1.default.compile((0, utils_2.loadTemplate)('webhooks-index.js.hbs')); - fs_1.default.writeFileSync("".concat(libPath, "/webhooks/index.js"), template({ - specifications: specifications, - apiKey: getApiKey(), - })); - return [2 /*return*/]; - }); -}); }; -var generateServerFunctionJSFiles = function (libPath, specifications) { return __awaiter(void 0, void 0, void 0, function () { - var serverIndexJSTemplate; - return __generator(this, function (_a) { - serverIndexJSTemplate = handlebars_1.default.compile((0, utils_2.loadTemplate)('server-index.js.hbs')); - fs_1.default.writeFileSync("".concat(libPath, "/server/index.js"), serverIndexJSTemplate({ - specifications: specifications, - })); - return [2 /*return*/]; - }); -}); }; -var generateServerVariableJSFiles = function (libPath, specifications) { return __awaiter(void 0, void 0, void 0, function () { - var contextData, contextPaths, template, arrPaths, _i, specifications_1, specification; - return __generator(this, function (_a) { - contextData = (0, specs_1.getContextData)(specifications); - contextPaths = getContextPaths(contextData); - template = handlebars_1.default.compile((0, utils_2.loadTemplate)('vari/index.js.hbs')); - arrPaths = []; - for (_i = 0, specifications_1 = specifications; _i < specifications_1.length; _i++) { - specification = specifications_1[_i]; - if ((0, utils_1.isPlainObjectPredicate)(specification.variable.value) || Array.isArray(specification.variable.value)) { - arrPaths.push({ - context: specification.context || '', - paths: (0, utils_2.getStringPaths)(specification.variable.value), - }); - } - } - fs_1.default.writeFileSync("".concat(libPath, "/vari/index.js"), template({ - specifications: specifications, - contextPaths: contextPaths, - apiKey: getApiKey(), - arrPaths: JSON.stringify(arrPaths), - })); - return [2 /*return*/]; - }); -}); }; -var generateAuthFunctionJSFiles = function (libPath, specifications) { return __awaiter(void 0, void 0, void 0, function () { - var apiBaseUrl, apiKey, authIndexJSTemplate, specsToGenerate, authFunctionJSTemplate, codeGenerationErrors; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - apiBaseUrl = getApiBaseUrl(); - apiKey = getApiKey(); - authIndexJSTemplate = handlebars_1.default.compile((0, utils_2.loadTemplate)('auth-index.js.hbs')); - fs_1.default.writeFileSync("".concat(libPath, "/auth/index.js"), authIndexJSTemplate({ - getTokenFunctions: specifications.filter(function (spec) { return spec.name === 'getToken'; }), - subResourceFunctions: specifications.filter(function (spec) { return spec.subResource; }), - apiBaseUrl: apiBaseUrl, - apiKey: apiKey, - })); - specsToGenerate = specifications.filter(function (spec) { return !spec.subResource; }); - if (specsToGenerate.length === 0) - return [2 /*return*/, []]; - authFunctionJSTemplate = handlebars_1.default.compile((0, utils_2.loadTemplate)('auth-function.js.hbs')); - codeGenerationErrors = {}; - return [4 /*yield*/, Promise.all(specifications.map(function (spec) { - return fsWriteAsync("".concat(libPath, "/auth/").concat(spec.context ? "".concat(spec.context, "-") : '').concat(spec.name, ".js"), authFunctionJSTemplate(__assign(__assign({}, spec), { audienceRequired: spec.function.arguments.some(function (arg) { return arg.name === 'audience'; }), apiBaseUrl: apiBaseUrl, apiKey: apiKey }))) - .catch(function (error) { - codeGenerationErrors[spec.id] = { - stack: error.stack, - specification: spec, - }; - }); - }))]; - case 1: - _a.sent(); - return [2 /*return*/, Array.from(Object.values(codeGenerationErrors))]; - } - }); -}); }; -var getContextPaths = function (contextData) { - var paths = []; - var traverseAndAddPath = function (data, path) { - if (path === void 0) { path = ''; } - for (var _i = 0, _a = Object.keys(data); _i < _a.length; _i++) { - var key = _a[_i]; - if (typeof data[key].context === 'string') { - continue; - } - var currentPath = path ? "".concat(path, ".").concat(key) : key; - paths.push(currentPath); - traverseAndAddPath(data[key], currentPath); - } - }; - traverseAndAddPath(contextData); - return paths; -}; -var showErrGeneratingFiles = function (error) { - shelljs_1.default.echo(chalk_1.default.red('ERROR')); - shelljs_1.default.echo('Error while generating code files. Make sure the version of library/server is up to date.'); - shelljs_1.default.echo(chalk_1.default.red(error.message)); - shelljs_1.default.echo(chalk_1.default.red(error.stack)); - shelljs_1.default.exit(2); -}; -var generateSingleCustomFunction = function (polyPath, functionId, updated, noTypes) { - if (noTypes === void 0) { noTypes = false; } - return __awaiter(void 0, void 0, void 0, function () { - var libPath, contextData, prevSpecs, specs, error_1, customFunction; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - shelljs_1.default.echo('-n', updated ? 'Regenerating TypeScript SDK...' : 'Generating TypeScript SDK...'); - libPath = (0, utils_2.getPolyLibPath)(polyPath); - contextData = {}; - try { - contextData = (0, utils_2.getContextDataFileContent)(libPath); - } - catch (error) { - shelljs_1.default.echo(chalk_1.default.red('ERROR')); - shelljs_1.default.echo('Error while fetching local context data.'); - shelljs_1.default.echo(chalk_1.default.red(error.message)); - shelljs_1.default.echo(chalk_1.default.red(error.stack)); - return [2 /*return*/]; - } - prevSpecs = (0, utils_2.getSpecsFromContextData)(contextData); - specs = []; - _a.label = 1; - case 1: - _a.trys.push([1, 3, , 4]); - return [4 /*yield*/, (0, api_1.getSpecs)([], [], [functionId], noTypes)]; - case 2: - specs = _a.sent(); - return [3 /*break*/, 4]; - case 3: - error_1 = _a.sent(); - (0, utils_2.showErrGettingSpecs)(error_1); - return [2 /*return*/]; - case 4: - customFunction = specs[0]; - if (prevSpecs.some(function (prevSpec) { return prevSpec.id === customFunction.id; })) { - specs = prevSpecs.map(function (prevSpec) { - if (prevSpec.id === customFunction.id) { - return customFunction; - } - return prevSpec; - }); - } - else { - prevSpecs.push(customFunction); - specs = prevSpecs; - } - return [4 /*yield*/, prepareDir(polyPath)]; - case 5: - _a.sent(); - (0, types_1.setGenerationErrors)(false); - return [4 /*yield*/, (0, exports.generateSpecs)(libPath, specs, noTypes)]; - case 6: - _a.sent(); - if ((0, types_1.getGenerationErrors)()) { - shelljs_1.default.echo(chalk_1.default.yellow('Generate DONE with errors. Please investigate the errors and contact support@polyapi.io for assistance.')); - } - else { - shelljs_1.default.echo(chalk_1.default.green('DONE')); - } - return [2 /*return*/]; - } - }); - }); -}; -exports.generateSingleCustomFunction = generateSingleCustomFunction; -var generate = function (_a) { - var polyPath = _a.polyPath, contexts = _a.contexts, names = _a.names, functionIds = _a.functionIds, noTypes = _a.noTypes; - return __awaiter(void 0, void 0, void 0, function () { - var specs, generateMsg, error_2; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - specs = []; - generateMsg = contexts ? "Generating Poly TypeScript SDK for contexts \"".concat(contexts, "\"...") : 'Generating Poly TypeScript SDK...'; - shelljs_1.default.echo('-n', generateMsg); - return [4 /*yield*/, prepareDir(polyPath)]; - case 1: - _b.sent(); - (0, config_1.loadConfig)(polyPath); - _b.label = 2; - case 2: - _b.trys.push([2, 4, , 5]); - return [4 /*yield*/, (0, api_1.getSpecs)(contexts, names, functionIds, noTypes)]; - case 3: - specs = _b.sent(); - return [3 /*break*/, 5]; - case 4: - error_2 = _b.sent(); - (0, utils_2.showErrGettingSpecs)(error_2); - return [2 /*return*/]; - case 5: - (0, types_1.setGenerationErrors)(false); - return [4 /*yield*/, (0, exports.generateSpecs)((0, utils_2.getPolyLibPath)(polyPath), specs, noTypes)]; - case 6: - _b.sent(); - if ((0, types_1.getGenerationErrors)()) { - shelljs_1.default.echo(chalk_1.default.yellow('Generate DONE with errors. Please investigate the errors and contact support@polyapi.io for assistance.')); - } - else { - shelljs_1.default.echo(chalk_1.default.green('DONE')); - } - return [2 /*return*/]; - } - }); - }); -}; -exports.generate = generate; -var tryAsync = function (promise, generatingName) { return __awaiter(void 0, void 0, void 0, function () { - var err_2; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.trys.push([0, 2, , 3]); - return [4 /*yield*/, promise]; - case 1: return [2 /*return*/, _a.sent()]; - case 2: - err_2 = _a.sent(); - shelljs_1.default.echo(chalk_1.default.red("\nUnexpected error encountered while generating ".concat(generatingName, ": ").concat(err_2))); - return [3 /*break*/, 3]; - case 3: return [2 /*return*/]; - } - }); -}); }; -var generateSpecs = function (libPath, specs, noTypes) { return __awaiter(void 0, void 0, void 0, function () { - var missingNames, jsFilesCodeGenerationErrors_1, filteredSpecs, error_3; - var _a; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - _b.trys.push([0, 6, , 7]); - missingNames = []; - _a = specs.reduce(function (acc, s) { - acc[s.name.trim() ? 1 : 0].push(s); - return acc; - }, [[], []]), missingNames = _a[0], specs = _a[1]; - return [4 /*yield*/, generateJSFiles(libPath, specs)]; - case 1: - jsFilesCodeGenerationErrors_1 = _b.sent(); - filteredSpecs = specs.filter(function (spec) { return !jsFilesCodeGenerationErrors_1.find(function (codeGenerationError) { return codeGenerationError.specification.id === spec.id; }); }); - if (!!noTypes) return [3 /*break*/, 5]; - return [4 /*yield*/, tryAsync((0, types_1.generateFunctionsTSDeclarationFile)(libPath, filteredSpecs), 'function types')]; - case 2: - _b.sent(); - return [4 /*yield*/, tryAsync((0, types_1.generateVariablesTSDeclarationFile)(libPath, filteredSpecs), 'variable types')]; - case 3: - _b.sent(); - return [4 /*yield*/, tryAsync((0, schemaTypes_1.generateSchemaTSDeclarationFiles)(libPath, filteredSpecs.filter(function (s) { return s.type === 'schema'; })), 'schemas')]; - case 4: - _b.sent(); - _b.label = 5; - case 5: - (0, utils_2.generateContextDataFile)(libPath, filteredSpecs); - if (missingNames.length) { - (0, types_1.setGenerationErrors)(true); - missingNames.map(function (s) { return (0, utils_2.echoGenerationError)(s); }); - } - if (jsFilesCodeGenerationErrors_1.length) { - (0, types_1.setGenerationErrors)(true); - jsFilesCodeGenerationErrors_1.forEach(function (error) { - (0, utils_2.echoGenerationError)(error.specification); - }); - } - return [3 /*break*/, 7]; - case 6: - error_3 = _b.sent(); - showErrGeneratingFiles(error_3); - return [3 /*break*/, 7]; - case 7: return [2 /*return*/]; - } - }); -}); }; -exports.generateSpecs = generateSpecs; diff --git a/build/commands/generate/schemaTypes.js b/build/commands/generate/schemaTypes.js deleted file mode 100644 index a0c4ec1..0000000 --- a/build/commands/generate/schemaTypes.js +++ /dev/null @@ -1,568 +0,0 @@ -"use strict"; -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.__test = exports.generateSchemaTSDeclarationFiles = void 0; -var fs_1 = require("fs"); -var lodash_1 = require("lodash"); -var helper_string_1 = require("@guanghechen/helper-string"); -var node_os_1 = require("node:os"); -var utils_1 = require("../../utils"); -var types_1 = require("./types"); -var formatName = function (name, nested) { - if (nested === void 0) { nested = false; } - if (nested) - return name.includes('-') ? "'".concat(name, "'") : name; - return (0, helper_string_1.toPascalCase)(name); -}; -var ws = (0, lodash_1.memoize)(function (depth) { - if (depth === void 0) { depth = 1; } - return depth < 0 ? '' : new Array(depth).fill(' ').join(''); -}); -var end = (0, lodash_1.memoize)(function (nested) { return !nested || nested === 'object' ? ';' : ''; }); -var wrapParens = function (v) { - return v.includes('| ') || v.includes('& ') - ? "(".concat(v, ")") - : v; -}; -var printComment = function (comment, depth, deprecated) { - if (comment === void 0) { comment = ''; } - if (depth === void 0) { depth = 0; } - if (deprecated === void 0) { deprecated = false; } - if (!comment && !deprecated) - return ''; - if (!comment && deprecated) { - return "".concat(ws(depth), "/**").concat(node_os_1.EOL).concat(ws(depth), " * @deprecated").concat(node_os_1.EOL).concat(ws(depth), " */").concat(node_os_1.EOL); - } - var nl = comment.includes(node_os_1.EOL) ? node_os_1.EOL : '\n'; - return __spreadArray(__spreadArray([ - "".concat(ws(depth), "/**").concat(deprecated ? "".concat(node_os_1.EOL).concat(ws(depth), " * @deprecated") : '') - ], comment.split(nl).map(function (line) { return "".concat(ws(depth), " * ").concat(line); }), true), [ - "".concat(ws(depth), " */").concat(node_os_1.EOL), - ], false).join(node_os_1.EOL); -}; -var printTypeName = function (title, key, nested, optional) { - if (optional === void 0) { optional = false; } - if (!nested) { - return "type ".concat(formatName(title || key), " = "); - } - if (nested === 'object') { - return "".concat(formatName(key, true)).concat(optional ? '?' : '', ": "); - } - // Don't print the name when nested within arrays or enums - return ''; -}; -var printEnumSchema = function (schema, key, depth, nested, optional) { - if (optional === void 0) { optional = false; } - var values = schema.enum || []; - if (values.length === 1) { - return printConstSchema(__assign(__assign({}, schema), { const: values[0] }), key, depth, nested, optional); - } - if (schema.nullable && !values.includes(null)) - values.unshift(null); - return "".concat(printComment(schema.description, depth, schema.deprecated)).concat(ws(depth)).concat(printTypeName(schema.title, key, nested, optional)).concat(values.map(function (v) { return "".concat(node_os_1.EOL).concat(ws(depth + 1), "| ").concat(typeof v === 'string' ? "'".concat(v, "'") : v); }).join('')).concat(end(nested)); -}; -var printStringSchema = function (schema, key, depth, nested, optional) { - if (optional === void 0) { optional = false; } - return "".concat(printComment(schema.description, depth, schema.deprecated)).concat(ws(depth)).concat(printTypeName(schema.title, key, nested, optional)).concat(schema.nullable ? 'null | ' : '', "string").concat(end(nested)); -}; -var printNumberSchema = function (schema, key, depth, nested, optional) { - if (optional === void 0) { optional = false; } - return "".concat(printComment(schema.description, depth, schema.deprecated)).concat(ws(depth)).concat(printTypeName(schema.title, key, nested, optional)).concat(schema.nullable ? 'null | ' : '', "number").concat(end(nested)); -}; -var printBooleanSchema = function (schema, key, depth, nested, optional) { - if (optional === void 0) { optional = false; } - return "".concat(printComment(schema.description, depth, schema.deprecated)).concat(ws(depth)).concat(printTypeName(schema.title, key, nested, optional)).concat(schema.nullable ? 'null | ' : '', "boolean").concat(end(nested)); -}; -var printNullSchema = function (schema, key, depth, nested, optional) { - if (optional === void 0) { optional = false; } - return "".concat(printComment(schema.description, depth, schema.deprecated)).concat(ws(depth)).concat(printTypeName(schema.title, key, nested, optional), "null").concat(end(nested)); -}; -var printObjectSchema = function (schema, key, depth, nested, optional) { - if (optional === void 0) { optional = false; } - var result = "".concat(printComment(schema.description, depth, schema.deprecated)).concat(ws(depth)).concat(printTypeName(schema.title, key, nested, optional), "{"); - if (schema.properties || schema.patternProperties || schema.additionalProperties) { - if (schema.properties) { - Object.entries(schema.properties).forEach(function (_a) { - var _b; - var k = _a[0], v = _a[1]; - result = "".concat(result).concat(node_os_1.EOL).concat(printSchemaAsType(v, k, depth + 1, 'object', !((_b = schema.required) === null || _b === void 0 ? void 0 : _b.includes(k)))); - }); - } - if (schema.patternProperties) { - // If single pattern property or many with same type then printSchemaAsType with key: `[k: string]` - // If multiple types then printSchemaAsType with key: `[k: string]` and union type for value - var subschemas = Array.from(Object.values(schema.patternProperties)); - var types = new Set(subschemas.map(function (s) { return JSON.stringify(s); })); - var subschema = void 0; - if (typeof schema.additionalProperties === 'object') { - subschema = { anyOf: subschemas.concat(schema.additionalProperties) }; - } - else if (types.size === 1) { - subschema = JSON.parse(Array.from(types.values())[0]); - } - else { - subschema = { anyOf: subschemas }; - } - result = "".concat(result).concat(node_os_1.EOL).concat(printSchemaAsType(subschema, '[k: string]', depth + 1, 'object')); - } - else if (schema.additionalProperties) { - if (typeof schema.additionalProperties === 'object') { - result = "".concat(result).concat(node_os_1.EOL).concat(printSchemaAsType(schema.additionalProperties, '[k: string]', depth + 1, 'object')); - } - else { - result = "".concat(result).concat(node_os_1.EOL).concat(ws(depth + 1), "[k: string]: unknown;"); - } - } - result = "".concat(result).concat(node_os_1.EOL).concat(ws(depth), "}").concat(end(nested)); - } - else { - result = "".concat(result, "}").concat(end(nested)); - } - return result; -}; -var printTupleSchema = function (schema, key, depth, nested, optional) { - if (optional === void 0) { optional = false; } - if (!Array.isArray(schema.items)) - throw new Error('schema.items should be an array to use this function'); - var result = "".concat(printComment(schema.description, depth, schema.deprecated)).concat(ws(depth)).concat(printTypeName(schema.title, key, nested, optional)); - if (!schema.items.length) { - result = "".concat(result, "void[]").concat(end(nested)); - } - else { - // tuple type - result = "".concat(result, "[").concat(node_os_1.EOL).concat(schema.items.map(function (item) { return printSchemaAsType(item, '', depth + 1, 'array'); }).join(",".concat(node_os_1.EOL))); - if (schema.additionalItems) { - if (typeof schema.additionalItems === 'object') { - var child = printSchemaAsType(schema.additionalItems, '', depth + 1, 'array').trim(); - if (child.includes(node_os_1.EOL)) { - result = "".concat(result, ",").concat(node_os_1.EOL).concat(ws(depth + 1), "...Array<").concat(child, ">"); - } - else { - result = "".concat(result, ",").concat(node_os_1.EOL).concat(ws(depth + 1), "...").concat(child, "[]"); - } - } - else { - result = "".concat(result, ",").concat(node_os_1.EOL).concat(ws(depth + 1), "...unknown[]"); - } - } - result = "".concat(result).concat(node_os_1.EOL).concat(ws(depth), "]").concat(end(nested)); - } - return result; -}; -var printArraySchema = function (schema, key, depth, nested, optional) { - if (optional === void 0) { optional = false; } - if (Array.isArray(schema.items)) - return printTupleSchema(schema, key, depth, nested, optional); - var result = "".concat(printComment(schema.description, depth, schema.deprecated)).concat(ws(depth)).concat(printTypeName(schema.title, key, nested, optional)); - if (schema.items) { - var child = printSchemaAsType(schema.items, '', depth + 1, 'array'); - if (child.includes(node_os_1.EOL)) { - result = "".concat(result, "Array<").concat(node_os_1.EOL).concat(child).concat(node_os_1.EOL).concat(ws(depth), ">").concat(end(nested)); - } - else { - result = "".concat(result).concat(child.trim(), "[]").concat(end(nested)); - } - } - else { - result = "".concat(result, "unknown[]").concat(end(nested)); - } - return result; -}; -var printMultiTypeSchema = function (schema, key, depth, nested, optional) { - if (optional === void 0) { optional = false; } - if (!Array.isArray(schema.type) || !schema.type.length) - throw new Error('schema.type should be a non-empty array to use this function'); - return "".concat(printComment(schema.description, depth, schema.deprecated)).concat(ws(depth)).concat(printTypeName(schema.title, key, nested, optional)).concat(schema.type.join(' | ')).concat(end(nested)); -}; -var printIntersectionSchema = function (schema, key, depth, nested, optional) { - if (optional === void 0) { optional = false; } - if (!Array.isArray(schema.allOf) || !schema.allOf.length) - throw new Error('schema.allOf should be a non-empty array to use this function'); - if (schema.allOf.length === 1) { - // no need to print as an intersection type since only one value - return printSchemaAsType(__assign(__assign(__assign({}, schema), schema.allOf[0]), { allOf: undefined }), key, depth, nested, optional); - } - var subtypes = schema.allOf - .map(function (s) { return printSchemaAsType(s, '', depth, 'intersection'); }) - // wrap subschemas in parens if needed - .map(function (v) { return wrapParens(v.trim()); }) - .join(' & '); - if (schema.nullable) { - subtypes = "null | (".concat(subtypes, ")"); - } - return "".concat(printComment(schema.description, depth, schema.deprecated)).concat(ws(depth)).concat(printTypeName(schema.title, key, nested, optional)).concat(subtypes).concat(end(nested)); -}; -var printUnionSchema = function (schema, key, depth, nested, optional) { - if (optional === void 0) { optional = false; } - if (!Array.isArray(schema.anyOf) || !schema.anyOf.length) - throw new Error('schema.anyOf should be a non-empty array to use this function'); - if (schema.anyOf.length === 1) { - // no need to print as a union type since only one value - return printSchemaAsType(__assign(__assign(__assign({}, schema), schema.anyOf[0]), { anyOf: undefined }), key, depth, nested, optional); - } - var subtypes = schema.anyOf - .map(function (s) { return printSchemaAsType(s, '', depth + 1, 'union'); }) - .map(function (v, i) { return "".concat(node_os_1.EOL).concat(ws(depth + 1)).concat(i || !nested || nested === 'object' ? '| ' : '').concat(wrapParens(v.trim())); }) - .join(''); - return "".concat(printComment(schema.description, depth, schema.deprecated)).concat(ws(depth)).concat(printTypeName(schema.title, key, nested, optional)).concat(schema.nullable ? "".concat(node_os_1.EOL).concat(ws(depth + 1), "| null") : '').concat(subtypes).concat(end(nested)); -}; -var printPolyRefSchema = function (schema, key, depth, nested, optional) { - if (optional === void 0) { optional = false; } - return "".concat(printComment(schema.description, depth, schema.deprecated)).concat(ws(depth)).concat(printTypeName(schema.title, key, nested, optional)).concat(schema['x-poly-ref'].publicNamespace ? "".concat(schema['x-poly-ref'].publicNamespace, ".") : '').concat(schema['x-poly-ref'].path.split('.').map(function (v) { return formatName(v); }).join('.')).concat(end(nested)); -}; -var printAnySchema = function (schema, key, depth, nested, optional) { - if (optional === void 0) { optional = false; } - return "".concat(printComment(schema.description, depth, schema.deprecated)).concat(ws(depth)).concat(printTypeName(schema.title, key, nested, optional), "unknown").concat(end(nested)); -}; -var printUnresolvedSchema = function (schema, key, depth, nested, optional) { - if (optional === void 0) { optional = false; } - return "".concat(printComment(schema.description, depth, schema.deprecated)).concat(ws(depth)).concat(printTypeName(schema.title, key, nested, optional), "unknown /* Unresolved type */").concat(end(nested)); -}; -var printConstSchema = function (schema, key, depth, nested, optional) { - if (optional === void 0) { optional = false; } - return "".concat(printComment(schema.description, depth, schema.deprecated)).concat(ws(depth)).concat(printTypeName(schema.title, key, nested, optional)).concat(schema.nullable && schema.const !== null ? 'null | ' : '').concat(typeof schema.const === 'string' ? "'".concat(schema.const, "'") : schema.const).concat(end(nested)); -}; -var printSchemaAsType = function (schema, key, depth, nested, optional) { - if (depth === void 0) { depth = 0; } - if (optional === void 0) { optional = false; } - if (schema['x-poly-ref']) - return printPolyRefSchema(schema, key, depth, nested, optional); - if (schema.const !== undefined) - return printConstSchema(schema, key, depth, nested, optional); - if (Array.isArray(schema.enum) && schema.enum.length) - return printEnumSchema(schema, key, depth, nested, optional); - if (Array.isArray(schema.type) && schema.type.length) - return printMultiTypeSchema(schema, key, depth, nested, optional); - if (Array.isArray(schema.anyOf) && schema.anyOf.length) - return printUnionSchema(schema, key, depth, nested, optional); - if (Array.isArray(schema.allOf) && schema.allOf.length) - return printIntersectionSchema(schema, key, depth, nested, optional); - switch (schema.type) { - case 'object': return printObjectSchema(schema, key, depth, nested, optional); - case 'array': return printArraySchema(schema, key, depth, nested, optional); - case 'string': return printStringSchema(schema, key, depth, nested, optional); - case 'integer': - case 'number': - return printNumberSchema(schema, key, depth, nested, optional); - case 'boolean': return printBooleanSchema(schema, key, depth, nested, optional); - case 'null': return printNullSchema(schema, key, depth, nested, optional); - case 'unresolved': return printUnresolvedSchema(schema, key, depth, nested, optional); - } - return printAnySchema(schema, key, depth, nested, optional); -}; -var printSchemaTreeAsTypes = function (schema, name, depth) { - if (depth === void 0) { depth = 0; } - var result = "".concat(ws(depth), "namespace ").concat(formatName(name, false), " {"); - for (var _i = 0, _a = Object.entries(schema); _i < _a.length; _i++) { - var _b = _a[_i], key = _b[0], child = _b[1]; - // null/undefined child is placeholder type so that we can generate namespaces with nothing inside them - if (!child) - continue; - var generated = ''; - if ('type' in child && child.type === 'schema') { - try { - generated = printSchemaAsType(child.definition, (child.name || key), depth + 1); - } - catch (err) { - console.error(err); - (0, utils_1.echoGenerationError)(child); - (0, types_1.setGenerationErrors)(true); - } - } - else { - generated = printSchemaTreeAsTypes(child, key, depth + 1); - } - result = "".concat(result).concat(node_os_1.EOL).concat(generated); - } - result = "".concat(result).concat(node_os_1.EOL).concat(ws(depth), "}"); - return result; -}; -var normalizeSchema = function (schema) { - var _a; - if (schema.type === 'schema') { - schema.definition.title = schema.name; - schema.definition.description = schema.definition.description || schema.description; - schema.definition = normalizeSchema(schema.definition); - return schema; - } - if (Array.isArray(schema.oneOf)) { - // Treat oneOf as equivalent to anyOf - schema.anyOf = schema.oneOf; - schema.oneOf = undefined; - } - if (schema.discriminator) { - // TODO: Need to fix backend code to handle discriminators more effectively - var _b = schema.discriminator, propertyName = _b.propertyName, mapping = _b.mapping; - var property = (_a = schema.properties) === null || _a === void 0 ? void 0 : _a[propertyName]; - if (property && !property.enum) { - property.enum = Object.keys(mapping); - } - } - if (Array.isArray(schema.anyOf)) { - schema.anyOf = schema.anyOf.map(function (s) { return normalizeSchema(s); }); - } - if (Array.isArray(schema.allOf)) { - schema.allOf = schema.allOf.map(function (s) { return normalizeSchema(s); }); - } - if (schema.type === 'object' || (Array.isArray(schema.type) && schema.type.includes('object'))) { - if (schema.additionalProperties == null) { - schema.additionalProperties = {}; - } - if (!Array.isArray(schema.required)) { - schema.required = []; - } - } - else if (schema.type === 'array' || (Array.isArray(schema.type) && schema.type.includes('array'))) { - if (schema.items && !Array.isArray(schema.items) && schema.additionalItems) { - // Convert schema.items to tuple type - schema.items = [schema.items]; - } - if (!schema.items) { - schema.items = {}; - } - if (schema.additionalItems === true) { - schema.additionalItems = {}; - } - } - if (Array.isArray(schema.enum) && schema.enum.length === 1) { - schema.const = schema.enum[0]; - schema.enum = undefined; - } - return schema; -}; -var getPolySchemaRefs = function (schema) { - if (schema['x-poly-ref']) - return [schema['x-poly-ref'].path]; - var toSearch = []; - if (schema.schemas) - toSearch = toSearch.concat(Object.values(schema.schemas)); - if (schema.properties) - toSearch = toSearch.concat(Object.values(schema.properties)); - if (schema.patternProperties) - toSearch = toSearch.concat(Object.values(schema.patternProperties)); - if (schema.items) { - if (Array.isArray(schema.items)) { - toSearch = toSearch.concat(schema.items); - } - else { - toSearch.push(schema.items); - } - } - if (typeof schema.additionalItems === 'object') - toSearch.push(schema.items); - if (typeof schema.additionalProperties === 'object') - toSearch.push(schema.additionalProperties); - if (Array.isArray(schema.allOf)) - toSearch = toSearch.concat(schema.allOf); - if (Array.isArray(schema.anyOf)) - toSearch = toSearch.concat(schema.anyOf); - return toSearch.flatMap(function (s) { return getPolySchemaRefs(s); }); -}; -var fillInUnresolvedSchemas = function (specs) { - var _a; - var schemas = new Map(); - for (var _i = 0, specs_1 = specs; _i < specs_1.length; _i++) { - var spec = specs_1[_i]; - schemas.set(spec.contextName, spec); - // If schema is unresolved then it doesn't exist in the database so we add a placeholder type - if ((_a = spec.unresolvedPolySchemaRefs) === null || _a === void 0 ? void 0 : _a.length) { - for (var _b = 0, _c = spec.unresolvedPolySchemaRefs; _b < _c.length; _b++) { - var unresolved = _c[_b]; - if (schemas.has(unresolved.path)) - continue; - var parts = unresolved.path.split('.'); - var name_1 = parts.pop(); - var fillerSpec = { - id: '', - type: 'schema', - name: name_1, - context: parts.join('.'), - contextName: unresolved.path, - definition: { type: 'unresolved', title: name_1, description: "Unresolved schema, please add schema `".concat(unresolved.path, "` to complete it.") }, - visibilityMetadata: { - // @ts-expect-error - it's fine - visibility: 'ENVIRONMENT', - }, - }; - schemas.set(unresolved.path, fillerSpec); - } - } - // Look for any schema references which are missing (exist in the DB but some part of context was excluded in generation command) - var refs = getPolySchemaRefs(spec.definition); - for (var _d = 0, refs_1 = refs; _d < refs_1.length; _d++) { - var contextName = refs_1[_d]; - if (schemas.has(contextName)) - continue; - var parts = contextName.split('.'); - var name_2 = parts.pop(); - var context = parts.join('.'); - var fillerSpec = { - id: '', - type: 'schema', - name: name_2, - context: context, - contextName: contextName, - definition: { type: 'unresolved', title: name_2, description: "Missing schema, as context `".concat(context, "` was not generated.") }, - visibilityMetadata: { - // @ts-expect-error - it's fine - visibility: 'ENVIRONMENT', - }, - }; - schemas.set(contextName, fillerSpec); - } - } - return Array.from(schemas.values()); -}; -var printSchemaRoot = function (root) { - // print the interfaces - var result = "declare namespace schemas {".concat(node_os_1.EOL).concat(ws(1), "interface ").concat(root.interfaceName, " {").concat(Object.entries(root.interfaces).map(function (_a) { - var k = _a[0], v = _a[1]; - return "".concat(node_os_1.EOL).concat(ws(2)).concat(k, ": ").concat(v, ";"); - }).join('')).concat(node_os_1.EOL).concat(ws(1), "}"); - // print the namespaces - for (var _i = 0, _a = Object.entries(root.namespaces); _i < _a.length; _i++) { - var _b = _a[_i], key = _b[0], tree = _b[1]; - var types = 'type' in tree && tree.type === 'schema' - ? printSchemaAsType(tree, key, 1) - : printSchemaTreeAsTypes(tree, (0, helper_string_1.toPascalCase)(key), 1); - result = "".concat(result).concat(node_os_1.EOL).concat(types); - } - // close the module - result = "".concat(result).concat(node_os_1.EOL, "}"); - return result; -}; -var buildSchemaTree = function (specs) { - var schemas = { - default: { - path: 'default', - interfaceName: 'Schemas', - interfaces: {}, - namespaces: {}, - hasTypes: false, - }, - }; - for (var _i = 0, specs_2 = specs; _i < specs_2.length; _i++) { - var spec = specs_2[_i]; - if (!spec.context) { - schemas.default.interfaces[spec.name] = spec.name; - schemas.default.namespaces[spec.name] = spec; - schemas.default.hasTypes = true; - continue; - } - var specInterfaceName = (0, helper_string_1.toPascalCase)(spec.context); - var contextParts = spec.context.split('.'); - var last = contextParts.length - 1; - for (var i = 0; i <= last; i++) { - var name_3 = contextParts[i]; - var interfaceName = i === last ? specInterfaceName : (0, helper_string_1.toPascalCase)(contextParts[i]); - var path = contextParts.slice(0, i + 1).join('.'); - var parent_1 = i ? contextParts.slice(0, i).join('.') : 'default'; - if (schemas[path]) - continue; - schemas[path] = { - path: path, - interfaceName: interfaceName, - interfaces: {}, - namespaces: {}, - hasTypes: false, - }; - schemas[parent_1].interfaces[name_3] = interfaceName; - (0, lodash_1.set)(schemas[parent_1].namespaces, path, {}); - } - (0, lodash_1.set)(schemas[spec.context].namespaces, spec.contextName, spec); - schemas[spec.context].interfaces[spec.name] = spec.contextName.split('.').map(function (v) { return (0, helper_string_1.toPascalCase)(v); }).join('.'); - schemas[spec.context].hasTypes = true; - } - return Array.from(Object.values(schemas)); -}; -var printSchemaSpecs = function (specs) { - // first normalize the schemas and fill in unresolved ones - var normalized = fillInUnresolvedSchemas(specs.map(function (schema) { return normalizeSchema(schema); })); - // then build schema trees - var trees = buildSchemaTree(normalized); - // then print all the schema types as strings ready to be saved to disk - var fileMap = Object.fromEntries(trees.map(function (tree) { return ["".concat(tree.path, ".d.ts"), printSchemaRoot(tree)]; })); - fileMap['index.d.ts'] = Object.keys(fileMap).map(function (file) { return "/// "); }).join(node_os_1.EOL); - return fileMap; -}; -var generateSchemaTSDeclarationFiles = function (libPath, specs) { return __awaiter(void 0, void 0, void 0, function () { - var files; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - files = printSchemaSpecs(specs); - return [4 /*yield*/, Promise.all(Object.entries(files) - .map(function (_a) { - var file = _a[0], contents = _a[1]; - return new Promise(function (resolve, reject) { - return fs_1.default.writeFile("".concat(libPath, "/schemas/").concat(file), contents, function (err) { return err ? reject(err) : resolve(); }); - }); - }))]; - case 1: - _a.sent(); - return [2 /*return*/]; - } - }); -}); }; -exports.generateSchemaTSDeclarationFiles = generateSchemaTSDeclarationFiles; -exports.__test = { - printComment: printComment, - printSchemaAsType: printSchemaAsType, - buildSchemaTree: buildSchemaTree, - printSchemaSpecs: printSchemaSpecs, -}; diff --git a/build/commands/generate/types.js b/build/commands/generate/types.js deleted file mode 100644 index b66e10a..0000000 --- a/build/commands/generate/types.js +++ /dev/null @@ -1,741 +0,0 @@ -"use strict"; -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -var __asyncValues = (this && this.__asyncValues) || function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } -}; -var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.generateVariablesTSDeclarationFile = exports.generateFunctionsTSDeclarationFile = exports.getGenerationErrors = exports.setGenerationErrors = void 0; -var fs_1 = require("fs"); -var handlebars_1 = require("handlebars"); -var helper_string_1 = require("@guanghechen/helper-string"); -var json_schema_to_typescript_1 = require("json-schema-to-typescript"); -var ts = require("typescript"); -var utils_1 = require("@poly/common/utils"); -var specs_1 = require("@poly/common/specs"); -var utils_2 = require("../../utils"); -var index_1 = require("@poly/common/json-schema/index"); -var generationErrors = false; -var setGenerationErrors = function (value) { - generationErrors = value; -}; -exports.setGenerationErrors = setGenerationErrors; -var getGenerationErrors = function () { return generationErrors; }; -exports.getGenerationErrors = getGenerationErrors; -var schemaToDeclarations = function (namespace, typeName, schema, value, options) { - if (options === void 0) { options = { - unknownAny: true, - }; } - return __awaiter(void 0, void 0, void 0, function () { - var wrapToNamespace, appendPathUnionType, typeNameContextDelimiter, result, sourceFile, polySchemaTypeReferenceSet, polySchemaTypeReferenceList, polySchemaInterfaceDeclarationList, visitor, visitedPaths, getUnresolvedSchemaArg, getPolySchemaTypeParts, _loop_1, _i, polySchemaInterfaceDeclarationList_1, polySchemaInterfaceDeclaration, _a, polySchemaTypeReferenceList_1, polySchemaTypeReference, polySchemaTypeReferenceParts, resolvedStatus, isResolved, realPathParts; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - wrapToNamespace = function (code) { return "namespace ".concat(namespace, " {\n ").concat(code, "\n}"); }; - appendPathUnionType = function (code, value) { - if (Array.isArray(value) || (0, utils_1.isPlainObjectPredicate)(value)) { - var unionPath = (0, utils_2.getStringPaths)(value).map(function (value) { return "'".concat(value, "'"); }); - // If the value is an empty array or object we naturally can't get any property paths - // So we fallback to an empty string as the type - var pathValue = unionPath.join(' | ') || '\'\''; - return "".concat(code, "\nexport type PathValue = ").concat(pathValue); - } - return code; - }; - typeNameContextDelimiter = '$$$'; - schema.title = typeName; - return [4 /*yield*/, (0, json_schema_to_typescript_1.compile)(schema, typeName, { - format: false, - bannerComment: '', - ignoreMinAndMaxItems: true, - unknownAny: options.unknownAny, - customName: function (innerSchema, keyNameFromDefinition) { - // eslint-disable-next-line @typescript-eslint/naming-convention - var ref = innerSchema['x-poly-ref']; - if (ref !== null && typeof ref === 'object' && !Array.isArray(ref)) { - var schemaTypeNameParts = ['$PolySchema']; - if (['Argument', 'ReturnType'].includes(innerSchema.title)) { - schemaTypeNameParts.push("$".concat(innerSchema.title)); - } - else { - schemaTypeNameParts.push('___'); - } - if (ref.publicNamespace) { - schemaTypeNameParts.push('$Public'); - } - else { - schemaTypeNameParts.push('___'); - } - if (ref['x-unresolved']) { - schemaTypeNameParts.push('$Unresolved'); - } - else { - schemaTypeNameParts.push('$Resolved'); - } - if (ref.publicNamespace) { - schemaTypeNameParts.push.apply(schemaTypeNameParts, __spreadArray([ref.publicNamespace], ref.path.split('.'), false)); - } - else { - schemaTypeNameParts.push.apply(schemaTypeNameParts, ref.path.split('.')); - } - return schemaTypeNameParts.join(typeNameContextDelimiter); - } - return keyNameFromDefinition; - }, - })]; - case 1: - result = _b.sent(); - sourceFile = ts.createSourceFile('x.ts', result, ts.ScriptTarget.Latest); - polySchemaTypeReferenceSet = new Set(); - polySchemaTypeReferenceList = []; - polySchemaInterfaceDeclarationList = []; - visitor = function (node) { - if (ts.isTypeReferenceNode(node)) { - var name_1 = node.getFullText(sourceFile).trim(); - if (name_1.match(/^\$PolySchema\$\$\$/) && !polySchemaTypeReferenceSet.has(name_1)) { - polySchemaTypeReferenceSet.add(name_1); - polySchemaTypeReferenceList.push({ - name: name_1, - path: '', - replacement: '', - }); - } - } - if (ts.isInterfaceDeclaration(node)) { - var children = node.getChildren(sourceFile); - var possibleIdentifier = children.find(function (node) { return node.kind === ts.SyntaxKind.Identifier; }); - if (possibleIdentifier) { - var name_2 = possibleIdentifier.getFullText(sourceFile).trim(); - var code = node.getFullText(sourceFile); - if (name_2.match(/^\$PolySchema\$\$\$/) || (['Argument', 'ReturnType'].includes(name_2) && code.match(/.+?<\/path>/))) { - polySchemaInterfaceDeclarationList.push({ - name: name_2, - code: code, - }); - } - } - } - ts.forEachChild(node, visitor); - }; - ts.forEachChild(sourceFile, visitor); - visitedPaths = []; - getUnresolvedSchemaArg = function (path, isPublic) { - return isPublic ? "Unresolved public schema `".concat(path, "`.") : "Unresolved schema, please add schema `".concat(path, "` to complete it."); - }; - getPolySchemaTypeParts = function (typeName) { return typeName.split(typeNameContextDelimiter); }; - _loop_1 = function (polySchemaInterfaceDeclaration) { - var _c = getPolySchemaTypeParts(polySchemaInterfaceDeclaration.name), argumentOrReturnType = _c[1], visibilityStatus = _c[2], resolvedStatus = _c[3], realContextParts = _c.slice(4); - var isResolved = resolvedStatus === '$Resolved'; - var isPublic = visibilityStatus === '$Public'; - var matchPathNameCommentInCode = polySchemaInterfaceDeclaration.code.match(/(.+?)<\/path>/); - if (matchPathNameCommentInCode === null) { - return "continue"; - } - var path = matchPathNameCommentInCode[1]; - if (['$ReturnType', '$Argument'].includes(argumentOrReturnType)) { - if (isResolved) { - var typePath = "schemas.".concat(path.split('.').map(helper_string_1.toPascalCase).join('.')); - result = result.replace(polySchemaInterfaceDeclaration.code, "export interface ".concat(argumentOrReturnType.replace('$', ''), " extends ").concat(typePath, " {}")); - } - else { - result = result.replace(polySchemaInterfaceDeclaration.code, "/**\n * ".concat(getUnresolvedSchemaArg(path, isPublic), "\n */\n export type ").concat(argumentOrReturnType.replace('$', ''), " = any;")); - } - } - else { - var polySchemaTypeReference = polySchemaTypeReferenceList.find(function (polySchemaTypeReference) { return polySchemaTypeReference.name === polySchemaInterfaceDeclaration.name; }); - if (polySchemaTypeReference) { - polySchemaTypeReference.path = path; - } - if (isResolved) { - result = result.replace(polySchemaInterfaceDeclaration.code, ''); - } - else { - var schemaPathVisited = visitedPaths.find(function (visitedPath) { return visitedPath.path === path; }); - if (!schemaPathVisited) { - visitedPaths.push({ - path: path, - typeName: polySchemaInterfaceDeclaration.name, - }); - result = result.replace(polySchemaInterfaceDeclaration.code, "/**\n * ".concat(getUnresolvedSchemaArg(path, isPublic), "\n */\n type ").concat(__spreadArray(__spreadArray([], realContextParts, true), ['Schema'], false).join('$'), " = any")); - } - else { - polySchemaTypeReference.replacement = schemaPathVisited.typeName; - result = result.replace(polySchemaInterfaceDeclaration.code, ''); - } - } - } - }; - /* - 1. Remove interfaces from resolved schemas that belong to some object property, also track them to fix each type that point to removed interfaces. - 2. Extend argument/return type interfaces with linked schema if they are linked to a schema. - 3. Replace interfaces from argument/return type that are linked to an unresolved schemas for an `any` type. - */ - for (_i = 0, polySchemaInterfaceDeclarationList_1 = polySchemaInterfaceDeclarationList; _i < polySchemaInterfaceDeclarationList_1.length; _i++) { - polySchemaInterfaceDeclaration = polySchemaInterfaceDeclarationList_1[_i]; - _loop_1(polySchemaInterfaceDeclaration); - } - /** - * Iterate over all removed interfaces and replace each type reference with proper schema reference. - */ - for (_a = 0, polySchemaTypeReferenceList_1 = polySchemaTypeReferenceList; _a < polySchemaTypeReferenceList_1.length; _a++) { - polySchemaTypeReference = polySchemaTypeReferenceList_1[_a]; - polySchemaTypeReferenceParts = getPolySchemaTypeParts(polySchemaTypeReference.name); - resolvedStatus = polySchemaTypeReferenceParts[3]; - isResolved = resolvedStatus === '$Resolved'; - if (isResolved) { - realPathParts = polySchemaTypeReference.path.split('.').map(helper_string_1.toPascalCase); - result = result.replace(polySchemaTypeReference.name, "schemas.".concat(realPathParts.join('.'))); - } - else { - result = result.replace(polySchemaTypeReference.name, 'unknown'); - } - } - return [2 /*return*/, wrapToNamespace(appendPathUnionType(result, value))]; - } - }); - }); -}; -var getObjectTypeDeclarations = function (namespacePath, namespace, objectProperty, typeName) { return __awaiter(void 0, void 0, void 0, function () { - var declarations; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, schemaToDeclarations(namespace, typeName, objectProperty.schema)]; - case 1: - declarations = _a.sent(); - // setting typeName to be used when generating return type - objectProperty.typeName = "".concat(namespacePath ? "".concat(namespacePath, ".") : '').concat(namespace, ".").concat(typeName); - return [2 /*return*/, declarations]; - } - }); -}); }; -var getArgumentsTypeDeclarations = function (namespacePath, parentType, properties, typeName) { - if (typeName === void 0) { typeName = 'Argument'; } - return __awaiter(void 0, void 0, void 0, function () { - var typeDeclarations, objectProperties, functionProperties, _i, objectProperties_1, property, objectProperty, namespace, _a, _b, _c, _d, _e, _f, functionProperties_1, property, functionProperty, _g, _h, _j, _k, _l; - return __generator(this, function (_m) { - switch (_m.label) { - case 0: - typeDeclarations = []; - objectProperties = properties.filter(function (property) { return property.type.kind === 'object'; }); - functionProperties = properties.filter(function (property) { return property.type.kind === 'function'; }); - _i = 0, objectProperties_1 = objectProperties; - _m.label = 1; - case 1: - if (!(_i < objectProperties_1.length)) return [3 /*break*/, 6]; - property = objectProperties_1[_i]; - objectProperty = property.type; - if (!objectProperty.schema) return [3 /*break*/, 3]; - namespace = "".concat(parentType, "$").concat((0, helper_string_1.toPascalCase)(property.name)); - // setting typeName to be used when generating arguments type - objectProperty.typeName = "".concat(namespacePath ? "".concat(namespacePath, ".") : '').concat(namespace, ".").concat(typeName); - _b = (_a = typeDeclarations).push; - return [4 /*yield*/, schemaToDeclarations(namespace, typeName, objectProperty.schema)]; - case 2: - _b.apply(_a, [_m.sent()]); - return [3 /*break*/, 5]; - case 3: - if (!objectProperty.properties) return [3 /*break*/, 5]; - _d = (_c = typeDeclarations.push).apply; - _e = [typeDeclarations]; - return [4 /*yield*/, getArgumentsTypeDeclarations(namespacePath, "".concat(parentType, "$").concat((0, helper_string_1.toPascalCase)(property.name)), objectProperty.properties)]; - case 4: - _d.apply(_c, _e.concat([(_m.sent())])); - _m.label = 5; - case 5: - _i++; - return [3 /*break*/, 1]; - case 6: - _f = 0, functionProperties_1 = functionProperties; - _m.label = 7; - case 7: - if (!(_f < functionProperties_1.length)) return [3 /*break*/, 11]; - property = functionProperties_1[_f]; - functionProperty = property.type; - if (functionProperty.name) { - // predefined type name - return [3 /*break*/, 10]; - } - _h = (_g = typeDeclarations.push).apply; - _j = [typeDeclarations]; - return [4 /*yield*/, getArgumentsTypeDeclarations(namespacePath, "".concat(parentType, "$").concat((0, helper_string_1.toPascalCase)(property.name)), functionProperty.spec.arguments.filter(function (arg) { return arg.type.kind === 'object'; }))]; - case 8: - _h.apply(_g, _j.concat([(_m.sent())])); - if (!(functionProperty.spec.returnType.kind === 'object' && functionProperty.spec.returnType.schema)) return [3 /*break*/, 10]; - _l = (_k = typeDeclarations).push; - return [4 /*yield*/, getObjectTypeDeclarations(namespacePath, "".concat(parentType, "$").concat((0, helper_string_1.toPascalCase)(property.name)), functionProperty.spec.returnType, 'ReturnType')]; - case 9: - _l.apply(_k, [_m.sent()]); - _m.label = 10; - case 10: - _f++; - return [3 /*break*/, 7]; - case 11: return [2 /*return*/, typeDeclarations]; - } - }); - }); -}; -var getIDComment = function (specification) { - switch (specification.type) { - case 'apiFunction': - case 'serverFunction': - case 'customFunction': - return "* Function ID: ".concat(specification.id); - case 'authFunction': - return "* Auth provider ID: ".concat(specification.id); - case 'webhookHandle': - return "* Webhook ID: ".concat(specification.id); - default: - return null; - } -}; -var getAdditionalComments = function (specification) { - switch (specification.type) { - case 'customFunction': - if (!specification.requirements.length) { - return null; - } - return "This function requires you to have the following libraries installed:\n- ".concat(specification.requirements.join('\n- ')); - default: - return null; - } -}; -var getSpecificationWithFunctionComment = function (specification) { - var descriptionComment = specification.description - ? specification.description - .split('\n') - .map(function (line) { return "* ".concat(line); }) - .join('\n') - : null; - var toArgumentComment = function (arg, prefix) { - if (prefix === void 0) { prefix = ''; } - if (arg.name === 'payload' && arg.type.kind === 'object' && arg.type.properties) { - return arg.type.properties - .map(function (payloadProperty) { return toArgumentComment(payloadProperty, 'payload.'); }) - .filter(Boolean) - .join('\n'); - } - if (!arg.description) { - return null; - } - return "* @param ".concat(prefix).concat(arg.name, " ").concat(arg.description); - }; - var argumentsComment = specification.function.arguments - .map(function (arg) { return toArgumentComment(arg); }) - .filter(Boolean) - .join('\n'); - var additionalComments = getAdditionalComments(specification); - var idComment = getIDComment(specification); - return "".concat(descriptionComment ? "".concat(descriptionComment, "\n") : '').concat(argumentsComment ? "".concat(argumentsComment, "\n") : '').concat(additionalComments ? "".concat(additionalComments, "\n") : '').concat(idComment ? "*\n".concat(idComment, "\n") : '').trim(); -}; -var getSpecificationWithVariableComment = function (specification) { - var descriptionComment = specification.description - ? specification.description - .split('\n') - .map(function (line) { return "* ".concat(line); }) - .join('\n') - : null; - var secretComment = specification.variable.secret - ? '* Note: The variable is secret and can be used only within Poly functions.' - : null; - var idComment = "* Variable ID: ".concat(specification.id); - return "".concat(descriptionComment ? "".concat(descriptionComment, "\n") : '').concat(secretComment ? "".concat(secretComment, "\n") : '').concat(idComment ? "*\n".concat(idComment) : '').trim(); -}; -var getVariableValueTypeDeclarations = function (namespacePath, namespace, objectProperty, value) { return __awaiter(void 0, void 0, void 0, function () { - var declarations; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, schemaToDeclarations(namespace, 'ValueType', objectProperty.schema, value, { - unknownAny: false, - })]; - case 1: - declarations = _a.sent(); - // setting typeName to be used when generating variable value type - objectProperty.typeName = "".concat(namespacePath ? "".concat(namespacePath, ".") : '').concat(namespace, ".ValueType"); - return [2 /*return*/, declarations]; - } - }); -}); }; -var getSpecificationsTypeDeclarations = function (namespacePath, specifications) { return __awaiter(void 0, void 0, void 0, function () { - var errors, getDeclarationOrHandleError, argumentsTypeDeclarations, returnTypeDeclarations, variableValueDeclarations, schemaDeclarations; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - errors = []; - getDeclarationOrHandleError = function (getDeclaration, specification) { return __awaiter(void 0, void 0, void 0, function () { - var error_1; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.trys.push([0, 2, , 3]); - return [4 /*yield*/, getDeclaration()]; - case 1: return [2 /*return*/, _a.sent()]; - case 2: - error_1 = _a.sent(); - (0, exports.setGenerationErrors)(true); - errors.push({ - specification: specification, - stack: error_1.stack, - }); - return [2 /*return*/, Promise.resolve('')]; - case 3: return [2 /*return*/]; - } - }); - }); }; - return [4 /*yield*/, Promise.all(specifications - .filter(function (spec) { return 'function' in spec; }) - .map(function (spec) { return spec; }) - .map(function (spec) { - return getDeclarationOrHandleError(function () { return getArgumentsTypeDeclarations(namespacePath, (0, helper_string_1.toPascalCase)(spec.name), spec.function.arguments); }, spec); - }))]; - case 1: - argumentsTypeDeclarations = (_a.sent()).flat(); - return [4 /*yield*/, Promise.all(specifications - .filter(function (spec) { - return 'function' in spec && - ((spec.function.returnType.kind === 'object' && - spec.function.returnType.schema && - !(0, specs_1.isBinary)(spec.function.returnType)) || - (spec.type === 'serverFunction' && spec.serverSideAsync === true)); - }) - .map(function (spec) { return spec; }) - .map(function (spec) { - if (spec.type === 'serverFunction' && spec.serverSideAsync === true) { - var ns = (0, helper_string_1.toPascalCase)(spec.name); - return Promise.resolve("namespace ".concat(ns, " {\n export type ReturnType = { executionId: string };\n}")); - } - else { - return getDeclarationOrHandleError(function () { - return getObjectTypeDeclarations(namespacePath, (0, helper_string_1.toPascalCase)(spec.name), spec.function.returnType, 'ReturnType'); - }, spec); - } - }))]; - case 2: - returnTypeDeclarations = _a.sent(); - return [4 /*yield*/, Promise.all(specifications - .filter(function (spec) { return 'variable' in spec && spec.variable.valueType.kind === 'object' && spec.variable.valueType.schema; }) - .map(function (spec) { return spec; }) - .map(function (spec) { - return getDeclarationOrHandleError(function () { return getVariableValueTypeDeclarations(namespacePath, (0, helper_string_1.toPascalCase)(spec.name), spec.variable.valueType, spec.variable.value); }, spec); - }))]; - case 3: - variableValueDeclarations = _a.sent(); - return [4 /*yield*/, Promise.all(specifications.filter(function (specification) { return specification.type === 'schema'; }) - .map(function (spec) { return getDeclarationOrHandleError(function () { return getObjectTypeDeclarations(namespacePath, (0, helper_string_1.toPascalCase)(spec.name), { - schema: spec.definition, - kind: 'object', - }, 'Schema'); }, spec); }))]; - case 4: - schemaDeclarations = _a.sent(); - if (errors.length) { - errors.forEach(function (err) { - (0, utils_2.echoGenerationError)(err.specification); - }); - } - return [2 /*return*/, __spreadArray(__spreadArray(__spreadArray(__spreadArray([], argumentsTypeDeclarations, true), returnTypeDeclarations, true), variableValueDeclarations, true), schemaDeclarations, true).join('\n')]; - } - }); -}); }; -var generateTSContextDeclarationFile = function (libPath, context, specifications, subContexts, pathPrefix) { return __awaiter(void 0, void 0, void 0, function () { - var template, contextPaths, typeDeclarations, toFunctionDeclaration, toVariableDeclaration, toSchemaDeclaration, outputPath, _a, _b, _c; - return __generator(this, function (_d) { - switch (_d.label) { - case 0: - template = handlebars_1.default.compile((0, utils_2.loadTemplate)("".concat(pathPrefix, "/{{context}}.d.ts.hbs"))); - contextPaths = context.path === '' ? [] : context.path.split('.').map(helper_string_1.toPascalCase); - return [4 /*yield*/, getSpecificationsTypeDeclarations(contextPaths.join('.'), specifications)]; - case 1: - typeDeclarations = _d.sent(); - toFunctionDeclaration = function (specification) { - var toArgumentDeclaration = function (arg) { return ({ - name: (0, helper_string_1.toCamelCase)(arg.name), - required: arg.required, - type: (0, specs_1.toTypeDeclaration)(arg.type), - }); }; - var wrapInResponseType = function (returnType) { - switch (specification.type) { - case 'apiFunction': - return specification.apiType === 'graphql' - ? "GraphqlAPIFunctionResponse<".concat(returnType, ">") - : "ApiFunctionResponse<".concat(returnType, ">"); - case 'authFunction': - return specification.name === 'getToken' ? returnType : "AuthFunctionResponse<".concat(returnType, ">"); - } - return returnType; - }; - var computedReturnType; - if (specification.type === 'serverFunction' && - specification.serverSideAsync === true) { - computedReturnType = "".concat(context.interfaceName, ".").concat((0, helper_string_1.toPascalCase)(specification.name), ".ReturnType"); - } - else { - computedReturnType = (0, specs_1.toTypeDeclaration)(specification.function.returnType); - } - return { - name: specification.name.split('.').pop(), - comment: getSpecificationWithFunctionComment(specification), - deprecated: specification.state === 'DEPRECATED', - arguments: specification.function.arguments.map(toArgumentDeclaration), - returnType: wrapInResponseType(computedReturnType), - synchronous: specification.type === 'serverFunction' ? false : specification.function.synchronous === true, - }; - }; - toVariableDeclaration = function (specification) { - var type = (0, specs_1.toTypeDeclaration)(specification.variable.valueType); - var pathUnionType = type.split('.'); - pathUnionType[pathUnionType.length - 1] = 'PathValue'; - return { - name: specification.name.split('.').pop(), - comment: getSpecificationWithVariableComment(specification), - type: type, - secret: specification.variable.secret, - isObjectType: specification.variable.valueType.kind === 'object', - pathUnionType: pathUnionType.join('.'), - }; - }; - toSchemaDeclaration = function (specification) { - var contextParts = specification.context.split('.').filter(function (v) { return v; }); - return { - name: specification.name.split('.').pop(), - typeDeclaration: contextParts.length ? "".concat(specification.context.split('.').map(helper_string_1.toPascalCase).join('.'), ".").concat((0, helper_string_1.toPascalCase)(specification.name)) : "".concat((0, helper_string_1.toPascalCase)(specification.name)), - }; - }; - outputPath = "".concat(libPath, "/").concat(pathPrefix, "/").concat(context.fileName); - _b = (_a = fs_1.default).writeFileSync; - _c = [outputPath]; - return [4 /*yield*/, (0, utils_2.prettyPrint)(template({ - interfaceName: context.interfaceName, - contextPaths: contextPaths, - typeDeclarations: typeDeclarations, - functionDeclarations: specifications - .filter(function (spec) { return 'function' in spec; }) - .map(toFunctionDeclaration), - variableDeclarations: specifications - .filter(function (spec) { return 'variable' in spec; }) - .map(toVariableDeclaration), - schemaDeclarations: specifications.filter(function (spec) { return spec.type === 'schema'; }).map(toSchemaDeclaration), - subContexts: subContexts, - }))]; - case 2: - _b.apply(_a, _c.concat([_d.sent()])); - return [2 /*return*/]; - } - }); -}); }; -var generateTSDeclarationFilesForContext = function (libPath, context, contextData, pathPrefix, contextCollector) { - if (contextCollector === void 0) { contextCollector = []; } - return __awaiter(void 0, void 0, void 0, function () { - var contextDataKeys, contextDataSpecifications, contextDataSubContexts, _a, contextDataSubContexts_1, contextDataSubContexts_1_1, subContext, e_1_1; - var _b, e_1, _c, _d; - return __generator(this, function (_e) { - switch (_e.label) { - case 0: - contextDataKeys = Object.keys(contextData); - contextDataSpecifications = contextDataKeys - .map(function (key) { return contextData[key]; }) - .filter(function (value) { return typeof value.type === 'string'; }); - contextDataSubContexts = contextDataKeys - .filter(function (key) { return !contextData[key].type; }) - .map(function (key) { - var path = "".concat(context.path ? "".concat(context.path, ".") : '').concat(key); - return { - name: key, - path: path, - fileName: "".concat(path, ".d.ts"), - interfaceName: (0, helper_string_1.toPascalCase)(path), - level: context.level + 1, - }; - }); - return [4 /*yield*/, generateTSContextDeclarationFile(libPath, context, contextDataSpecifications, contextDataSubContexts, pathPrefix)]; - case 1: - _e.sent(); - contextCollector = __spreadArray(__spreadArray([], contextCollector, true), [context], false); - _e.label = 2; - case 2: - _e.trys.push([2, 8, 9, 14]); - _a = true, contextDataSubContexts_1 = __asyncValues(contextDataSubContexts); - _e.label = 3; - case 3: return [4 /*yield*/, contextDataSubContexts_1.next()]; - case 4: - if (!(contextDataSubContexts_1_1 = _e.sent(), _b = contextDataSubContexts_1_1.done, !_b)) return [3 /*break*/, 7]; - _d = contextDataSubContexts_1_1.value; - _a = false; - subContext = _d; - return [4 /*yield*/, generateTSDeclarationFilesForContext(libPath, subContext, contextData[subContext.name], pathPrefix, contextCollector)]; - case 5: - contextCollector = _e.sent(); - _e.label = 6; - case 6: - _a = true; - return [3 /*break*/, 3]; - case 7: return [3 /*break*/, 14]; - case 8: - e_1_1 = _e.sent(); - e_1 = { error: e_1_1 }; - return [3 /*break*/, 14]; - case 9: - _e.trys.push([9, , 12, 13]); - if (!(!_a && !_b && (_c = contextDataSubContexts_1.return))) return [3 /*break*/, 11]; - return [4 /*yield*/, _c.call(contextDataSubContexts_1)]; - case 10: - _e.sent(); - _e.label = 11; - case 11: return [3 /*break*/, 13]; - case 12: - if (e_1) throw e_1.error; - return [7 /*endfinally*/]; - case 13: return [7 /*endfinally*/]; - case 14: return [2 /*return*/, contextCollector]; - } - }); - }); -}; -var assignUnresolvedRefsToPolySchemaRefObj = function (schemaDefinition, unresolvedPolySchemaRefs) { - if (unresolvedPolySchemaRefs === void 0) { unresolvedPolySchemaRefs = []; } - (0, index_1.iterateRefs)(schemaDefinition, function (schema) { - var ref = schema['x-poly-ref']; - if (ref !== null && typeof ref === 'object' && !Array.isArray(ref)) { - var foundUnresolved = unresolvedPolySchemaRefs.find(function (unresolvedPolySchemaRef) { return unresolvedPolySchemaRef.path === ref.path && unresolvedPolySchemaRef.publicNamespace === ref.publicNamespace; }); - if (foundUnresolved) { - schema['x-poly-ref']['x-unresolved'] = true; - } - schema.description = "".concat(ref.publicNamespace ? "".concat(ref.publicNamespace, ".").concat(ref.path) : ref.path, ""); - } - return schema; - }, 'x-poly-ref'); -}; -var generateTSDeclarationFiles = function (libPath, specs, interfaceName, pathPrefix) { return __awaiter(void 0, void 0, void 0, function () { - var contextData, contexts; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - contextData = (0, specs_1.getContextData)(specs); - return [4 /*yield*/, generateTSDeclarationFilesForContext(libPath, { - name: '', - path: '', - interfaceName: interfaceName, - fileName: 'default.d.ts', - level: 0, - }, contextData, pathPrefix)]; - case 1: - contexts = _a.sent(); - return [4 /*yield*/, generateTSIndexDeclarationFile(libPath, contexts, pathPrefix)]; - case 2: - _a.sent(); - return [2 /*return*/]; - } - }); -}); }; -var generateTSIndexDeclarationFile = function (libPath, contexts, pathPrefix) { return __awaiter(void 0, void 0, void 0, function () { - var template, _a, _b, _c; - return __generator(this, function (_d) { - switch (_d.label) { - case 0: - template = handlebars_1.default.compile((0, utils_2.loadTemplate)("".concat(pathPrefix, "/index.d.ts.hbs"))); - _b = (_a = fs_1.default).writeFileSync; - _c = ["".concat(libPath, "/").concat(pathPrefix, "/index.d.ts")]; - return [4 /*yield*/, (0, utils_2.prettyPrint)(template({ - contexts: contexts.map(function (context) { return (__assign(__assign({}, context), { firstLevel: context.level === 1 })); }), - }))]; - case 1: - _b.apply(_a, _c.concat([_d.sent()])); - return [2 /*return*/]; - } - }); -}); }; -var generateFunctionsTSDeclarationFile = function (libPath, specs) { return __awaiter(void 0, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, generateTSDeclarationFiles(libPath, specs.filter(function (spec) { return 'function' in spec; }).map(function (spec) { - for (var _i = 0, _a = spec.function.arguments; _i < _a.length; _i++) { - var functionArg = _a[_i]; - if (functionArg.type.kind === 'object' && functionArg.type.schema) { - assignUnresolvedRefsToPolySchemaRefObj(functionArg.type.schema, functionArg.type.unresolvedPolySchemaRefs); - } - else if (functionArg.type.kind === 'object' && functionArg.type.properties) { - for (var _b = 0, _c = functionArg.type.properties; _b < _c.length; _b++) { - var property = _c[_b]; - if (property.type.kind === 'object') { - assignUnresolvedRefsToPolySchemaRefObj(property.type.schema, functionArg.type.unresolvedPolySchemaRefs); - } - } - } - } - if (spec.function.returnType.kind === 'object' && spec.function.returnType.schema) { - assignUnresolvedRefsToPolySchemaRefObj(spec.function.returnType.schema, spec.function.returnType.unresolvedPolySchemaRefs); - } - return spec; - }), 'Poly', '.')]; - case 1: - _a.sent(); - return [2 /*return*/]; - } - }); -}); }; -exports.generateFunctionsTSDeclarationFile = generateFunctionsTSDeclarationFile; -var generateVariablesTSDeclarationFile = function (libPath, specs) { return __awaiter(void 0, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, generateTSDeclarationFiles(libPath, specs.filter(function (spec) { return 'variable' in spec; }), 'Vari', 'vari')]; - case 1: return [2 /*return*/, _a.sent()]; - } - }); -}); }; -exports.generateVariablesTSDeclarationFile = generateVariablesTSDeclarationFile; diff --git a/build/commands/model/generate.js b/build/commands/model/generate.js deleted file mode 100644 index c883d4e..0000000 --- a/build/commands/model/generate.js +++ /dev/null @@ -1,385 +0,0 @@ -"use strict"; -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.generateModel = void 0; -var fs_1 = require("fs"); -var util_1 = require("util"); -var chalk_1 = require("chalk"); -var shelljs_1 = require("shelljs"); -var lodash_1 = require("lodash"); -var axios_1 = require("axios"); -var api_1 = require("../../api"); -var utils_1 = require("../../utils"); -var path_1 = require("path"); -var slugify_1 = require("slugify"); -var lodash_2 = require("lodash"); -var readFile = (0, util_1.promisify)(fs_1.default.readFile); -var readDir = (0, util_1.promisify)(fs_1.default.readdir); -var access = (0, util_1.promisify)(fs_1.default.access); -var write = (0, util_1.promisify)(fs_1.default.writeFile); -var slugify = function (content) { return (0, slugify_1.default)(content, { - lower: true, - strict: true, -}); }; -var axiosClient = axios_1.default.create(); -var writeModelFile = function (title, specificationInput, destination, rename) { - if (rename === void 0) { rename = []; } - return __awaiter(void 0, void 0, void 0, function () { - var adjustLines, contents, _i, rename_1, _a, prevName, newName, writeFile, getFilename, lastCount, foundSingleName, error_1, _b, _c, file, matchResult, count, fileName; - return __generator(this, function (_d) { - switch (_d.label) { - case 0: - title = slugify(title); - adjustLines = function (v) { - var lines = v.split('\n'); - return lines.map(function (line, index) { - if (index === 0) { - return line; - } - return " ".concat(line); - }).join('\n'); - }; - contents = "{\n \"functions\": [\n ".concat(specificationInput.functions.map(function (f) { return JSON.stringify(f, null, 2); }).map(adjustLines).join(',\n '), "\n ],\n \"webhooks\": [\n ").concat(specificationInput.webhooks.map(function (w) { return JSON.stringify(w, null, 2); }).map(adjustLines).join(',\n '), "\n ],\n \"schemas\": [\n ").concat(specificationInput.schemas.map(function (s) { return JSON.stringify(s, null, 2); }).map(adjustLines).join(',\n '), "\n ]\n}"); - for (_i = 0, rename_1 = rename; _i < rename_1.length; _i++) { - _a = rename_1[_i], prevName = _a[0], newName = _a[1]; - // Match name with full word boundaries - // So given prevName = "foo", newName = "bar": - // ` foo ` becomes ` bar `, - // and `{{foo}}` becomes `{{bar}}`, - // but ` foobaz ` stays ` foobaz ` - contents = contents.replaceAll(new RegExp("\\b".concat(prevName, "\\b"), 'g'), newName); - } - writeFile = function (fileName) { - return write(path_1.default.join('./', fileName), contents, { encoding: 'utf-8' }); - }; - if (!destination) return [3 /*break*/, 2]; - return [4 /*yield*/, writeFile(destination)]; - case 1: - _d.sent(); - return [2 /*return*/, path_1.default.join('./', destination)]; - case 2: - getFilename = function (currentCount) { - return currentCount === 0 ? "".concat(title, ".json") : "".concat(title, "-").concat(currentCount, ".json"); - }; - lastCount = 0; - foundSingleName = false; - _d.label = 3; - case 3: - _d.trys.push([3, 5, , 6]); - return [4 /*yield*/, access(path_1.default.join('./', "".concat(title, ".json")))]; - case 4: - _d.sent(); - foundSingleName = true; - return [3 /*break*/, 6]; - case 5: - error_1 = _d.sent(); - return [3 /*break*/, 6]; - case 6: - _b = 0; - return [4 /*yield*/, readDir('.')]; - case 7: - _c = _d.sent(); - _d.label = 8; - case 8: - if (!(_b < _c.length)) return [3 /*break*/, 10]; - file = _c[_b]; - matchResult = file.match(new RegExp("".concat((0, lodash_1.escapeRegExp)(title), "-([0-9])+"))); - if (matchResult) { - count = matchResult[1]; - if (Number(count) > lastCount) { - lastCount = Number(count); - } - } - _d.label = 9; - case 9: - _b++; - return [3 /*break*/, 8]; - case 10: - fileName = getFilename(lastCount === 0 && !foundSingleName ? 0 : lastCount + 1); - return [4 /*yield*/, writeFile(fileName)]; - case 11: - _d.sent(); - return [2 /*return*/, fileName]; - } - }); - }); -}; -var processResources = function (_a) { - var resources = _a.resources, disableAi = _a.disableAi, context = _a.context, defaultAIDataGenerator = _a.defaultAIDataGenerator, aiDataProcessor = _a.aiDataProcessor, getAIDataFn = _a.getAIDataFn, resourceName = _a.resourceName; - return __awaiter(void 0, void 0, void 0, function () { - var chunkSize, resourceChunks, chunkIterations, descriptionSettledResults, _i, resourceChunks_1, resourceChunk, calls, lastFunctionNumberInChunk, _loop_1, _b, resourceChunk_1, resource, _c, _d, _e, failedDescriptions, resourcesWithNoName, i, descriptionSettledResult, resource, httpStatusCode, errMessage, message, response, _f, failedDescriptions_1, failedResourceDescription, _g, resourcesWithNoName_1, resourceWithNoName; - var _h, _j, _k, _l, _m; - return __generator(this, function (_o) { - switch (_o.label) { - case 0: - chunkSize = 5; - resourceChunks = (0, lodash_2.chunk)(resources, chunkSize); - chunkIterations = 0; - descriptionSettledResults = []; - shelljs_1.default.echo('\n'); - _i = 0, resourceChunks_1 = resourceChunks; - _o.label = 1; - case 1: - if (!(_i < resourceChunks_1.length)) return [3 /*break*/, 4]; - resourceChunk = resourceChunks_1[_i]; - calls = []; - lastFunctionNumberInChunk = chunkSize * (chunkIterations + 1); - if (!disableAi) { - shelljs_1.default.echo("Processing from ".concat(resourceName, " number ").concat((chunkSize * chunkIterations) + 1, " to ").concat(resourceName, " number ").concat(lastFunctionNumberInChunk <= resources.length ? lastFunctionNumberInChunk : resources.length, " out of ").concat(resources.length)); - } - _loop_1 = function (resource) { - if (disableAi) { - calls.push(new Promise(function (resolve) { return resolve(defaultAIDataGenerator(resource)); })); - } - else { - calls.push(getAIDataFn(resource)); - } - }; - for (_b = 0, resourceChunk_1 = resourceChunk; _b < resourceChunk_1.length; _b++) { - resource = resourceChunk_1[_b]; - _loop_1(resource); - } - chunkIterations++; - _d = (_c = descriptionSettledResults.push).apply; - _e = [descriptionSettledResults]; - return [4 /*yield*/, Promise.allSettled(calls)]; - case 2: - _d.apply(_c, _e.concat([(_o.sent())])); - _o.label = 3; - case 3: - _i++; - return [3 /*break*/, 1]; - case 4: - failedDescriptions = []; - resourcesWithNoName = []; - for (i = 0; i < descriptionSettledResults.length; i++) { - descriptionSettledResult = descriptionSettledResults[i]; - resource = resources[i]; - if (descriptionSettledResult.status === 'rejected') { - if (context) { - resource.context = context; - } - httpStatusCode = (_j = (_h = descriptionSettledResult.reason) === null || _h === void 0 ? void 0 : _h.response) === null || _j === void 0 ? void 0 : _j.status; - errMessage = (_m = (_l = (_k = descriptionSettledResult.reason) === null || _k === void 0 ? void 0 : _k.response) === null || _l === void 0 ? void 0 : _l.data) === null || _m === void 0 ? void 0 : _m.message; - message = 'Request failure'; - if (httpStatusCode) { - message = "".concat(message, " with status code ").concat(chalk_1.default.redBright(httpStatusCode)); - } - if (errMessage) { - message = "".concat(message, " - \"").concat(errMessage, "\""); - } - failedDescriptions.push(__assign(__assign({}, resource), { index: i, reason: message })); - if (!resource.name) { - resourcesWithNoName.push(__assign(__assign({}, resource), { index: i })); - } - } - else { - response = descriptionSettledResult.value; - aiDataProcessor(resource, response); - if (response.traceId) { - failedDescriptions.push(__assign(__assign({}, resource), { index: i, traceId: response.traceId })); - } - if (!resource.name && !response.name) { - resourcesWithNoName.push(__assign(__assign({}, resource), { index: i })); - } - } - } - if (failedDescriptions.length) { - shelljs_1.default.echo('\n'); - shelljs_1.default.echo(chalk_1.default.yellowBright('Warning:'), "Failed to generate some descriptions for ".concat(resourceName, "s:")); - shelljs_1.default.echo('\n'); - for (_f = 0, failedDescriptions_1 = failedDescriptions; _f < failedDescriptions_1.length; _f++) { - failedResourceDescription = failedDescriptions_1[_f]; - shelljs_1.default.echo("".concat((0, utils_1.firstLetterToUppercase)(resourceName), " with context"), "\"".concat(failedResourceDescription.context || '', "\" and"), 'name', "\"".concat(failedResourceDescription.name || '', "\""), 'at index:', chalk_1.default.yellow("".concat(failedResourceDescription.index)), failedResourceDescription.reason ? "- Reason: ".concat(failedResourceDescription.reason) : "- Trace id: ".concat(failedResourceDescription.traceId)); - } - } - if (resourcesWithNoName.length) { - shelljs_1.default.echo('\n'); - shelljs_1.default.echo(chalk_1.default.redBright('Action required:'), "The following ".concat(resourceName, "s from your specification input do not have a name:")); - shelljs_1.default.echo('\n'); - for (_g = 0, resourcesWithNoName_1 = resourcesWithNoName; _g < resourcesWithNoName_1.length; _g++) { - resourceWithNoName = resourcesWithNoName_1[_g]; - shelljs_1.default.echo("".concat((0, utils_1.firstLetterToUppercase)(resourceName), " at index:"), chalk_1.default.redBright(resourceWithNoName.index)); - } - } - return [2 /*return*/]; - } - }); - }); -}; -var generateModel = function (specPath, destination, context, hostUrl, hostUrlAsArgument, disableAi, rename) { - if (disableAi === void 0) { disableAi = false; } - if (rename === void 0) { rename = []; } - return __awaiter(void 0, void 0, void 0, function () { - var contents, response, error_2, error_3, specificationInputDto, createdFileName, error_4, error_5; - var _a, _b; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - _c.trys.push([0, 15, , 16]); - shelljs_1.default.echo('Translating specification into poly api specification input and generating context, names and descriptions for all resources...'); - contents = ''; - if (!specPath.startsWith('https://')) return [3 /*break*/, 5]; - _c.label = 1; - case 1: - _c.trys.push([1, 3, , 4]); - shelljs_1.default.echo('Fetching open api specs from provided url...'); - return [4 /*yield*/, axiosClient.get(specPath)]; - case 2: - response = _c.sent(); - contents = response.data; - return [3 /*break*/, 4]; - case 3: - error_2 = _c.sent(); - throw new Error("Failed to fetch contents from url \"".concat(specPath, "\"")); - case 4: return [3 /*break*/, 8]; - case 5: - _c.trys.push([5, 7, , 8]); - return [4 /*yield*/, readFile(specPath, { encoding: 'utf-8' })]; - case 6: - contents = _c.sent(); - return [3 /*break*/, 8]; - case 7: - error_3 = _c.sent(); - throw new Error('File does not exist.'); - case 8: - _c.trys.push([8, 13, , 14]); - if (disableAi) { - shelljs_1.default.echo('Ai generation is disabled.'); - } - if (destination && fs_1.default.existsSync(path_1.default.join('./', destination))) { - throw new Error('Destination file already exists.'); - } - if (hostUrlAsArgument === '') { - hostUrlAsArgument = 'hostUrl'; - } - return [4 /*yield*/, (0, api_1.translateSpecification)(contents, context, hostUrl, hostUrlAsArgument)]; - case 9: - specificationInputDto = _c.sent(); - return [4 /*yield*/, processResources({ - resources: specificationInputDto.functions, - aiDataProcessor: function (resource, aiData) { - resource.name = aiData.name; - resource.context = context || aiData.context; - resource.description = aiData.description; - resource.arguments = aiData.arguments; - }, - defaultAIDataGenerator: function (resource) { - return { - name: resource.name, - context: resource.context, - description: resource.description, - arguments: resource.arguments, - }; - }, - disableAi: disableAi, - getAIDataFn: function (resource) { - return (0, api_1.getApiFunctionDescription)({ - name: resource.name, - context: resource.context, - description: resource.description, - arguments: resource.arguments, - source: resource.source, - }); - }, - context: context, - resourceName: 'function', - })]; - case 10: - _c.sent(); - return [4 /*yield*/, processResources({ - resources: specificationInputDto.webhooks, - aiDataProcessor: function (resource, aiData) { - resource.name = aiData.name; - resource.context = context || aiData.context; - resource.description = aiData.description; - }, - defaultAIDataGenerator: function (resource) { - return { - name: resource.name, - context: resource.context, - description: resource.description, - }; - }, - disableAi: disableAi, - getAIDataFn: function (resource) { - return (0, api_1.getWebhookHandleDescription)({ - name: resource.name, - context: resource.context, - description: resource.description, - eventPayload: resource.eventPayloadTypeSchema, - }); - }, - context: context, - resourceName: 'webhook', - })]; - case 11: - _c.sent(); - return [4 /*yield*/, writeModelFile(specificationInputDto.title, specificationInputDto, destination, rename)]; - case 12: - createdFileName = _c.sent(); - shelljs_1.default.echo(chalk_1.default.green('Poly api specification input created:'), 'Open file', chalk_1.default.blueBright(createdFileName), 'to check details.'); - return [3 /*break*/, 14]; - case 13: - error_4 = _c.sent(); - if ((_b = (_a = error_4.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.message) { - throw new Error(error_4.response.data.message); - } - throw error_4; - case 14: return [3 /*break*/, 16]; - case 15: - error_5 = _c.sent(); - shelljs_1.default.echo(chalk_1.default.red('Error:'), error_5.message); - return [3 /*break*/, 16]; - case 16: return [2 /*return*/]; - } - }); - }); -}; -exports.generateModel = generateModel; diff --git a/build/commands/model/index.js b/build/commands/model/index.js deleted file mode 100644 index 0f848c7..0000000 --- a/build/commands/model/index.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -__exportStar(require("./generate"), exports); -__exportStar(require("./validate"), exports); -__exportStar(require("./train"), exports); diff --git a/build/commands/model/train.js b/build/commands/model/train.js deleted file mode 100644 index 52638f3..0000000 --- a/build/commands/model/train.js +++ /dev/null @@ -1,236 +0,0 @@ -"use strict"; -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.train = void 0; -var fs_1 = require("fs"); -var util_1 = require("util"); -var chalk_1 = require("chalk"); -var shelljs_1 = require("shelljs"); -var child_process_1 = require("child_process"); -var dotenv_1 = require("dotenv"); -var lodash_1 = require("lodash"); -var api_1 = require("../../api"); -var utils_1 = require("../../utils"); -var readFile = (0, util_1.promisify)(fs_1.default.readFile); -var exec = (0, util_1.promisify)(child_process_1.exec); -dotenv_1.default.config(); -var generateClientCode = function (polyPath) { return __awaiter(void 0, void 0, void 0, function () { - var response, error_1; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.trys.push([0, 2, , 3]); - shelljs_1.default.echo('Re-generating poly library...'); - return [4 /*yield*/, exec("npx poly generate --customPath ".concat(polyPath))]; - case 1: - response = _a.sent(); - if (response.stderr) { - throw new Error(); - } - shelljs_1.default.echo(chalk_1.default.green('Success: '), 'Poly library re-generated.'); - return [3 /*break*/, 3]; - case 2: - error_1 = _a.sent(); - shelljs_1.default.echo(chalk_1.default.yellow('Warning:', '"npx poly generate" command failed.')); - return [3 /*break*/, 3]; - case 3: return [2 /*return*/]; - } - }); -}); }; -var executeTraining = function (_a) { - var resources = _a.resources, resourceName = _a.resourceName, upsertFn = _a.upsertFn; - return __awaiter(void 0, void 0, void 0, function () { - var chunkSize, resourceChunks, chunkIterations, results, _i, resourceChunks_1, resourceChunk, calls, lastResourceNumberInChunk, _b, resourceChunk_1, resource, _c, _d, _e, failedResources, createdResources, i, settledResult, resource, httpStatusCode, errMessage, message, response, _f, failedResources_1, failedResource; - var _g, _h, _j, _k, _l; - return __generator(this, function (_m) { - switch (_m.label) { - case 0: - chunkSize = 5; - resourceChunks = (0, lodash_1.chunk)(resources, chunkSize); - chunkIterations = 0; - results = []; - shelljs_1.default.echo('\n'); - _i = 0, resourceChunks_1 = resourceChunks; - _m.label = 1; - case 1: - if (!(_i < resourceChunks_1.length)) return [3 /*break*/, 4]; - resourceChunk = resourceChunks_1[_i]; - calls = []; - lastResourceNumberInChunk = chunkSize * (chunkIterations + 1); - shelljs_1.default.echo("Training from ".concat(resourceName, " number ").concat((chunkSize * chunkIterations) + 1, " to ").concat(resourceName, " number ").concat(lastResourceNumberInChunk <= resources.length ? lastResourceNumberInChunk : resources.length, " out of ").concat(resources.length)); - for (_b = 0, resourceChunk_1 = resourceChunk; _b < resourceChunk_1.length; _b++) { - resource = resourceChunk_1[_b]; - calls.push(upsertFn(resource)); - } - chunkIterations++; - _d = (_c = results.push).apply; - _e = [results]; - return [4 /*yield*/, Promise.allSettled(calls)]; - case 2: - _d.apply(_c, _e.concat([(_m.sent())])); - _m.label = 3; - case 3: - _i++; - return [3 /*break*/, 1]; - case 4: - failedResources = []; - createdResources = []; - for (i = 0; i < results.length; i++) { - settledResult = results[i]; - resource = resources[i]; - if (settledResult.status === 'rejected') { - httpStatusCode = (_h = (_g = settledResult.reason) === null || _g === void 0 ? void 0 : _g.response) === null || _h === void 0 ? void 0 : _h.status; - errMessage = (_l = (_k = (_j = settledResult.reason) === null || _j === void 0 ? void 0 : _j.response) === null || _k === void 0 ? void 0 : _k.data) === null || _l === void 0 ? void 0 : _l.message; - message = 'Request failure'; - if (httpStatusCode) { - message = "".concat(message, " with status code ").concat(chalk_1.default.redBright(httpStatusCode)); - } - if (errMessage) { - message = "".concat(message, " - \"").concat(errMessage, "\""); - } - failedResources.push(__assign(__assign({}, resource), { index: i, reason: message })); - } - else { - response = settledResult.value; - createdResources.push(response); - } - } - if (createdResources.length) { - shelljs_1.default.echo('\n'); - shelljs_1.default.echo(chalk_1.default.green('Success:'), "Trained ".concat(resourceName, "s:")); - shelljs_1.default.echo('\n'); - shelljs_1.default.echo(createdResources.map(function (_a, index) { - var id = _a.id, name = _a.name, context = _a.context; - return chalk_1.default.blueBright("".concat(index + 1, ". ").concat(context ? context + '.' : '').concat(name, " - ").concat(id)); - }).join('\n')); - shelljs_1.default.echo('\n'); - } - if (failedResources.length) { - shelljs_1.default.echo('\n'); - shelljs_1.default.echo(chalk_1.default.redBright('Danger:'), "Failed to train ".concat(resourceName, "s for:")); - shelljs_1.default.echo('\n'); - for (_f = 0, failedResources_1 = failedResources; _f < failedResources_1.length; _f++) { - failedResource = failedResources_1[_f]; - shelljs_1.default.echo("".concat((0, utils_1.firstLetterToUppercase)(resourceName), " with context"), "\"".concat(failedResource.context || '', "\" and"), 'name', "\"".concat(failedResource.name || '', "\""), 'at index:', chalk_1.default.yellow("".concat(failedResource.index)), "- Reason: ".concat(failedResource.reason)); - } - shelljs_1.default.echo('\n'); - } - return [2 /*return*/, createdResources.length]; - } - }); - }); -}; -var train = function (polyPath, path) { return __awaiter(void 0, void 0, void 0, function () { - var contents, error_2, specificationInput, createdApiFunctionsCount, createdWebhooksCount, createdSchemasCount, error_3; - var _a, _b; - return __generator(this, function (_c) { - switch (_c.label) { - case 0: - shelljs_1.default.echo('Training poly resources...'); - contents = ''; - _c.label = 1; - case 1: - _c.trys.push([1, 3, , 4]); - return [4 /*yield*/, readFile(path, { encoding: 'utf-8' })]; - case 2: - contents = _c.sent(); - return [3 /*break*/, 4]; - case 3: - error_2 = _c.sent(); - throw new Error('File does not exist.'); - case 4: - _c.trys.push([4, 10, , 11]); - specificationInput = JSON.parse(contents); - return [4 /*yield*/, executeTraining({ - resources: specificationInput.functions, - resourceName: 'api function', - upsertFn: function (resource) { - return (0, api_1.upsertApiFunction)(resource); - }, - })]; - case 5: - createdApiFunctionsCount = _c.sent(); - return [4 /*yield*/, executeTraining({ - resources: specificationInput.webhooks, - resourceName: 'webhook', - upsertFn: function (resource) { - return (0, api_1.upsertWebhookHandle)(resource); - }, - })]; - case 6: - createdWebhooksCount = _c.sent(); - return [4 /*yield*/, executeTraining({ - resources: specificationInput.schemas, - resourceName: 'schema', - upsertFn: function (resource) { - return (0, api_1.upsertSchema)(resource); - }, - })]; - case 7: - createdSchemasCount = _c.sent(); - if (!(createdApiFunctionsCount > 0 || createdWebhooksCount > 0 || createdSchemasCount > 0)) return [3 /*break*/, 9]; - return [4 /*yield*/, generateClientCode(polyPath)]; - case 8: - _c.sent(); - _c.label = 9; - case 9: return [3 /*break*/, 11]; - case 10: - error_3 = _c.sent(); - if (((_a = error_3.response) === null || _a === void 0 ? void 0 : _a.status) === 400) { - shelljs_1.default.echo(chalk_1.default.red('Error:'), (_b = error_3.response.data) === null || _b === void 0 ? void 0 : _b.message); - } - else { - shelljs_1.default.echo(chalk_1.default.red('Error:'), error_3.message); - } - return [3 /*break*/, 11]; - case 11: return [2 /*return*/]; - } - }); -}); }; -exports.train = train; diff --git a/build/commands/model/validate.js b/build/commands/model/validate.js deleted file mode 100644 index e38a31f..0000000 --- a/build/commands/model/validate.js +++ /dev/null @@ -1,181 +0,0 @@ -"use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.validateModel = void 0; -var shelljs_1 = require("shelljs"); -var fs_1 = require("fs"); -var chalk_1 = require("chalk"); -var util_1 = require("util"); -var lodash_1 = require("lodash"); -var api_1 = require("../../api"); -var readFile = (0, util_1.promisify)(fs_1.default.readFile); -var DuplicatedIdentifierError = /** @class */ (function (_super) { - __extends(DuplicatedIdentifierError, _super); - function DuplicatedIdentifierError(identifier) { - var _this = _super.call(this, 'Duplicated name and context') || this; - _this.identifier = identifier; - return _this; - } - return DuplicatedIdentifierError; -}(Error)); -var getDuplicatedIdentifier = function (apiFunctions) { - for (var i = 0; i < apiFunctions.length; i++) { - var firstApiFunction = apiFunctions[i]; - for (var c = 0; c < apiFunctions.length; c++) { - var secondApiFunction = apiFunctions[c]; - if (firstApiFunction.name && firstApiFunction.context === secondApiFunction.context && firstApiFunction.name === secondApiFunction.name && c !== i) { - return firstApiFunction.context ? "".concat(firstApiFunction.context, ".").concat(firstApiFunction.name) : firstApiFunction.name; - } - } - } - return null; -}; -var validateModel = function (path) { return __awaiter(void 0, void 0, void 0, function () { - var contents, error_1, specificationInput, duplicatedIdentifier, chunkSize, apiFunctionChunks, _i, apiFunctionChunks_1, apiFunctionsChunk, _a, apiFunctionsChunk_1, apiFunction, duplicatedIdentifier, chunkSize, webhookHandleChunks, _b, webhookHandleChunks_1, webhookHandleChunk, _c, webhookHandleChunk_1, webhookHandle, error_2; - var _d, _e; - return __generator(this, function (_f) { - switch (_f.label) { - case 0: - shelljs_1.default.echo('Validating poly specification input...'); - contents = ''; - _f.label = 1; - case 1: - _f.trys.push([1, 3, , 4]); - return [4 /*yield*/, readFile(path, { encoding: 'utf-8' })]; - case 2: - contents = _f.sent(); - return [3 /*break*/, 4]; - case 3: - error_1 = _f.sent(); - throw new Error('File does not exist.'); - case 4: - _f.trys.push([4, 17, , 18]); - specificationInput = JSON.parse(contents); - if (!('functions' in specificationInput) && !('webhooks' in specificationInput)) { - throw new Error('Expected specification to contain "webhooks" and/or "functions", but found neither.'); - } - if (!('functions' in specificationInput)) return [3 /*break*/, 10]; - duplicatedIdentifier = getDuplicatedIdentifier(specificationInput.functions); - if (duplicatedIdentifier) { - throw new DuplicatedIdentifierError(duplicatedIdentifier); - } - chunkSize = 5; - apiFunctionChunks = (0, lodash_1.chunk)(specificationInput.functions, chunkSize); - _i = 0, apiFunctionChunks_1 = apiFunctionChunks; - _f.label = 5; - case 5: - if (!(_i < apiFunctionChunks_1.length)) return [3 /*break*/, 10]; - apiFunctionsChunk = apiFunctionChunks_1[_i]; - _a = 0, apiFunctionsChunk_1 = apiFunctionsChunk; - _f.label = 6; - case 6: - if (!(_a < apiFunctionsChunk_1.length)) return [3 /*break*/, 9]; - apiFunction = apiFunctionsChunk_1[_a]; - return [4 /*yield*/, (0, api_1.validateApiFunctionDto)(apiFunction)]; - case 7: - _f.sent(); - _f.label = 8; - case 8: - _a++; - return [3 /*break*/, 6]; - case 9: - _i++; - return [3 /*break*/, 5]; - case 10: - if (!('webhooks' in specificationInput)) return [3 /*break*/, 16]; - duplicatedIdentifier = getDuplicatedIdentifier(specificationInput.webhooks); - if (duplicatedIdentifier) { - throw new DuplicatedIdentifierError(duplicatedIdentifier); - } - chunkSize = 5; - webhookHandleChunks = (0, lodash_1.chunk)(specificationInput.webhooks, chunkSize); - _b = 0, webhookHandleChunks_1 = webhookHandleChunks; - _f.label = 11; - case 11: - if (!(_b < webhookHandleChunks_1.length)) return [3 /*break*/, 16]; - webhookHandleChunk = webhookHandleChunks_1[_b]; - _c = 0, webhookHandleChunk_1 = webhookHandleChunk; - _f.label = 12; - case 12: - if (!(_c < webhookHandleChunk_1.length)) return [3 /*break*/, 15]; - webhookHandle = webhookHandleChunk_1[_c]; - return [4 /*yield*/, (0, api_1.validateWebhookHandleDto)(webhookHandle)]; - case 13: - _f.sent(); - _f.label = 14; - case 14: - _c++; - return [3 /*break*/, 12]; - case 15: - _b++; - return [3 /*break*/, 11]; - case 16: - shelljs_1.default.echo(chalk_1.default.green('Poly specification input is valid.')); - return [3 /*break*/, 18]; - case 17: - error_2 = _f.sent(); - if (error_2 instanceof DuplicatedIdentifierError) { - shelljs_1.default.echo(chalk_1.default.red('Error:'), error_2.message, chalk_1.default.red(error_2.identifier)); - } - else if (((_d = error_2.response) === null || _d === void 0 ? void 0 : _d.status) === 400) { - shelljs_1.default.echo(chalk_1.default.red('Error:'), (_e = error_2.response.data) === null || _e === void 0 ? void 0 : _e.message); - } - else { - shelljs_1.default.echo(chalk_1.default.red('Error:'), error_2.message); - } - return [3 /*break*/, 18]; - case 18: return [2 /*return*/]; - } - }); -}); }; -exports.validateModel = validateModel; diff --git a/build/commands/prepare.js b/build/commands/prepare.js deleted file mode 100644 index 18e191e..0000000 --- a/build/commands/prepare.js +++ /dev/null @@ -1,209 +0,0 @@ -"use strict"; -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.prepareDeployables = void 0; -var shelljs_1 = require("shelljs"); -var transpiler_1 = require("../transpiler"); -var deployables_1 = require("../deployables"); -var api_1 = require("../api"); -var getFunctionDescription = function (type, description, args, code) { - return type === 'server-function' - ? (0, api_1.getServerFunctionDescription)({ description: description, arguments: args, code: code }) - : (0, api_1.getClientFunctionDescription)({ description: description, arguments: args, code: code }); -}; -var fillInMissingFunctionDetails = function (deployable, code) { return __awaiter(void 0, void 0, void 0, function () { - var isMissingDescriptions, aiGenerated_1, _a; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - isMissingDescriptions = !deployable.types.description || - !deployable.types.returns.description || - deployable.types.params.some(function (p) { return !p.description; }); - if (!isMissingDescriptions) return [3 /*break*/, 4]; - _b.label = 1; - case 1: - _b.trys.push([1, 3, , 4]); - return [4 /*yield*/, getFunctionDescription(deployable.type, deployable.types.description, deployable.types.params.map(function (p) { return (__assign(__assign({}, p), { key: p.name })); }), code)]; - case 2: - aiGenerated_1 = _b.sent(); - if (!deployable.types.description && aiGenerated_1.description) { - deployable.types.description = aiGenerated_1.description; - deployable.dirty = true; - } - deployable.types.params = deployable.types.params.map(function (p) { - if (p.description) - return p; - var aiArg = aiGenerated_1.arguments.find(function (a) { return a.name === p.name; }); - if (!aiArg || !aiArg.description) - return p; - deployable.dirty = true; - return __assign(__assign({}, p), { description: aiArg.description }); - }); - return [3 /*break*/, 4]; - case 3: - _a = _b.sent(); - return [3 /*break*/, 4]; - case 4: return [2 /*return*/, deployable]; - } - }); -}); }; -var fillInMissingDetails = function (deployable, code) { return __awaiter(void 0, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (deployable.type) { - case 'server-function': - case 'client-function': - return [2 /*return*/, fillInMissingFunctionDetails(deployable, code)]; - } - throw new Error("Unsupported deployable type: '".concat(deployable.type, "'")); - }); -}); }; -var getAllDeployables = function (disableDocs, disableAi, gitRevision) { return __awaiter(void 0, void 0, void 0, function () { - var baseUrl, possibleDeployables, found, _i, possibleDeployables_1, possible, _a, deployable, code, fullName, _b, _c, _d, _e, err_1; - return __generator(this, function (_f) { - switch (_f.label) { - case 0: - console.log('Searching for poly deployables.'); - baseUrl = (0, transpiler_1.getTSBaseUrl)() || '.'; - possibleDeployables = (0, deployables_1.getAllDeployableFiles)({ includeDirs: [baseUrl] }); - console.log("Found ".concat(possibleDeployables.length, " possible deployable file").concat(possibleDeployables.length === 1 ? '' : 's', ".")); - found = new Map(); - _i = 0, possibleDeployables_1 = possibleDeployables; - _f.label = 1; - case 1: - if (!(_i < possibleDeployables_1.length)) return [3 /*break*/, 11]; - possible = possibleDeployables_1[_i]; - _f.label = 2; - case 2: - _f.trys.push([2, 9, , 10]); - return [4 /*yield*/, (0, transpiler_1.parseDeployable)(possible, baseUrl, gitRevision)]; - case 3: - _a = _f.sent(), deployable = _a[0], code = _a[1]; - fullName = "".concat(deployable.context, ".").concat(deployable.name); - if (!found.has(fullName)) return [3 /*break*/, 4]; - console.error("Prepared ".concat(deployable.type.replaceAll('-', ' '), " ").concat(fullName, ": DUPLICATE")); - return [3 /*break*/, 8]; - case 4: - _c = (_b = found).set; - _d = [fullName]; - if (!(disableAi || deployable.disableAi || deployable.type === 'webhook')) return [3 /*break*/, 5]; - _e = deployable; - return [3 /*break*/, 7]; - case 5: return [4 /*yield*/, fillInMissingDetails(deployable, code)]; - case 6: - _e = _f.sent(); - _f.label = 7; - case 7: - _c.apply(_b, _d.concat([_e])); - console.log("Prepared ".concat(deployable.type.replaceAll('-', ' '), " ").concat(fullName, ": ").concat(deployable.dirty && !disableDocs ? 'UPDATED' : 'OK')); - _f.label = 8; - case 8: return [3 /*break*/, 10]; - case 9: - err_1 = _f.sent(); - console.error("ERROR parsing ".concat(possible)); - console.error(err_1); - return [3 /*break*/, 10]; - case 10: - _i++; - return [3 /*break*/, 1]; - case 11: return [2 /*return*/, Array.from(found.values())]; - } - }); -}); }; -var prepareDeployables = function (lazy, disableDocs, disableAi) { return __awaiter(void 0, void 0, void 0, function () { - var _a, gitRevision, parsedDeployables, dirtyDeployables; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - _a = lazy; - if (!_a) return [3 /*break*/, 2]; - return [4 /*yield*/, (0, deployables_1.isCacheUpToDate)()]; - case 1: - _a = (_b.sent()); - _b.label = 2; - case 2: - if (_a) { - console.log('Poly deployments are prepared.'); - return [2 /*return*/]; - } - shelljs_1.default.echo('Preparing Poly deployments...'); - return [4 /*yield*/, (0, deployables_1.prepareDeployableDirectory)()]; - case 3: - _b.sent(); - gitRevision = (0, deployables_1.getGitRevision)(); - return [4 /*yield*/, getAllDeployables(disableDocs, disableAi, gitRevision)]; - case 4: - parsedDeployables = _b.sent(); - if (!parsedDeployables.length) { - console.warn('No deployable files found. Did you define a `polyConfig` within your deployment?'); - return [2 /*return*/, process.exit(1)]; - } - dirtyDeployables = parsedDeployables.filter(function (d) { return !!d.dirty; }); - if (!dirtyDeployables.length) return [3 /*break*/, 6]; - // Write back deployables files with updated comments - console.log("Fixing ".concat(dirtyDeployables.length, " deployable file").concat(dirtyDeployables.length === 1 ? '' : 's', ".")); - // NOTE: writeUpdatedDeployable has side effects that update deployable.fileRevision which is in both this list and parsedDeployables - return [4 /*yield*/, Promise.all(dirtyDeployables.map(function (deployable) { return (0, deployables_1.writeUpdatedDeployable)(deployable, disableDocs); }))]; - case 5: - // NOTE: writeUpdatedDeployable has side effects that update deployable.fileRevision which is in both this list and parsedDeployables - _b.sent(); - _b.label = 6; - case 6: - console.log('Poly deployments are prepared.'); - return [4 /*yield*/, (0, deployables_1.saveDeployableRecords)(parsedDeployables)]; - case 7: - _b.sent(); - return [4 /*yield*/, (0, deployables_1.writeCacheRevision)(gitRevision)]; - case 8: - _b.sent(); - console.log('Cached deployables and generated typedefs into node_modules/.poly/deployables directory.'); - return [2 /*return*/]; - } - }); -}); }; -exports.prepareDeployables = prepareDeployables; diff --git a/build/commands/setup.js b/build/commands/setup.js deleted file mode 100644 index c0266ca..0000000 --- a/build/commands/setup.js +++ /dev/null @@ -1,311 +0,0 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var shelljs_1 = require("shelljs"); -var prompts_1 = require("@inquirer/prompts"); -var fs_1 = require("fs"); -var config_1 = require("../config"); -var chalk_1 = require("chalk"); -var axios_1 = require("axios"); -var path_1 = require("path"); -var adm_zip_1 = require("adm-zip"); -var client_dependencies_1 = require("@poly/common/client-dependencies"); -var api_1 = require("../api"); -var utils_1 = require("../utils"); -var setup = function (polyPath, baseUrl, apiKey, apiVersion) { - if (apiVersion === void 0) { apiVersion = '1'; } - return __awaiter(void 0, void 0, void 0, function () { - var isNonInteractive, polyApiBaseUrl, polyApiKey, _a, tenantId, environmentId, projectTemplatesConfig, templateChoices, projectTemplateFileUrl, error_1, errorMessage; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - _b.trys.push([0, 11, , 12]); - (0, config_1.loadConfig)(polyPath); - process.env.POLY_API_KEY = process.env.POLY_API_KEY || apiVersion; - isNonInteractive = baseUrl && apiKey; - baseUrl = (0, utils_1.validateBaseUrl)(baseUrl); - if (!!process.env.ENVIRONMENT_SETUP_COMPLETE) return [3 /*break*/, 2]; - return [4 /*yield*/, setupEnvironment(polyPath)]; - case 1: - _b.sent(); - _b.label = 2; - case 2: - polyApiBaseUrl = baseUrl; - polyApiKey = apiKey; - if (!!isNonInteractive) return [3 /*break*/, 10]; - return [4 /*yield*/, shelljs_1.default.echo('Please setup your connection to Poly service.')]; - case 3: - _b.sent(); - return [4 /*yield*/, (0, prompts_1.input)({ - message: 'Poly API Base URL:', - default: process.env.POLY_API_BASE_URL || 'https://na1.polyapi.io', - transformer: function (value) { return value.trim(); }, - validate: function (url) { - if (!utils_1.URL_REGEX.test(url)) { - return 'Given URL is not valid. Please enter a valid URL.'; - } - return true; - }, - })]; - case 4: - polyApiBaseUrl = _b.sent(); - polyApiBaseUrl = (0, utils_1.validateBaseUrl)(polyApiBaseUrl); - return [4 /*yield*/, (0, prompts_1.input)({ - message: 'Poly App Key or User Key:', - default: process.env.POLY_API_KEY, - transformer: function (value) { return value.trim(); }, - })]; - case 5: - polyApiKey = _b.sent(); - if (!(process.env.ENVIRONMENT_SETUP_COMPLETE !== 'true')) return [3 /*break*/, 10]; - return [4 /*yield*/, (0, api_1.getAuthData)(polyApiBaseUrl, polyApiKey)]; - case 6: - _a = _b.sent(), tenantId = _a.tenant.id, environmentId = _a.environment.id; - return [4 /*yield*/, (0, api_1.getProjectTemplatesConfig)(polyApiBaseUrl, polyApiKey, tenantId, environmentId)]; - case 7: - projectTemplatesConfig = _b.sent(); - templateChoices = __spreadArray([ - { name: 'No (empty project)', value: null } - ], projectTemplatesConfig.templates - .filter(function (template) { return template.typescript; }) - .map(function (template) { return ({ name: template.name, value: template.typescript }); }), true); - return [4 /*yield*/, (0, prompts_1.rawlist)({ - message: 'Do you want to use a project template?', - choices: templateChoices, - })]; - case 8: - projectTemplateFileUrl = _b.sent(); - if (!projectTemplateFileUrl) return [3 /*break*/, 10]; - return [4 /*yield*/, initProjectStructure(projectTemplateFileUrl)]; - case 9: - _b.sent(); - _b.label = 10; - case 10: - polyApiBaseUrl = (0, utils_1.validateBaseUrl)(polyApiBaseUrl); - (0, config_1.saveConfig)(polyPath, { - POLY_API_BASE_URL: polyApiBaseUrl, - POLY_API_KEY: polyApiKey, - API_VERSION: apiVersion || '1', - DISABLE_AI: process.env.DISABLE_AI || 'false', - NO_COLOR: process.env.NO_COLOR || 'false', - ENVIRONMENT_SETUP_COMPLETE: 'true', - }); - shelljs_1.default.echo(chalk_1.default.green('Poly setup complete.')); - return [3 /*break*/, 12]; - case 11: - error_1 = _b.sent(); - errorMessage = (0, utils_1.handleAxiosError)(error_1, axios_1.default); - shelljs_1.default.echo(chalk_1.default.redBright('ERROR:'), errorMessage); - return [3 /*break*/, 12]; - case 12: return [2 /*return*/]; - } - }); - }); -}; -var initProjectStructure = function (fileUrl) { return __awaiter(void 0, void 0, void 0, function () { - var response, fileName, filePath, zip, zipBaseName, extractedDirPath, error_2; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.trys.push([0, 2, , 3]); - shelljs_1.default.echo('-n', 'Downloading project template...'); - return [4 /*yield*/, axios_1.default.get(fileUrl, { - responseType: 'arraybuffer', - })]; - case 1: - response = _a.sent(); - fileName = path_1.default.basename(fileUrl); - filePath = path_1.default.join(process.cwd(), fileName); - fs_1.default.writeFileSync(filePath, response.data); - shelljs_1.default.echo(chalk_1.default.green('DONE')); - shelljs_1.default.echo('-n', 'Extracting project template...'); - zip = new adm_zip_1.default(filePath); - zip.extractAllTo(process.cwd(), true); - shelljs_1.default.echo(chalk_1.default.green('DONE')); - zipBaseName = path_1.default.parse(filePath).name; - extractedDirPath = path_1.default.join(process.cwd(), zipBaseName); - // Check if single directory with same name as zip file exists - if (fs_1.default.existsSync(extractedDirPath) && fs_1.default.statSync(extractedDirPath).isDirectory()) { - // Move all contents to current directory and remove extracted directory - shelljs_1.default.mv("".concat(extractedDirPath, "/*"), process.cwd()); - fs_1.default.rmdirSync(extractedDirPath); - } - fs_1.default.unlinkSync(filePath); - return [3 /*break*/, 3]; - case 2: - error_2 = _a.sent(); - shelljs_1.default.echo(chalk_1.default.red('ERROR')); - shelljs_1.default.echo(chalk_1.default.red('Project template cannot be downloaded or extracted. Continuing...')); - return [3 /*break*/, 3]; - case 3: return [2 /*return*/]; - } - }); -}); }; -var setupEnvironment = function (polyPath) { return __awaiter(void 0, void 0, void 0, function () { - var packageJson; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - (0, config_1.loadConfig)(polyPath); - (0, client_dependencies_1.checkNodeVersion)({ - onOldVersion: function (message) { - shelljs_1.default.echo(chalk_1.default.red(message)); - throw new Error('Node.js version is too old.'); - }, - }); - packageJson = getPackageJson(); - return [4 /*yield*/, (0, client_dependencies_1.checkLibraryVersions)(packageJson, { - createOrUpdateLib: function (library, create) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, shelljs_1.default.echo("".concat(create ? 'Installing' : 'Updating', " ").concat(library, "..."))]; - case 1: - _a.sent(); - return [4 /*yield*/, shelljs_1.default.exec("".concat((0, client_dependencies_1.getPackageManager)(), " add ").concat(library, "@latest"))]; - case 2: - _a.sent(); - return [2 /*return*/]; - } - }); - }); - }, - requestUserPermissionToUpdateLib: function (library, version, minVersion) { - return __awaiter(this, void 0, void 0, function () { - var updateVersion; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, (0, prompts_1.confirm)({ - message: (0, client_dependencies_1.getUpdateLibraryVersionMessage)(version, minVersion, library), - default: true, - })]; - case 1: - updateVersion = _a.sent(); - return [2 /*return*/, updateVersion]; - } - }); - }); - }, - })]; - case 1: - _a.sent(); - return [4 /*yield*/, (0, client_dependencies_1.checkTsConfig)({ - getCurrentConfig: function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - if (!fs_1.default.existsSync("".concat(process.cwd(), "/tsconfig.json"))) { - return [2 /*return*/, undefined]; - } - return [2 /*return*/, fs_1.default.readFileSync("".concat(process.cwd(), "/tsconfig.json")).toString()]; - }); - }); - }, - requestUserPermissionToCreateTsConfig: function () { - return __awaiter(this, void 0, void 0, function () { - var createTsConfig; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, (0, prompts_1.confirm)({ - message: 'tsconfig.json does not exist. Do you want to create it?', - default: true, - })]; - case 1: - createTsConfig = _a.sent(); - return [2 /*return*/, createTsConfig]; - } - }); - }); - }, - requestUserPermissionToUpdateTsConfig: function () { - return __awaiter(this, void 0, void 0, function () { - var updateTsConfig; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, (0, prompts_1.confirm)({ - message: 'tsconfig.json does not have esModuleInterop set to true. Do you want to update it?', - default: true, - })]; - case 1: - updateTsConfig = _a.sent(); - return [2 /*return*/, updateTsConfig]; - } - }); - }); - }, - saveTsConfig: function (tsConfig) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - fs_1.default.writeFileSync("".concat(process.cwd(), "/tsconfig.json"), tsConfig); - return [2 /*return*/]; - }); - }); - }, - })]; - case 2: - _a.sent(); - shelljs_1.default.exec("".concat((0, client_dependencies_1.getPackageManager)(), " install")); - return [2 /*return*/]; - } - }); -}); }; -var getPackageJson = function () { - var packageJson; - try { - packageJson = fs_1.default.readFileSync("".concat(process.cwd(), "/package.json")); - } - catch (error) { - throw new Error("Failed to open package.json file, details: ".concat(error.message)); - } - try { - var contents = JSON.parse(packageJson.toString()); - return contents; - } - catch (error) { - throw new Error('package.json file contains JSON syntax errors, please fix and try again.'); - } -}; -exports.default = setup; diff --git a/build/commands/snippet.js b/build/commands/snippet.js deleted file mode 100644 index 37a99eb..0000000 --- a/build/commands/snippet.js +++ /dev/null @@ -1,121 +0,0 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.addSnippet = void 0; -var fs_1 = require("fs"); -var util_1 = require("util"); -var chalk_1 = require("chalk"); -var shelljs_1 = require("shelljs"); -var api_1 = require("../api"); -var utils_1 = require("../utils"); -var readFile = (0, util_1.promisify)(fs_1.default.readFile); -var languageFormatMap = { - javascript: ['js', 'ts', 'mjs'], - java: ['java'], - python: ['py'], -}; -var addSnippet = function (polyPath, name, path, context, description) { return __awaiter(void 0, void 0, void 0, function () { - var code, language, error_1, fileFormat, _i, _a, _b, currentLanguage, formats, response, error_2, httpStatusCode, errMessage, finalMessage, messages; - var _c, _d, _e; - return __generator(this, function (_f) { - switch (_f.label) { - case 0: - code = ''; - language = ''; - _f.label = 1; - case 1: - _f.trys.push([1, 3, , 4]); - return [4 /*yield*/, readFile(path, { encoding: 'utf-8' })]; - case 2: - code = _f.sent(); - return [3 /*break*/, 4]; - case 3: - error_1 = _f.sent(); - throw new Error('File does not exist.'); - case 4: - fileFormat = path.split('.').pop(); - for (_i = 0, _a = Object.entries(languageFormatMap); _i < _a.length; _i++) { - _b = _a[_i], currentLanguage = _b[0], formats = _b[1]; - if (formats.includes(fileFormat)) { - language = currentLanguage; - break; - } - } - _f.label = 5; - case 5: - _f.trys.push([5, 7, , 8]); - shelljs_1.default.echo('Adding snippet...'); - return [4 /*yield*/, (0, api_1.upsertSnippet)({ - name: name, - context: context, - description: description || undefined, - code: code, - language: language, - })]; - case 6: - response = _f.sent(); - shelljs_1.default.echo("".concat(chalk_1.default.greenBright('Success:')), 'Snippet successfully added.'); - shelljs_1.default.echo("Snippet ID: ".concat(response.data.id)); - (0, utils_1.upsertResourceInSpec)(polyPath, { - updated: response.status === 200, - resourceId: response.data.id, - resourceName: 'snippet', - }); - return [3 /*break*/, 8]; - case 7: - error_2 = _f.sent(); - httpStatusCode = (_c = error_2.response) === null || _c === void 0 ? void 0 : _c.status; - errMessage = (_e = (_d = error_2.response) === null || _d === void 0 ? void 0 : _d.data) === null || _e === void 0 ? void 0 : _e.message; - finalMessage = ''; - if (httpStatusCode === 400) { - messages = Array.isArray(error_2.response.data.message) ? error_2.response.data.message : ["Failed with status code ".concat(chalk_1.default.redBright(400))]; - finalMessage = messages[0]; - } - else if (httpStatusCode) { - finalMessage = errMessage; - } - else { - finalMessage = error_2.message; - } - shelljs_1.default.echo("".concat(chalk_1.default.redBright('Error:')), finalMessage); - return [3 /*break*/, 8]; - case 8: return [2 /*return*/]; - } - }); -}); }; -exports.addSnippet = addSnippet; diff --git a/build/commands/sync.js b/build/commands/sync.js deleted file mode 100644 index b15ced4..0000000 --- a/build/commands/sync.js +++ /dev/null @@ -1,261 +0,0 @@ -"use strict"; -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.syncDeployables = void 0; -var fs_1 = require("fs"); -var lodash_1 = require("lodash"); -var deployables_1 = require("../deployables"); -var api_1 = require("../api"); -var DEPLOY_ORDER = [ - 'server-function', - 'client-function', - 'webhook', -]; -var removeDeployable = function (deployable) { return __awaiter(void 0, void 0, void 0, function () { - var _a, instance, instance, webhook; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - _a = deployable.type; - switch (_a) { - case 'server-function': return [3 /*break*/, 1]; - case 'client-function': return [3 /*break*/, 4]; - case 'webhook': return [3 /*break*/, 7]; - } - return [3 /*break*/, 10]; - case 1: return [4 /*yield*/, (0, api_1.getServerFunctionByName)(deployable.context, deployable.name)]; - case 2: - instance = _b.sent(); - if (!instance) - return [2 /*return*/, false]; - return [4 /*yield*/, (0, api_1.deleteServerFunction)(instance.id)]; - case 3: - _b.sent(); - return [2 /*return*/, true]; - case 4: return [4 /*yield*/, (0, api_1.getClientFunctionByName)(deployable.context, deployable.name)]; - case 5: - instance = _b.sent(); - if (!instance) - return [2 /*return*/, false]; - return [4 /*yield*/, (0, api_1.deleteClientFunction)(instance.id)]; - case 6: - _b.sent(); - return [2 /*return*/, true]; - case 7: return [4 /*yield*/, (0, api_1.getWebhookByName)(deployable.context, deployable.name)]; - case 8: - webhook = _b.sent(); - if (!webhook) - return [2 /*return*/, false]; - return [4 /*yield*/, (0, api_1.deleteWebhook)(webhook.id)]; - case 9: - _b.sent(); - return [2 /*return*/, true]; - case 10: return [2 /*return*/, false]; - } - }); -}); }; -var syncDeployableAndGetId = function (deployable, code) { return __awaiter(void 0, void 0, void 0, function () { - var _a; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - _a = deployable.type; - switch (_a) { - case 'server-function': return [3 /*break*/, 1]; - case 'client-function': return [3 /*break*/, 3]; - case 'webhook': return [3 /*break*/, 5]; - } - return [3 /*break*/, 7]; - case 1: return [4 /*yield*/, (0, api_1.createOrUpdateServerFunction)(deployable.context, deployable.name, deployable.description, code, deployable.typeSchemas, deployable.dependencies, deployable.config)]; - case 2: return [2 /*return*/, (_b.sent()).id]; - case 3: return [4 /*yield*/, (0, api_1.createOrUpdateClientFunction)(deployable.context, deployable.name, deployable.description, code, deployable.typeSchemas, deployable.config)]; - case 4: return [2 /*return*/, (_b.sent()).id]; - case 5: return [4 /*yield*/, (0, api_1.createOrUpdateWebhook)(deployable.context, deployable.name, deployable.description, deployable.config)]; - case 6: return [2 /*return*/, (_b.sent()).id]; - case 7: throw new Error("Unsupported deployable type: '".concat(deployable.type, "'")); - } - }); -}); }; -var syncDeployable = function (deployable) { return __awaiter(void 0, void 0, void 0, function () { - var code, id; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - code = fs_1.default.readFileSync(deployable.file, 'utf8'); - return [4 /*yield*/, syncDeployableAndGetId(deployable, code)]; - case 1: - id = _a.sent(); - return [2 /*return*/, { - name: deployable.name, - context: deployable.context, - instance: deployable.instance, - type: deployable.type, - id: id, - deployed: new Date().toISOString(), - fileRevision: deployable.fileRevision, - }]; - } - }); -}); }; -var syncDeployables = function (dryRun, instance) { - if (instance === void 0) { instance = process.env.POLY_API_BASE_URL; } - return __awaiter(void 0, void 0, void 0, function () { - var gitRevision, allDeployables, toRemove, groupedDeployables, _i, DEPLOY_ORDER_1, type, deployables, _loop_1, _a, deployables_2, deployable; - var _b, _c; - return __generator(this, function (_d) { - switch (_d.label) { - case 0: return [4 /*yield*/, (0, deployables_1.prepareDeployableDirectory)()]; - case 1: - _d.sent(); - return [4 /*yield*/, (0, deployables_1.getCacheDeploymentsRevision)()]; - case 2: - gitRevision = _d.sent(); - return [4 /*yield*/, (0, deployables_1.loadDeployableRecords)()]; - case 3: - allDeployables = _d.sent(); - toRemove = []; - if (!allDeployables.length) { - console.log('No deployables found. Skipping sync.'); - return [2 /*return*/]; - } - groupedDeployables = (0, lodash_1.groupBy)(allDeployables, 'type'); - _i = 0, DEPLOY_ORDER_1 = DEPLOY_ORDER; - _d.label = 4; - case 4: - if (!(_i < DEPLOY_ORDER_1.length)) return [3 /*break*/, 9]; - type = DEPLOY_ORDER_1[_i]; - deployables = groupedDeployables[type] || []; - _loop_1 = function (deployable) { - var previousDeployment, gitRevisionChanged, fileRevisionChanged, action, syncDeployment, deployment, found, removeIndex; - return __generator(this, function (_e) { - switch (_e.label) { - case 0: - previousDeployment = deployable.deployments.find(function (i) { return i.instance === instance; }); - gitRevisionChanged = gitRevision !== deployable.gitRevision; - fileRevisionChanged = (previousDeployment === null || previousDeployment === void 0 ? void 0 : previousDeployment.fileRevision) !== deployable.fileRevision; - action = gitRevisionChanged - ? 'REMOVED' - : !(previousDeployment === null || previousDeployment === void 0 ? void 0 : previousDeployment.id) - ? 'ADDED' - : fileRevisionChanged - ? 'UPDATED' - : 'OK'; - if (!(!dryRun && (gitRevisionChanged || fileRevisionChanged))) return [3 /*break*/, 6]; - if (!(previousDeployment && deployable.type !== previousDeployment.type)) return [3 /*break*/, 2]; - return [4 /*yield*/, removeDeployable(previousDeployment)]; - case 1: - _e.sent(); - _e.label = 2; - case 2: - syncDeployment = __assign(__assign(__assign({}, deployable), previousDeployment), { type: deployable.type, description: (_b = deployable.description) !== null && _b !== void 0 ? _b : (_c = deployable.types) === null || _c === void 0 ? void 0 : _c.description, instance: instance }); - if (!(gitRevision === deployable.gitRevision)) return [3 /*break*/, 4]; - return [4 /*yield*/, syncDeployable(syncDeployment)]; - case 3: - deployment = _e.sent(); - if (previousDeployment) { - previousDeployment.id = deployment.id; - previousDeployment.context = deployment.context; - previousDeployment.name = deployment.name; - previousDeployment.type = deployment.type; - previousDeployment.deployed = deployment.deployed; - previousDeployment.fileRevision = deployment.fileRevision; - } - else { - deployable.deployments.unshift(deployment); - } - return [3 /*break*/, 6]; - case 4: return [4 /*yield*/, removeDeployable(syncDeployment)]; - case 5: - found = _e.sent(); - if (!found) - action = 'NOT FOUND'; - removeIndex = allDeployables.findIndex(function (d) { return d.name === deployable.name && d.context === deployable.context && d.file === deployable.file; }); - toRemove.push.apply(toRemove, allDeployables.splice(removeIndex, 1)); - _e.label = 6; - case 6: - console.log("".concat(dryRun ? 'Would sync' : 'Synced', " ").concat(deployable.type.replaceAll('-', ' '), " ").concat(deployable.context, ".").concat(deployable.name, ": ").concat(dryRun ? 'TO BE ' : '').concat(action)); - return [2 /*return*/]; - } - }); - }; - _a = 0, deployables_2 = deployables; - _d.label = 5; - case 5: - if (!(_a < deployables_2.length)) return [3 /*break*/, 8]; - deployable = deployables_2[_a]; - return [5 /*yield**/, _loop_1(deployable)]; - case 6: - _d.sent(); - _d.label = 7; - case 7: - _a++; - return [3 /*break*/, 5]; - case 8: - _i++; - return [3 /*break*/, 4]; - case 9: - if (dryRun) - return [2 /*return*/]; - return [4 /*yield*/, Promise.all(allDeployables.map(function (deployable) { return (0, deployables_1.writeUpdatedDeployable)(deployable, true); }))]; - case 10: - _d.sent(); - return [4 /*yield*/, (0, deployables_1.saveDeployableRecords)(allDeployables)]; - case 11: - _d.sent(); - if (!toRemove.length) return [3 /*break*/, 13]; - return [4 /*yield*/, (0, deployables_1.removeDeployableRecords)(toRemove)]; - case 12: - _d.sent(); - _d.label = 13; - case 13: return [2 /*return*/]; - } - }); - }); -}; -exports.syncDeployables = syncDeployables; diff --git a/build/commands/tenant.js b/build/commands/tenant.js deleted file mode 100644 index ec1b0a2..0000000 --- a/build/commands/tenant.js +++ /dev/null @@ -1,279 +0,0 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.create = void 0; -var shelljs_1 = require("shelljs"); -var prompts_1 = require("@inquirer/prompts"); -var chalk_1 = require("chalk"); -var api_1 = require("../api"); -var config_1 = require("../config"); -var child_process_1 = require("child_process"); -var util_1 = require("util"); -var isEmail_1 = require("validator/lib/isEmail"); -var exec = (0, util_1.promisify)(child_process_1.exec); -var create = function (instance, loadedTenantSignUp) { - if (loadedTenantSignUp === void 0) { loadedTenantSignUp = null; } - return __awaiter(void 0, void 0, void 0, function () { - var tenantSignUp, credentials, email, tenantName, requestEmail, requestTenant, signUp, err_1, verifyTenant, error_1, generate, error_2; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - tenantSignUp = loadedTenantSignUp; - credentials = null; - email = ''; - tenantName = null; - requestEmail = function () { return __awaiter(void 0, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, (0, prompts_1.input)({ - message: 'Enter your email:', - transformer: function (value) { return value.trim(); }, - validate: function (email) { - if (typeof email !== 'string' || !(0, isEmail_1.default)(email)) { - return 'Given email is not valid. Enter a valid email.'; - } - return true; - }, - })]; - case 1: - email = _a.sent(); - return [2 /*return*/]; - } - }); - }); }; - requestTenant = function () { return __awaiter(void 0, void 0, void 0, function () { - var result; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, (0, prompts_1.input)({ - message: 'Enter your desired tenant name (optional):', - transformer: function (value) { return value.trim(); }, - })]; - case 1: - result = _a.sent(); - tenantName = result || null; - return [2 /*return*/]; - } - }); - }); }; - signUp = function (data) { - if (data === void 0) { data = ''; } - return __awaiter(void 0, void 0, void 0, function () { - var acceptedTos, response, error_3; - var _a; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - _b.trys.push([0, 8, , 9]); - if (!(data === 'tenant')) return [3 /*break*/, 2]; - return [4 /*yield*/, requestTenant()]; - case 1: - _b.sent(); - return [3 /*break*/, 6]; - case 2: return [4 /*yield*/, requestEmail()]; - case 3: - _b.sent(); - return [4 /*yield*/, requestTenant()]; - case 4: - _b.sent(); - return [4 /*yield*/, (0, prompts_1.confirm)({ - message: 'Do you agree with our terms of service expressed here: https://polyapi.io/terms-of-service ?', - })]; - case 5: - acceptedTos = _b.sent(); - if (!acceptedTos) { - return [2 /*return*/, false]; - } - _b.label = 6; - case 6: - shelljs_1.default.echo('-n', '\n\nChecking email and tenant name...\n\n'); - return [4 /*yield*/, (0, api_1.createTenantSignUp)(instance, email, tenantName)]; - case 7: - response = _b.sent(); - tenantSignUp = response; - return [3 /*break*/, 9]; - case 8: - error_3 = _b.sent(); - shelljs_1.default.echo(chalk_1.default.red('ERROR\n')); - if (((_a = error_3.response) === null || _a === void 0 ? void 0 : _a.status) === 409) { - if (error_3.response.data.code === 'TENANT_ALREADY_EXISTS') { - shelljs_1.default.echo('Tenant already in use.\n'); - return [2 /*return*/, signUp('tenant')]; - } - else if (error_3.response.data.code === 'EMAIL_ALREADY_EXISTS') { - shelljs_1.default.echo('Email already in use.\n'); - return [2 /*return*/, signUp()]; - } - } - shelljs_1.default.echo('Error during sign up process.\n'); - throw error_3; - case 9: return [2 /*return*/, true]; - } - }); - }); - }; - _a.label = 1; - case 1: - _a.trys.push([1, 3, , 4]); - return [4 /*yield*/, signUp()]; - case 2: - if (!(_a.sent())) { - return [2 /*return*/]; - } - return [3 /*break*/, 4]; - case 3: - err_1 = _a.sent(); - return [2 /*return*/]; - case 4: - verifyTenant = function (showDescription) { - if (showDescription === void 0) { showDescription = true; } - return __awaiter(void 0, void 0, void 0, function () { - var code, error_4, response, error_5; - var _a, _b, _c, _d, _e, _f, _g; - return __generator(this, function (_h) { - switch (_h.label) { - case 0: - if (showDescription) { - shelljs_1.default.echo('A verification code has been sent to your email address', chalk_1.default.bold("(".concat(tenantSignUp.email, "),")), 'check your email and enter your verification code. \nIf you didn\'t receive your verification code you can enter', chalk_1.default.bold('resend'), 'to send it again\n'); - } - return [4 /*yield*/, (0, prompts_1.input)({ - message: 'Enter your verification code:', - transformer: function (value) { return value.trim(); }, - validate: function (verificationCode) { return !!verificationCode.length; }, - })]; - case 1: - code = _h.sent(); - if (!(code === 'resend')) return [3 /*break*/, 6]; - _h.label = 2; - case 2: - _h.trys.push([2, 4, , 5]); - shelljs_1.default.echo('\n\nResending your verification code...\n'); - return [4 /*yield*/, (0, api_1.resendVerificationCode)(instance, tenantSignUp.email)]; - case 3: - _h.sent(); - return [3 /*break*/, 5]; - case 4: - error_4 = _h.sent(); - shelljs_1.default.echo(chalk_1.default.red('ERROR\n')); - shelljs_1.default.echo('Error sending verification code to', "".concat(chalk_1.default.bold(tenantSignUp.email), "."), '\n'); - throw error_4; - case 5: return [2 /*return*/, verifyTenant(false)]; - case 6: - shelljs_1.default.echo('-n', 'Verifying your code...\n\n'); - _h.label = 7; - case 7: - _h.trys.push([7, 9, , 13]); - return [4 /*yield*/, (0, api_1.verifyTenantSignUp)(instance, tenantSignUp.email, code)]; - case 8: - response = _h.sent(); - shelljs_1.default.echo(chalk_1.default.green('Tenant created successfully, details:\n')); - shelljs_1.default.echo(chalk_1.default.bold('Instance url:'), response.apiBaseUrl, '\n'); - shelljs_1.default.echo(chalk_1.default.bold('Admin polyApiKey:'), response.apiKey, '\n'); - credentials = { - apiBaseUrl: response.apiBaseUrl, - apiKey: response.apiKey, - }; - return [3 /*break*/, 13]; - case 9: - error_5 = _h.sent(); - shelljs_1.default.echo(chalk_1.default.red('ERROR\n')); - if (!(((_a = error_5.response) === null || _a === void 0 ? void 0 : _a.status) === 409)) return [3 /*break*/, 12]; - if (((_c = (_b = error_5.response) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.code) === 'INVALID_VERIFICATION_CODE') { - shelljs_1.default.echo('Wrong verification code. If you didn\'t receive your verification code, you can type', chalk_1.default.bold('resend'), 'to send a new one.'); - } - if (((_e = (_d = error_5.response) === null || _d === void 0 ? void 0 : _d.data) === null || _e === void 0 ? void 0 : _e.code) === 'EXPIRED_VERIFICATION_CODE') { - shelljs_1.default.echo('Verification code has expired.\n'); - return [2 /*return*/, verifyTenant()]; - } - if (!(((_g = (_f = error_5.response) === null || _f === void 0 ? void 0 : _f.data) === null || _g === void 0 ? void 0 : _g.code) === 'TENANT_ALREADY_EXISTS')) return [3 /*break*/, 11]; - shelljs_1.default.echo('Tenant already in use.\n'); - return [4 /*yield*/, signUp('tenant')]; - case 10: - _h.sent(); - return [2 /*return*/, verifyTenant()]; - case 11: return [2 /*return*/, verifyTenant()]; - case 12: - shelljs_1.default.echo('Error during sign up process.\n'); - throw error_5; - case 13: return [2 /*return*/, true]; - } - }); - }); - }; - _a.label = 5; - case 5: - _a.trys.push([5, 7, , 8]); - return [4 /*yield*/, verifyTenant()]; - case 6: - if (!(_a.sent())) { - return [2 /*return*/]; - } - return [3 /*break*/, 8]; - case 7: - error_1 = _a.sent(); - return [2 /*return*/]; - case 8: return [4 /*yield*/, (0, prompts_1.confirm)({ - message: 'Would you like to generate the poly client library using the new tenant key?', - })]; - case 9: - generate = _a.sent(); - if (!generate) return [3 /*break*/, 13]; - (0, config_1.saveConfig)(undefined, { - POLY_API_BASE_URL: credentials.apiBaseUrl, - POLY_API_KEY: credentials.apiKey, - }); - _a.label = 10; - case 10: - _a.trys.push([10, 12, , 13]); - shelljs_1.default.echo('Generating your poly client library...\n'); - return [4 /*yield*/, exec('npx poly generate')]; - case 11: - _a.sent(); - shelljs_1.default.echo(chalk_1.default.green('Poly client library generated.')); - return [3 /*break*/, 13]; - case 12: - error_2 = _a.sent(); - shelljs_1.default.echo(chalk_1.default.red('ERROR\n')); - shelljs_1.default.echo('Error generating your poly client library.'); - return [3 /*break*/, 13]; - case 13: return [2 /*return*/]; - } - }); - }); -}; -exports.create = create; diff --git a/build/config.js b/build/config.js deleted file mode 100644 index 6b3a646..0000000 --- a/build/config.js +++ /dev/null @@ -1,29 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.saveConfig = exports.loadConfig = void 0; -var fs_1 = require("fs"); -var dotenv_1 = require("dotenv"); -var getPolyConfigDirPath = function (polyPath) { - // If path does not start with `./` or `/` then we adjust! - return /^\.?\/.*/.test(polyPath) ? polyPath : "".concat(__dirname, "/../../../../../").concat(polyPath); -}; -var getPolyConfigFilePath = function (polyPath) { - return "".concat(getPolyConfigDirPath(polyPath), "/.config.env"); -}; -var loadConfig = function (polyPath) { - var configFilePath = getPolyConfigFilePath(polyPath); - if (fs_1.default.existsSync(configFilePath)) { - dotenv_1.default.config({ path: configFilePath, override: process.env.CONFIG_ENV_PATH_PRIORITY === 'true' }); - } -}; -exports.loadConfig = loadConfig; -var saveConfig = function (polyPath, config) { - fs_1.default.mkdirSync(getPolyConfigDirPath(polyPath), { recursive: true }); - fs_1.default.writeFileSync(getPolyConfigFilePath(polyPath), Object.entries(config) - .map(function (_a) { - var key = _a[0], value = _a[1]; - return "".concat(key, "=").concat(value); - }) - .join('\n')); -}; -exports.saveConfig = saveConfig; diff --git a/build/constants.js b/build/constants.js deleted file mode 100644 index 81d8c1d..0000000 --- a/build/constants.js +++ /dev/null @@ -1,4 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.DEFAULT_POLY_PATH = void 0; -exports.DEFAULT_POLY_PATH = 'node_modules/.poly'; diff --git a/build/deployables.js b/build/deployables.js deleted file mode 100644 index 0d061fb..0000000 --- a/build/deployables.js +++ /dev/null @@ -1,348 +0,0 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.writeUpdatedDeployable = exports.writeDeployComments = exports.isCacheUpToDate = exports.writeCacheRevision = exports.getCacheDeploymentsRevision = exports.getGitRevision = exports.getDeployableFileRevision = exports.getAllDeployableFiles = exports.getAllDeployableFilesLinux = exports.getAllDeployableFilesWindows = exports.removeDeployableRecords = exports.saveDeployableRecords = exports.loadDeployableRecords = exports.prepareDeployableDirectory = exports.DeployableTsTypeToName = exports.DeployableTypeEntries = exports.CACHE_DIR = exports.CACHE_VERSION_FILE = void 0; -var os_1 = require("os"); -var fs_1 = require("fs"); -var promises_1 = require("node:fs/promises"); -var shelljs_1 = require("shelljs"); -var crypto_1 = require("crypto"); -exports.CACHE_VERSION_FILE = './node_modules/.poly/deployments_revision'; -exports.CACHE_DIR = './node_modules/.poly/deployables'; -exports.DeployableTypeEntries = []; -exports.DeployableTypeEntries.push(['PolyServerFunction', 'server-function']); -exports.DeployableTypeEntries.push(['PolyClientFunction', 'client-function']); -// DeployableTypeEntries.push(['PolyApiFunction', 'api-function']); -// DeployableTypeEntries.push(['PolyVariable', 'variable']); -exports.DeployableTypeEntries.push(['PolyWebhook', 'webhook']); -// DeployableTypeEntries.push(['PolyTrigger', 'trigger']); -exports.DeployableTsTypeToName = Object.fromEntries(exports.DeployableTypeEntries); -var prepareDeployableDirectory = function () { return __awaiter(void 0, void 0, void 0, function () { - var _a; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - _b.trys.push([0, 2, , 3]); - return [4 /*yield*/, (0, promises_1.mkdir)(exports.CACHE_DIR, { recursive: true })]; - case 1: - _b.sent(); - return [3 /*break*/, 3]; - case 2: - _a = _b.sent(); - return [3 /*break*/, 3]; - case 3: return [2 /*return*/]; - } - }); -}); }; -exports.prepareDeployableDirectory = prepareDeployableDirectory; -var loadDeployableRecords = function () { return __awaiter(void 0, void 0, void 0, function () { - var cachedRecords; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, (0, promises_1.readdir)(exports.CACHE_DIR, { withFileTypes: true })]; - case 1: - cachedRecords = (_a.sent()) - .filter(function (d) { return d.isFile() && d.name.endsWith('.json'); }) - .map(function (d) { return d.name; }); - return [2 /*return*/, Promise.all(cachedRecords.map(function (name) { - return readJsonFile("".concat(exports.CACHE_DIR, "/").concat(name)); - }))]; - } - }); -}); }; -exports.loadDeployableRecords = loadDeployableRecords; -var saveDeployableRecords = function (records) { return __awaiter(void 0, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, Promise.all(records.map(function (record) { - return writeJsonFile("".concat(exports.CACHE_DIR, "/").concat(record.context, ".").concat(record.name, ".json"), record); - }))]; - case 1: - _a.sent(); - return [2 /*return*/]; - } - }); -}); }; -exports.saveDeployableRecords = saveDeployableRecords; -var removeDeployableRecords = function (records) { return __awaiter(void 0, void 0, void 0, function () { - return __generator(this, function (_a) { - shelljs_1.default.rm.apply(shelljs_1.default, __spreadArray(['-f'], records.map(function (record) { return "".concat(exports.CACHE_DIR, "/").concat(record.context, ".").concat(record.name, ".json"); }), false)); - return [2 /*return*/]; - }); -}); }; -exports.removeDeployableRecords = removeDeployableRecords; -var readJsonFile = function (path) { return __awaiter(void 0, void 0, void 0, function () { - var file; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, (0, promises_1.readFile)(path, { encoding: 'utf8' })]; - case 1: - file = _a.sent(); - return [2 /*return*/, JSON.parse(file)]; - } - }); -}); }; -var writeJsonFile = function (path, contents) { return __awaiter(void 0, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, (0, promises_1.open)(path, 'w')]; - case 1: - _a.sent(); - return [2 /*return*/, (0, promises_1.writeFile)(path, JSON.stringify(contents, undefined, 2), { encoding: 'utf8', flag: 'w' })]; - } - }); -}); }; -var getAllDeployableFilesWindows = function (_a) { - var typeNames = _a.typeNames, includeDirs = _a.includeDirs, includeFilesOrExtensions = _a.includeFilesOrExtensions, excludeDirs = _a.excludeDirs; - // To get the equivalent of grep in Windows we use a combination of `dir` and `findstr` - var includePattern = includeFilesOrExtensions.length > 0 ? includeFilesOrExtensions.map(function (f) { return f.includes('.') ? f : "*.".concat(f); }).join(' ') : '*'; - var excludePattern = excludeDirs.length > 0 ? excludeDirs.join('|') : ''; - var pattern = typeNames.length > 0 - ? typeNames.map(function (name) { return "polyConfig: ".concat(name); }).join('|') - : 'polyConfig'; - var excludeCommand = excludePattern ? " | findstr /V /I \"".concat(excludePattern, "\"") : ''; - var searchCommand = " | findstr /M /I /F:/ /C:\"".concat(pattern, "\""); - var result = []; - for (var _i = 0, includeDirs_1 = includeDirs; _i < includeDirs_1.length; _i++) { - var dir = includeDirs_1[_i]; - var dirCommand = "dir /S /P /B ".concat(includePattern, " ").concat(dir); - var fullCommand = "".concat(dirCommand).concat(excludeCommand).concat(searchCommand); - try { - var output = shelljs_1.default.exec(fullCommand).toString('utf8'); - result = result.concat(output.split(/\r?\n/).filter(Boolean)); - } - catch (_b) { } - } - return result; -}; -exports.getAllDeployableFilesWindows = getAllDeployableFilesWindows; -var getAllDeployableFilesLinux = function (_a) { - var typeNames = _a.typeNames, includeDirs = _a.includeDirs, includeFilesOrExtensions = _a.includeFilesOrExtensions, excludeDirs = _a.excludeDirs; - // In Linux we can just use `grep` to find possible poly deployables - var include = includeFilesOrExtensions.length - ? includeFilesOrExtensions.map(function (f) { - return "--include=".concat(f.includes('.') ? f : "*.".concat(f)); - }).join(' ') - : ''; - var excludeDir = excludeDirs.length ? excludeDirs.map(function (dir) { return "--exclude-dir=".concat(dir); }).join(' ') : ''; - var searchPath = includeDirs.length - ? includeDirs.join(' ') - : '.'; - var patterns = typeNames.length > 0 - ? typeNames.map(function (name) { return "-e 'polyConfig: ".concat(name, "'"); }).join(' ') - : '-e \'polyConfig\''; - var grepCommand = "grep ".concat(include, " ").concat(excludeDir, " -Rl ").concat(patterns, " ").concat(searchPath); - var output = shelljs_1.default.exec(grepCommand).toString('utf8'); - return output.split('\n').filter(Boolean); -}; -exports.getAllDeployableFilesLinux = getAllDeployableFilesLinux; -var getAllDeployableFiles = function (config) { - if (config === void 0) { config = {}; } - config.typeNames = config.typeNames = exports.DeployableTypeEntries.map(function (p) { return p[0]; }); - config.includeDirs = config.includeDirs = ['.']; - config.includeFilesOrExtensions = config.includeFilesOrExtensions = ['ts', 'js']; - config.excludeDirs = config.excludeDirs = [ - 'node_modules', - 'dist', - 'build', - 'output', - '.vscode', - '.poly', - '.github', - '.husky', - '.yarn', - ]; - var isWindows = os_1.default.platform() === 'win32'; - return isWindows - ? (0, exports.getAllDeployableFilesWindows)(config) - : (0, exports.getAllDeployableFilesLinux)(config); -}; -exports.getAllDeployableFiles = getAllDeployableFiles; -var getDeployableFileRevision = function (fileContents) { - return (0, crypto_1.createHash)('sha256') - .update( - // We want the file_revision to reflect the actual contents of the deployable - // So trim all leading single-line comments before we hash the file - // This prevents our deployment receipt comments from inadvertently changing the file revision - fileContents.replace(/^(\/\/.*\n)+/, '')) - .digest('hex') - // Trimming to 7 characters to align with git revision format and to keep this nice and short! - .substring(0, 7); -}; -exports.getDeployableFileRevision = getDeployableFileRevision; -var getGitRevision = function (branchOrTag) { - if (branchOrTag === void 0) { branchOrTag = 'HEAD'; } - try { - var result = shelljs_1.default.exec("git rev-parse --short ".concat(branchOrTag)).toString('utf8').trim(); - if (!result) - throw new Error('Failed to get git revision.'); - return result; - } - catch (err) { - console.warn('Failed to get git revision. Falling back to random hash.'); - return Array.from({ length: 8 }, function () { return Math.floor(Math.random() * 16).toString(16); }).join(''); - } -}; -exports.getGitRevision = getGitRevision; -var getCacheDeploymentsRevision = function () { - if (!(0, fs_1.existsSync)(exports.CACHE_VERSION_FILE)) - return Promise.resolve(''); - return (0, promises_1.readFile)(exports.CACHE_VERSION_FILE, { - flag: 'r', - encoding: 'utf8', - }); -}; -exports.getCacheDeploymentsRevision = getCacheDeploymentsRevision; -var writeCacheRevision = function (gitRevision) { - if (gitRevision === void 0) { gitRevision = (0, exports.getGitRevision)(); } - return __awaiter(void 0, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, (0, promises_1.writeFile)(exports.CACHE_VERSION_FILE, gitRevision, { - flag: 'w', - encoding: 'utf8', - })]; - case 1: - _a.sent(); - return [2 /*return*/]; - } - }); - }); -}; -exports.writeCacheRevision = writeCacheRevision; -var isCacheUpToDate = function () { return __awaiter(void 0, void 0, void 0, function () { - var cachedRevision, gitRevision; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, (0, exports.getCacheDeploymentsRevision)()]; - case 1: - cachedRevision = _a.sent(); - gitRevision = (0, exports.getGitRevision)(); - return [2 /*return*/, cachedRevision === gitRevision]; - } - }); -}); }; -exports.isCacheUpToDate = isCacheUpToDate; -var writeDeployComments = function (deployments) { - var _a; - var canopyPath = ((_a = process.env.POLY_API_BASE_URL) === null || _a === void 0 ? void 0 : _a.includes('localhost')) - ? 'polyui/collections' - : 'canopy/polyui/collections'; - return deployments - .map(function (d) { - return "// Poly deployed @ ".concat(d.deployed, " - ").concat(d.context, ".").concat(d.name, " - ").concat(d.instance.endsWith(':8000') ? d.instance.replace(':8000', ':3000') : d.instance, "/").concat(canopyPath, "/").concat(d.type, "s/").concat(d.id, " - ").concat(d.fileRevision); - }).join('\n'); -}; -exports.writeDeployComments = writeDeployComments; -var printJSDocFunctionComment = function (_a) { - var description = _a.description, params = _a.params, returns = _a.returns; - return "/**\n".concat(__spreadArray(__spreadArray(__spreadArray([], description.split('\n').filter(Boolean), true), params.map(function (p) { return "@param {".concat(p.type, "} ").concat(p.name).concat(p.description ? ' - ' : '').concat(p.description); }), true), [ - "@returns {".concat(returns.type, "} ").concat(returns.description), - ], false).map(function (l) { return " * ".concat(l); }).join('\n'), "\n */\n"); -}; -var updateDeploymentComments = function (fileContent, deployable) { - while (deployable.deploymentCommentRanges.length > 0) { - var range = deployable.deploymentCommentRanges.pop(); - fileContent = "".concat(fileContent.substring(0, range[0])).concat(fileContent.substring(range[1])); - } - if (deployable.deployments.length) { - var deploymentComments = (0, exports.writeDeployComments)(deployable.deployments); - // +1 because of the newline character we insert afterwards - deployable.deploymentCommentRanges.push([0, deploymentComments.length + 1]); - // Then add deploy comments to the top - fileContent = "".concat(deploymentComments, "\n").concat(fileContent); - } - return fileContent; -}; -var updateDeployableFunctionComments = function (fileContent, deployable, disableDocs) { - if (disableDocs === void 0) { disableDocs = false; } - if (!disableDocs) { - // First write/overwrite the JSDoc comment - fileContent = "".concat(fileContent.substring(0, deployable.docStartIndex)).concat(printJSDocFunctionComment(deployable.types)).concat(fileContent.substring(deployable.docEndIndex)); - } - return fileContent; -}; -var writeUpdatedDeployable = function (deployable, disableDocs) { - if (disableDocs === void 0) { disableDocs = false; } - return __awaiter(void 0, void 0, void 0, function () { - var fileContents; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, (0, promises_1.readFile)(deployable.file, { - flag: 'r', - encoding: 'utf8', - })]; - case 1: - fileContents = _a.sent(); - switch (deployable.type) { - case 'client-function': - case 'server-function': { - fileContents = updateDeployableFunctionComments(fileContents, deployable, disableDocs); - break; - } - case 'webhook': - break; - default: - throw new Error("Unsupported deployable type: '".concat(deployable.type, "'")); - } - // Then write/overwrite any deployment comments (must happen last to prevent the JSDoc comment ranges from breaking) - if (deployable.type !== 'webhook') - fileContents = updateDeploymentComments(fileContents, deployable); - return [4 /*yield*/, (0, promises_1.writeFile)(deployable.file, fileContents, { - flag: 'w', - encoding: 'utf8', - })]; - case 2: - _a.sent(); - // Get an updated fileRevision - deployable.fileRevision = (0, exports.getDeployableFileRevision)(fileContents); - return [2 /*return*/, deployable]; - } - }); - }); -}; -exports.writeUpdatedDeployable = writeUpdatedDeployable; diff --git a/build/transpiler.js b/build/transpiler.js deleted file mode 100644 index 524fa09..0000000 --- a/build/transpiler.js +++ /dev/null @@ -1,575 +0,0 @@ -"use strict"; -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -var __rest = (this && this.__rest) || function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.parseDeployable = exports.parseDeployComment = exports.generateTypeSchemas = exports.getDependencies = exports.getTSBaseUrl = exports.getTSConfig = void 0; -var fs_1 = require("fs"); -var chalk_1 = require("chalk"); -var shelljs_1 = require("shelljs"); -var typescript_1 = require("typescript"); -var TJS = require("typescript-json-schema"); -var transpiler_1 = require("@poly/common/transpiler"); -var path_1 = require("path"); -var deployables_1 = require("./deployables"); -var os_1 = require("os"); -var crypto_1 = require("crypto"); -var getTSConfig = function () { - var tsConfig = typescript_1.default.findConfigFile('./', typescript_1.default.sys.fileExists, 'tsconfig.json'); - if (tsConfig) { - return typescript_1.default.readConfigFile(tsConfig, typescript_1.default.sys.readFile).config; - } - return {}; -}; -exports.getTSConfig = getTSConfig; -var getTSBaseUrl = function (config) { - var _a; - if (config === void 0) { config = (0, exports.getTSConfig)(); } - return ((_a = config.compilerOptions) === null || _a === void 0 ? void 0 : _a.baseUrl) || undefined; -}; -exports.getTSBaseUrl = getTSBaseUrl; -var loadTsSourceFile = function (filePath) { - var fileContent = fs_1.default.readFileSync(filePath, 'utf8'); - var sourceFile = typescript_1.default.createSourceFile(filePath, fileContent, typescript_1.default.ScriptTarget.Latest, true, typescript_1.default.ScriptKind.TS); - return sourceFile; -}; -var getDependencies = function (code, fileName, baseUrl) { - var importedLibraries = new Set(); - var compilerOptions = { - module: typescript_1.default.ModuleKind.CommonJS, - esModuleInterop: true, - noImplicitUseStrict: true, - baseUrl: baseUrl, - }; - var compilerHost = typescript_1.default.createCompilerHost(compilerOptions); - typescript_1.default.transpileModule(code, { - compilerOptions: compilerOptions, - transformers: { - before: [ - function (context) { - return function (sourceFile) { - var visitor = function (node) { - if (typescript_1.default.isImportDeclaration(node)) { - var moduleName = node.moduleSpecifier.text; - var resolvedModule = typescript_1.default.resolveModuleName(moduleName, fileName, compilerOptions, compilerHost); - if (resolvedModule.resolvedModule) { - if (resolvedModule.resolvedModule.isExternalLibraryImport) { - importedLibraries.add(moduleName); - } - } - else { - // Handle unresolved modules (fallback) - if (!moduleName.startsWith('.')) { - importedLibraries.add(moduleName); - } - } - } - return node; - }; - return typescript_1.default.visitEachChild(sourceFile, visitor, context); - }; - }, - ], - }, - }); - var dependencies = Array.from(importedLibraries) - .filter(function (library) { return !transpiler_1.EXCLUDED_REQUIREMENTS.includes(library); }); - if (dependencies.length) { - var packageJson = fs_1.default.readFileSync(path_1.default.join(process.cwd(), 'package.json'), 'utf-8'); - try { - packageJson = JSON.parse(packageJson); - } - catch (error) { - shelljs_1.default.echo(chalk_1.default.yellow('\nWarning:'), 'Failed to parse package.json file in order to read dependencies, there could be issues with some dependencies at the time of deploying the server function.'); - } - var packageJsonDependencies = packageJson.dependencies || {}; - var packageJsonDevDependencies = packageJson.devDependencies || {}; - var _loop_1 = function (dependency) { - if (packageJsonDependencies[dependency] || packageJsonDevDependencies[dependency]) { - return "continue"; - } - var dependencyParts = dependency.split('/'); - while (dependencyParts.length > 0) { - dependencyParts.pop(); - var newDependencyPath = dependencyParts.join('/'); - if (packageJsonDependencies[newDependencyPath] || packageJsonDevDependencies[newDependencyPath]) { - dependencies = dependencies.map(function (currentDependency) { - if (currentDependency === dependency) { - return dependencyParts.join('/'); - } - return currentDependency; - }); - break; - } - } - }; - for (var _i = 0, dependencies_1 = dependencies; _i < dependencies_1.length; _i++) { - var dependency = dependencies_1[_i]; - _loop_1(dependency); - } - } - return dependencies; -}; -exports.getDependencies = getDependencies; -var generateTypeSchemas = function (fileName, baseUrl, ignoredTypeNames) { - var compilerOptions = { - allowJs: true, - lib: ['es2015'], - baseUrl: baseUrl, - }; - var sourceFile = loadTsSourceFile(fileName); - var program = typescript_1.default.createProgram([fileName], compilerOptions); - var schemaDefs = {}; - var settings = { - required: true, - noExtraProps: true, - ignoreErrors: true, - strictNullChecks: true, - }; - var generator = TJS.buildGenerator(program, settings); - /** - * This functions looks for the type declaration by priority and replaces the data in generator, - * so the correct schema is generated. - * - * @param typeName - * @param symbolRefs - */ - var consolidateGeneratorSymbolType = function (typeName, symbolRefs) { - var tryConsolidationByFile = function (fileName) { - var symbolRef = symbolRefs.find(function (symbolRef) { - return symbolRef.symbol.declarations.some(function (declaration) { return declaration.getSourceFile().fileName.includes(fileName); }); - }); - if (symbolRef) { - var declaredType = program.getTypeChecker().getDeclaredTypeOfSymbol(symbolRef.symbol); - if (declaredType) { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore hack to replace the symbol with the preferred one - generator.allSymbols[typeName] = declaredType; - return true; - } - } - return false; - }; - if (tryConsolidationByFile(fileName)) { - return; - } - tryConsolidationByFile('/node_modules/.poly/'); - }; - var isInnerFunctionNode = function (node) { - var parent = node.parent; - var insideBlock = false; - while (parent) { - if (parent.kind === typescript_1.default.SyntaxKind.Block) { - insideBlock = true; - } - else if (parent.kind === typescript_1.default.SyntaxKind.FunctionDeclaration && insideBlock) { - return true; - } - parent = parent.parent; - } - return false; - }; - var visitor = function (node) { - var _a, _b, _c; - if (typescript_1.default.isUnionTypeNode(node) || typescript_1.default.isIntersectionTypeNode(node)) { - // create a temporary combined type to get the schema for the union/intersection - var combinedTypeName = 'CombinedTempType'; - var typeName = node.getText(); - if (ignoredTypeNames === null || ignoredTypeNames === void 0 ? void 0 : ignoredTypeNames.includes(typeName)) { - return; - } - var tempSource = "type ".concat(combinedTypeName, " = ").concat(typeName, ";"); - var tempDir = os_1.default.tmpdir(); - var tempFilePath = path_1.default.join(tempDir, "".concat(crypto_1.default.randomBytes(16).toString('hex'), ".ts")); - fs_1.default.writeFileSync(tempFilePath, tempSource); - try { - var tempCombinedTypeProgram = typescript_1.default.createProgram([fileName, tempFilePath], compilerOptions); - var schema = TJS.generateSchema(tempCombinedTypeProgram, combinedTypeName, settings, undefined, TJS.buildGenerator(tempCombinedTypeProgram, settings)); - if (schema) { - var hasVoidType = node.types.some(function (type) { return type.getText() === 'void'; }); - if (hasVoidType && typescript_1.default.isUnionTypeNode(node)) { - // Check if the union contains 'void' type and if so, add nullable type to the schema - if (schema.anyOf) { - schema.anyOf.push({ type: 'null' }); - } - else { - schema = { - $schema: schema.$schema, - anyOf: [ - __assign(__assign({}, schema), { $schema: undefined }), - { type: 'null' }, - ], - }; - } - } - schemaDefs[typeName] = { - schema: schema, - typeParameterVariations: [], - }; - } - } - finally { - fs_1.default.unlinkSync(tempFilePath); - } - } - if (typescript_1.default.isTypeReferenceNode(node) && !isInnerFunctionNode(node)) { - var typeName = node.typeName.getText(); - if (ignoredTypeNames === null || ignoredTypeNames === void 0 ? void 0 : ignoredTypeNames.includes(typeName)) { - return; - } - var symbolRefs = generator.getSymbols(typeName); - var isGenericType = ((_a = node.typeArguments) === null || _a === void 0 ? void 0 : _a.length) > 0; - if (!symbolRefs.length) { - // not a reference to a type - return; - } - consolidateGeneratorSymbolType(typeName, symbolRefs); - var typeParameterVariations = ((_b = schemaDefs[typeName]) === null || _b === void 0 ? void 0 : _b.typeParameterVariations) || []; - if (isGenericType) { - var symbolRef = symbolRefs[0]; - var typeParameters_1 = []; - if (typeParameters_1.length === 0 && symbolRef) { - // read type parameters from declaration - symbolRef.symbol.declarations.forEach(function (declaration) { - var _a; - if (typescript_1.default.isTypeAliasDeclaration(declaration) || typescript_1.default.isInterfaceDeclaration(declaration) || typescript_1.default.isClassDeclaration(declaration)) { - if (declaration.parent && typescript_1.default.isSourceFile(declaration.parent) && declaration.parent.hasNoDefaultLib) { - // skipping, this is a default lib - return; - } - typeParameters_1.push.apply(typeParameters_1, ((_a = declaration.typeParameters) === null || _a === void 0 ? void 0 : _a.map(function (typeParameter) { return typeParameter.name.text; })) || []); - } - }); - } - if (typeParameters_1.length) { - var parameterSchemaTypes_1 = {}; - typeParameters_1.forEach(function (typeParameter, index) { - var typeArgument = node.typeArguments[index]; - if (typeArgument) { - parameterSchemaTypes_1[typeParameter] = typeArgument.getText(); - } - }); - typeParameterVariations.push(parameterSchemaTypes_1); - } - } - var schema = ((_c = schemaDefs[typeName]) === null || _c === void 0 ? void 0 : _c.schema) || TJS.generateSchema(program, typeName, settings, undefined, generator); - if (schema) { - schemaDefs[typeName] = { - schema: schema, - typeParameterVariations: typeParameterVariations, - }; - } - } - typescript_1.default.forEachChild(node, visitor); - }; - typescript_1.default.forEachChild(sourceFile, visitor); - enhanceWithParameterTypeSchemas(schemaDefs); - return extractSchemas(schemaDefs); -}; -exports.generateTypeSchemas = generateTypeSchemas; -var enhanceWithParameterTypeSchemas = function (schemaDefs) { - Object.keys(schemaDefs) - .forEach(function (typeName) { - var schemaDef = schemaDefs[typeName]; - var typeVariations = schemaDef.typeParameterVariations; - if (!typeVariations.length) { - return; - } - typeVariations.forEach(function (typeVariation) { - var typeParameters = Object.keys(typeVariation); // e.g. - if (!typeParameters.length) { - return; - } - var parameterTypes = "".concat(Object.values(typeVariation).join(', ')); - var updatedDefinitions = __assign(__assign({}, schemaDef.schema.definitions), typeParameters.reduce(function (acc, typeParameter) { - var _a; - var typeParameterSchemaDef = schemaDefs[typeVariation[typeParameter]]; - return (__assign(__assign(__assign({}, acc), typeParameterSchemaDef === null || typeParameterSchemaDef === void 0 ? void 0 : typeParameterSchemaDef.schema.definitions), (_a = {}, _a[typeParameter] = __assign(__assign({}, typeParameterSchemaDef === null || typeParameterSchemaDef === void 0 ? void 0 : typeParameterSchemaDef.schema), { $schema: undefined, definitions: undefined }), _a))); - }, {})); - schemaDefs["".concat(typeName, "<").concat(parameterTypes, ">")] = { - schema: __assign(__assign({}, schemaDef.schema), { definitions: updatedDefinitions }), - }; - }); - }); -}; -var extractSchemas = function (schemaDefs) { return Object.keys(schemaDefs) - .reduce(function (acc, typeName) { - var _a; - return __assign(__assign({}, acc), (_a = {}, _a[typeName] = schemaDefs[typeName].schema, _a)); -}, {}); }; -var parseDeployComment = function (comment) { - // Poly deployed @ 2024-08-29T22:46:46.791Z - test.weeklyReport - https://develop-k8s.polyapi.io/canopy/polyui/collections/server-functions/f0630f95-eac8-4c7d-9d23-639d39034bb6 - e3b0c44 - var match = comment.match(/^\s*(?:\/\/\s*)*Poly deployed @ (\S+) - (\S+)\.([^.]+) - (https?:\/\/[^/]+)\/\S+\/(\S+)s\/(\S+) - (\S+)$/); - if (!match) - return null; - var deployed = match[1], context = match[2], name = match[3], instance = match[4], type = match[5], id = match[6], fileRevision = match[7]; - return { - name: name, - context: context, - type: type, - id: id, - deployed: deployed, - fileRevision: fileRevision, - // Local development puts canopy on a different port than the poly-server - instance: instance.endsWith('localhost:3000') ? instance.replace(':3000', ':8000') : instance, - }; -}; -exports.parseDeployComment = parseDeployComment; -// Function to extract leading comments from the source file -var getDeployComments = function (sourceFile) { - var text = sourceFile.getFullText(); - var matches = []; - var ranges = []; - var leadingRanges = typescript_1.default.getLeadingCommentRanges(text, 0); - if (leadingRanges) { - for (var _i = 0, leadingRanges_1 = leadingRanges; _i < leadingRanges_1.length; _i++) { - var range = leadingRanges_1[_i]; - var comment = text.substring(range.pos, range.end); - var match = (0, exports.parseDeployComment)(comment.trim()); - if (match) { - matches.push(match); - ranges.push([range.pos, range.end + (range.hasTrailingNewLine ? 1 : 0)]); - } - } - } - return [matches, ranges]; -}; -// Function to extract the PolyServerFunction config -var getPolyConfig = function (types, sourceFile) { - var config = null; - var visit = function (node) { - var _a; - if (typescript_1.default.isVariableStatement(node)) { - var declaration = node.declarationList.declarations[0]; - var name_1 = declaration.name.getText(sourceFile); - var type_1 = (_a = declaration.type) === null || _a === void 0 ? void 0 : _a.getText(sourceFile); - if (name_1 === 'polyConfig' && type_1 && types.includes(type_1)) { - var initializer = node.declarationList.declarations[0].initializer; - if (initializer && typescript_1.default.isObjectLiteralExpression(initializer)) { - // eval() is generally considered harmful - // but since we're running entirely client side on user-provided code - // and since these configs are type-safe we're going to allow it - // eslint-disable-next-line no-eval - config = eval("(".concat(initializer.getText(), ")")); - config.type = type_1; - } - } - } - typescript_1.default.forEachChild(node, visit); - }; - visit(sourceFile); - var name = config.name, context = config.context, type = config.type, description = config.description, other = __rest(config, ["name", "context", "type", "description"]); - if (!name) - throw new Error("polyConfig is missing 'name'."); - if (!context) - throw new Error("polyConfig is missing 'context'."); - return { name: name, context: context, type: type, description: description, config: other }; -}; -// Helper function to parse JSDoc tags into an object -var parseJSDoc = function (node) { - var _a; - var jsDocTags = null; - var jsDoc = node.getChildren().filter(typescript_1.default.isJSDoc); - if (jsDoc.length > 0) { - jsDocTags = { - description: '', - params: [], - returns: { - type: 'void', - description: '', - }, - }; - var firstJsDoc = jsDoc[0]; - jsDocTags.description = firstJsDoc.comment ? typescript_1.default.getTextOfJSDocComment(firstJsDoc.comment) : ''; - (_a = firstJsDoc.tags) === null || _a === void 0 ? void 0 : _a.forEach(function (tag) { - var _a, _b; - var tagName = tag.tagName.text; - var tagComment = typescript_1.default.getTextOfJSDocComment(tag.comment) || ''; - if (tagName === 'param' && typescript_1.default.isJSDocParameterTag(tag)) { - var paramDetails = tagComment.split(/[\s-]+/); - var paramName = tag.name.getText(); - var paramType = ((_a = tag.typeExpression) === null || _a === void 0 ? void 0 : _a.getText().replace(/^{|}$/g, '')) || ''; - var paramDescription = paramDetails.join(' ').trim(); - jsDocTags.params.push({ - name: paramName, - type: paramType, - description: paramDescription, - }); - } - else if (tagName === 'returns' && typescript_1.default.isJSDocReturnTag(tag)) { - jsDocTags.returns = { - type: ((_b = tag.typeExpression) === null || _b === void 0 ? void 0 : _b.getText().replace(/^{|}$/g, '')) || '', - description: tagComment.trim(), - }; - } - else { - jsDocTags[tagName] = tagComment.trim(); - } - }); - } - return jsDocTags; -}; -var parseTSTypes = function (node, sourceFile) { - var _a; - var params = node.parameters.map(function (param) { - var _a; - var name = param.name.getText(sourceFile); - var type = (_a = param.type) === null || _a === void 0 ? void 0 : _a.getText(sourceFile); - if (!type) - throw new Error("Missing type for function argument '".concat(name, "' in file '").concat(sourceFile.fileName, "'.")); - return { - name: name, - type: type, - description: '', - }; - }); - var type = (_a = node.type) === null || _a === void 0 ? void 0 : _a.getText(sourceFile); - if (!type) - throw new Error("Missing return type for function in file '".concat(sourceFile.fileName, "'. Use 'void' if no return type.")); - var returns = { - type: type, - description: '', - }; - return { - params: params, - returns: returns, - description: '', - }; -}; -// Function to extract function details including JSDoc, arguments, and return type -var getFunctionDetails = function (sourceFile, functionName) { - var functionDetails = null; - var dirty = false; // Dirty means that something needs fixed in the file - var visit = function (node) { - var _a; - if (typescript_1.default.isFunctionDeclaration(node) && ((_a = node.name) === null || _a === void 0 ? void 0 : _a.getText(sourceFile)) === functionName) { - var jsDoc_1 = parseJSDoc(node); - var types_1 = parseTSTypes(node, sourceFile); - if (jsDoc_1 && - types_1.params.every(function (p, i) { return p.type === jsDoc_1.params[i].type && p.name === jsDoc_1.params[i].name; }) && - types_1.returns.type === jsDoc_1.returns.type) { - // Try to preserve JSDoc descriptions if things haven't changed - jsDoc_1.params.forEach(function (p, i) { - types_1.params[i].description = p.description; - }); - types_1.returns.description = jsDoc_1.returns.description; - types_1.description = jsDoc_1.description; - dirty = types_1.params.some(function (p, i) { return p.type !== jsDoc_1.params[i].type || p.name !== jsDoc_1.params[i].name; }); - } - else { - dirty = true; - } - var docStartIndex = node.getStart(sourceFile, true); - var docEndIndex = node.getStart(sourceFile, false); - functionDetails = { - types: types_1, - docStartIndex: docStartIndex, - docEndIndex: docEndIndex, - dirty: dirty, - }; - } - else { - typescript_1.default.forEachChild(node, visit); - } - }; - visit(sourceFile); - if (!functionDetails) - throw new Error("Failed to find a function named '".concat(functionName, "' within file '").concat(sourceFile.fileName, "'. Verify that your polyConfig name matches a valid function declared within the same file.")); - return functionDetails; -}; -var parseDeployableFunction = function (sourceFile, polyConfig, baseUrl, fileRevision, gitRevision) { - var _a = getDeployComments(sourceFile), deployments = _a[0], deploymentCommentRanges = _a[1]; - var functionDetails = getFunctionDetails(sourceFile, polyConfig.name); - var dependencies = (0, exports.getDependencies)(sourceFile.getFullText(), sourceFile.fileName, baseUrl); - var typeSchemas = (0, exports.generateTypeSchemas)(sourceFile.fileName, baseUrl, deployables_1.DeployableTypeEntries.map(function (d) { return d[0]; })); - return __assign(__assign(__assign({}, polyConfig), functionDetails), { deployments: deployments, deploymentCommentRanges: deploymentCommentRanges, dependencies: dependencies, typeSchemas: typeSchemas, fileRevision: fileRevision, gitRevision: gitRevision, file: sourceFile.fileName }); -}; -var parseWebhook = function (sourceFile, polyConfig, baseUrl, fileRevision, gitRevision) { - var deployments = getDeployComments(sourceFile)[0]; - return __assign(__assign({}, polyConfig), { deployments: deployments, fileRevision: fileRevision, gitRevision: gitRevision, file: sourceFile.fileName }); -}; -var parseDeployable = function (filePath, baseUrl, gitRevision) { return __awaiter(void 0, void 0, void 0, function () { - var sourceFile, polyConfig, fileContents, fileRevision; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, loadTsSourceFile(filePath)]; - case 1: - sourceFile = _a.sent(); - polyConfig = getPolyConfig(deployables_1.DeployableTypeEntries.map(function (e) { return e[0]; }), sourceFile); - polyConfig.type = deployables_1.DeployableTsTypeToName[polyConfig.type]; - fileContents = sourceFile.getFullText(); - fileRevision = (0, deployables_1.getDeployableFileRevision)(fileContents); - try { - switch (polyConfig.type) { - case 'server-function': - case 'client-function': - return [2 /*return*/, [parseDeployableFunction(sourceFile, polyConfig, baseUrl, fileRevision, gitRevision), fileContents]]; - case 'webhook': - return [2 /*return*/, [parseWebhook(sourceFile, polyConfig, baseUrl, fileRevision, gitRevision), fileContents]]; - } - throw new Error('Invalid Poly deployment with unsupported type'); - } - catch (err) { - console.error("Prepared ".concat(polyConfig.type.replaceAll('-', ' '), " ").concat(polyConfig.context, ".").concat(polyConfig.name, ": ERROR")); - console.error(err); - } - return [2 /*return*/]; - } - }); -}); }; -exports.parseDeployable = parseDeployable; diff --git a/build/types.js b/build/types.js deleted file mode 100644 index c8ad2e5..0000000 --- a/build/types.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/build/utils.js b/build/utils.js deleted file mode 100644 index 747293c..0000000 --- a/build/utils.js +++ /dev/null @@ -1,259 +0,0 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.handleAxiosError = exports.validateBaseUrl = exports.URL_REGEX = exports.isValidHttpUrl = exports.firstLetterToUppercase = exports.getStringPaths = exports.upsertResourceInSpec = exports.generateContextDataFile = exports.showErrGettingSpecs = exports.prettyPrint = exports.loadTemplate = exports.echoGenerationError = exports.getSpecsFromContextData = exports.getContextDataFileContent = exports.getPolyLibPath = void 0; -var fs_1 = require("fs"); -var jsonpath_1 = require("jsonpath"); -var prettier_1 = require("prettier"); -var chalk_1 = require("chalk"); -var shelljs_1 = require("shelljs"); -var api_1 = require("./api"); -var getPolyLibPath = function (polyPath) { return polyPath.startsWith('/') - ? "".concat(polyPath, "/lib") - : "".concat(__dirname, "/../../../../../").concat(polyPath, "/lib"); }; -exports.getPolyLibPath = getPolyLibPath; -var getContextDataFileContent = function (libPath) { - try { - var contents = fs_1.default.readFileSync("".concat(libPath, "/specs.json"), 'utf-8'); - return JSON.parse(contents); - } - catch (err) { - return {}; - } -}; -exports.getContextDataFileContent = getContextDataFileContent; -var getSpecsFromContextData = function (contextData) { - var specs = []; - var traverseAndGetSpec = function (data) { - for (var _i = 0, _a = Object.keys(data); _i < _a.length; _i++) { - var key = _a[_i]; - if (typeof data[key].context === 'string') { - specs.push(data[key]); - } - else { - traverseAndGetSpec(data[key]); - } - } - }; - traverseAndGetSpec(contextData); - return specs; -}; -exports.getSpecsFromContextData = getSpecsFromContextData; -var echoGenerationError = function (specification) { - var typeMap = { - apiFunction: 'API Function', - customFunction: 'Custom Function', - authFunction: 'Auth Function', - webhookHandle: 'Webhook Handle', - serverFunction: 'Server Function', - serverVariable: 'Variable', - schema: 'Schema', - snippet: 'Snippet', - }; - var type = typeMap[specification.type]; - shelljs_1.default.echo(chalk_1.default.red("\nError encountered while processing ".concat(type, " '").concat(specification.contextName, "' (id: '").concat(specification.id, "'). ").concat(type, " is unavailable."))); -}; -exports.echoGenerationError = echoGenerationError; -var loadTemplate = function (fileName) { return fs_1.default.readFileSync("".concat(__dirname, "/templates/").concat(fileName), 'utf8'); }; -exports.loadTemplate = loadTemplate; -var prettyPrint = function (code, parser) { - if (parser === void 0) { parser = 'typescript'; } - return prettier_1.default.format(code, { - parser: parser, - singleQuote: true, - printWidth: 160, - }); -}; -exports.prettyPrint = prettyPrint; -var showErrGettingSpecs = function (error) { - var _a; - shelljs_1.default.echo(chalk_1.default.red('ERROR')); - shelljs_1.default.echo('Error while getting data from Poly server. Make sure the version of library/server is up to date.'); - shelljs_1.default.echo(chalk_1.default.red(error.message), chalk_1.default.red(JSON.stringify((_a = error.response) === null || _a === void 0 ? void 0 : _a.data))); - shelljs_1.default.exit(1); -}; -exports.showErrGettingSpecs = showErrGettingSpecs; -var generateContextDataFile = function (libPath, specs) { - fs_1.default.writeFileSync("".concat(libPath, "/specs.json"), JSON.stringify(specs.filter(function (spec) { - if (spec.type === 'snippet') { - return spec.language === 'javascript'; - } - if (spec.type === 'customFunction') { - return spec.language === 'javascript'; - } - return true; - }), null, 2)); -}; -exports.generateContextDataFile = generateContextDataFile; -var upsertResourceInSpec = function (polyPath, _a) { - var resourceId = _a.resourceId, resourceName = _a.resourceName, updated = _a.updated; - return __awaiter(void 0, void 0, void 0, function () { - var contextData, prevSpecs, specs, error_1, resource; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - shelljs_1.default.echo('-n', updated ? "Updating ".concat(resourceName, " in specs...") : "Adding ".concat(resourceName, " to SDK...")); - contextData = {}; - try { - contextData = (0, exports.getContextDataFileContent)((0, exports.getPolyLibPath)(polyPath)); - } - catch (error) { - shelljs_1.default.echo(chalk_1.default.red('ERROR')); - shelljs_1.default.echo('Error while fetching local context data.'); - shelljs_1.default.echo(chalk_1.default.red(error.message)); - shelljs_1.default.echo(chalk_1.default.red(error.stack)); - return [2 /*return*/]; - } - prevSpecs = (0, exports.getSpecsFromContextData)(contextData); - specs = []; - _b.label = 1; - case 1: - _b.trys.push([1, 3, , 4]); - return [4 /*yield*/, (0, api_1.getSpecs)([], [], [resourceId], false)]; - case 2: - specs = _b.sent(); - return [3 /*break*/, 4]; - case 3: - error_1 = _b.sent(); - (0, exports.showErrGettingSpecs)(error_1); - return [2 /*return*/]; - case 4: - resource = specs[0]; - if (prevSpecs.some(function (prevSpec) { return prevSpec.id === resource.id; })) { - specs = prevSpecs.map(function (prevSpec) { - if (prevSpec.id === resource.id) { - return resource; - } - return prevSpec; - }); - } - else { - prevSpecs.push(resource); - specs = prevSpecs; - } - (0, exports.generateContextDataFile)((0, exports.getPolyLibPath)(polyPath), specs); - shelljs_1.default.echo(chalk_1.default.green('DONE')); - return [2 /*return*/]; - } - }); - }); -}; -exports.upsertResourceInSpec = upsertResourceInSpec; -var getStringPaths = function (data) { - var paths = jsonpath_1.default.paths(data, '$..*', 100); - var stringPaths = []; - for (var i = 0; i < paths.length; i++) { - var stringPath = ''; - for (var _i = 0, _a = paths[i]; _i < _a.length; _i++) { - var part = _a[_i]; - var isString = typeof part === 'string'; - var delimiter = (stringPath.length > 0 && isString) ? '.' : ''; - if (isString) { - stringPath = "".concat(stringPath).concat(delimiter).concat(part); - } - else { - stringPath = "".concat(stringPath).concat(delimiter, "[").concat(part, "]"); - } - } - stringPaths.push(stringPath); - } - return stringPaths; -}; -exports.getStringPaths = getStringPaths; -var firstLetterToUppercase = function (value) { return "".concat(value.charAt(0).toUpperCase()).concat(value.slice(1)); }; -exports.firstLetterToUppercase = firstLetterToUppercase; -var isValidHttpUrl = function (url) { - try { - var parsedUrl = new URL(url); - return parsedUrl.protocol === 'http:' || parsedUrl.protocol === 'https:'; - } - catch (_a) { - return false; - } -}; -exports.isValidHttpUrl = isValidHttpUrl; -var sanitizeUrl = function (url) { - if (url === null || url === void 0 ? void 0 : url.endsWith('/')) { - url = url.slice(0, -1); - } - return url; -}; -exports.URL_REGEX = /^(https?:\/\/)?(?:w{1,3}\.)?((localhost|(\d{1,3}(\.\d{1,3}){3})|[^\s.]+\.[a-z]{2,})(?:\.[a-z]{2,})?)(:\d+)?(\/[^\s]*)?(?![^<]*(?:<\/\w+>|\/?>))$/; -var validateBaseUrl = function (url) { - var sanitizedUrl = sanitizeUrl(url); - if (sanitizedUrl && !exports.URL_REGEX.test(sanitizedUrl)) { - throw new Error('Given URL is not valid. Please enter a valid URL.'); - } - return sanitizedUrl; -}; -exports.validateBaseUrl = validateBaseUrl; -var handleAxiosError = function (error, axios) { - var errorMessage = ''; - if (error instanceof AggregateError) { - errorMessage = 'Multiple errors occurred:\n'; - error.errors.forEach(function (err, index) { - errorMessage += "Error #".concat(index + 1, ": ").concat(err.message, "\n"); - }); - } - else if (axios.isAxiosError(error)) { - if (error.response) { - errorMessage = "Request failed with status code ".concat(error.response.status, "\n"); - errorMessage += "Status text: ".concat(error.response.statusText, "\n"); - } - else if (error.request) { - errorMessage = 'No response received from the server.\n'; - } - else { - errorMessage = "Axios error occurred: ".concat(error.message, "\n"); - } - } - else if (error.code === 'ECONNREFUSED') { - errorMessage = "Connection refused. Is the server running?\nDetails: ".concat(error.message, "\n"); - } - else if (error.code === 'ENOTFOUND') { - errorMessage = "DNS resolution failed. Is the hostname correct?\nDetails: ".concat(error.message, "\n"); - } - else { - errorMessage = "Unexpected error occurred: ".concat(error.message, "\n"); - if (error.stack) { - errorMessage += "Stack trace: ".concat(error.stack, "\n"); - } - } - return errorMessage.trim(); -}; -exports.handleAxiosError = handleAxiosError; From 30a4c033c13560870f8197d4d6f844fbc9fb9365 Mon Sep 17 00:00:00 2001 From: Aaron Goin Date: Fri, 9 May 2025 11:02:45 -0700 Subject: [PATCH 02/73] bringing over the deploy workflow --- .github/workflows/polyapi-npm-promotion.yaml | 126 +++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 .github/workflows/polyapi-npm-promotion.yaml diff --git a/.github/workflows/polyapi-npm-promotion.yaml b/.github/workflows/polyapi-npm-promotion.yaml new file mode 100644 index 0000000..cfdc1eb --- /dev/null +++ b/.github/workflows/polyapi-npm-promotion.yaml @@ -0,0 +1,126 @@ +name: Promote NPM package +on: + pull_request: + types: [ closed ] + paths: + - "packages/client/package.json" + branches: + - develop + - main + +jobs: + develop: + name: Promote develop NPM package + runs-on: ubuntu-latest + if: ${{ github.event.pull_request.head.ref == 'develop' && github.event.pull_request.base.ref == 'main' && github.event.pull_request.merged == true }} + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + + steps: + - uses: actions/checkout@v3 + + + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: '18' + registry-url: 'https://registry.npmjs.org' + + + - name: Publish package + run: | + VERSION=$(node -p "require('./packages/client/package.json').version") + VERSIONREMOTE=$(npm view polyapi --json | jq -r '.["dist-tags"].na1') + VERSIONREMOTELATEST=$(npm view polyapi --json | jq -r '.["dist-tags"].latest') + + if [[ $VERSION == $VERSIONREMOTE ]]; then + echo "Repository NPM version it's the same that na1 on registry" + else + npm dist-tag add polyapi@$VERSION na1 + fi + + if [[ $VERSION == $VERSIONREMOTELATEST ]]; then + echo "Repository NPM version it's the same that latest on registry" + else + npm dist-tag add polyapi@$VERSION latest + fi + + + main: + name: Tagging of develop package + runs-on: ubuntu-latest + if: ${{ github.event.pull_request.head.ref == 'main' && github.event.pull_request.base.ref == 'develop' && github.event.pull_request.merged == true }} + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + + + steps: + - uses: actions/checkout@v3 + + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: '18' + registry-url: 'https://registry.npmjs.org' + + + - name: Publish package + run: | + VERSION=$(node -p "require('./packages/client/package.json').version") + VERSIONREMOTE=$(npm view polyapi --json | jq -r '.["dist-tags"].develop') + + if [[ $VERSION == $VERSIONREMOTE ]]; then + echo "Repository NPM version it's the same that develop on registry" + else + npm dist-tag add polyapi@$VERSION develop + fi + + other-branch: + name: NPM build and push. + runs-on: ubuntu-latest + if: ${{ github.event.pull_request.head.ref != 'develop' && github.event.pull_request.base.ref == 'main' && github.event.pull_request.merged == true }} + + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + + + steps: + - uses: actions/checkout@v3 + + + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: '18' + registry-url: 'https://registry.npmjs.org' + + - name: Publish package + run: | + VERSION=$(node -p "require('./packages/client/package.json').version") + echo $VERSION + REMOTEVERSION=$(npm view polyapi --json | jq -r '.["dist-tags"].na1') + echo $REMOTEVERSION + VERSIONREMOTELATEST=$(npm view polyapi --json | jq -r '.["dist-tags"].latest') + echo $VERSIONREMOTELATEST + VERSIONREMOTEDEVELOP=$(npm view polyapi --json | jq -r '.["dist-tags"].develop') + echo $VERSIONREMOTEDEVELOP + + if [[ "$VERSION" == "$REMOTEVERSION" ]]; then + echo "Local NPM version is the same as remote" + else + if [[ "$VERSION" != "$VERSIONREMOTEDEVELOP" ]]; then + yarn install + npx prisma@4.11.0 generate --generator js + cd packages/client + npm install --include=dev + npm publish --tag na1 + else + npm dist-tag add polyapi@$VERSION na1 + fi + fi + + if [[ "$VERSION" == "$VERSIONREMOTELATEST" ]]; then + echo "Local NPM version is the same as remote" + else + npm dist-tag add polyapi@$VERSION latest + fi \ No newline at end of file From abacf7c921845029b4b7a43226d58d6e45921f52 Mon Sep 17 00:00:00 2001 From: Aaron Goin Date: Fri, 9 May 2025 11:18:10 -0700 Subject: [PATCH 03/73] adding CI/CD workflows --- .github/workflows/deploy-npm-package.yaml | 51 ++++++++++++++++++++ .github/workflows/polyapi-npm-promotion.yaml | 8 +-- 2 files changed, 55 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/deploy-npm-package.yaml diff --git a/.github/workflows/deploy-npm-package.yaml b/.github/workflows/deploy-npm-package.yaml new file mode 100644 index 0000000..2c0f86a --- /dev/null +++ b/.github/workflows/deploy-npm-package.yaml @@ -0,0 +1,51 @@ +name: Docker Image & NPM publish CI/CD +on: + push: + branches: + - develop + +jobs: + develop: + name: Build and deploy NPM package. + runs-on: ubuntu-latest + environment: dev + permissions: + contents: read + packages: write + + if: ${{ github.ref == 'refs/heads/develop' }} + + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + + steps: + - uses: actions/checkout@v3 + + - name: Setup Node + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # 4.0.2 + with: + node-version: '20' + registry-url: 'https://registry.npmjs.org' + cache: 'yarn' + + - uses: dorny/paths-filter@v2 + id: changes + with: + filters: | + client: + - 'package.json' + + - if: steps.changes.outputs.client == 'true' + name: Publish package + run: | + VERSION=$(node -p "require('./package.json').version") + echo $VERSION + REMOTEVERSION=$(npm view polyapi --json | jq -r '.["dist-tags"].develop') + echo $REMOTEVERSION + + if [[ "$VERSION" == "$REMOTEVERSION" ]]; then + echo "Local NPM version is the same as remote" + else + npm install --include=dev + npm publish --tag develop + fi diff --git a/.github/workflows/polyapi-npm-promotion.yaml b/.github/workflows/polyapi-npm-promotion.yaml index cfdc1eb..6444f1b 100644 --- a/.github/workflows/polyapi-npm-promotion.yaml +++ b/.github/workflows/polyapi-npm-promotion.yaml @@ -3,7 +3,7 @@ on: pull_request: types: [ closed ] paths: - - "packages/client/package.json" + - "package.json" branches: - develop - main @@ -29,7 +29,7 @@ jobs: - name: Publish package run: | - VERSION=$(node -p "require('./packages/client/package.json').version") + VERSION=$(node -p "require('./package.json').version") VERSIONREMOTE=$(npm view polyapi --json | jq -r '.["dist-tags"].na1') VERSIONREMOTELATEST=$(npm view polyapi --json | jq -r '.["dist-tags"].latest') @@ -66,7 +66,7 @@ jobs: - name: Publish package run: | - VERSION=$(node -p "require('./packages/client/package.json').version") + VERSION=$(node -p "require('./package.json').version") VERSIONREMOTE=$(npm view polyapi --json | jq -r '.["dist-tags"].develop') if [[ $VERSION == $VERSIONREMOTE ]]; then @@ -96,7 +96,7 @@ jobs: - name: Publish package run: | - VERSION=$(node -p "require('./packages/client/package.json').version") + VERSION=$(node -p "require('./package.json').version") echo $VERSION REMOTEVERSION=$(npm view polyapi --json | jq -r '.["dist-tags"].na1') echo $REMOTEVERSION From d3f36ecc253c1742abb568250d54f8f9b204b6e6 Mon Sep 17 00:00:00 2001 From: Aaron Goin Date: Fri, 9 May 2025 11:19:17 -0700 Subject: [PATCH 04/73] updating to use npm cache instead of yarn --- .github/workflows/deploy-npm-package.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-npm-package.yaml b/.github/workflows/deploy-npm-package.yaml index 2c0f86a..f249188 100644 --- a/.github/workflows/deploy-npm-package.yaml +++ b/.github/workflows/deploy-npm-package.yaml @@ -26,7 +26,7 @@ jobs: with: node-version: '20' registry-url: 'https://registry.npmjs.org' - cache: 'yarn' + cache: 'npm' - uses: dorny/paths-filter@v2 id: changes From f23457beea67a9f5ac9c0668ba5e1a36d4e51c23 Mon Sep 17 00:00:00 2001 From: Aaron Goin Date: Mon, 12 May 2025 14:54:14 -0700 Subject: [PATCH 05/73] Bringing in Richard's updates! --- package.json | 2 +- src/commands/generate/index.ts | 2 ++ src/commands/generate/types.ts | 4 ++-- src/types/specifications.ts | 2 +- templates/vari/index.d.ts.hbs | 10 +++++----- templates/vari/index.js.hbs | 8 ++++---- templates/vari/{{context}}.d.ts.hbs | 4 ++-- 7 files changed, 17 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index a3e07e9..2b24b6d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.23.7", + "version": "0.23.8", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { diff --git a/src/commands/generate/index.ts b/src/commands/generate/index.ts index 3770ed7..a5ea430 100644 --- a/src/commands/generate/index.ts +++ b/src/commands/generate/index.ts @@ -32,6 +32,8 @@ import { DEFAULT_POLY_PATH } from '../../constants'; import { generateFunctionsTSDeclarationFile, generateVariablesTSDeclarationFile, getGenerationErrors, setGenerationErrors } from './types'; import { generateSchemaTSDeclarationFiles } from './schemaTypes'; +// Register the eq helper for equality comparison +handlebars.registerHelper('eq', (a, b) => a === b); const fsWriteAsync = (file: PathOrFileDescriptor, data: string) => new Promise((resolve, reject) => { diff --git a/src/commands/generate/types.ts b/src/commands/generate/types.ts index 5d476ef..e657a32 100644 --- a/src/commands/generate/types.ts +++ b/src/commands/generate/types.ts @@ -378,7 +378,7 @@ const getSpecificationWithVariableComment = (specification: SpecificationWithVar .map((line) => `* ${line}`) .join('\n') : null; - const secretComment = specification.variable.secret + const secretComment = specification.variable.secrecy === 'SECRET' ? '* Note: The variable is secret and can be used only within Poly functions.' : null; @@ -558,7 +558,7 @@ const generateTSContextDeclarationFile = async ( name: specification.name.split('.').pop(), comment: getSpecificationWithVariableComment(specification), type, - secret: specification.variable.secret, + secrecy: specification.variable.secrecy, isObjectType: specification.variable.valueType.kind === 'object', pathUnionType: pathUnionType.join('.'), }; diff --git a/src/types/specifications.ts b/src/types/specifications.ts index ea4f676..10fe608 100644 --- a/src/types/specifications.ts +++ b/src/types/specifications.ts @@ -132,7 +132,7 @@ export interface ServerVariableSpecification extends ISpecification { export interface VariableSpecification { environmentId: string; - secret: boolean; + secrecy: 'SECRET' | 'OBSCURED' | 'NONE' valueType: PropertyType; value?: ValueType; } diff --git a/templates/vari/index.d.ts.hbs b/templates/vari/index.d.ts.hbs index 0d1d9fa..12c15e1 100644 --- a/templates/vari/index.d.ts.hbs +++ b/templates/vari/index.d.ts.hbs @@ -6,7 +6,7 @@ declare module vari { type UnregisterOnUpdateHandler = () => void; interface VariableChangeEvent { type: 'update' | 'delete'; - secret: boolean; + secrecy: 'SECRET' | 'OBSCURED' | 'NONE'; id: string; previousValue: T; /** @@ -18,7 +18,7 @@ declare module vari { * User ID or Application ID of the user or application that updated the variable. */ updatedBy: string; - updatedFields: ('value' | 'secret')[]; + updatedFields: ('value' | 'secrecy')[]; }; interface VariableUpdateResponse { data: { @@ -27,7 +27,7 @@ declare module vari { name: string; description: string; visibility: 'ENVIRONMENT' | 'TENANT' | 'PUBLIC'; - secret: boolean; + secrecy: 'SECRET' | 'OBSCURED' | 'NONE'; value?: T } status: number; @@ -40,9 +40,9 @@ declare module vari { */ type?: 'update' | 'delete'; /** - * Filter updates by secret or non-secret variables + * Filter updates by secrecy level */ - secret?: boolean; + secrecy?: 'SECRET' | 'OBSCURED' | 'NONE'; }; interface Vari { diff --git a/templates/vari/index.js.hbs b/templates/vari/index.js.hbs index 6e704b9..2a0dbdc 100644 --- a/templates/vari/index.js.hbs +++ b/templates/vari/index.js.hbs @@ -27,7 +27,7 @@ function getStringPath(pathParts) { const variables = [ {{#each specifications}} - ['{{#if context}}{{context}}.{{/if}}{{name}}', '{{id}}', {{variable.secret}}], + ['{{#if context}}{{context}}.{{/if}}{{name}}', '{{id}}', '{{variable.secrecy}}'], {{/each}} ]; @@ -41,10 +41,10 @@ const contextPaths = [ const getVariableHandlers = (clientID, getSocket, getApiKey) => { const variableHandlers = {}; - variables.forEach(([contextPath, id, secret]) => { + variables.forEach(([contextPath, id, secrecy]) => { set(variableHandlers, contextPath, { get: () => { - if (secret) { + if (secrecy === 'SECRET') { throw new Error('Cannot access secret variable from client. Use .inject() instead within Poly function.'); } else { return axios.get( @@ -145,7 +145,7 @@ const getVariableHandlers = (clientID, getSocket, getApiKey) => { if (prop.match(/\d+/)) { - if (secret) { + if (secrecy === 'SECRECY') { pathParts.push(Number(prop)); } else if (paths.find(currentPath => { const arrContextPath = contextPath.split('.'); diff --git a/templates/vari/{{context}}.d.ts.hbs b/templates/vari/{{context}}.d.ts.hbs index 2098aea..3aa0f67 100644 --- a/templates/vari/{{context}}.d.ts.hbs +++ b/templates/vari/{{context}}.d.ts.hbs @@ -4,7 +4,7 @@ declare module vari { {{name}}: {{interfaceName}}Values; {{/each}} {{#each variableDeclarations}} - {{#if secret}} + {{#if (eq secrecy 'SECRET')}} {{else}} {{name}}: {{type}}; {{/if}} @@ -42,7 +42,7 @@ declare module vari { * @example * await poly.products.addItem(vari.products.shopId.inject(), 'Toy car', 1) */ - {{#if secret}} + {{#if (eq secrecy 'SECRET')}} inject(): {{{type}}}; inject(path: string): any; {{else}} From a40668cdd7fd48fc680c79c329739ad44756efb4 Mon Sep 17 00:00:00 2001 From: Aaron Goin Date: Tue, 13 May 2025 08:24:13 -0700 Subject: [PATCH 06/73] Some missed cleanup, missing dev dependencies, and fixed build. --- .eslintrc.js | 264 ++++- README_INTERNAL.md | 24 +- package-lock.json | 1822 +++++++++++++++++++++++++++++--- package.json | 9 +- src/commands/generate/index.ts | 2 +- src/commands/generate/types.ts | 1 - src/commands/tenant.ts | 2 +- src/deployables.ts | 2 +- src/transpiler.ts | 2 +- src/types/functions.ts | 14 +- src/types/index.ts | 2 +- src/types/schemas.ts | 4 +- src/types/shared.ts | 3 +- src/types/snippets.ts | 2 +- src/types/specifications.ts | 10 +- src/types/templates.ts | 2 +- src/types/webhooks.ts | 2 +- src/utils.ts | 3 +- 18 files changed, 1996 insertions(+), 174 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index bfa9662..f58b4be 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,5 +1,267 @@ module.exports = { + parser: '@typescript-eslint/parser', + parserOptions: { + project: 'tsconfig.json', + tsconfigRootDir: '.', + sourceType: 'module', + }, + plugins: ['@typescript-eslint/eslint-plugin'], extends: [ - '../../.eslintrc.js', + 'plugin:@typescript-eslint/recommended', + 'plugin:prettier/recommended', ], + root: true, + env: { + node: true, + jest: true, + }, + ignorePatterns: ['.eslintrc.js', 'scripts/*'], + rules: { + 'no-var': 'warn', + 'object-shorthand': ['warn', 'properties'], + + 'accessor-pairs': ['error', { setWithoutGet: true, enforceForClassMembers: true }], + 'array-bracket-spacing': ['error', 'never'], + 'array-bracket-newline': ['error', { multiline: true }], + 'array-callback-return': ['error', { + allowImplicit: false, + checkForEach: false, + }], + 'arrow-spacing': ['error', { before: true, after: true }], + 'block-spacing': ['error', 'always'], + 'brace-style': ['error', '1tbs', { allowSingleLine: true }], + 'camelcase': ['error', { + allow: ['^UNSAFE_'], + properties: 'never', + ignoreGlobals: true, + }], + 'comma-dangle': ['error', { + arrays: 'always-multiline', + objects: 'always-multiline', + imports: 'always-multiline', + exports: 'always-multiline', + functions: 'always-multiline', + }], + 'comma-spacing': ['error', { before: false, after: true }], + 'comma-style': ['error', 'last'], + 'computed-property-spacing': ['error', 'never', { enforceForClassMembers: true }], + 'constructor-super': 'error', + 'curly': ['error', 'multi-line'], + 'default-case-last': 'error', + 'dot-location': ['error', 'property'], + 'eol-last': 'error', + 'eqeqeq': ['error', 'always', { null: 'ignore' }], + 'func-call-spacing': ['error', 'never'], + 'func-style': ['error', 'expression', { allowArrowFunctions: true }], + 'generator-star-spacing': ['error', { before: true, after: true }], + 'indent': ['error', 2, { + SwitchCase: 1, + VariableDeclarator: 1, + outerIIFEBody: 1, + MemberExpression: 1, + FunctionDeclaration: { parameters: 1, body: 1 }, + FunctionExpression: { parameters: 1, body: 1 }, + CallExpression: { arguments: 1 }, + ArrayExpression: 1, + ObjectExpression: 1, + ImportDeclaration: 1, + flatTernaryExpressions: false, + ignoreComments: false, + ignoredNodes: [ + 'TemplateLiteral *', + 'JSXElement', + 'JSXElement > *', + 'JSXAttribute', + 'JSXIdentifier', + 'JSXNamespacedName', + 'JSXMemberExpression', + 'JSXSpreadAttribute', + 'JSXExpressionContainer', + 'JSXOpeningElement', + 'JSXClosingElement', + 'JSXFragment', + 'JSXOpeningFragment', + 'JSXClosingFragment', + 'JSXText', + 'JSXEmptyExpression', + 'JSXSpreadChild', + 'PropertyDefinition[decorators]' + ], + offsetTernaryExpressions: true, + }], + 'key-spacing': ['error', { beforeColon: false, afterColon: true }], + 'keyword-spacing': ['error', { before: true, after: true }], + 'lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true }], + 'multiline-ternary': ['error', 'always-multiline'], + 'new-cap': ['error', { newIsCap: true, capIsNew: false, properties: true }], + 'new-parens': 'error', + 'no-array-constructor': 'error', + 'no-async-promise-executor': 'error', + 'no-caller': 'error', + 'no-case-declarations': 'error', + 'no-class-assign': 'error', + 'no-compare-neg-zero': 'error', + 'no-cond-assign': 'error', + 'no-const-assign': 'error', + 'no-constant-condition': ['error', { checkLoops: false }], + 'no-control-regex': 'error', + 'no-debugger': 'error', + 'no-delete-var': 'error', + 'no-dupe-args': 'error', + 'no-dupe-class-members': 'error', + 'no-dupe-keys': 'error', + 'no-duplicate-case': 'error', + 'no-useless-backreference': 'error', + 'no-empty': ['error', { allowEmptyCatch: true }], + 'no-empty-character-class': 'error', + 'no-empty-pattern': 'error', + 'no-eval': 'error', + 'no-ex-assign': 'error', + 'no-extend-native': 'error', + 'no-extra-bind': 'error', + 'no-extra-boolean-cast': 'error', + 'no-extra-parens': ['error', 'functions'], + 'no-fallthrough': 'error', + 'no-floating-decimal': 'error', + 'no-func-assign': 'error', + 'no-global-assign': 'error', + 'no-implied-eval': 'error', + 'no-import-assign': 'error', + 'no-invalid-regexp': 'error', + 'no-irregular-whitespace': 'error', + 'no-iterator': 'error', + 'no-labels': ['error', { allowLoop: false, allowSwitch: false }], + 'no-lone-blocks': 'error', + 'no-loss-of-precision': 'error', + 'no-misleading-character-class': 'error', + 'no-useless-catch': 'error', + 'no-mixed-operators': ['error', { + groups: [ + ['==', '!=', '===', '!==', '>', '>=', '<', '<='], + ['&&', '||'], + ['in', 'instanceof'], + ], + allowSamePrecedence: true, + }], + 'no-mixed-spaces-and-tabs': 'error', + 'no-multi-spaces': 'error', + 'no-multi-str': 'error', + 'no-multiple-empty-lines': ['error', { max: 1, maxBOF: 0, maxEOF: 0 }], + 'no-new': 'error', + 'no-new-func': 'error', + 'no-new-object': 'error', + 'no-new-symbol': 'error', + 'no-new-wrappers': 'error', + 'no-obj-calls': 'error', + 'no-octal': 'error', + 'no-octal-escape': 'error', + 'no-proto': 'error', + 'no-redeclare': ['error', { builtinGlobals: false }], + 'no-regex-spaces': 'error', + 'no-return-assign': ['error', 'except-parens'], + 'no-self-assign': ['error', { props: true }], + 'no-self-compare': 'error', + 'no-sequences': 'error', + 'no-shadow-restricted-names': 'error', + 'no-sparse-arrays': 'error', + 'no-tabs': 'error', + 'no-template-curly-in-string': 'error', + 'no-this-before-super': 'error', + 'no-throw-literal': 'error', + 'no-trailing-spaces': 'error', + 'no-undef': 'error', + 'no-undef-init': 'error', + 'no-unexpected-multiline': 'error', + 'no-unmodified-loop-condition': 'error', + 'no-unneeded-ternary': ['error', { defaultAssignment: false }], + 'no-unreachable': 'error', + 'no-unreachable-loop': 'error', + 'no-unsafe-finally': 'error', + 'no-unsafe-negation': 'error', + 'no-unused-expressions': ['error', { + allowShortCircuit: true, + allowTernary: true, + allowTaggedTemplates: true, + }], + 'no-unused-vars': ['error', { + args: 'none', + caughtErrors: 'none', + ignoreRestSiblings: true, + vars: 'all', + }], + 'no-useless-call': 'error', + 'no-useless-computed-key': 'error', + 'no-useless-rename': 'error', + 'no-useless-return': 'error', + 'no-void': ['error', { allowAsStatement: true }], + 'no-whitespace-before-property': 'error', + 'no-with': 'error', + 'object-curly-newline': ['error', { multiline: true, consistent: true }], + 'object-curly-spacing': ['error', 'always'], + 'object-property-newline': ['error', { allowMultiplePropertiesPerLine: true }], + 'one-var': ['error', { initialized: 'never' }], + 'operator-linebreak': ['error', 'after', { overrides: { '?': 'before', ':': 'before', '|>': 'before' } }], + 'padded-blocks': ['error', { blocks: 'never', switches: 'never', classes: 'never' }], + 'prefer-const': ['error', { destructuring: 'all' }], + 'prefer-promise-reject-errors': 'error', + 'prefer-regex-literals': ['error', { disallowRedundantWrapping: true }], + 'quote-props': ['error', 'as-needed'], + 'quotes': ['error', 'single', { avoidEscape: true, allowTemplateLiterals: false }], + 'rest-spread-spacing': ['error', 'never'], + 'semi': ['error', 'always'], + 'semi-spacing': ['error', { before: false, after: true }], + 'space-before-blocks': ['error', 'always'], + 'space-before-function-paren': ['error', { + 'anonymous': 'always', + 'named': 'never', + 'asyncArrow': 'always', + }], + 'space-in-parens': ['error', 'never'], + 'space-infix-ops': 'error', + 'space-unary-ops': ['error', { words: true, nonwords: false }], + 'spaced-comment': ['error', 'always', { + line: { markers: ['*package', '!', '/', ',', '='] }, + block: { balanced: true, markers: ['*package', '!', ',', ':', '::', 'flow-include'], exceptions: ['*'] }, + }], + 'symbol-description': 'error', + 'template-curly-spacing': ['error', 'never'], + 'template-tag-spacing': ['error', 'never'], + 'unicode-bom': ['error', 'never'], + 'use-isnan': ['error', { + enforceForSwitchCase: true, + enforceForIndexOf: true, + }], + 'valid-typeof': ['error', { requireStringLiterals: true }], + 'wrap-iife': ['error', 'any', { functionPrototypeMethods: true }], + 'yield-star-spacing': ['error', 'both'], + + '@typescript-eslint/interface-name-prefix': 'off', + '@typescript-eslint/explicit-function-return-type': 'off', + '@typescript-eslint/explicit-module-boundary-types': 'off', + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/no-non-null-assertion': 'off', + '@typescript-eslint/no-unused-vars': 'error', + 'prettier/prettier': [ + 0, + { + 'endOfLine': 'auto', + }, + ], + "@typescript-eslint/naming-convention": [ + "error", + { + "selector": [ + "classProperty", + "typeProperty", + "classMethod", + "objectLiteralMethod", + "typeMethod", + "accessor", + "enumMember" + ], + "format": ["strictCamelCase"], + "modifiers": ["requiresQuotes"] + } + ] + }, }; diff --git a/README_INTERNAL.md b/README_INTERNAL.md index d8e33e2..ecde7f2 100644 --- a/README_INTERNAL.md +++ b/README_INTERNAL.md @@ -72,4 +72,26 @@ You should see "HELLO WORLD" at the bottom of the README! ## Conclusion -That's it! Happy hacking! \ No newline at end of file +That's it! Happy hacking! + +# PolyAPI TypeScript/JavaScript Client + +## Adding a new kind of deployable for `poly prepare` and `poly sync` + +1. Update user-facing typedef exports in `types.ts` to add a new type and any custom configuration it might have. Follow the existing naming convention: `PolyThing`. + +2. Update typedefs in `src/deployments.ts`. + + a. Add type to DeployableTypes (matching collection id as used in canopy collection url). + + b. Add type to DeployableTypeNames matching the type added in the `types.ts` file. + + c. Add entry to DeployableTypeEntries mapping the new DeployableTypeName to the new DeployableType + +3. Update transpiler to support the new type and add a function if you need to parse more than the type and config object. See `parseDeployable` in `src/transpiler.ts`. + +4. Add function to write this new type of deployable back to its source file. See `writeUpdatedDeployable` in `src/deployments.ts`. + +5. Update poly prepare to support filling in missing details for this new type. See `fillInMissingDetails` in `src/commands/prepare.ts`. + +6. Update poly sync to support syncing and removing this new type. See `syncDeployableAndGetId` and `removeDeployable` in `src/commands/sync.ts`. \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 45b53f9..8685d64 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,21 +1,26 @@ { "name": "polyapi", - "version": "0.23.7", + "version": "0.23.8", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "polyapi", - "version": "0.23.7", + "version": "0.23.8", "license": "MIT", "dependencies": { "@guanghechen/helper-string": "4.7.1", "@inquirer/prompts": "^7.0.1", + "@typescript-eslint/eslint-plugin": "^5.0.0", + "@typescript-eslint/parser": "^5.0.0", "adm-zip": "^0.5.16", "axios": "^1.8.3", "chalk": "4.1.2", "comment-json": "^4.2.3", "dotenv": "^16.0.3", + "eslint": "^8.56.0", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-prettier": "^4.0.0", "handlebars": "4.7.7", "http-proxy-agent": "^7.0.0", "https-proxy-agent": "^7.0.0", @@ -34,13 +39,14 @@ "yargs": "17.7.1" }, "bin": { - "poly": "build/client/src/cli.js" + "poly": "build/cli.js" }, "devDependencies": { "@types/adm-zip": "^0.5.5", "@types/jest": "29.2.4", "@types/jsonpath": "^0.2.4", "@types/lodash": "^4.14.192", + "@types/node": "18.11.18", "@types/validator": "^13.11.1", "copyfiles": "^2.4.1", "jest": "29.3.1", @@ -656,6 +662,110 @@ "node": ">=12" } }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.7.0.tgz", + "integrity": "sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw==", + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", + "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", + "license": "MIT", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "license": "MIT", + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "license": "Python-2.0" + }, + "node_modules/@eslint/eslintrc/node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "license": "MIT", + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@eslint/eslintrc/node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/@eslint/eslintrc/node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@eslint/js": { + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz", + "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==", + "license": "MIT", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, "node_modules/@guanghechen/helper-string": { "version": "4.7.1", "resolved": "https://registry.npmjs.org/@guanghechen/helper-string/-/helper-string-4.7.1.tgz", @@ -670,6 +780,41 @@ "node": ">= 16.0.0" } }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz", + "integrity": "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==", + "deprecated": "Use @eslint/config-array instead", + "license": "Apache-2.0", + "dependencies": { + "@humanwhocodes/object-schema": "^2.0.3", + "debug": "^4.3.1", + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "license": "Apache-2.0", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", + "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", + "deprecated": "Use @eslint/object-schema instead", + "license": "BSD-3-Clause" + }, "node_modules/@inquirer/checkbox": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/@inquirer/checkbox/-/checkbox-4.0.1.tgz", @@ -1352,7 +1497,6 @@ "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" @@ -1365,7 +1509,6 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true, "engines": { "node": ">= 8" } @@ -1374,7 +1517,6 @@ "version": "1.2.8", "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" @@ -1555,9 +1697,16 @@ "integrity": "sha512-w9iWudx1XWOHW5lQRS9iKpK/XuRhnN+0T7HvdCCd802FYkT1AMTnxndJHGrNJwRoRHkslGr4S29tjm1cT7x/7w==" }, "node_modules/@types/node": { - "version": "18.15.11", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.11.tgz", - "integrity": "sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q==" + "version": "18.11.18", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.18.tgz", + "integrity": "sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA==", + "license": "MIT" + }, + "node_modules/@types/semver": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.7.0.tgz", + "integrity": "sha512-k107IF4+Xr7UHjwDc7Cfd6PRQfbdkiRabXGRjo07b4WyPahFBZCZ1sE+BNxYIJPPg73UkfOsVOLwqVc/6ETrIA==", + "license": "MIT" }, "node_modules/@types/stack-utils": { "version": "2.0.3", @@ -1589,6 +1738,276 @@ "dev": true, "license": "MIT" }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz", + "integrity": "sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==", + "license": "MIT", + "dependencies": { + "@eslint-community/regexpp": "^4.4.0", + "@typescript-eslint/scope-manager": "5.62.0", + "@typescript-eslint/type-utils": "5.62.0", + "@typescript-eslint/utils": "5.62.0", + "debug": "^4.3.4", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "natural-compare-lite": "^1.4.0", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^5.0.0", + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "license": "0BSD" + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "license": "MIT", + "dependencies": { + "tslib": "^1.8.1" + }, + "engines": { + "node": ">= 6" + }, + "peerDependencies": { + "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz", + "integrity": "sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==", + "license": "BSD-2-Clause", + "dependencies": { + "@typescript-eslint/scope-manager": "5.62.0", + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/typescript-estree": "5.62.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz", + "integrity": "sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==", + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/visitor-keys": "5.62.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.62.0.tgz", + "integrity": "sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==", + "license": "MIT", + "dependencies": { + "@typescript-eslint/typescript-estree": "5.62.0", + "@typescript-eslint/utils": "5.62.0", + "debug": "^4.3.4", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/type-utils/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "license": "0BSD" + }, + "node_modules/@typescript-eslint/type-utils/node_modules/tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "license": "MIT", + "dependencies": { + "tslib": "^1.8.1" + }, + "engines": { + "node": ">= 6" + }, + "peerDependencies": { + "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + } + }, + "node_modules/@typescript-eslint/types": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz", + "integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==", + "license": "MIT", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz", + "integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==", + "license": "BSD-2-Clause", + "dependencies": { + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/visitor-keys": "5.62.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "license": "0BSD" + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "license": "MIT", + "dependencies": { + "tslib": "^1.8.1" + }, + "engines": { + "node": ">= 6" + }, + "peerDependencies": { + "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.62.0.tgz", + "integrity": "sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==", + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@types/json-schema": "^7.0.9", + "@types/semver": "^7.3.12", + "@typescript-eslint/scope-manager": "5.62.0", + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/typescript-estree": "5.62.0", + "eslint-scope": "^5.1.1", + "semver": "^7.3.7" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/@typescript-eslint/utils/node_modules/eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz", + "integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==", + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "5.62.0", + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@ungap/structured-clone": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz", + "integrity": "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==", + "license": "ISC" + }, "node_modules/acorn": { "version": "8.10.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", @@ -1600,6 +2019,15 @@ "node": ">=0.4.0" } }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, "node_modules/acorn-walk": { "version": "8.2.0", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", @@ -1628,6 +2056,22 @@ "node": ">= 14" } }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, "node_modules/ansi-escapes": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", @@ -1700,7 +2144,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true, "engines": { "node": ">=8" } @@ -1874,7 +2317,6 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", - "dev": true, "dependencies": { "fill-range": "^7.1.1" }, @@ -1945,7 +2387,6 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true, "license": "MIT", "engines": { "node": ">=6" @@ -2294,7 +2735,6 @@ "version": "7.0.6", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", - "dev": true, "license": "MIT", "dependencies": { "path-key": "^3.1.0", @@ -2391,7 +2831,6 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, "dependencies": { "path-type": "^4.0.0" }, @@ -2399,6 +2838,18 @@ "node": ">=8" } }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "license": "Apache-2.0", + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/dot-case": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz", @@ -2453,61 +2904,370 @@ "xmlhttprequest-ssl": "~2.0.0" } }, - "node_modules/engine.io-parser": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.2.2.tgz", - "integrity": "sha512-RcyUFKA93/CXH20l4SoVvzZfrSDMOTUS3bWVpTt2FuFP+XYrL8i8oonHP7WInRyVHXh0n/ORtoeiE1os+8qkSw==", + "node_modules/engine.io-parser": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.2.2.tgz", + "integrity": "sha512-RcyUFKA93/CXH20l4SoVvzZfrSDMOTUS3bWVpTt2FuFP+XYrL8i8oonHP7WInRyVHXh0n/ORtoeiE1os+8qkSw==", + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/escodegen": { + "version": "1.14.3", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz", + "integrity": "sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==", + "dependencies": { + "esprima": "^4.0.1", + "estraverse": "^4.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1" + }, + "bin": { + "escodegen": "bin/escodegen.js", + "esgenerate": "bin/esgenerate.js" + }, + "engines": { + "node": ">=4.0" + }, + "optionalDependencies": { + "source-map": "~0.6.1" + } + }, + "node_modules/eslint": { + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz", + "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", + "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.1", + "@humanwhocodes/config-array": "^0.13.0", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-config-prettier": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", + "integrity": "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==", + "license": "MIT", + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, + "node_modules/eslint-plugin-prettier": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz", + "integrity": "sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==", + "license": "MIT", + "dependencies": { + "prettier-linter-helpers": "^1.0.0" + }, + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "eslint": ">=7.28.0", + "prettier": ">=2.0.0" + }, + "peerDependenciesMeta": { + "eslint-config-prettier": { + "optional": true + } + } + }, + "node_modules/eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-scope/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "license": "Python-2.0" + }, + "node_modules/eslint/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/eslint/node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "license": "MIT", + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/eslint/node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/eslint/node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "license": "MIT", + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, "engines": { - "node": ">=10.0.0" + "node": ">= 0.8.0" } }, - "node_modules/error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, + "node_modules/eslint/node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "license": "MIT", "dependencies": { - "is-arrayish": "^0.2.1" + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/escalade": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", - "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "node_modules/eslint/node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "license": "MIT", "engines": { - "node": ">=6" + "node": ">= 0.8.0" } }, - "node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, + "node_modules/eslint/node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1" + }, "engines": { - "node": ">=0.8.0" + "node": ">= 0.8.0" } }, - "node_modules/escodegen": { - "version": "1.14.3", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz", - "integrity": "sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==", - "dependencies": { - "esprima": "^4.0.1", - "estraverse": "^4.2.0", - "esutils": "^2.0.2", - "optionator": "^0.8.1" + "node_modules/eslint/node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" }, - "bin": { - "escodegen": "bin/escodegen.js", - "esgenerate": "bin/esgenerate.js" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/espree": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" }, "engines": { - "node": ">=4.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, - "optionalDependencies": { - "source-map": "~0.6.1" + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/esprima": { @@ -2522,6 +3282,48 @@ "node": ">=4" } }, + "node_modules/esquery": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", + "license": "BSD-3-Clause", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esquery/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esrecurse/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, "node_modules/estraverse": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", @@ -2601,11 +3403,22 @@ "node": ">=4" } }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "license": "MIT" + }, + "node_modules/fast-diff": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", + "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", + "license": "Apache-2.0" + }, "node_modules/fast-glob": { "version": "3.2.12", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", - "dev": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -2621,7 +3434,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true, "license": "MIT" }, "node_modules/fast-levenshtein": { @@ -2633,7 +3445,6 @@ "version": "1.15.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", - "dev": true, "dependencies": { "reusify": "^1.0.4" } @@ -2648,11 +3459,22 @@ "bser": "2.1.1" } }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "license": "MIT", + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, "node_modules/fill-range": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", - "dev": true, "dependencies": { "to-regex-range": "^5.0.1" }, @@ -2674,6 +3496,42 @@ "node": ">=8" } }, + "node_modules/flat-cache": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "license": "MIT", + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.3", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flat-cache/node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "license": "ISC", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/flatted": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", + "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", + "license": "ISC" + }, "node_modules/follow-redirects": { "version": "1.15.6", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", @@ -2794,7 +3652,6 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, "dependencies": { "is-glob": "^4.0.1" }, @@ -2816,7 +3673,6 @@ "version": "11.1.0", "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dev": true, "dependencies": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", @@ -2839,6 +3695,12 @@ "dev": true, "license": "ISC" }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "license": "MIT" + }, "node_modules/handlebars": { "version": "4.7.7", "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", @@ -2951,11 +3813,35 @@ "version": "5.2.4", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", - "dev": true, "engines": { "node": ">= 4" } }, + "node_modules/import-fresh": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", + "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", + "license": "MIT", + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/import-fresh/node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, "node_modules/import-local": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.2.0.tgz", @@ -2980,7 +3866,6 @@ "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "dev": true, "license": "MIT", "engines": { "node": ">=0.8.19" @@ -3079,11 +3964,19 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, "engines": { "node": ">=0.12.0" } }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/is-stream": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", @@ -3107,7 +4000,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true, "license": "ISC" }, "node_modules/istanbul-lib-coverage": { @@ -3875,6 +4767,12 @@ "node": ">=6" } }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "license": "MIT" + }, "node_modules/json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", @@ -3934,6 +4832,18 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "license": "MIT" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "license": "MIT" + }, "node_modules/json5": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", @@ -3969,6 +4879,15 @@ "node": ">=0.4.0" } }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, "node_modules/kleur": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", @@ -4026,6 +4945,12 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "license": "MIT" + }, "node_modules/lower-case": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", @@ -4082,7 +5007,6 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true, "engines": { "node": ">= 8" } @@ -4091,7 +5015,6 @@ "version": "4.0.8", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", - "dev": true, "dependencies": { "braces": "^3.0.3", "picomatch": "^2.3.1" @@ -4191,7 +5114,12 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", - "dev": true, + "license": "MIT" + }, + "node_modules/natural-compare-lite": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", + "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", "license": "MIT" }, "node_modules/neo-async": { @@ -4306,7 +5234,6 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, "license": "MIT", "dependencies": { "yocto-queue": "^0.1.0" @@ -4366,6 +5293,18 @@ "tslib": "^2.0.3" } }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "license": "MIT", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/parse-json": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", @@ -4412,7 +5351,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -4430,7 +5368,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -4470,7 +5407,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true, "engines": { "node": ">=8" } @@ -4486,7 +5422,6 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, "engines": { "node": ">=8.6" }, @@ -4548,6 +5483,18 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, + "node_modules/prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "license": "MIT", + "dependencies": { + "fast-diff": "^1.1.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/pretty-format": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", @@ -4601,6 +5548,15 @@ "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/pure-rand": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.1.0.tgz", @@ -4628,7 +5584,6 @@ "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true, "funding": [ { "type": "github", @@ -4755,7 +5710,6 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true, "engines": { "iojs": ">=1.0.0", "node": ">=0.10.0" @@ -4825,7 +5779,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, "funding": [ { "type": "github", @@ -4896,7 +5849,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, "license": "MIT", "dependencies": { "shebang-regex": "^3.0.0" @@ -4909,7 +5861,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -4949,7 +5900,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true, "engines": { "node": ">=8" } @@ -5121,7 +6071,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -5167,6 +6116,12 @@ "node": ">=8" } }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "license": "MIT" + }, "node_modules/through2": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", @@ -5279,7 +6234,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, "dependencies": { "is-number": "^7.0.0" }, @@ -5650,6 +6604,15 @@ "tslib": "^2.0.3" } }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -5717,7 +6680,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, "license": "ISC", "dependencies": { "isexe": "^2.0.0" @@ -5864,7 +6826,6 @@ "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true, "license": "MIT", "engines": { "node": ">=10" @@ -6309,6 +7270,68 @@ "@jridgewell/trace-mapping": "0.3.9" } }, + "@eslint-community/eslint-utils": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.7.0.tgz", + "integrity": "sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw==", + "requires": { + "eslint-visitor-keys": "^3.4.3" + } + }, + "@eslint-community/regexpp": { + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", + "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==" + }, + "@eslint/eslintrc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "requires": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "dependencies": { + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + }, + "globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "requires": { + "type-fest": "^0.20.2" + } + }, + "js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "requires": { + "argparse": "^2.0.1" + } + }, + "type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==" + } + } + }, + "@eslint/js": { + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz", + "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==" + }, "@guanghechen/helper-string": { "version": "4.7.1", "resolved": "https://registry.npmjs.org/@guanghechen/helper-string/-/helper-string-4.7.1.tgz", @@ -6320,6 +7343,26 @@ "upper-case": "^2.0.2" } }, + "@humanwhocodes/config-array": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz", + "integrity": "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==", + "requires": { + "@humanwhocodes/object-schema": "^2.0.3", + "debug": "^4.3.1", + "minimatch": "^3.0.5" + } + }, + "@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==" + }, + "@humanwhocodes/object-schema": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", + "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==" + }, "@inquirer/checkbox": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/@inquirer/checkbox/-/checkbox-4.0.1.tgz", @@ -6825,7 +7868,6 @@ "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, "requires": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" @@ -6834,14 +7876,12 @@ "@nodelib/fs.stat": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==" }, "@nodelib/fs.walk": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, "requires": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" @@ -7006,9 +8046,14 @@ "integrity": "sha512-w9iWudx1XWOHW5lQRS9iKpK/XuRhnN+0T7HvdCCd802FYkT1AMTnxndJHGrNJwRoRHkslGr4S29tjm1cT7x/7w==" }, "@types/node": { - "version": "18.15.11", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.11.tgz", - "integrity": "sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q==" + "version": "18.11.18", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.18.tgz", + "integrity": "sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA==" + }, + "@types/semver": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.7.0.tgz", + "integrity": "sha512-k107IF4+Xr7UHjwDc7Cfd6PRQfbdkiRabXGRjo07b4WyPahFBZCZ1sE+BNxYIJPPg73UkfOsVOLwqVc/6ETrIA==" }, "@types/stack-utils": { "version": "2.0.3", @@ -7037,11 +8082,169 @@ "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==", "dev": true }, + "@typescript-eslint/eslint-plugin": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz", + "integrity": "sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==", + "requires": { + "@eslint-community/regexpp": "^4.4.0", + "@typescript-eslint/scope-manager": "5.62.0", + "@typescript-eslint/type-utils": "5.62.0", + "@typescript-eslint/utils": "5.62.0", + "debug": "^4.3.4", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "natural-compare-lite": "^1.4.0", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "requires": { + "tslib": "^1.8.1" + } + } + } + }, + "@typescript-eslint/parser": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz", + "integrity": "sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==", + "requires": { + "@typescript-eslint/scope-manager": "5.62.0", + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/typescript-estree": "5.62.0", + "debug": "^4.3.4" + } + }, + "@typescript-eslint/scope-manager": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz", + "integrity": "sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==", + "requires": { + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/visitor-keys": "5.62.0" + } + }, + "@typescript-eslint/type-utils": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.62.0.tgz", + "integrity": "sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==", + "requires": { + "@typescript-eslint/typescript-estree": "5.62.0", + "@typescript-eslint/utils": "5.62.0", + "debug": "^4.3.4", + "tsutils": "^3.21.0" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "requires": { + "tslib": "^1.8.1" + } + } + } + }, + "@typescript-eslint/types": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz", + "integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==" + }, + "@typescript-eslint/typescript-estree": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz", + "integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==", + "requires": { + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/visitor-keys": "5.62.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "requires": { + "tslib": "^1.8.1" + } + } + } + }, + "@typescript-eslint/utils": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.62.0.tgz", + "integrity": "sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==", + "requires": { + "@eslint-community/eslint-utils": "^4.2.0", + "@types/json-schema": "^7.0.9", + "@types/semver": "^7.3.12", + "@typescript-eslint/scope-manager": "5.62.0", + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/typescript-estree": "5.62.0", + "eslint-scope": "^5.1.1", + "semver": "^7.3.7" + }, + "dependencies": { + "eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + } + } + } + }, + "@typescript-eslint/visitor-keys": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz", + "integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==", + "requires": { + "@typescript-eslint/types": "5.62.0", + "eslint-visitor-keys": "^3.3.0" + } + }, + "@ungap/structured-clone": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz", + "integrity": "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==" + }, "acorn": { "version": "8.10.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==" }, + "acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "requires": {} + }, "acorn-walk": { "version": "8.2.0", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", @@ -7060,6 +8263,17 @@ "debug": "^4.3.4" } }, + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, "ansi-escapes": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", @@ -7113,8 +8327,7 @@ "array-union": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==" }, "asynckit": { "version": "0.4.0", @@ -7249,7 +8462,6 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", - "dev": true, "requires": { "fill-range": "^7.1.1" } @@ -7290,8 +8502,7 @@ "callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==" }, "camel-case": { "version": "4.1.2", @@ -7551,7 +8762,6 @@ "version": "7.0.6", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", - "dev": true, "requires": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -7610,11 +8820,18 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, "requires": { "path-type": "^4.0.0" } }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "requires": { + "esutils": "^2.0.2" + } + }, "dot-case": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz", @@ -7695,11 +8912,232 @@ "source-map": "~0.6.1" } }, + "eslint": { + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz", + "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", + "requires": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.1", + "@humanwhocodes/config-array": "^0.13.0", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" + }, + "dependencies": { + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + }, + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==" + }, + "find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "requires": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + } + }, + "glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "requires": { + "is-glob": "^4.0.3" + } + }, + "globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "requires": { + "type-fest": "^0.20.2" + } + }, + "js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "requires": { + "argparse": "^2.0.1" + } + }, + "levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, + "locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "requires": { + "p-locate": "^5.0.0" + } + }, + "optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "requires": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + } + }, + "p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "requires": { + "p-limit": "^3.0.2" + } + }, + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==" + }, + "type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "requires": { + "prelude-ls": "^1.2.1" + } + }, + "type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==" + } + } + }, + "eslint-config-prettier": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", + "integrity": "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==", + "requires": {} + }, + "eslint-plugin-prettier": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz", + "integrity": "sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==", + "requires": { + "prettier-linter-helpers": "^1.0.0" + } + }, + "eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "dependencies": { + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==" + } + } + }, + "eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==" + }, + "espree": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "requires": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + } + }, "esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" }, + "esquery": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", + "requires": { + "estraverse": "^5.1.0" + }, + "dependencies": { + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==" + } + } + }, + "esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "requires": { + "estraverse": "^5.2.0" + }, + "dependencies": { + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==" + } + } + }, "estraverse": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", @@ -7756,11 +9194,20 @@ "tmp": "^0.0.33" } }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + }, + "fast-diff": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", + "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==" + }, "fast-glob": { "version": "3.2.12", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", - "dev": true, "requires": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -7772,8 +9219,7 @@ "fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" }, "fast-levenshtein": { "version": "2.0.6", @@ -7784,7 +9230,6 @@ "version": "1.15.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", - "dev": true, "requires": { "reusify": "^1.0.4" } @@ -7798,11 +9243,18 @@ "bser": "2.1.1" } }, + "file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "requires": { + "flat-cache": "^3.0.4" + } + }, "fill-range": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", - "dev": true, "requires": { "to-regex-range": "^5.0.1" } @@ -7817,6 +9269,31 @@ "path-exists": "^4.0.0" } }, + "flat-cache": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "requires": { + "flatted": "^3.2.9", + "keyv": "^4.5.3", + "rimraf": "^3.0.2" + }, + "dependencies": { + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "requires": { + "glob": "^7.1.3" + } + } + } + }, + "flatted": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", + "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==" + }, "follow-redirects": { "version": "1.15.6", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", @@ -7889,7 +9366,6 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, "requires": { "is-glob": "^4.0.1" } @@ -7904,7 +9380,6 @@ "version": "11.1.0", "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dev": true, "requires": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", @@ -7920,6 +9395,11 @@ "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "dev": true }, + "graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==" + }, "handlebars": { "version": "4.7.7", "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", @@ -8000,8 +9480,23 @@ "ignore": { "version": "5.2.4", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", - "dev": true + "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==" + }, + "import-fresh": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", + "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "dependencies": { + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==" + } + } }, "import-local": { "version": "3.2.0", @@ -8016,8 +9511,7 @@ "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "dev": true + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==" }, "inflight": { "version": "1.0.6", @@ -8088,8 +9582,12 @@ "is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" + }, + "is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==" }, "is-stream": { "version": "2.0.1", @@ -8106,8 +9604,7 @@ "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" }, "istanbul-lib-coverage": { "version": "3.2.2", @@ -8669,6 +10166,11 @@ "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", "dev": true }, + "json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==" + }, "json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", @@ -8711,6 +10213,16 @@ } } }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==" + }, "json5": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", @@ -8734,6 +10246,14 @@ } } }, + "keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "requires": { + "json-buffer": "3.0.1" + } + }, "kleur": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", @@ -8775,6 +10295,11 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, + "lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" + }, "lower-case": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", @@ -8821,14 +10346,12 @@ "merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==" }, "micromatch": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", - "dev": true, "requires": { "braces": "^3.0.3", "picomatch": "^2.3.1" @@ -8892,8 +10415,12 @@ "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", - "dev": true + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==" + }, + "natural-compare-lite": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", + "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==" }, "neo-async": { "version": "2.6.2", @@ -8985,7 +10512,6 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, "requires": { "yocto-queue": "^0.1.0" } @@ -9025,6 +10551,14 @@ "tslib": "^2.0.3" } }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "requires": { + "callsites": "^3.0.0" + } + }, "parse-json": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", @@ -9063,8 +10597,7 @@ "path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" }, "path-is-absolute": { "version": "1.0.1", @@ -9074,8 +10607,7 @@ "path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" }, "path-parse": { "version": "1.0.7", @@ -9103,8 +10635,7 @@ "path-type": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==" }, "picocolors": { "version": "1.1.1", @@ -9115,8 +10646,7 @@ "picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" }, "pirates": { "version": "4.0.6", @@ -9152,6 +10682,14 @@ "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.0.tgz", "integrity": "sha512-zBf5eHpwHOGPC47h0zrPyNn+eAEIdEzfywMoYn2XPi0P44Zp0tSq64rq0xAREh4auw2cJZHo9QUob+NqCQky4g==" }, + "prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "requires": { + "fast-diff": "^1.1.2" + } + }, "pretty-format": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", @@ -9192,6 +10730,11 @@ "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" }, + "punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==" + }, "pure-rand": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.1.0.tgz", @@ -9207,8 +10750,7 @@ "queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==" }, "react-is": { "version": "18.3.1", @@ -9289,8 +10831,7 @@ "reusify": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==" }, "rimraf": { "version": "4.4.1", @@ -9337,7 +10878,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, "requires": { "queue-microtask": "^1.2.2" } @@ -9384,7 +10924,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, "requires": { "shebang-regex": "^3.0.0" } @@ -9392,8 +10931,7 @@ "shebang-regex": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" }, "shelljs": { "version": "0.8.5", @@ -9420,8 +10958,7 @@ "slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==" }, "slugify": { "version": "1.6.6", @@ -9552,8 +11089,7 @@ "strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==" }, "supports-color": { "version": "7.2.0", @@ -9579,6 +11115,11 @@ "minimatch": "^3.0.4" } }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==" + }, "through2": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", @@ -9675,7 +11216,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, "requires": { "is-number": "^7.0.0" } @@ -9933,6 +11473,14 @@ "tslib": "^2.0.3" } }, + "uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "requires": { + "punycode": "^2.1.0" + } + }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -9990,7 +11538,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, "requires": { "isexe": "^2.0.0" } @@ -10084,8 +11631,7 @@ "yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==" }, "yoctocolors-cjs": { "version": "2.1.2", diff --git a/package.json b/package.json index 2b24b6d..b47c567 100644 --- a/package.json +++ b/package.json @@ -15,13 +15,13 @@ ], "main": "index.js", "bin": { - "poly": "build/client/src/cli.js" + "poly": "build/cli.js" }, "scripts": { "build": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json", "prebuild": "rimraf build", "postbuild": "npm run copy-templates", - "copy-templates": "copyfiles \"templates/**/*.hbs\" build/client/src", + "copy-templates": "copyfiles \"templates/**/*.hbs\" build", "format": "prettier --write \"src/**/*.ts\"", "lint": "eslint \"src/**/*.ts\" --fix", "prepare": "npm run build", @@ -48,11 +48,16 @@ "dependencies": { "@guanghechen/helper-string": "4.7.1", "@inquirer/prompts": "^7.0.1", + "@typescript-eslint/eslint-plugin": "^5.0.0", + "@typescript-eslint/parser": "^5.0.0", "adm-zip": "^0.5.16", "axios": "^1.8.3", "chalk": "4.1.2", "comment-json": "^4.2.3", "dotenv": "^16.0.3", + "eslint": "^8.56.0", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-prettier": "^4.0.0", "handlebars": "4.7.7", "http-proxy-agent": "^7.0.0", "https-proxy-agent": "^7.0.0", diff --git a/src/commands/generate/index.ts b/src/commands/generate/index.ts index a5ea430..6c037b4 100644 --- a/src/commands/generate/index.ts +++ b/src/commands/generate/index.ts @@ -305,7 +305,7 @@ const showErrGeneratingFiles = (error: any) => { shell.exit(2); }; -const generateSingleCustomFunction = async (polyPath: string, functionId: string, updated: boolean, noTypes: boolean = false) => { +const generateSingleCustomFunction = async (polyPath: string, functionId: string, updated: boolean, noTypes = false) => { shell.echo('-n', updated ? 'Regenerating TypeScript SDK...' : 'Generating TypeScript SDK...'); const libPath = getPolyLibPath(polyPath); diff --git a/src/commands/generate/types.ts b/src/commands/generate/types.ts index e657a32..b3d083a 100644 --- a/src/commands/generate/types.ts +++ b/src/commands/generate/types.ts @@ -28,7 +28,6 @@ import { toTypeDeclaration, } from '../../utils'; - interface Context { name: string; path: string; diff --git a/src/commands/tenant.ts b/src/commands/tenant.ts index 14206ad..a459079 100644 --- a/src/commands/tenant.ts +++ b/src/commands/tenant.ts @@ -2,7 +2,7 @@ import shell from 'shelljs'; import { input, confirm } from '@inquirer/prompts'; import chalk from 'chalk'; import { createTenantSignUp, resendVerificationCode, verifyTenantSignUp } from '../api'; -import { SignUpDto } from '../../../model/src/dto'; +import { SignUpDto } from '../types'; import { saveConfig } from '../config'; import { exec as execCommand } from 'child_process'; import { promisify } from 'util'; diff --git a/src/deployables.ts b/src/deployables.ts index a6af08c..7d5d1af 100644 --- a/src/deployables.ts +++ b/src/deployables.ts @@ -17,7 +17,7 @@ export type DeployableTypes = // | "webhook" // | "trigger"; -// NOTE: Make sure these names line up with the public types in `poly-alpha/packages/client/index.d.ts` +// NOTE: Make sure these names line up with the public types in `src/index.d.ts` export type DeployableTypeNames = | 'PolyServerFunction' | 'PolyClientFunction' diff --git a/src/transpiler.ts b/src/transpiler.ts index 946f212..a3c449b 100644 --- a/src/transpiler.ts +++ b/src/transpiler.ts @@ -55,7 +55,7 @@ const EXCLUDED_REQUIREMENTS = [ 'polyapi', // 3rd Party - 'axios' + 'axios', ]; export const getTSConfig = () => { diff --git a/src/types/functions.ts b/src/types/functions.ts index d428f96..4efee29 100644 --- a/src/types/functions.ts +++ b/src/types/functions.ts @@ -1,5 +1,5 @@ -import { LifecycleState, Visibility } from "./shared"; -import { SchemaRef } from "./specifications"; +import { LifecycleState, Visibility } from './shared'; +import { SchemaRef } from './specifications'; export interface FunctionBasicDto { id: string; @@ -44,7 +44,7 @@ export interface FunctionArgument { unresolvedPolySchemaRefs?: SchemaRef[]; } -export interface FunctionArgumentDto extends Omit {}; +export type FunctionArgumentDto = Omit; export interface FunctionDetailsDto extends FunctionBasicDto { ownerUserId?: string | null; @@ -58,7 +58,6 @@ export interface FunctionDetailsDto extends FunctionBasicDto { unresolvedReturnTypePolySchemaRefs?: SchemaRef[]; } - export interface EntrySource { key: string; value: string; @@ -150,11 +149,6 @@ export interface ApiFunctionDetailsDto extends FunctionDetailsDto { enabledRedirect: boolean; } -export interface ArgumentSerializationDto { - style?: string; - explode?: boolean; -} - export interface ArgumentsMetadataDto { name: string; description?: string; @@ -185,7 +179,6 @@ export interface CreateApiFunctionDto { ownerUserId?: string; } - export interface ApiFunctionDescriptionGenerationDto { name: string; context: string; @@ -208,7 +201,6 @@ export interface ExecuteApiFunctionDescriptionGenerationDto { source: CreateSourceDto; } - export interface CreateServerCustomFunctionResponseDto extends FunctionDetailsDto { traceId?: string; } diff --git a/src/types/index.ts b/src/types/index.ts index c1c5457..0a06745 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -5,4 +5,4 @@ export * from './specifications'; export * from './functions'; export * from './webhooks'; export * from './snippets'; -export * from './schemas'; \ No newline at end of file +export * from './schemas'; diff --git a/src/types/schemas.ts b/src/types/schemas.ts index 3d37553..94f8dba 100644 --- a/src/types/schemas.ts +++ b/src/types/schemas.ts @@ -1,4 +1,4 @@ -import { Visibility } from "./shared"; +import { Visibility } from './shared'; export interface CreateSchemaDto { name: string; @@ -18,4 +18,4 @@ export interface SchemaDto { contextName: string; visibility: Visibility; ownerUserId?: string | null; -} \ No newline at end of file +} diff --git a/src/types/shared.ts b/src/types/shared.ts index 6b9c1cf..4fe7e4c 100644 --- a/src/types/shared.ts +++ b/src/types/shared.ts @@ -1,4 +1,3 @@ - export enum Visibility { Environment = 'ENVIRONMENT', Tenant = 'TENANT', @@ -11,4 +10,4 @@ export enum LifecycleState { Stable = 'STABLE', Deprecated = 'DEPRECATED', Disabled = 'DISABLED', -} \ No newline at end of file +} diff --git a/src/types/snippets.ts b/src/types/snippets.ts index 2693918..2e199e7 100644 --- a/src/types/snippets.ts +++ b/src/types/snippets.ts @@ -1,4 +1,4 @@ -import { Visibility } from "./shared"; +import { Visibility } from './shared'; export interface SnippetDetailsDto { id: string; diff --git a/src/types/specifications.ts b/src/types/specifications.ts index 10fe608..d49bfc2 100644 --- a/src/types/specifications.ts +++ b/src/types/specifications.ts @@ -1,7 +1,7 @@ -import { CreateApiFunctionDto } from "./functions"; -import { CreateSchemaDto } from "./schemas"; -import { LifecycleState, Visibility } from "./shared"; -import { CreateWebhookHandleDto } from "./webhooks"; +import { CreateApiFunctionDto } from './functions'; +import { CreateSchemaDto } from './schemas'; +import { LifecycleState, Visibility } from './shared'; +import { CreateWebhookHandleDto } from './webhooks'; export type ValueType = string | number | boolean | object | null | any[]; @@ -143,7 +143,6 @@ export interface SnippetSpecification extends ISpecification{ description: string; } - export interface SchemaRef { publicNamespace?: string; path: string; @@ -165,7 +164,6 @@ export type Specification = | SnippetSpecification | SchemaSpecification; - interface CreateWebhookHandleDtoForSpecificationInput extends CreateWebhookHandleDto { context: string; } diff --git a/src/types/templates.ts b/src/types/templates.ts index 40084d6..8d4560c 100644 --- a/src/types/templates.ts +++ b/src/types/templates.ts @@ -11,4 +11,4 @@ export interface ProjectTemplatesConfig { export interface ProjectTemplatesConfigVariable { value: ProjectTemplatesConfig -} \ No newline at end of file +} diff --git a/src/types/webhooks.ts b/src/types/webhooks.ts index 82e3c5c..4b80c52 100644 --- a/src/types/webhooks.ts +++ b/src/types/webhooks.ts @@ -1,4 +1,4 @@ -import { LifecycleState, Visibility } from "./shared"; +import { LifecycleState, Visibility } from './shared'; export interface WebhookSecurityFunction { id: string; diff --git a/src/utils.ts b/src/utils.ts index b055500..1e52059 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -260,7 +260,7 @@ export const iterateRefs = (schema: any, cb: (schema: any) => any, refIdentifier export const getContextData = ( specs: Specification[] | Record, - collectTypesUnder?: Partial> + collectTypesUnder?: Partial>, ) => { const contextData = {} as Record; @@ -278,7 +278,6 @@ export const getContextData = ( }; export const toTypeDeclaration = (type: PropertyType, synchronous = true) => { - const wrapInPromiseIfNeeded = (code: string) => (synchronous ? code : `Promise<${code}>`); switch (type.kind) { case 'plain': From 6eccb9787c9e46b0b8147282326367f7765e121d Mon Sep 17 00:00:00 2001 From: Richard Date: Thu, 15 May 2025 22:02:12 +0200 Subject: [PATCH 07/73] hard pinned package versions (#2) --- package-lock.json | 62 +++++++++++++++++++++++------------------------ package.json | 62 +++++++++++++++++++++++------------------------ 2 files changed, 62 insertions(+), 62 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8685d64..0d5a810 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,51 +10,51 @@ "license": "MIT", "dependencies": { "@guanghechen/helper-string": "4.7.1", - "@inquirer/prompts": "^7.0.1", - "@typescript-eslint/eslint-plugin": "^5.0.0", - "@typescript-eslint/parser": "^5.0.0", - "adm-zip": "^0.5.16", - "axios": "^1.8.3", + "@inquirer/prompts": "7.0.1", + "@typescript-eslint/eslint-plugin": "5.62.0", + "@typescript-eslint/parser": "5.62.0", + "adm-zip": "0.5.16", + "axios": "1.8.3", "chalk": "4.1.2", - "comment-json": "^4.2.3", - "dotenv": "^16.0.3", - "eslint": "^8.56.0", - "eslint-config-prettier": "^9.1.0", - "eslint-plugin-prettier": "^4.0.0", + "comment-json": "4.2.3", + "dotenv": "16.0.3", + "eslint": "8.57.1", + "eslint-config-prettier": "9.1.0", + "eslint-plugin-prettier": "4.2.1", "handlebars": "4.7.7", - "http-proxy-agent": "^7.0.0", - "https-proxy-agent": "^7.0.0", - "json-schema-to-typescript": "^15.0.4", - "jsonpath": "^1.1.1", + "http-proxy-agent": "7.0.0", + "https-proxy-agent": "7.0.0", + "json-schema-to-typescript": "15.0.4", + "jsonpath": "1.1.1", "lodash": "4.17.21", - "prettier": "^3.0.0", - "semver": "^7.5.4", + "prettier": "3.0.0", + "semver": "7.5.4", "shelljs": "0.8.5", - "slugify": "^1.6.6", - "socket.io-client": "^4.7.5", - "typescript": "~5.1.6", - "typescript-json-schema": "^0.63.0", + "slugify": "1.6.6", + "socket.io-client": "4.7.5", + "typescript": "5.1.6", + "typescript-json-schema": "0.63.0", "uuid": "9.0.0", - "validator": "^13.11.0", + "validator": "13.11.0", "yargs": "17.7.1" }, "bin": { "poly": "build/cli.js" }, "devDependencies": { - "@types/adm-zip": "^0.5.5", + "@types/adm-zip": "0.5.5", "@types/jest": "29.2.4", - "@types/jsonpath": "^0.2.4", - "@types/lodash": "^4.14.192", + "@types/jsonpath": "0.2.4", + "@types/lodash": "4.17.9", "@types/node": "18.11.18", - "@types/validator": "^13.11.1", - "copyfiles": "^2.4.1", + "@types/validator": "13.11.9", + "copyfiles": "2.4.1", "jest": "29.3.1", - "jest-summary-reporter": "^0.0.2", - "rimraf": "^4.4.1", - "tsc-alias": "^1.8.6", - "tslint": "^6.1.3", - "tslint-config-prettier": "^1.18.0" + "jest-summary-reporter": "0.0.2", + "rimraf": "4.4.1", + "tsc-alias": "1.8.6", + "tslint": "6.1.3", + "tslint-config-prettier": "1.18.0" }, "engines": { "node": ">=18.20.5" diff --git a/package.json b/package.json index b47c567..924d594 100644 --- a/package.json +++ b/package.json @@ -31,48 +31,48 @@ "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js" }, "devDependencies": { - "@types/adm-zip": "^0.5.5", + "@types/adm-zip": "0.5.5", "@types/jest": "29.2.4", - "@types/jsonpath": "^0.2.4", - "@types/lodash": "^4.14.192", - "@types/validator": "^13.11.1", + "@types/jsonpath": "0.2.4", + "@types/lodash": "4.17.9", + "@types/validator": "13.11.9", "@types/node": "18.11.18", - "copyfiles": "^2.4.1", + "copyfiles": "2.4.1", "jest": "29.3.1", - "jest-summary-reporter": "^0.0.2", - "rimraf": "^4.4.1", - "tsc-alias": "^1.8.6", - "tslint": "^6.1.3", - "tslint-config-prettier": "^1.18.0" + "jest-summary-reporter": "0.0.2", + "rimraf": "4.4.1", + "tsc-alias": "1.8.6", + "tslint": "6.1.3", + "tslint-config-prettier": "1.18.0" }, "dependencies": { "@guanghechen/helper-string": "4.7.1", - "@inquirer/prompts": "^7.0.1", - "@typescript-eslint/eslint-plugin": "^5.0.0", - "@typescript-eslint/parser": "^5.0.0", - "adm-zip": "^0.5.16", - "axios": "^1.8.3", + "@inquirer/prompts": "7.0.1", + "@typescript-eslint/eslint-plugin": "5.62.0", + "@typescript-eslint/parser": "5.62.0", + "adm-zip": "0.5.16", + "axios": "1.8.3", "chalk": "4.1.2", - "comment-json": "^4.2.3", - "dotenv": "^16.0.3", - "eslint": "^8.56.0", - "eslint-config-prettier": "^9.1.0", - "eslint-plugin-prettier": "^4.0.0", + "comment-json": "4.2.3", + "dotenv": "16.0.3", + "eslint": "8.57.1", + "eslint-config-prettier": "9.1.0", + "eslint-plugin-prettier": "4.2.1", "handlebars": "4.7.7", - "http-proxy-agent": "^7.0.0", - "https-proxy-agent": "^7.0.0", - "json-schema-to-typescript": "^15.0.4", - "jsonpath": "^1.1.1", + "http-proxy-agent": "7.0.0", + "https-proxy-agent": "7.0.0", + "json-schema-to-typescript": "15.0.4", + "jsonpath": "1.1.1", "lodash": "4.17.21", - "prettier": "^3.0.0", - "semver": "^7.5.4", + "prettier": "3.0.0", + "semver": "7.5.4", "shelljs": "0.8.5", - "slugify": "^1.6.6", - "socket.io-client": "^4.7.5", - "typescript": "~5.1.6", - "typescript-json-schema": "^0.63.0", + "slugify": "1.6.6", + "socket.io-client": "4.7.5", + "typescript": "5.1.6", + "typescript-json-schema": "0.63.0", "uuid": "9.0.0", - "validator": "^13.11.0", + "validator": "13.11.0", "yargs": "17.7.1" }, "engines": { From 814377ff9754f7d9b924a052dfa4970d2d564ecd Mon Sep 17 00:00:00 2001 From: Aaron Goin Date: Thu, 15 May 2025 15:39:07 -0700 Subject: [PATCH 08/73] adding husky pre-commit hook for linting --- .husky/pre-commit | 4 ++++ package-lock.json | 21 +++++++++++++++++++++ package.json | 5 +++-- 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100755 .husky/pre-commit diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000..251a23e --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +npm run lint \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 0d5a810..01b7612 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,6 +24,7 @@ "handlebars": "4.7.7", "http-proxy-agent": "7.0.0", "https-proxy-agent": "7.0.0", + "husky": "^8.0.3", "json-schema-to-typescript": "15.0.4", "jsonpath": "1.1.1", "lodash": "4.17.21", @@ -3798,6 +3799,21 @@ "node": ">=10.17.0" } }, + "node_modules/husky": { + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/husky/-/husky-8.0.3.tgz", + "integrity": "sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==", + "license": "MIT", + "bin": { + "husky": "lib/bin.js" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/typicode" + } + }, "node_modules/iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -9469,6 +9485,11 @@ "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", "dev": true }, + "husky": { + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/husky/-/husky-8.0.3.tgz", + "integrity": "sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==" + }, "iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", diff --git a/package.json b/package.json index 924d594..18d1c85 100644 --- a/package.json +++ b/package.json @@ -24,8 +24,8 @@ "copy-templates": "copyfiles \"templates/**/*.hbs\" build", "format": "prettier --write \"src/**/*.ts\"", "lint": "eslint \"src/**/*.ts\" --fix", - "prepare": "npm run build", - "prepublishOnly": "npm run lint", + "prepare": "husky install", + "prepublishOnly": "npm run lint && npm run build", "preversion": "npm run lint", "postversion": "git push && git push --tags", "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js" @@ -61,6 +61,7 @@ "handlebars": "4.7.7", "http-proxy-agent": "7.0.0", "https-proxy-agent": "7.0.0", + "husky": "^8.0.3", "json-schema-to-typescript": "15.0.4", "jsonpath": "1.1.1", "lodash": "4.17.21", From 2abfc5aba1d76398870ac16e17d68a345fe13d9d Mon Sep 17 00:00:00 2001 From: SudiptaTJ Date: Fri, 16 May 2025 15:20:26 +0600 Subject: [PATCH 09/73] =?UTF-8?q?#=20Feature=20(4156):=20P3)=20Bug=20with?= =?UTF-8?q?=20deploying=20a=20client=20function=20after=20it=20a=E2=80=A6?= =?UTF-8?q?=20(#1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * # Feature (4156): P3) Bug with deploying a client function after it as deployed as a server function - Refactoring npm client - Verification added for checking existing function by name and context - color updated --- .gitignore | 1 + package.json | 2 +- src/cli.ts | 2 +- src/commands/function.ts | 24 +++++++++++++++++++----- src/config.ts | 2 +- 5 files changed, 23 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index f04a890..eacfa63 100644 --- a/.gitignore +++ b/.gitignore @@ -137,3 +137,4 @@ dist .yarn/build-state.yml .yarn/install-state.gz .pnp.* +.idea \ No newline at end of file diff --git a/package.json b/package.json index 18d1c85..e92a1d1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.23.8", + "version": "0.23.9", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { diff --git a/src/cli.ts b/src/cli.ts index 81f1db7..357eaf1 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -230,7 +230,7 @@ void yargs return; } const { addOrUpdateCustomFunction } = await import('./commands/function'); - await addOrUpdateCustomFunction(DEFAULT_POLY_PATH, context, name, description, file, server, logsEnabled, generateContexts, executionApiKey); + await addOrUpdateCustomFunction(DEFAULT_POLY_PATH, context, name, description, file, client, server, logsEnabled, generateContexts, executionApiKey); }, ); }) diff --git a/src/commands/function.ts b/src/commands/function.ts index b1d4d8b..e5eb154 100644 --- a/src/commands/function.ts +++ b/src/commands/function.ts @@ -15,6 +15,7 @@ export const addOrUpdateCustomFunction = async ( name: string, description: string | null, file: string, + client: boolean | undefined, server: boolean | undefined, logsEnabled: boolean | undefined, generateContexts: string | undefined, @@ -38,10 +39,21 @@ export const addOrUpdateCustomFunction = async ( const specs = await getSpecs([context], [name]); const functionSpec = specs.find(spec => spec.name === name && spec.context === context); const updating = !!functionSpec; - if (server === undefined && updating) { - server = functionSpec.type === 'serverFunction'; - } else { - server = server ?? false; + if (updating) { + const isConflictingType = + (client === true && functionSpec.type === 'serverFunction') || + (server === true && functionSpec.type === 'customFunction'); + + if (isConflictingType) { + const existingType = functionSpec.type === 'serverFunction' ? 'server' : 'client'; + const targetType = existingType === 'server' ? 'client' : 'server'; + + shell.echo( + chalk.redBright(`ERROR: Function already exists as a ${existingType} function.`) + '\n' + + chalk.red(`Please delete it before deploying as a ${targetType} function.`), + ); + return; + } } const typeSchemas = generateTypeSchemas(file, tsConfigBaseUrl, DeployableTypeEntries.map(d => d[0])); @@ -69,7 +81,9 @@ export const addOrUpdateCustomFunction = async ( shell.echo(chalk.green('DEPLOYED')); shell.echo(`Function ID: ${customFunction.id}`); - } else { + } + + if (client) { shell.echo('-n', `${updating ? 'Updating' : 'Adding'} Client Function to PolyAPI Catalog...`); customFunction = await createOrUpdateClientFunction(context, name, description, code, typeSchemas); shell.echo(chalk.green('DONE')); diff --git a/src/config.ts b/src/config.ts index e114d02..cc08b28 100644 --- a/src/config.ts +++ b/src/config.ts @@ -3,7 +3,7 @@ import dotenv from 'dotenv'; const getPolyConfigDirPath = (polyPath: string) => // If path does not start with `./` or `/` then we adjust! - /^\.?\/.*/.test(polyPath) ? polyPath : `${__dirname}/../../../../../${polyPath}`; + /^\.?\/.*/.test(polyPath) ? polyPath : `${__dirname}/../../../${polyPath}`; const getPolyConfigFilePath = (polyPath: string) => `${getPolyConfigDirPath(polyPath)}/.config.env`; From a22106394ddd1d2cfe33e7f00029fc6f092a924d Mon Sep 17 00:00:00 2001 From: Aaron Goin Date: Fri, 16 May 2025 09:17:33 -0700 Subject: [PATCH 10/73] Fixing bug where client was not resolving dependencies correctly --- package.json | 2 +- src/utils.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index e92a1d1..ab19872 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.23.9", + "version": "0.23.10", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { diff --git a/src/utils.ts b/src/utils.ts index 1e52059..4ba4235 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -12,7 +12,7 @@ import { INSTANCE_URL_MAP } from './constants'; export const getPolyLibPath = (polyPath: string) => polyPath.startsWith('/') ? `${polyPath}/lib` - : `${__dirname}/../../../../../${polyPath}/lib`; + : `${__dirname}/../../../${polyPath}/lib`; export const getContextDataFileContent = (libPath: string) => { try { From 165cdc348ed3a3a9943848c0670311a3255f4963 Mon Sep 17 00:00:00 2001 From: Aaron Goin Date: Fri, 16 May 2025 11:02:37 -0700 Subject: [PATCH 11/73] adding missing dependency for testing, and fixing issue where some names in the generated schemas were not being wrapped in quotes --- package-lock.json | 100 ++++++++++++++++++++++++++- package.json | 3 +- src/commands/generate/schemaTypes.ts | 15 ++-- test/generateTypes.spec.ts | 33 ++++++++- 4 files changed, 143 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 01b7612..3b40641 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "polyapi", - "version": "0.23.8", + "version": "0.23.11", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "polyapi", - "version": "0.23.8", + "version": "0.23.11", "license": "MIT", "dependencies": { "@guanghechen/helper-string": "4.7.1", @@ -53,6 +53,7 @@ "jest": "29.3.1", "jest-summary-reporter": "0.0.2", "rimraf": "4.4.1", + "ts-jest": "29.0.3", "tsc-alias": "1.8.6", "tslint": "6.1.3", "tslint-config-prettier": "1.18.0" @@ -2358,6 +2359,19 @@ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, + "node_modules/bs-logger": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz", + "integrity": "sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-json-stable-stringify": "2.x" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/bser": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", @@ -4961,6 +4975,13 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, + "node_modules/lodash.memoize": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", + "integrity": "sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==", + "dev": true, + "license": "MIT" + }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", @@ -6257,6 +6278,50 @@ "node": ">=8.0" } }, + "node_modules/ts-jest": { + "version": "29.0.3", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.0.3.tgz", + "integrity": "sha512-Ibygvmuyq1qp/z3yTh9QTwVVAbFdDy/+4BtIQR2sp6baF2SJU/8CKK/hhnGIDY2L90Az2jIqTwZPnN2p+BweiQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "bs-logger": "0.x", + "fast-json-stable-stringify": "2.x", + "jest-util": "^29.0.0", + "json5": "^2.2.1", + "lodash.memoize": "4.x", + "make-error": "1.x", + "semver": "7.x", + "yargs-parser": "^21.0.1" + }, + "bin": { + "ts-jest": "cli.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": ">=7.0.0-beta.0 <8", + "@jest/types": "^29.0.0", + "babel-jest": "^29.0.0", + "jest": "^29.0.0", + "typescript": ">=4.3" + }, + "peerDependenciesMeta": { + "@babel/core": { + "optional": true + }, + "@jest/types": { + "optional": true + }, + "babel-jest": { + "optional": true + }, + "esbuild": { + "optional": true + } + } + }, "node_modules/ts-node": { "version": "10.9.1", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", @@ -8494,6 +8559,15 @@ "update-browserslist-db": "^1.1.1" } }, + "bs-logger": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz", + "integrity": "sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==", + "dev": true, + "requires": { + "fast-json-stable-stringify": "2.x" + } + }, "bser": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", @@ -10316,6 +10390,12 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, + "lodash.memoize": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", + "integrity": "sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==", + "dev": true + }, "lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", @@ -11241,6 +11321,22 @@ "is-number": "^7.0.0" } }, + "ts-jest": { + "version": "29.0.3", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.0.3.tgz", + "integrity": "sha512-Ibygvmuyq1qp/z3yTh9QTwVVAbFdDy/+4BtIQR2sp6baF2SJU/8CKK/hhnGIDY2L90Az2jIqTwZPnN2p+BweiQ==", + "dev": true, + "requires": { + "bs-logger": "0.x", + "fast-json-stable-stringify": "2.x", + "jest-util": "^29.0.0", + "json5": "^2.2.1", + "lodash.memoize": "4.x", + "make-error": "1.x", + "semver": "7.x", + "yargs-parser": "^21.0.1" + } + }, "ts-node": { "version": "10.9.1", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", diff --git a/package.json b/package.json index ab19872..1b37edd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.23.10", + "version": "0.23.11", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { @@ -42,6 +42,7 @@ "jest-summary-reporter": "0.0.2", "rimraf": "4.4.1", "tsc-alias": "1.8.6", + "ts-jest": "29.0.3", "tslint": "6.1.3", "tslint-config-prettier": "1.18.0" }, diff --git a/src/commands/generate/schemaTypes.ts b/src/commands/generate/schemaTypes.ts index 5d5defc..81608d1 100644 --- a/src/commands/generate/schemaTypes.ts +++ b/src/commands/generate/schemaTypes.ts @@ -9,10 +9,16 @@ import { import { echoGenerationError } from '../../utils'; import { setGenerationErrors } from './types'; -const formatName = (name: string, nested = false) => { - if (nested) return name.includes('-') ? `'${name}'` : name; - return toPascalCase(name); -}; +const unsafeCharacters = /(?:^\d)|[^0-9a-zA-Z_]/gi; +const unescapedSingleQuote = /\b'\b/gi; + +const wrapUnsafeNames = (name: string) => { + if (!name.match(unsafeCharacters)) return name; + if (name.includes('\'')) name = name.replaceAll(unescapedSingleQuote, '\''); + return `'${name}'` +} + +const formatName = (name: string, nested = false) => wrapUnsafeNames(nested ? name : toPascalCase(name)); type JsonSchemaType = | 'string' @@ -573,6 +579,7 @@ export const generateSchemaTSDeclarationFiles = async (libPath: string, specs: S }; export const __test = { + formatName, printComment, printSchemaAsType, buildSchemaTree, diff --git a/test/generateTypes.spec.ts b/test/generateTypes.spec.ts index f3e5ce3..e520f82 100644 --- a/test/generateTypes.spec.ts +++ b/test/generateTypes.spec.ts @@ -1,11 +1,21 @@ import { EOL } from 'node:os'; import { JsonSchema, SchemaSpec, __test } from '../src/commands/generate/schemaTypes'; -const { printSchemaAsType, printComment, buildSchemaTree, printSchemaSpecs } = __test; +const { + formatName, + printSchemaAsType, + printComment, + buildSchemaTree, + printSchemaSpecs +} = __test; // Utility to make creating multiline strings in more precise way than is possible with template literal strings const multiline = (...lines: string[]) => lines.join(EOL); +type Foo = { + '123Abc': string; +} + describe('Generate types from specs', () => { describe('printComment', () => { @@ -64,6 +74,27 @@ describe('Generate types from specs', () => { }); }); + test.only('formatName', () => { + expect(formatName('Abc')).toBe('Abc'); + expect(formatName('Abc', true)).toBe('Abc'); + expect(formatName('AbcDef')).toBe('AbcDef'); + expect(formatName('AbcDef', true)).toBe('AbcDef'); + expect(formatName('abc')).toBe('Abc'); + expect(formatName('abc', true)).toBe('abc'); + expect(formatName('a b c')).toBe('ABC'); + expect(formatName('a b c', true)).toBe('\'a b c\''); + expect(formatName('a-b-c')).toBe('ABC'); + expect(formatName('a-b-c', true)).toBe('\'a-b-c\''); + expect(formatName('@abc')).toBe('Abc'); + expect(formatName('@abc', true)).toBe('\'@abc\''); + expect(formatName('_abc')).toBe('Abc'); + expect(formatName('_abc', true)).toBe('_abc'); + expect(formatName('123abc')).toBe('\'123abc\''); + expect(formatName('123abc', true)).toBe('\'123abc\''); + expect(formatName('abc123')).toBe('Abc123'); + expect(formatName('abc123', true)).toBe('abc123'); + }) + describe('printSchemaAsType', () => { describe('poly schema', () => { From 40c52369e83d6db3efb441ab7ec32c87143193d8 Mon Sep 17 00:00:00 2001 From: Aaron Goin Date: Fri, 16 May 2025 13:17:36 -0700 Subject: [PATCH 12/73] Handling x-poly-refs contained with function arguments that are themselves function types (fixes webhook types and more) --- package-lock.json | 4 +-- package.json | 2 +- src/commands/generate/schemaTypes.ts | 4 +-- src/commands/generate/types.ts | 39 ++++++++++++++++------------ 4 files changed, 27 insertions(+), 22 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3b40641..ee0ac63 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "polyapi", - "version": "0.23.11", + "version": "0.23.12", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "polyapi", - "version": "0.23.11", + "version": "0.23.12", "license": "MIT", "dependencies": { "@guanghechen/helper-string": "4.7.1", diff --git a/package.json b/package.json index 1b37edd..46cfec9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.23.11", + "version": "0.23.12", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { diff --git a/src/commands/generate/schemaTypes.ts b/src/commands/generate/schemaTypes.ts index 81608d1..892c191 100644 --- a/src/commands/generate/schemaTypes.ts +++ b/src/commands/generate/schemaTypes.ts @@ -15,8 +15,8 @@ const unescapedSingleQuote = /\b'\b/gi; const wrapUnsafeNames = (name: string) => { if (!name.match(unsafeCharacters)) return name; if (name.includes('\'')) name = name.replaceAll(unescapedSingleQuote, '\''); - return `'${name}'` -} + return `'${name}'`; +}; const formatName = (name: string, nested = false) => wrapUnsafeNames(nested ? name : toPascalCase(name)); diff --git a/src/commands/generate/types.ts b/src/commands/generate/types.ts index b3d083a..9ee01f8 100644 --- a/src/commands/generate/types.ts +++ b/src/commands/generate/types.ts @@ -14,6 +14,7 @@ import { SpecificationWithFunction, SpecificationWithVariable, ServerFunctionSpecification, + FunctionSpecification, } from '../../types'; import { getContextData, @@ -438,8 +439,8 @@ const getSpecificationsTypeDeclarations = async (namespacePath: string, specific 'function' in spec && ( (spec.function.returnType.kind === 'object' && - spec.function.returnType.schema && - !isBinary(spec.function.returnType)) || + spec.function.returnType.schema && + !isBinary(spec.function.returnType)) || (spec.type === 'serverFunction' && (spec as ServerFunctionSpecification).serverSideAsync === true) ), ) @@ -687,25 +688,29 @@ const generateTSIndexDeclarationFile = async (libPath: string, contexts: Context }; export const generateFunctionsTSDeclarationFile = async (libPath: string, specs: Specification[]) => { - await generateTSDeclarationFiles( - libPath, - specs.filter(spec => 'function' in spec).map((spec: SpecificationWithFunction) => { - for (const functionArg of spec.function.arguments) { - if (functionArg.type.kind === 'object' && functionArg.type.schema) { - assignUnresolvedRefsToPolySchemaRefObj(functionArg.type.schema, functionArg.type.unresolvedPolySchemaRefs); - } else if (functionArg.type.kind === 'object' && functionArg.type.properties) { - for (const property of functionArg.type.properties) { - if (property.type.kind === 'object') { - assignUnresolvedRefsToPolySchemaRefObj(property.type.schema, functionArg.type.unresolvedPolySchemaRefs); - } + const assignUnresolvedRefsRecursive = (fn: FunctionSpecification) => { + for (const functionArg of fn.arguments) { + if (functionArg.type.kind === 'object' && functionArg.type.schema) { + assignUnresolvedRefsToPolySchemaRefObj(functionArg.type.schema, functionArg.type.unresolvedPolySchemaRefs); + } else if (functionArg.type.kind === 'object' && functionArg.type.properties) { + for (const property of functionArg.type.properties) { + if (property.type.kind === 'object') { + assignUnresolvedRefsToPolySchemaRefObj(property.type.schema, functionArg.type.unresolvedPolySchemaRefs); } } + } else if (functionArg.type.kind === 'function' && typeof functionArg.type.spec === 'object') { + assignUnresolvedRefsRecursive(functionArg.type.spec); } + } + if (fn.returnType.kind === 'object' && fn.returnType.schema) { + assignUnresolvedRefsToPolySchemaRefObj(fn.returnType.schema, fn.returnType.unresolvedPolySchemaRefs); + } + }; - if (spec.function.returnType.kind === 'object' && spec.function.returnType.schema) { - assignUnresolvedRefsToPolySchemaRefObj(spec.function.returnType.schema, spec.function.returnType.unresolvedPolySchemaRefs); - } - + await generateTSDeclarationFiles( + libPath, + specs.filter(spec => 'function' in spec).map((spec: SpecificationWithFunction) => { + assignUnresolvedRefsRecursive(spec.function); return spec; }), 'Poly', From 4178e7254056e1e188dccd43959389cc85920810 Mon Sep 17 00:00:00 2001 From: Dan Fellin Date: Thu, 22 May 2025 06:03:26 -0700 Subject: [PATCH 13/73] improve logging of failed api function calls (#4) * improve logging of failed api function calls * Update templates/api-index.js.hbs Co-authored-by: Aaron Goin * onward --------- Co-authored-by: Aaron Goin --- package-lock.json | 4 ++-- package.json | 2 +- templates/api-index.js.hbs | 6 +++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index ee0ac63..fa915ce 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "polyapi", - "version": "0.23.12", + "version": "0.23.13", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "polyapi", - "version": "0.23.12", + "version": "0.23.13", "license": "MIT", "dependencies": { "@guanghechen/helper-string": "4.7.1", diff --git a/package.json b/package.json index 46cfec9..4428a7e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.23.12", + "version": "0.23.13", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { diff --git a/templates/api-index.js.hbs b/templates/api-index.js.hbs index 7a4a4cc..752bf93 100644 --- a/templates/api-index.js.hbs +++ b/templates/api-index.js.hbs @@ -29,7 +29,11 @@ module.exports = (clientID, polyCustom) => merge( } ).then(({ headers, data }) => { if (data && (data.status < 200 || data.status >= 300)) { - console.error('Error executing api function with id:', id, 'Status code:', data.status, 'Request data:', requestArgs, 'Response data:', data.data); + let responseData = data.data; + try { + responseData = JSON.stringify(data.data); + } catch (err) {} + console.error('Error executing api function with id:', id, 'Status code:', data.status, 'Request data:', requestArgs, 'Response data:', responseData); } const serverExecutionTimeMs = Number(headers['x-poly-execution-duration']); const roundTripNetworkLatencyMs = Date.now() - requestStartTime - serverExecutionTimeMs; From c1589f12b6d8b54d00d775f658b238cba50ae5e1 Mon Sep 17 00:00:00 2001 From: Richard Date: Thu, 22 May 2025 17:24:03 +0200 Subject: [PATCH 14/73] P2) (MS) npm client: add direct execute option and MTLS option (#3) * adds direct execute and mtls options support * reversed unintended change * fixed metric names + http agent to be created only once * version increment --- package-lock.json | 2 +- package.json | 2 +- src/commands/generate/index.ts | 11 ++++ templates/api-index.js.hbs | 97 +++++++++++++++++++++++++++++++++- 4 files changed, 108 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index fa915ce..08ebe7b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.23.13", + "version": "0.23.14", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/package.json b/package.json index 4428a7e..4dbd91e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.23.13", + "version": "0.23.14", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { diff --git a/src/commands/generate/index.ts b/src/commands/generate/index.ts index 6c037b4..bd3d2e7 100644 --- a/src/commands/generate/index.ts +++ b/src/commands/generate/index.ts @@ -66,6 +66,16 @@ const prepareDir = async (polyPath: string) => { } }; +const getExecutionConfig = () => ({ + directExecute: process.env.API_FUNCTION_DIRECT_EXECUTE === 'true', + mtls: { + certPath: process.env.MTLS_CERT_PATH, + keyPath: process.env.MTLS_KEY_PATH, + caPath: process.env.MTLS_CA_PATH, + rejectUnauthorized: process.env.NODE_ENV !== 'development', + }, +}); + const generateRedirectIndexFiles = async (polyPath: string) => { const defaultPolyLib = getPolyLibPath(DEFAULT_POLY_PATH); @@ -156,6 +166,7 @@ const generateApiFunctionJSFiles = async (libPath: string, specifications: ApiFu `${libPath}/api/index.js`, template({ specifications, + executionConfig: getExecutionConfig(), }), ); }; diff --git a/templates/api-index.js.hbs b/templates/api-index.js.hbs index 752bf93..52d270f 100644 --- a/templates/api-index.js.hbs +++ b/templates/api-index.js.hbs @@ -1,6 +1,19 @@ const axios = require('../axios'); const set = require('lodash/set'); const merge = require('lodash/merge'); +const https = require('https'); +const fs = require('fs'); + +// Environment variables injected during generation +const env = { + directExecute: {{executionConfig.directExecute}}, + mtls: { + certPath: '{{executionConfig.mtls.certPath}}', + keyPath: '{{executionConfig.mtls.keyPath}}', + caPath: '{{executionConfig.mtls.caPath}}', + rejectUnauthorized: {{executionConfig.mtls.rejectUnauthorized}}, + } +}; const functions = [ {{#each specifications}} @@ -8,6 +21,28 @@ const functions = [ {{/each}} ]; +// Create MTLS agent if paths are provided +let httpsAgent = undefined; +const getHttpsAgent = () => { + if (httpsAgent) { + return httpsAgent; + } + + const { mtls } = env; + if (!mtls.certPath || !mtls.keyPath || !mtls.caPath) { + return undefined; + } + + httpsAgent = new https.Agent({ + cert: fs.readFileSync(mtls.certPath), + key: fs.readFileSync(mtls.keyPath), + ca: fs.readFileSync(mtls.caPath), + rejectUnauthorized: mtls.rejectUnauthorized, + }); + + return httpsAgent; +}; + module.exports = (clientID, polyCustom) => merge( {}, functions.reduce( @@ -15,8 +50,66 @@ module.exports = (clientID, polyCustom) => merge( acc, path, (...args) => { - const requestStartTime = Date.now(); + const requestServerStartTime = Date.now(); const requestArgs = argKeys.reduce((acc, key, index) => ({ ...acc, [key]: args[index] }), {}); + + // Check if direct execution is enabled + const { directExecute } = env; + + if (directExecute === true) { + // Make direct API call + + let polyHeaders; + let serverPreperationTimeMs; + let roundTripServerNetworkLatencyMs; + let requestApiStartTime; + + return axios.post( + `/functions/api/${id}/direct-execute?clientId=${clientID}`, + requestArgs, + { + headers: { + 'x-poly-execution-id': polyCustom.executionId, + } + } + ).then(({ headers, data }) => { + polyHeaders = headers; + if (data && (data.status < 200 || data.status >= 300)) { + console.error('Error getting direct execution data for api function with id:', id, 'Status code:', data.status, 'Request data:', requestArgs, 'Response data:', data.data); + } + + serverPreperationTimeMs = Number(polyHeaders['x-poly-execution-duration']); + roundTripServerNetworkLatencyMs = Date.now() - requestServerStartTime - serverPreperationTimeMs; + + requestApiStartTime = Date.now(); + const httpsAgent = getHttpsAgent(); + + return axios({ + ...data, + headers: { + ...data.headers, + }, + httpsAgent, + }) + }).then(({ headers, data, status, ...args }) => { + if (status && (status < 200 || status >= 300)) { + console.error('Error direct executing api function with id:', id, 'Status code:', status, 'Request data:', requestArgs, 'Response data:', data.data); + } + const apiExecutionTimeMs = Date.now() - requestApiStartTime; + return { + data: data, + status: status, + headers: { ...headers }, + metrics: { + roundTripServerNetworkLatencyMs, + serverPreperationTimeMs, + apiExecutionTimeMs, + } + }; + }); + } + + // default indirect execution return axios.post( `/functions/api/${id}/execute?clientId=${clientID}`, { @@ -36,7 +129,7 @@ module.exports = (clientID, polyCustom) => merge( console.error('Error executing api function with id:', id, 'Status code:', data.status, 'Request data:', requestArgs, 'Response data:', responseData); } const serverExecutionTimeMs = Number(headers['x-poly-execution-duration']); - const roundTripNetworkLatencyMs = Date.now() - requestStartTime - serverExecutionTimeMs; + const roundTripNetworkLatencyMs = Date.now() - requestServerStartTime - serverExecutionTimeMs; return { ...data, metrics: { From d61677229ffddb52151721098242d469fa1cb654 Mon Sep 17 00:00:00 2001 From: Dan Fellin Date: Thu, 22 May 2025 08:55:51 -0700 Subject: [PATCH 15/73] lost my logging in code review, lets go agane (#6) --- package-lock.json | 4 ++-- package.json | 2 +- templates/api-index.js.hbs | 6 +++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 08ebe7b..7c16eb0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "polyapi", - "version": "0.23.14", + "version": "0.23.15", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "polyapi", - "version": "0.23.13", + "version": "0.23.15", "license": "MIT", "dependencies": { "@guanghechen/helper-string": "4.7.1", diff --git a/package.json b/package.json index 4dbd91e..057acaa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.23.14", + "version": "0.23.15", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { diff --git a/templates/api-index.js.hbs b/templates/api-index.js.hbs index 52d270f..f144f89 100644 --- a/templates/api-index.js.hbs +++ b/templates/api-index.js.hbs @@ -75,7 +75,11 @@ module.exports = (clientID, polyCustom) => merge( ).then(({ headers, data }) => { polyHeaders = headers; if (data && (data.status < 200 || data.status >= 300)) { - console.error('Error getting direct execution data for api function with id:', id, 'Status code:', data.status, 'Request data:', requestArgs, 'Response data:', data.data); + let responseData = data.data; + try { + responseData = JSON.stringify(data.data); + } catch (err) {} + console.error('Error executing api function with id:', id, 'Status code:', data.status, 'Request data:', requestArgs, 'Response data:', responseData); } serverPreperationTimeMs = Number(polyHeaders['x-poly-execution-duration']); From d2d8376abc67bca4f729d974624b9b9ae98338e9 Mon Sep 17 00:00:00 2001 From: SudiptaTJ Date: Mon, 26 May 2025 21:31:31 +0600 Subject: [PATCH 16/73] P3) VSCode Extension: Add a Refresh Button to Tree View #4107 (#5) * # Feature (4107): P3) VSCode Extension: Add a Refresh Button to Tree View - load config now can return value - Add or Update config function added * # Feature (4107): P3) VSCode Extension: Add a Refresh Button to Tree View - load config now can return value - Add or Update config function added - Version updated --- package-lock.json | 4 +- package.json | 2 +- src/commands/generate/index.ts | 5 +- src/config.ts | 18 +- yarn.lock | 4027 ++++++++++++++++++++++++++++++++ 5 files changed, 4050 insertions(+), 6 deletions(-) create mode 100644 yarn.lock diff --git a/package-lock.json b/package-lock.json index 7c16eb0..db55fd5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "polyapi", - "version": "0.23.15", + "version": "0.23.16", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "polyapi", - "version": "0.23.15", + "version": "0.23.16", "license": "MIT", "dependencies": { "@guanghechen/helper-string": "4.7.1", diff --git a/package.json b/package.json index 057acaa..6e32fec 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.23.15", + "version": "0.23.16", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { diff --git a/src/commands/generate/index.ts b/src/commands/generate/index.ts index bd3d2e7..eeeac88 100644 --- a/src/commands/generate/index.ts +++ b/src/commands/generate/index.ts @@ -14,7 +14,7 @@ import { WebhookHandleSpecification, } from '../../types'; import { getSpecs } from '../../api'; -import { loadConfig } from '../../config'; +import { loadConfig, addOrUpdateConfig } from '../../config'; import { generateContextDataFile, getContextDataFileContent, @@ -393,6 +393,9 @@ const generate = async ({ try { specs = await getSpecs(contexts, names, functionIds, noTypes); + if (contexts) { + addOrUpdateConfig(polyPath, 'LAST_GENERATE_CONTEXTS_USED', contexts?.join(',')); + } } catch (error) { showErrGettingSpecs(error); return; diff --git a/src/config.ts b/src/config.ts index cc08b28..5614dd6 100644 --- a/src/config.ts +++ b/src/config.ts @@ -8,11 +8,17 @@ const getPolyConfigDirPath = (polyPath: string) => const getPolyConfigFilePath = (polyPath: string) => `${getPolyConfigDirPath(polyPath)}/.config.env`; -export const loadConfig = (polyPath: string) => { +export const loadConfig = (polyPath: string): Record | undefined => { const configFilePath = getPolyConfigFilePath(polyPath); if (fs.existsSync(configFilePath)) { - dotenv.config({ path: configFilePath, override: process.env.CONFIG_ENV_PATH_PRIORITY === 'true' }); + const result = dotenv.config({ + path: configFilePath, + override: process.env.CONFIG_ENV_PATH_PRIORITY === 'true', + }); + + return result.parsed; } + return undefined; }; export const saveConfig = (polyPath: string, config: Record) => { @@ -24,3 +30,11 @@ export const saveConfig = (polyPath: string, config: Record) => .join('\n'), ); }; + +export const addOrUpdateConfig = (polyPath: string, key: string, value: string) => { + const existingConfig = loadConfig(polyPath) ?? {}; + + existingConfig[key] = value; + + saveConfig(polyPath, existingConfig); +}; \ No newline at end of file diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 0000000..6a20968 --- /dev/null +++ b/yarn.lock @@ -0,0 +1,4027 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@ampproject/remapping@^2.2.0": + version "2.3.0" + resolved "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz" + integrity sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw== + dependencies: + "@jridgewell/gen-mapping" "^0.3.5" + "@jridgewell/trace-mapping" "^0.3.24" + +"@apidevtools/json-schema-ref-parser@^11.5.5": + version "11.7.0" + resolved "https://registry.npmjs.org/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-11.7.0.tgz" + integrity sha512-pRrmXMCwnmrkS3MLgAIW5dXRzeTv6GLjkjb4HmxNnvAKXN1Nfzp4KmGADBQvlVUcqi+a5D+hfGDLLnd5NnYxog== + dependencies: + "@jsdevtools/ono" "^7.1.3" + "@types/json-schema" "^7.0.15" + js-yaml "^4.1.0" + +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.26.2": + version "7.26.2" + resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz" + integrity sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ== + dependencies: + "@babel/helper-validator-identifier" "^7.25.9" + js-tokens "^4.0.0" + picocolors "^1.0.0" + +"@babel/compat-data@^7.26.5": + version "7.26.8" + resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.8.tgz" + integrity sha512-oH5UPLMWR3L2wEFLnFJ1TZXqHufiTKAiLfqw5zkhS4dKXLJ10yVztfil/twG8EDTA4F/tvVNw9nOl4ZMslB8rQ== + +"@babel/core@^7.0.0", "@babel/core@^7.0.0-0", "@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.23.9", "@babel/core@^7.8.0", "@babel/core@>=7.0.0-beta.0 <8": + version "7.26.10" + resolved "https://registry.npmjs.org/@babel/core/-/core-7.26.10.tgz" + integrity sha512-vMqyb7XCDMPvJFFOaT9kxtiRh42GwlZEg1/uIgtZshS5a/8OaduUfCi7kynKgc3Tw/6Uo2D+db9qBttghhmxwQ== + dependencies: + "@ampproject/remapping" "^2.2.0" + "@babel/code-frame" "^7.26.2" + "@babel/generator" "^7.26.10" + "@babel/helper-compilation-targets" "^7.26.5" + "@babel/helper-module-transforms" "^7.26.0" + "@babel/helpers" "^7.26.10" + "@babel/parser" "^7.26.10" + "@babel/template" "^7.26.9" + "@babel/traverse" "^7.26.10" + "@babel/types" "^7.26.10" + convert-source-map "^2.0.0" + debug "^4.1.0" + gensync "^1.0.0-beta.2" + json5 "^2.2.3" + semver "^6.3.1" + +"@babel/generator@^7.26.10", "@babel/generator@^7.7.2": + version "7.26.10" + resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.26.10.tgz" + integrity sha512-rRHT8siFIXQrAYOYqZQVsAr8vJ+cBNqcVAY6m5V8/4QqzaPl+zDBe6cLEPRDuNOUf3ww8RfJVlOyQMoSI+5Ang== + dependencies: + "@babel/parser" "^7.26.10" + "@babel/types" "^7.26.10" + "@jridgewell/gen-mapping" "^0.3.5" + "@jridgewell/trace-mapping" "^0.3.25" + jsesc "^3.0.2" + +"@babel/helper-compilation-targets@^7.26.5": + version "7.26.5" + resolved "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.26.5.tgz" + integrity sha512-IXuyn5EkouFJscIDuFF5EsiSolseme1s0CZB+QxVugqJLYmKdxI1VfIBOst0SUu4rnk2Z7kqTwmoO1lp3HIfnA== + dependencies: + "@babel/compat-data" "^7.26.5" + "@babel/helper-validator-option" "^7.25.9" + browserslist "^4.24.0" + lru-cache "^5.1.1" + semver "^6.3.1" + +"@babel/helper-module-imports@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz" + integrity sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw== + dependencies: + "@babel/traverse" "^7.25.9" + "@babel/types" "^7.25.9" + +"@babel/helper-module-transforms@^7.26.0": + version "7.26.0" + resolved "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.26.0.tgz" + integrity sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw== + dependencies: + "@babel/helper-module-imports" "^7.25.9" + "@babel/helper-validator-identifier" "^7.25.9" + "@babel/traverse" "^7.25.9" + +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.25.9", "@babel/helper-plugin-utils@^7.8.0": + version "7.26.5" + resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.26.5.tgz" + integrity sha512-RS+jZcRdZdRFzMyr+wcsaqOmld1/EqTghfaBGQQd/WnRdzdlvSZ//kF7U8VQTxf1ynZ4cjUcYgjVGx13ewNPMg== + +"@babel/helper-string-parser@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz" + integrity sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA== + +"@babel/helper-validator-identifier@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz" + integrity sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ== + +"@babel/helper-validator-option@^7.25.9": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz" + integrity sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw== + +"@babel/helpers@^7.26.10": + version "7.26.10" + resolved "https://registry.npmjs.org/@babel/helpers/-/helpers-7.26.10.tgz" + integrity sha512-UPYc3SauzZ3JGgj87GgZ89JVdC5dj0AoetR5Bw6wj4niittNyFh6+eOGonYvJ1ao6B8lEa3Q3klS7ADZ53bc5g== + dependencies: + "@babel/template" "^7.26.9" + "@babel/types" "^7.26.10" + +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.23.9", "@babel/parser@^7.26.10", "@babel/parser@^7.26.9": + version "7.26.10" + resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.26.10.tgz" + integrity sha512-6aQR2zGE/QFi8JpDLjUZEPYOs7+mhKXm86VaKFiLP35JQwQb6bwUE+XbvkH0EptsYhbNBSUGaUBLKqxH1xSgsA== + dependencies: + "@babel/types" "^7.26.10" + +"@babel/plugin-syntax-async-generators@^7.8.4": + version "7.8.4" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz" + integrity sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-bigint@^7.8.3": + version "7.8.3" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz" + integrity sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-class-properties@^7.12.13": + version "7.12.13" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz" + integrity sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA== + dependencies: + "@babel/helper-plugin-utils" "^7.12.13" + +"@babel/plugin-syntax-class-static-block@^7.14.5": + version "7.14.5" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz" + integrity sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw== + dependencies: + "@babel/helper-plugin-utils" "^7.14.5" + +"@babel/plugin-syntax-import-attributes@^7.24.7": + version "7.26.0" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.26.0.tgz" + integrity sha512-e2dttdsJ1ZTpi3B9UYGLw41hifAubg19AtCu/2I/F1QNVclOBr1dYpTdmdyZ84Xiz43BS/tCUkMAZNLv12Pi+A== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-syntax-import-meta@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz" + integrity sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g== + dependencies: + "@babel/helper-plugin-utils" "^7.10.4" + +"@babel/plugin-syntax-json-strings@^7.8.3": + version "7.8.3" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz" + integrity sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-jsx@^7.7.2": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.25.9.tgz" + integrity sha512-ld6oezHQMZsZfp6pWtbjaNDF2tiiCYYDqQszHt5VV437lewP9aSi2Of99CK0D0XB21k7FLgnLcmQKyKzynfeAA== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/plugin-syntax-logical-assignment-operators@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz" + integrity sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig== + dependencies: + "@babel/helper-plugin-utils" "^7.10.4" + +"@babel/plugin-syntax-nullish-coalescing-operator@^7.8.3": + version "7.8.3" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz" + integrity sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-numeric-separator@^7.10.4": + version "7.10.4" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz" + integrity sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug== + dependencies: + "@babel/helper-plugin-utils" "^7.10.4" + +"@babel/plugin-syntax-object-rest-spread@^7.8.3": + version "7.8.3" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz" + integrity sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-optional-catch-binding@^7.8.3": + version "7.8.3" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz" + integrity sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-optional-chaining@^7.8.3": + version "7.8.3" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz" + integrity sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-private-property-in-object@^7.14.5": + version "7.14.5" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz" + integrity sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg== + dependencies: + "@babel/helper-plugin-utils" "^7.14.5" + +"@babel/plugin-syntax-top-level-await@^7.14.5": + version "7.14.5" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz" + integrity sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw== + dependencies: + "@babel/helper-plugin-utils" "^7.14.5" + +"@babel/plugin-syntax-typescript@^7.7.2": + version "7.25.9" + resolved "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.25.9.tgz" + integrity sha512-hjMgRy5hb8uJJjUcdWunWVcoi9bGpJp8p5Ol1229PoN6aytsLwNMgmdftO23wnCLMfVmTwZDWMPNq/D1SY60JQ== + dependencies: + "@babel/helper-plugin-utils" "^7.25.9" + +"@babel/template@^7.26.9", "@babel/template@^7.3.3": + version "7.26.9" + resolved "https://registry.npmjs.org/@babel/template/-/template-7.26.9.tgz" + integrity sha512-qyRplbeIpNZhmzOysF/wFMuP9sctmh2cFzRAZOn1YapxBsE1i9bJIY586R/WBLfLcmcBlM8ROBiQURnnNy+zfA== + dependencies: + "@babel/code-frame" "^7.26.2" + "@babel/parser" "^7.26.9" + "@babel/types" "^7.26.9" + +"@babel/traverse@^7.25.9", "@babel/traverse@^7.26.10": + version "7.26.10" + resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.26.10.tgz" + integrity sha512-k8NuDrxr0WrPH5Aupqb2LCVURP/S0vBEn5mK6iH+GIYob66U5EtoZvcdudR2jQ4cmTwhEwW1DLB+Yyas9zjF6A== + dependencies: + "@babel/code-frame" "^7.26.2" + "@babel/generator" "^7.26.10" + "@babel/parser" "^7.26.10" + "@babel/template" "^7.26.9" + "@babel/types" "^7.26.10" + debug "^4.3.1" + globals "^11.1.0" + +"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.25.9", "@babel/types@^7.26.10", "@babel/types@^7.26.9", "@babel/types@^7.3.3": + version "7.26.10" + resolved "https://registry.npmjs.org/@babel/types/-/types-7.26.10.tgz" + integrity sha512-emqcG3vHrpxUKTrxcblR36dcrcoRDvKmnL/dCL6ZsHaShW80qxCAcNhzQZrpeM765VzEos+xOi4s+r4IXzTwdQ== + dependencies: + "@babel/helper-string-parser" "^7.25.9" + "@babel/helper-validator-identifier" "^7.25.9" + +"@bcoe/v8-coverage@^0.2.3": + version "0.2.3" + resolved "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz" + integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== + +"@cspotcode/source-map-support@^0.8.0": + version "0.8.1" + resolved "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz" + integrity sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw== + dependencies: + "@jridgewell/trace-mapping" "0.3.9" + +"@eslint-community/eslint-utils@^4.2.0": + version "4.7.0" + resolved "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.7.0.tgz" + integrity sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw== + dependencies: + eslint-visitor-keys "^3.4.3" + +"@eslint-community/regexpp@^4.4.0", "@eslint-community/regexpp@^4.6.1": + version "4.12.1" + resolved "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz" + integrity sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ== + +"@eslint/eslintrc@^2.1.4": + version "2.1.4" + resolved "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz" + integrity sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ== + dependencies: + ajv "^6.12.4" + debug "^4.3.2" + espree "^9.6.0" + globals "^13.19.0" + ignore "^5.2.0" + import-fresh "^3.2.1" + js-yaml "^4.1.0" + minimatch "^3.1.2" + strip-json-comments "^3.1.1" + +"@eslint/js@8.57.1": + version "8.57.1" + resolved "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz" + integrity sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q== + +"@guanghechen/helper-string@4.7.1": + version "4.7.1" + resolved "https://registry.npmjs.org/@guanghechen/helper-string/-/helper-string-4.7.1.tgz" + integrity sha512-D5kKFnqgk+6vVTaGw3QnpMaXxaJrFvmN/6c5Wt6htfyxUyYBl3NR++dh/ugAMRjMex5u6BS/c+biIrGYUtyyvA== + dependencies: + change-case "^4.1.2" + lower-case "^2.0.2" + title-case "^3.0.3" + upper-case "^2.0.2" + +"@humanwhocodes/config-array@^0.13.0": + version "0.13.0" + resolved "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz" + integrity sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw== + dependencies: + "@humanwhocodes/object-schema" "^2.0.3" + debug "^4.3.1" + minimatch "^3.0.5" + +"@humanwhocodes/module-importer@^1.0.1": + version "1.0.1" + resolved "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz" + integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== + +"@humanwhocodes/object-schema@^2.0.3": + version "2.0.3" + resolved "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz" + integrity sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA== + +"@inquirer/checkbox@^4.0.1": + version "4.0.1" + resolved "https://registry.npmjs.org/@inquirer/checkbox/-/checkbox-4.0.1.tgz" + integrity sha512-ehJjmNPdguajc1hStvjN7DJNVjwG5LC1mgGMGFjCmdkn2fxB2GtULftMnlaqNmvMdPpqdaSoOFpl86VkLtG4pQ== + dependencies: + "@inquirer/core" "^10.0.1" + "@inquirer/figures" "^1.0.7" + "@inquirer/type" "^3.0.0" + ansi-escapes "^4.3.2" + yoctocolors-cjs "^2.1.2" + +"@inquirer/confirm@^5.0.1": + version "5.0.1" + resolved "https://registry.npmjs.org/@inquirer/confirm/-/confirm-5.0.1.tgz" + integrity sha512-6ycMm7k7NUApiMGfVc32yIPp28iPKxhGRMqoNDiUjq2RyTAkbs5Fx0TdzBqhabcKvniDdAAvHCmsRjnNfTsogw== + dependencies: + "@inquirer/core" "^10.0.1" + "@inquirer/type" "^3.0.0" + +"@inquirer/core@^10.0.1": + version "10.0.1" + resolved "https://registry.npmjs.org/@inquirer/core/-/core-10.0.1.tgz" + integrity sha512-KKTgjViBQUi3AAssqjUFMnMO3CM3qwCHvePV9EW+zTKGKafFGFF01sc1yOIYjLJ7QU52G/FbzKc+c01WLzXmVQ== + dependencies: + "@inquirer/figures" "^1.0.7" + "@inquirer/type" "^3.0.0" + ansi-escapes "^4.3.2" + cli-width "^4.1.0" + mute-stream "^2.0.0" + signal-exit "^4.1.0" + strip-ansi "^6.0.1" + wrap-ansi "^6.2.0" + yoctocolors-cjs "^2.1.2" + +"@inquirer/editor@^4.0.1": + version "4.0.1" + resolved "https://registry.npmjs.org/@inquirer/editor/-/editor-4.0.1.tgz" + integrity sha512-qAHHJ6hs343eNtCKgV2wV5CImFxYG8J1pl/YCeI5w9VoW7QpulRUU26+4NsMhjR6zDRjKBsH/rRjCIcaAOHsrg== + dependencies: + "@inquirer/core" "^10.0.1" + "@inquirer/type" "^3.0.0" + external-editor "^3.1.0" + +"@inquirer/expand@^4.0.1": + version "4.0.1" + resolved "https://registry.npmjs.org/@inquirer/expand/-/expand-4.0.1.tgz" + integrity sha512-9anjpdc802YInXekwePsa5LWySzVMHbhVS6v6n5IJxrl8w09mODOeP69wZ1d0WrOvot2buQSmYp4lW/pq8y+zQ== + dependencies: + "@inquirer/core" "^10.0.1" + "@inquirer/type" "^3.0.0" + yoctocolors-cjs "^2.1.2" + +"@inquirer/figures@^1.0.7": + version "1.0.7" + resolved "https://registry.npmjs.org/@inquirer/figures/-/figures-1.0.7.tgz" + integrity sha512-m+Trk77mp54Zma6xLkLuY+mvanPxlE4A7yNKs2HBiyZ4UkVs28Mv5c/pgWrHeInx+USHeX/WEPzjrWrcJiQgjw== + +"@inquirer/input@^4.0.1": + version "4.0.1" + resolved "https://registry.npmjs.org/@inquirer/input/-/input-4.0.1.tgz" + integrity sha512-m+SliZ2m43cDRIpAdQxfv5QOeAQCuhS8TGLvtzEP1An4IH1kBES4RLMRgE/fC+z29aN8qYG8Tq/eXQQKTYwqAg== + dependencies: + "@inquirer/core" "^10.0.1" + "@inquirer/type" "^3.0.0" + +"@inquirer/number@^3.0.1": + version "3.0.1" + resolved "https://registry.npmjs.org/@inquirer/number/-/number-3.0.1.tgz" + integrity sha512-gF3erqfm0snpwBjbyKXUUe17QJ7ebm49btXApajrM0rgCCoYX0o9W5NCuYNae87iPxaIJVjtuoQ42DX32IdbMA== + dependencies: + "@inquirer/core" "^10.0.1" + "@inquirer/type" "^3.0.0" + +"@inquirer/password@^4.0.1": + version "4.0.1" + resolved "https://registry.npmjs.org/@inquirer/password/-/password-4.0.1.tgz" + integrity sha512-D7zUuX4l4ZpL3D7/SWu9ibijP09jigwHi/gfUHLx5GMS5oXzuMfPV2xPMG1tskco4enTx70HA0VtMXecerpvbg== + dependencies: + "@inquirer/core" "^10.0.1" + "@inquirer/type" "^3.0.0" + ansi-escapes "^4.3.2" + +"@inquirer/prompts@7.0.1": + version "7.0.1" + resolved "https://registry.npmjs.org/@inquirer/prompts/-/prompts-7.0.1.tgz" + integrity sha512-cu2CpGC2hz7WTt2VBvdkzahDvYice6vYA/8Dm7Fy3tRNzKuQTF2EY3CV4H2GamveWE6tA2XzyXtbWX8+t4WMQg== + dependencies: + "@inquirer/checkbox" "^4.0.1" + "@inquirer/confirm" "^5.0.1" + "@inquirer/editor" "^4.0.1" + "@inquirer/expand" "^4.0.1" + "@inquirer/input" "^4.0.1" + "@inquirer/number" "^3.0.1" + "@inquirer/password" "^4.0.1" + "@inquirer/rawlist" "^4.0.1" + "@inquirer/search" "^3.0.1" + "@inquirer/select" "^4.0.1" + +"@inquirer/rawlist@^4.0.1": + version "4.0.1" + resolved "https://registry.npmjs.org/@inquirer/rawlist/-/rawlist-4.0.1.tgz" + integrity sha512-0LuMOgaWs7W8JNcbiKkoFwyWFDEeCmLqDCygF0hidQUVa6J5grFVRZxrpompiWDFM49Km2rf7WoZwRo1uf1yWQ== + dependencies: + "@inquirer/core" "^10.0.1" + "@inquirer/type" "^3.0.0" + yoctocolors-cjs "^2.1.2" + +"@inquirer/search@^3.0.1": + version "3.0.1" + resolved "https://registry.npmjs.org/@inquirer/search/-/search-3.0.1.tgz" + integrity sha512-ehMqjiO0pAf+KtdONKeCLVy4i3fy3feyRRhDrvzWhiwB8JccgKn7eHFr39l+Nx/FaZAhr0YxIJvkK5NuNvG+Ww== + dependencies: + "@inquirer/core" "^10.0.1" + "@inquirer/figures" "^1.0.7" + "@inquirer/type" "^3.0.0" + yoctocolors-cjs "^2.1.2" + +"@inquirer/select@^4.0.1": + version "4.0.1" + resolved "https://registry.npmjs.org/@inquirer/select/-/select-4.0.1.tgz" + integrity sha512-tVRatFRGU49bxFCKi/3P+C0E13KZduNFbWuHWRx0L2+jbiyKRpXgHp9qiRHWRk/KarhYBXzH/di6w3VQ5aJd5w== + dependencies: + "@inquirer/core" "^10.0.1" + "@inquirer/figures" "^1.0.7" + "@inquirer/type" "^3.0.0" + ansi-escapes "^4.3.2" + yoctocolors-cjs "^2.1.2" + +"@inquirer/type@^3.0.0": + version "3.0.0" + resolved "https://registry.npmjs.org/@inquirer/type/-/type-3.0.0.tgz" + integrity sha512-YYykfbw/lefC7yKj7nanzQXILM7r3suIvyFlCcMskc99axmsSewXWkAfXKwMbgxL76iAFVmRwmYdwNZNc8gjog== + +"@istanbuljs/load-nyc-config@^1.0.0": + version "1.1.0" + resolved "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz" + integrity sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ== + dependencies: + camelcase "^5.3.1" + find-up "^4.1.0" + get-package-type "^0.1.0" + js-yaml "^3.13.1" + resolve-from "^5.0.0" + +"@istanbuljs/schema@^0.1.2", "@istanbuljs/schema@^0.1.3": + version "0.1.3" + resolved "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz" + integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== + +"@jest/console@^29.7.0": + version "29.7.0" + resolved "https://registry.npmjs.org/@jest/console/-/console-29.7.0.tgz" + integrity sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg== + dependencies: + "@jest/types" "^29.6.3" + "@types/node" "*" + chalk "^4.0.0" + jest-message-util "^29.7.0" + jest-util "^29.7.0" + slash "^3.0.0" + +"@jest/core@^29.3.1", "@jest/core@^29.7.0": + version "29.7.0" + resolved "https://registry.npmjs.org/@jest/core/-/core-29.7.0.tgz" + integrity sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg== + dependencies: + "@jest/console" "^29.7.0" + "@jest/reporters" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/transform" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/node" "*" + ansi-escapes "^4.2.1" + chalk "^4.0.0" + ci-info "^3.2.0" + exit "^0.1.2" + graceful-fs "^4.2.9" + jest-changed-files "^29.7.0" + jest-config "^29.7.0" + jest-haste-map "^29.7.0" + jest-message-util "^29.7.0" + jest-regex-util "^29.6.3" + jest-resolve "^29.7.0" + jest-resolve-dependencies "^29.7.0" + jest-runner "^29.7.0" + jest-runtime "^29.7.0" + jest-snapshot "^29.7.0" + jest-util "^29.7.0" + jest-validate "^29.7.0" + jest-watcher "^29.7.0" + micromatch "^4.0.4" + pretty-format "^29.7.0" + slash "^3.0.0" + strip-ansi "^6.0.0" + +"@jest/environment@^29.7.0": + version "29.7.0" + resolved "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz" + integrity sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw== + dependencies: + "@jest/fake-timers" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/node" "*" + jest-mock "^29.7.0" + +"@jest/expect-utils@^29.7.0": + version "29.7.0" + resolved "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz" + integrity sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA== + dependencies: + jest-get-type "^29.6.3" + +"@jest/expect@^29.7.0": + version "29.7.0" + resolved "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz" + integrity sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ== + dependencies: + expect "^29.7.0" + jest-snapshot "^29.7.0" + +"@jest/fake-timers@^29.7.0": + version "29.7.0" + resolved "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz" + integrity sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ== + dependencies: + "@jest/types" "^29.6.3" + "@sinonjs/fake-timers" "^10.0.2" + "@types/node" "*" + jest-message-util "^29.7.0" + jest-mock "^29.7.0" + jest-util "^29.7.0" + +"@jest/globals@^29.7.0": + version "29.7.0" + resolved "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz" + integrity sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ== + dependencies: + "@jest/environment" "^29.7.0" + "@jest/expect" "^29.7.0" + "@jest/types" "^29.6.3" + jest-mock "^29.7.0" + +"@jest/reporters@^29.7.0": + version "29.7.0" + resolved "https://registry.npmjs.org/@jest/reporters/-/reporters-29.7.0.tgz" + integrity sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg== + dependencies: + "@bcoe/v8-coverage" "^0.2.3" + "@jest/console" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/transform" "^29.7.0" + "@jest/types" "^29.6.3" + "@jridgewell/trace-mapping" "^0.3.18" + "@types/node" "*" + chalk "^4.0.0" + collect-v8-coverage "^1.0.0" + exit "^0.1.2" + glob "^7.1.3" + graceful-fs "^4.2.9" + istanbul-lib-coverage "^3.0.0" + istanbul-lib-instrument "^6.0.0" + istanbul-lib-report "^3.0.0" + istanbul-lib-source-maps "^4.0.0" + istanbul-reports "^3.1.3" + jest-message-util "^29.7.0" + jest-util "^29.7.0" + jest-worker "^29.7.0" + slash "^3.0.0" + string-length "^4.0.1" + strip-ansi "^6.0.0" + v8-to-istanbul "^9.0.1" + +"@jest/schemas@^29.6.3": + version "29.6.3" + resolved "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz" + integrity sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA== + dependencies: + "@sinclair/typebox" "^0.27.8" + +"@jest/source-map@^29.6.3": + version "29.6.3" + resolved "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz" + integrity sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw== + dependencies: + "@jridgewell/trace-mapping" "^0.3.18" + callsites "^3.0.0" + graceful-fs "^4.2.9" + +"@jest/test-result@^29.7.0": + version "29.7.0" + resolved "https://registry.npmjs.org/@jest/test-result/-/test-result-29.7.0.tgz" + integrity sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA== + dependencies: + "@jest/console" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/istanbul-lib-coverage" "^2.0.0" + collect-v8-coverage "^1.0.0" + +"@jest/test-sequencer@^29.7.0": + version "29.7.0" + resolved "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz" + integrity sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw== + dependencies: + "@jest/test-result" "^29.7.0" + graceful-fs "^4.2.9" + jest-haste-map "^29.7.0" + slash "^3.0.0" + +"@jest/transform@^29.7.0": + version "29.7.0" + resolved "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz" + integrity sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw== + dependencies: + "@babel/core" "^7.11.6" + "@jest/types" "^29.6.3" + "@jridgewell/trace-mapping" "^0.3.18" + babel-plugin-istanbul "^6.1.1" + chalk "^4.0.0" + convert-source-map "^2.0.0" + fast-json-stable-stringify "^2.1.0" + graceful-fs "^4.2.9" + jest-haste-map "^29.7.0" + jest-regex-util "^29.6.3" + jest-util "^29.7.0" + micromatch "^4.0.4" + pirates "^4.0.4" + slash "^3.0.0" + write-file-atomic "^4.0.2" + +"@jest/types@^29.0.0", "@jest/types@^29.3.1", "@jest/types@^29.6.3": + version "29.6.3" + resolved "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz" + integrity sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw== + dependencies: + "@jest/schemas" "^29.6.3" + "@types/istanbul-lib-coverage" "^2.0.0" + "@types/istanbul-reports" "^3.0.0" + "@types/node" "*" + "@types/yargs" "^17.0.8" + chalk "^4.0.0" + +"@jridgewell/gen-mapping@^0.3.5": + version "0.3.8" + resolved "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz" + integrity sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA== + dependencies: + "@jridgewell/set-array" "^1.2.1" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@jridgewell/trace-mapping" "^0.3.24" + +"@jridgewell/resolve-uri@^3.0.3", "@jridgewell/resolve-uri@^3.1.0": + version "3.1.1" + resolved "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz" + integrity sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA== + +"@jridgewell/set-array@^1.2.1": + version "1.2.1" + resolved "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz" + integrity sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A== + +"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.14": + version "1.4.15" + resolved "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz" + integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== + +"@jridgewell/trace-mapping@^0.3.12": + version "0.3.25" + resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz" + integrity sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ== + dependencies: + "@jridgewell/resolve-uri" "^3.1.0" + "@jridgewell/sourcemap-codec" "^1.4.14" + +"@jridgewell/trace-mapping@^0.3.18": + version "0.3.25" + resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz" + integrity sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ== + dependencies: + "@jridgewell/resolve-uri" "^3.1.0" + "@jridgewell/sourcemap-codec" "^1.4.14" + +"@jridgewell/trace-mapping@^0.3.24": + version "0.3.25" + resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz" + integrity sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ== + dependencies: + "@jridgewell/resolve-uri" "^3.1.0" + "@jridgewell/sourcemap-codec" "^1.4.14" + +"@jridgewell/trace-mapping@^0.3.25": + version "0.3.25" + resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz" + integrity sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ== + dependencies: + "@jridgewell/resolve-uri" "^3.1.0" + "@jridgewell/sourcemap-codec" "^1.4.14" + +"@jridgewell/trace-mapping@0.3.9": + version "0.3.9" + resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz" + integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== + dependencies: + "@jridgewell/resolve-uri" "^3.0.3" + "@jridgewell/sourcemap-codec" "^1.4.10" + +"@jsdevtools/ono@^7.1.3": + version "7.1.3" + resolved "https://registry.npmjs.org/@jsdevtools/ono/-/ono-7.1.3.tgz" + integrity sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg== + +"@nodelib/fs.scandir@2.1.5": + version "2.1.5" + resolved "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz" + integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== + dependencies: + "@nodelib/fs.stat" "2.0.5" + run-parallel "^1.1.9" + +"@nodelib/fs.stat@^2.0.2", "@nodelib/fs.stat@2.0.5": + version "2.0.5" + resolved "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz" + integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== + +"@nodelib/fs.walk@^1.2.3", "@nodelib/fs.walk@^1.2.8": + version "1.2.8" + resolved "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz" + integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== + dependencies: + "@nodelib/fs.scandir" "2.1.5" + fastq "^1.6.0" + +"@sinclair/typebox@^0.27.8": + version "0.27.8" + resolved "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz" + integrity sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA== + +"@sinonjs/commons@^3.0.0": + version "3.0.1" + resolved "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz" + integrity sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ== + dependencies: + type-detect "4.0.8" + +"@sinonjs/fake-timers@^10.0.2": + version "10.3.0" + resolved "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz" + integrity sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA== + dependencies: + "@sinonjs/commons" "^3.0.0" + +"@socket.io/component-emitter@~3.1.0": + version "3.1.2" + resolved "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.2.tgz" + integrity sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA== + +"@tsconfig/node10@^1.0.7": + version "1.0.9" + resolved "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz" + integrity sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA== + +"@tsconfig/node12@^1.0.7": + version "1.0.11" + resolved "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz" + integrity sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag== + +"@tsconfig/node14@^1.0.0": + version "1.0.3" + resolved "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz" + integrity sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow== + +"@tsconfig/node16@^1.0.2": + version "1.0.4" + resolved "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz" + integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA== + +"@types/adm-zip@0.5.5": + version "0.5.5" + resolved "https://registry.npmjs.org/@types/adm-zip/-/adm-zip-0.5.5.tgz" + integrity sha512-YCGstVMjc4LTY5uK9/obvxBya93axZOVOyf2GSUulADzmLhYE45u2nAssCs/fWBs1Ifq5Vat75JTPwd5XZoPJw== + dependencies: + "@types/node" "*" + +"@types/babel__core@^7.1.14": + version "7.20.5" + resolved "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz" + integrity sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA== + dependencies: + "@babel/parser" "^7.20.7" + "@babel/types" "^7.20.7" + "@types/babel__generator" "*" + "@types/babel__template" "*" + "@types/babel__traverse" "*" + +"@types/babel__generator@*": + version "7.6.8" + resolved "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.8.tgz" + integrity sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw== + dependencies: + "@babel/types" "^7.0.0" + +"@types/babel__template@*": + version "7.4.4" + resolved "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz" + integrity sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A== + dependencies: + "@babel/parser" "^7.1.0" + "@babel/types" "^7.0.0" + +"@types/babel__traverse@*", "@types/babel__traverse@^7.0.6": + version "7.20.6" + resolved "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.6.tgz" + integrity sha512-r1bzfrm0tomOI8g1SzvCaQHo6Lcv6zu0EA+W2kHrt8dyrHQxGzBBL4kdkzIS+jBMV+EYcMAEAqXqYaLJq5rOZg== + dependencies: + "@babel/types" "^7.20.7" + +"@types/graceful-fs@^4.1.3": + version "4.1.9" + resolved "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz" + integrity sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ== + dependencies: + "@types/node" "*" + +"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0", "@types/istanbul-lib-coverage@^2.0.1": + version "2.0.6" + resolved "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz" + integrity sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w== + +"@types/istanbul-lib-report@*": + version "3.0.3" + resolved "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz" + integrity sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA== + dependencies: + "@types/istanbul-lib-coverage" "*" + +"@types/istanbul-reports@^3.0.0": + version "3.0.4" + resolved "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz" + integrity sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ== + dependencies: + "@types/istanbul-lib-report" "*" + +"@types/jest@29.2.4": + version "29.2.4" + resolved "https://registry.npmjs.org/@types/jest/-/jest-29.2.4.tgz" + integrity sha512-PipFB04k2qTRPePduVLTRiPzQfvMeLwUN3Z21hsAKaB/W9IIzgB2pizCL466ftJlcyZqnHoC9ZHpxLGl3fS86A== + dependencies: + expect "^29.0.0" + pretty-format "^29.0.0" + +"@types/json-schema@^7.0.15", "@types/json-schema@^7.0.9": + version "7.0.15" + resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz" + integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== + +"@types/jsonpath@0.2.4": + version "0.2.4" + resolved "https://registry.npmjs.org/@types/jsonpath/-/jsonpath-0.2.4.tgz" + integrity sha512-K3hxB8Blw0qgW6ExKgMbXQv2UPZBoE2GqLpVY+yr7nMD2Pq86lsuIzyAaiQ7eMqFL5B6di6pxSkogLJEyEHoGA== + +"@types/lodash@^4.17.7", "@types/lodash@4.17.9": + version "4.17.9" + resolved "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.9.tgz" + integrity sha512-w9iWudx1XWOHW5lQRS9iKpK/XuRhnN+0T7HvdCCd802FYkT1AMTnxndJHGrNJwRoRHkslGr4S29tjm1cT7x/7w== + +"@types/node@*", "@types/node@>=18", "@types/node@18.11.18": + version "18.11.18" + resolved "https://registry.npmjs.org/@types/node/-/node-18.11.18.tgz" + integrity sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA== + +"@types/node@^16.9.2": + version "16.18.54" + resolved "https://registry.npmjs.org/@types/node/-/node-16.18.54.tgz" + integrity sha512-oTmGy68gxZZ21FhTJVVvZBYpQHEBZxHKTsGshobMqm9qWpbqdZsA5jvsuPZcHu0KwpmLrOHWPdEfg7XDpNT9UA== + +"@types/semver@^7.3.12": + version "7.7.0" + resolved "https://registry.npmjs.org/@types/semver/-/semver-7.7.0.tgz" + integrity sha512-k107IF4+Xr7UHjwDc7Cfd6PRQfbdkiRabXGRjo07b4WyPahFBZCZ1sE+BNxYIJPPg73UkfOsVOLwqVc/6ETrIA== + +"@types/stack-utils@^2.0.0": + version "2.0.3" + resolved "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz" + integrity sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw== + +"@types/validator@13.11.9": + version "13.11.9" + resolved "https://registry.npmjs.org/@types/validator/-/validator-13.11.9.tgz" + integrity sha512-FCTsikRozryfayPuiI46QzH3fnrOoctTjvOYZkho9BTFLCOZ2rgZJHMOVgCOfttjPJcgOx52EpkY0CMfy87MIw== + +"@types/yargs-parser@*": + version "21.0.3" + resolved "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz" + integrity sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ== + +"@types/yargs@^17.0.8": + version "17.0.33" + resolved "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.33.tgz" + integrity sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA== + dependencies: + "@types/yargs-parser" "*" + +"@typescript-eslint/eslint-plugin@5.62.0": + version "5.62.0" + resolved "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz" + integrity sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag== + dependencies: + "@eslint-community/regexpp" "^4.4.0" + "@typescript-eslint/scope-manager" "5.62.0" + "@typescript-eslint/type-utils" "5.62.0" + "@typescript-eslint/utils" "5.62.0" + debug "^4.3.4" + graphemer "^1.4.0" + ignore "^5.2.0" + natural-compare-lite "^1.4.0" + semver "^7.3.7" + tsutils "^3.21.0" + +"@typescript-eslint/parser@^5.0.0", "@typescript-eslint/parser@5.62.0": + version "5.62.0" + resolved "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz" + integrity sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA== + dependencies: + "@typescript-eslint/scope-manager" "5.62.0" + "@typescript-eslint/types" "5.62.0" + "@typescript-eslint/typescript-estree" "5.62.0" + debug "^4.3.4" + +"@typescript-eslint/scope-manager@5.62.0": + version "5.62.0" + resolved "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz" + integrity sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w== + dependencies: + "@typescript-eslint/types" "5.62.0" + "@typescript-eslint/visitor-keys" "5.62.0" + +"@typescript-eslint/type-utils@5.62.0": + version "5.62.0" + resolved "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.62.0.tgz" + integrity sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew== + dependencies: + "@typescript-eslint/typescript-estree" "5.62.0" + "@typescript-eslint/utils" "5.62.0" + debug "^4.3.4" + tsutils "^3.21.0" + +"@typescript-eslint/types@5.62.0": + version "5.62.0" + resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz" + integrity sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ== + +"@typescript-eslint/typescript-estree@5.62.0": + version "5.62.0" + resolved "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz" + integrity sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA== + dependencies: + "@typescript-eslint/types" "5.62.0" + "@typescript-eslint/visitor-keys" "5.62.0" + debug "^4.3.4" + globby "^11.1.0" + is-glob "^4.0.3" + semver "^7.3.7" + tsutils "^3.21.0" + +"@typescript-eslint/utils@5.62.0": + version "5.62.0" + resolved "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.62.0.tgz" + integrity sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ== + dependencies: + "@eslint-community/eslint-utils" "^4.2.0" + "@types/json-schema" "^7.0.9" + "@types/semver" "^7.3.12" + "@typescript-eslint/scope-manager" "5.62.0" + "@typescript-eslint/types" "5.62.0" + "@typescript-eslint/typescript-estree" "5.62.0" + eslint-scope "^5.1.1" + semver "^7.3.7" + +"@typescript-eslint/visitor-keys@5.62.0": + version "5.62.0" + resolved "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz" + integrity sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw== + dependencies: + "@typescript-eslint/types" "5.62.0" + eslint-visitor-keys "^3.3.0" + +"@ungap/structured-clone@^1.2.0": + version "1.3.0" + resolved "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz" + integrity sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g== + +acorn-jsx@^5.3.2: + version "5.3.2" + resolved "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz" + integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== + +acorn-walk@^8.1.1: + version "8.2.0" + resolved "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz" + integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== + +"acorn@^6.0.0 || ^7.0.0 || ^8.0.0", acorn@^8.4.1, acorn@^8.9.0: + version "8.10.0" + resolved "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz" + integrity sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw== + +adm-zip@0.5.16: + version "0.5.16" + resolved "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.16.tgz" + integrity sha512-TGw5yVi4saajsSEgz25grObGHEUaDrniwvA2qwSC060KfqGPdglhvPMA2lPIoxs3PQIItj2iag35fONcQqgUaQ== + +agent-base@^7.0.2, agent-base@^7.1.0: + version "7.1.0" + resolved "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz" + integrity sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg== + dependencies: + debug "^4.3.4" + +ajv@^6.12.4: + version "6.12.6" + resolved "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz" + integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== + dependencies: + fast-deep-equal "^3.1.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + +ansi-escapes@^4.2.1, ansi-escapes@^4.3.2: + version "4.3.2" + resolved "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz" + integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== + dependencies: + type-fest "^0.21.3" + +ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== + +ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + dependencies: + color-convert "^1.9.0" + +ansi-styles@^4.0.0, ansi-styles@^4.1.0: + version "4.3.0" + resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +ansi-styles@^5.0.0: + version "5.2.0" + resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz" + integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== + +anymatch@^3.0.3, anymatch@~3.1.2: + version "3.1.3" + resolved "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz" + integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== + dependencies: + normalize-path "^3.0.0" + picomatch "^2.0.4" + +arg@^4.1.0: + version "4.1.3" + resolved "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz" + integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== + +argparse@^1.0.7: + version "1.0.10" + resolved "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz" + integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== + dependencies: + sprintf-js "~1.0.2" + +argparse@^2.0.1: + version "2.0.1" + resolved "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz" + integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== + +array-timsort@^1.0.3: + version "1.0.3" + resolved "https://registry.npmjs.org/array-timsort/-/array-timsort-1.0.3.tgz" + integrity sha512-/+3GRL7dDAGEfM6TseQk/U+mi18TU2Ms9I3UlLdUMhz2hbvGNTKdj9xniwXfUqgYhHxRx0+8UnKkvlNwVU+cWQ== + +array-union@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz" + integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz" + integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== + +axios@1.8.3: + version "1.8.3" + resolved "https://registry.npmjs.org/axios/-/axios-1.8.3.tgz" + integrity sha512-iP4DebzoNlP/YN2dpwCgb8zoCmhtkajzS48JvwmkSkXvPI3DHc7m+XYL5tGnSlJtR6nImXZmdCuN5aP8dh1d8A== + dependencies: + follow-redirects "^1.15.6" + form-data "^4.0.0" + proxy-from-env "^1.1.0" + +babel-jest@^29.0.0, babel-jest@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz" + integrity sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg== + dependencies: + "@jest/transform" "^29.7.0" + "@types/babel__core" "^7.1.14" + babel-plugin-istanbul "^6.1.1" + babel-preset-jest "^29.6.3" + chalk "^4.0.0" + graceful-fs "^4.2.9" + slash "^3.0.0" + +babel-plugin-istanbul@^6.1.1: + version "6.1.1" + resolved "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz" + integrity sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@istanbuljs/load-nyc-config" "^1.0.0" + "@istanbuljs/schema" "^0.1.2" + istanbul-lib-instrument "^5.0.4" + test-exclude "^6.0.0" + +babel-plugin-jest-hoist@^29.6.3: + version "29.6.3" + resolved "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz" + integrity sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg== + dependencies: + "@babel/template" "^7.3.3" + "@babel/types" "^7.3.3" + "@types/babel__core" "^7.1.14" + "@types/babel__traverse" "^7.0.6" + +babel-preset-current-node-syntax@^1.0.0: + version "1.1.0" + resolved "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.1.0.tgz" + integrity sha512-ldYss8SbBlWva1bs28q78Ju5Zq1F+8BrqBZZ0VFhLBvhh6lCpC2o3gDJi/5DRLs9FgYZCnmPYIVFU4lRXCkyUw== + dependencies: + "@babel/plugin-syntax-async-generators" "^7.8.4" + "@babel/plugin-syntax-bigint" "^7.8.3" + "@babel/plugin-syntax-class-properties" "^7.12.13" + "@babel/plugin-syntax-class-static-block" "^7.14.5" + "@babel/plugin-syntax-import-attributes" "^7.24.7" + "@babel/plugin-syntax-import-meta" "^7.10.4" + "@babel/plugin-syntax-json-strings" "^7.8.3" + "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" + "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" + "@babel/plugin-syntax-numeric-separator" "^7.10.4" + "@babel/plugin-syntax-object-rest-spread" "^7.8.3" + "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" + "@babel/plugin-syntax-optional-chaining" "^7.8.3" + "@babel/plugin-syntax-private-property-in-object" "^7.14.5" + "@babel/plugin-syntax-top-level-await" "^7.14.5" + +babel-preset-jest@^29.6.3: + version "29.6.3" + resolved "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz" + integrity sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA== + dependencies: + babel-plugin-jest-hoist "^29.6.3" + babel-preset-current-node-syntax "^1.0.0" + +balanced-match@^1.0.0: + version "1.0.2" + resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz" + integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== + +binary-extensions@^2.0.0: + version "2.2.0" + resolved "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz" + integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +brace-expansion@^2.0.1: + version "2.0.1" + resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz" + integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== + dependencies: + balanced-match "^1.0.0" + +braces@^3.0.3, braces@~3.0.2: + version "3.0.3" + resolved "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz" + integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA== + dependencies: + fill-range "^7.1.1" + +browserslist@^4.24.0, "browserslist@>= 4.21.0": + version "4.24.4" + resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.24.4.tgz" + integrity sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A== + dependencies: + caniuse-lite "^1.0.30001688" + electron-to-chromium "^1.5.73" + node-releases "^2.0.19" + update-browserslist-db "^1.1.1" + +bs-logger@0.x: + version "0.2.6" + resolved "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz" + integrity sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog== + dependencies: + fast-json-stable-stringify "2.x" + +bser@2.1.1: + version "2.1.1" + resolved "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz" + integrity sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ== + dependencies: + node-int64 "^0.4.0" + +buffer-from@^1.0.0: + version "1.1.2" + resolved "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz" + integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== + +builtin-modules@^1.1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz" + integrity sha512-wxXCdllwGhI2kCC0MnvTGYTMvnVZTvqgypkiTI8Pa5tcz2i6VqsqwYGgqwXji+4RgCzms6EajE4IxiUH6HH8nQ== + +callsites@^3.0.0: + version "3.1.0" + resolved "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz" + integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== + +camel-case@^4.1.2: + version "4.1.2" + resolved "https://registry.npmjs.org/camel-case/-/camel-case-4.1.2.tgz" + integrity sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw== + dependencies: + pascal-case "^3.1.2" + tslib "^2.0.3" + +camelcase@^5.3.1: + version "5.3.1" + resolved "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz" + integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== + +camelcase@^6.2.0: + version "6.3.0" + resolved "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz" + integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== + +caniuse-lite@^1.0.30001688: + version "1.0.30001704" + resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001704.tgz" + integrity sha512-+L2IgBbV6gXB4ETf0keSvLr7JUrRVbIaB/lrQ1+z8mRcQiisG5k+lG6O4n6Y5q6f5EuNfaYXKgymucphlEXQew== + +capital-case@^1.0.4: + version "1.0.4" + resolved "https://registry.npmjs.org/capital-case/-/capital-case-1.0.4.tgz" + integrity sha512-ds37W8CytHgwnhGGTi88pcPyR15qoNkOpYwmMMfnWqqWgESapLqvDx6huFjQ5vqWSn2Z06173XNA7LtMOeUh1A== + dependencies: + no-case "^3.0.4" + tslib "^2.0.3" + upper-case-first "^2.0.2" + +chalk@^2.3.0: + version "2.4.2" + resolved "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +chalk@^2.4.1: + version "2.4.2" + resolved "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +chalk@^4.0.0, chalk@4.1.2: + version "4.1.2" + resolved "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +change-case@^4.1.2: + version "4.1.2" + resolved "https://registry.npmjs.org/change-case/-/change-case-4.1.2.tgz" + integrity sha512-bSxY2ws9OtviILG1EiY5K7NNxkqg/JnRnFxLtKQ96JaviiIxi7djMrSd0ECT9AC+lttClmYwKw53BWpOMblo7A== + dependencies: + camel-case "^4.1.2" + capital-case "^1.0.4" + constant-case "^3.0.4" + dot-case "^3.0.4" + header-case "^2.0.4" + no-case "^3.0.4" + param-case "^3.0.4" + pascal-case "^3.1.2" + path-case "^3.0.4" + sentence-case "^3.0.4" + snake-case "^3.0.4" + tslib "^2.0.3" + +char-regex@^1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz" + integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw== + +chardet@^0.7.0: + version "0.7.0" + resolved "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz" + integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== + +chokidar@^3.5.3: + version "3.5.3" + resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz" + integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== + dependencies: + anymatch "~3.1.2" + braces "~3.0.2" + glob-parent "~5.1.2" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.6.0" + optionalDependencies: + fsevents "~2.3.2" + +ci-info@^3.2.0: + version "3.9.0" + resolved "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz" + integrity sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ== + +cjs-module-lexer@^1.0.0: + version "1.4.3" + resolved "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.4.3.tgz" + integrity sha512-9z8TZaGM1pfswYeXrUpzPrkx8UnWYdhJclsiYMm6x/w5+nN+8Tf/LnAgfLGQCm59qAOxU8WwHEq2vNwF6i4j+Q== + +cli-width@^4.1.0: + version "4.1.0" + resolved "https://registry.npmjs.org/cli-width/-/cli-width-4.1.0.tgz" + integrity sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ== + +cliui@^7.0.2: + version "7.0.4" + resolved "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz" + integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^7.0.0" + +cliui@^8.0.1: + version "8.0.1" + resolved "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz" + integrity sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.1" + wrap-ansi "^7.0.0" + +co@^4.6.0: + version "4.6.0" + resolved "https://registry.npmjs.org/co/-/co-4.6.0.tgz" + integrity sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ== + +collect-v8-coverage@^1.0.0: + version "1.0.2" + resolved "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz" + integrity sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q== + +color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + dependencies: + color-name "1.1.3" + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz" + integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== + +combined-stream@^1.0.8: + version "1.0.8" + resolved "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz" + integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== + dependencies: + delayed-stream "~1.0.0" + +commander@^2.12.1: + version "2.20.3" + resolved "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz" + integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== + +commander@^9.0.0: + version "9.5.0" + resolved "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz" + integrity sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ== + +comment-json@4.2.3: + version "4.2.3" + resolved "https://registry.npmjs.org/comment-json/-/comment-json-4.2.3.tgz" + integrity sha512-SsxdiOf064DWoZLH799Ata6u7iV658A11PlWtZATDlXPpKGJnbJZ5Z24ybixAi+LUUqJ/GKowAejtC5GFUG7Tw== + dependencies: + array-timsort "^1.0.3" + core-util-is "^1.0.3" + esprima "^4.0.1" + has-own-prop "^2.0.0" + repeat-string "^1.6.1" + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" + integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== + +constant-case@^3.0.4: + version "3.0.4" + resolved "https://registry.npmjs.org/constant-case/-/constant-case-3.0.4.tgz" + integrity sha512-I2hSBi7Vvs7BEuJDr5dDHfzb/Ruj3FyvFyh7KLilAjNQw3Be+xgqUBA2W6scVEcL0hL1dwPRtIqEPVUCKkSsyQ== + dependencies: + no-case "^3.0.4" + tslib "^2.0.3" + upper-case "^2.0.2" + +convert-source-map@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz" + integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== + +copyfiles@2.4.1: + version "2.4.1" + resolved "https://registry.npmjs.org/copyfiles/-/copyfiles-2.4.1.tgz" + integrity sha512-fereAvAvxDrQDOXybk3Qu3dPbOoKoysFMWtkY3mv5BsL8//OSZVL5DCLYqgRfY5cWirgRzlC+WSrxp6Bo3eNZg== + dependencies: + glob "^7.0.5" + minimatch "^3.0.3" + mkdirp "^1.0.4" + noms "0.0.0" + through2 "^2.0.1" + untildify "^4.0.0" + yargs "^16.1.0" + +core-util-is@^1.0.3, core-util-is@~1.0.0: + version "1.0.3" + resolved "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz" + integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== + +create-jest@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz" + integrity sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q== + dependencies: + "@jest/types" "^29.6.3" + chalk "^4.0.0" + exit "^0.1.2" + graceful-fs "^4.2.9" + jest-config "^29.7.0" + jest-util "^29.7.0" + prompts "^2.0.1" + +create-require@^1.1.0: + version "1.1.1" + resolved "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz" + integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== + +cross-spawn@^7.0.2, cross-spawn@^7.0.3: + version "7.0.6" + resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz" + integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA== + dependencies: + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" + +debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4, debug@~4.3.1, debug@~4.3.2, debug@4: + version "4.3.4" + resolved "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz" + integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== + dependencies: + ms "2.1.2" + +dedent@^1.0.0: + version "1.5.3" + resolved "https://registry.npmjs.org/dedent/-/dedent-1.5.3.tgz" + integrity sha512-NHQtfOOW68WD8lgypbLA5oT+Bt0xXJhiYvoR6SmmNXZfpzOGXwdKWmcwG8N7PwVVWV3eF/68nmD9BaJSsTBhyQ== + +deep-is@^0.1.3, deep-is@~0.1.3: + version "0.1.4" + resolved "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz" + integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== + +deepmerge@^4.2.2: + version "4.3.1" + resolved "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz" + integrity sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A== + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz" + integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== + +detect-newline@^3.0.0: + version "3.1.0" + resolved "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz" + integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== + +diff-sequences@^29.6.3: + version "29.6.3" + resolved "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz" + integrity sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q== + +diff@^4.0.1: + version "4.0.2" + resolved "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz" + integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== + +dir-glob@^3.0.1: + version "3.0.1" + resolved "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz" + integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== + dependencies: + path-type "^4.0.0" + +doctrine@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz" + integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== + dependencies: + esutils "^2.0.2" + +dot-case@^3.0.4: + version "3.0.4" + resolved "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz" + integrity sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w== + dependencies: + no-case "^3.0.4" + tslib "^2.0.3" + +dotenv@16.0.3: + version "16.0.3" + resolved "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz" + integrity sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ== + +electron-to-chromium@^1.5.73: + version "1.5.118" + resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.118.tgz" + integrity sha512-yNDUus0iultYyVoEFLnQeei7LOQkL8wg8GQpkPCRrOlJXlcCwa6eGKZkxQ9ciHsqZyYbj8Jd94X1CTPzGm+uIA== + +emittery@^0.13.1: + version "0.13.1" + resolved "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz" + integrity sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ== + +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + +engine.io-client@~6.5.2: + version "6.5.4" + resolved "https://registry.npmjs.org/engine.io-client/-/engine.io-client-6.5.4.tgz" + integrity sha512-GeZeeRjpD2qf49cZQ0Wvh/8NJNfeXkXXcoGh+F77oEAgo9gUHwT1fCRxSNU+YEEaysOJTnsFHmM5oAcPy4ntvQ== + dependencies: + "@socket.io/component-emitter" "~3.1.0" + debug "~4.3.1" + engine.io-parser "~5.2.1" + ws "~8.17.1" + xmlhttprequest-ssl "~2.0.0" + +engine.io-parser@~5.2.1: + version "5.2.2" + resolved "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.2.2.tgz" + integrity sha512-RcyUFKA93/CXH20l4SoVvzZfrSDMOTUS3bWVpTt2FuFP+XYrL8i8oonHP7WInRyVHXh0n/ORtoeiE1os+8qkSw== + +error-ex@^1.3.1: + version "1.3.2" + resolved "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz" + integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== + dependencies: + is-arrayish "^0.2.1" + +escalade@^3.1.1, escalade@^3.2.0: + version "3.2.0" + resolved "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz" + integrity sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA== + +escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz" + integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== + +escape-string-regexp@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz" + integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== + +escape-string-regexp@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz" + integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== + +escodegen@^1.8.1: + version "1.14.3" + resolved "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz" + integrity sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw== + dependencies: + esprima "^4.0.1" + estraverse "^4.2.0" + esutils "^2.0.2" + optionator "^0.8.1" + optionalDependencies: + source-map "~0.6.1" + +eslint-config-prettier@9.1.0: + version "9.1.0" + resolved "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz" + integrity sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw== + +eslint-plugin-prettier@4.2.1: + version "4.2.1" + resolved "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz" + integrity sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ== + dependencies: + prettier-linter-helpers "^1.0.0" + +eslint-scope@^5.1.1: + version "5.1.1" + resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz" + integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== + dependencies: + esrecurse "^4.3.0" + estraverse "^4.1.1" + +eslint-scope@^7.2.2: + version "7.2.2" + resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz" + integrity sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg== + dependencies: + esrecurse "^4.3.0" + estraverse "^5.2.0" + +eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4.3: + version "3.4.3" + resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz" + integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== + +eslint@*, "eslint@^6.0.0 || ^7.0.0 || ^8.0.0", "eslint@^6.0.0 || ^7.0.0 || >=8.0.0", eslint@>=7.0.0, eslint@>=7.28.0, eslint@8.57.1: + version "8.57.1" + resolved "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz" + integrity sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA== + dependencies: + "@eslint-community/eslint-utils" "^4.2.0" + "@eslint-community/regexpp" "^4.6.1" + "@eslint/eslintrc" "^2.1.4" + "@eslint/js" "8.57.1" + "@humanwhocodes/config-array" "^0.13.0" + "@humanwhocodes/module-importer" "^1.0.1" + "@nodelib/fs.walk" "^1.2.8" + "@ungap/structured-clone" "^1.2.0" + ajv "^6.12.4" + chalk "^4.0.0" + cross-spawn "^7.0.2" + debug "^4.3.2" + doctrine "^3.0.0" + escape-string-regexp "^4.0.0" + eslint-scope "^7.2.2" + eslint-visitor-keys "^3.4.3" + espree "^9.6.1" + esquery "^1.4.2" + esutils "^2.0.2" + fast-deep-equal "^3.1.3" + file-entry-cache "^6.0.1" + find-up "^5.0.0" + glob-parent "^6.0.2" + globals "^13.19.0" + graphemer "^1.4.0" + ignore "^5.2.0" + imurmurhash "^0.1.4" + is-glob "^4.0.0" + is-path-inside "^3.0.3" + js-yaml "^4.1.0" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.4.1" + lodash.merge "^4.6.2" + minimatch "^3.1.2" + natural-compare "^1.4.0" + optionator "^0.9.3" + strip-ansi "^6.0.1" + text-table "^0.2.0" + +espree@^9.6.0, espree@^9.6.1: + version "9.6.1" + resolved "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz" + integrity sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ== + dependencies: + acorn "^8.9.0" + acorn-jsx "^5.3.2" + eslint-visitor-keys "^3.4.1" + +esprima@^4.0.0, esprima@^4.0.1: + version "4.0.1" + resolved "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz" + integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== + +esprima@1.2.2: + version "1.2.2" + resolved "https://registry.npmjs.org/esprima/-/esprima-1.2.2.tgz" + integrity sha512-+JpPZam9w5DuJ3Q67SqsMGtiHKENSMRVoxvArfJZK01/BfLEObtZ6orJa/MtoGNR/rfMgp5837T41PAmTwAv/A== + +esquery@^1.4.2: + version "1.6.0" + resolved "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz" + integrity sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg== + dependencies: + estraverse "^5.1.0" + +esrecurse@^4.3.0: + version "4.3.0" + resolved "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz" + integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== + dependencies: + estraverse "^5.2.0" + +estraverse@^4.1.1, estraverse@^4.2.0: + version "4.3.0" + resolved "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz" + integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== + +estraverse@^5.1.0: + version "5.3.0" + resolved "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz" + integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== + +estraverse@^5.2.0: + version "5.3.0" + resolved "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz" + integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== + +esutils@^2.0.2: + version "2.0.3" + resolved "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz" + integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== + +execa@^5.0.0: + version "5.1.1" + resolved "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz" + integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg== + dependencies: + cross-spawn "^7.0.3" + get-stream "^6.0.0" + human-signals "^2.1.0" + is-stream "^2.0.0" + merge-stream "^2.0.0" + npm-run-path "^4.0.1" + onetime "^5.1.2" + signal-exit "^3.0.3" + strip-final-newline "^2.0.0" + +exit@^0.1.2: + version "0.1.2" + resolved "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz" + integrity sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ== + +expect@^29.0.0, expect@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz" + integrity sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw== + dependencies: + "@jest/expect-utils" "^29.7.0" + jest-get-type "^29.6.3" + jest-matcher-utils "^29.7.0" + jest-message-util "^29.7.0" + jest-util "^29.7.0" + +external-editor@^3.1.0: + version "3.1.0" + resolved "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz" + integrity sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew== + dependencies: + chardet "^0.7.0" + iconv-lite "^0.4.24" + tmp "^0.0.33" + +fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: + version "3.1.3" + resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz" + integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== + +fast-diff@^1.1.2: + version "1.3.0" + resolved "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz" + integrity sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw== + +fast-glob@^3.2.9: + version "3.2.12" + resolved "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz" + integrity sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w== + dependencies: + "@nodelib/fs.stat" "^2.0.2" + "@nodelib/fs.walk" "^1.2.3" + glob-parent "^5.1.2" + merge2 "^1.3.0" + micromatch "^4.0.4" + +fast-json-stable-stringify@^2.0.0, fast-json-stable-stringify@^2.1.0, fast-json-stable-stringify@2.x: + version "2.1.0" + resolved "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz" + integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== + +fast-levenshtein@^2.0.6, fast-levenshtein@~2.0.6: + version "2.0.6" + resolved "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz" + integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== + +fastq@^1.6.0: + version "1.15.0" + resolved "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz" + integrity sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw== + dependencies: + reusify "^1.0.4" + +fb-watchman@^2.0.0: + version "2.0.2" + resolved "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz" + integrity sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA== + dependencies: + bser "2.1.1" + +fdir@^6.4.2: + version "6.4.2" + resolved "https://registry.npmjs.org/fdir/-/fdir-6.4.2.tgz" + integrity sha512-KnhMXsKSPZlAhp7+IjUkRZKPb4fUyccpDrdFXbi4QL1qkmFh9kVY09Yox+n4MaOb3lHZ1Tv829C3oaaXoMYPDQ== + +file-entry-cache@^6.0.1: + version "6.0.1" + resolved "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz" + integrity sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg== + dependencies: + flat-cache "^3.0.4" + +fill-range@^7.1.1: + version "7.1.1" + resolved "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz" + integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg== + dependencies: + to-regex-range "^5.0.1" + +find-up@^4.0.0, find-up@^4.1.0: + version "4.1.0" + resolved "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz" + integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== + dependencies: + locate-path "^5.0.0" + path-exists "^4.0.0" + +find-up@^5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz" + integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== + dependencies: + locate-path "^6.0.0" + path-exists "^4.0.0" + +flat-cache@^3.0.4: + version "3.2.0" + resolved "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz" + integrity sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw== + dependencies: + flatted "^3.2.9" + keyv "^4.5.3" + rimraf "^3.0.2" + +flatted@^3.2.9: + version "3.3.3" + resolved "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz" + integrity sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg== + +follow-redirects@^1.15.6: + version "1.15.6" + resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz" + integrity sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA== + +form-data@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz" + integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + mime-types "^2.1.12" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz" + integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== + +fsevents@^2.3.2, fsevents@~2.3.2: + version "2.3.2" + resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz" + integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== + +function-bind@^1.1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz" + integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== + +gensync@^1.0.0-beta.2: + version "1.0.0-beta.2" + resolved "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz" + integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== + +get-caller-file@^2.0.5: + version "2.0.5" + resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + +get-package-type@^0.1.0: + version "0.1.0" + resolved "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz" + integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q== + +get-stream@^6.0.0: + version "6.0.1" + resolved "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz" + integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== + +glob-parent@^5.1.2, glob-parent@~5.1.2: + version "5.1.2" + resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz" + integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== + dependencies: + is-glob "^4.0.1" + +glob-parent@^6.0.2: + version "6.0.2" + resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz" + integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== + dependencies: + is-glob "^4.0.3" + +glob@^7.0.0, glob@^7.0.5, glob@^7.1.1, glob@^7.1.3, glob@^7.1.4, glob@^7.1.7: + version "7.2.3" + resolved "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz" + integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.1.1" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@^9.2.0: + version "9.3.2" + resolved "https://registry.npmjs.org/glob/-/glob-9.3.2.tgz" + integrity sha512-BTv/JhKXFEHsErMte/AnfiSv8yYOLLiyH2lTg8vn02O21zWFgHPTfxtgn1QRe7NRgggUhC8hacR2Re94svHqeA== + dependencies: + fs.realpath "^1.0.0" + minimatch "^7.4.1" + minipass "^4.2.4" + path-scurry "^1.6.1" + +globals@^11.1.0: + version "11.12.0" + resolved "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz" + integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== + +globals@^13.19.0: + version "13.24.0" + resolved "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz" + integrity sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ== + dependencies: + type-fest "^0.20.2" + +globby@^11.0.4, globby@^11.1.0: + version "11.1.0" + resolved "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz" + integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== + dependencies: + array-union "^2.1.0" + dir-glob "^3.0.1" + fast-glob "^3.2.9" + ignore "^5.2.0" + merge2 "^1.4.1" + slash "^3.0.0" + +graceful-fs@^4.2.9: + version "4.2.11" + resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz" + integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== + +graphemer@^1.4.0: + version "1.4.0" + resolved "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz" + integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag== + +handlebars@4.7.7: + version "4.7.7" + resolved "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz" + integrity sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA== + dependencies: + minimist "^1.2.5" + neo-async "^2.6.0" + source-map "^0.6.1" + wordwrap "^1.0.0" + optionalDependencies: + uglify-js "^3.1.4" + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz" + integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== + +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + +has-own-prop@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/has-own-prop/-/has-own-prop-2.0.0.tgz" + integrity sha512-Pq0h+hvsVm6dDEa8x82GnLSYHOzNDt7f0ddFa3FqcQlgzEiptPqL+XrOJNavjOzSYiYWIrgeVYYgGlLmnxwilQ== + +has@^1.0.3: + version "1.0.3" + resolved "https://registry.npmjs.org/has/-/has-1.0.3.tgz" + integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== + dependencies: + function-bind "^1.1.1" + +header-case@^2.0.4: + version "2.0.4" + resolved "https://registry.npmjs.org/header-case/-/header-case-2.0.4.tgz" + integrity sha512-H/vuk5TEEVZwrR0lp2zed9OCo1uAILMlx0JEMgC26rzyJJ3N1v6XkwHHXJQdR2doSjcGPM6OKPYoJgf0plJ11Q== + dependencies: + capital-case "^1.0.4" + tslib "^2.0.3" + +html-escaper@^2.0.0: + version "2.0.2" + resolved "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz" + integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== + +http-proxy-agent@7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.0.tgz" + integrity sha512-+ZT+iBxVUQ1asugqnD6oWoRiS25AkjNfG085dKJGtGxkdwLQrMKU5wJr2bOOFAXzKcTuqq+7fZlTMgG3SRfIYQ== + dependencies: + agent-base "^7.1.0" + debug "^4.3.4" + +https-proxy-agent@7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.0.tgz" + integrity sha512-0euwPCRyAPSgGdzD1IVN9nJYHtBhJwb6XPfbpQcYbPCwrBidX6GzxmchnaF4sfF/jPb74Ojx5g4yTg3sixlyPw== + dependencies: + agent-base "^7.0.2" + debug "4" + +human-signals@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz" + integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== + +husky@^8.0.3: + version "8.0.3" + resolved "https://registry.npmjs.org/husky/-/husky-8.0.3.tgz" + integrity sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg== + +iconv-lite@^0.4.24: + version "0.4.24" + resolved "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz" + integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== + dependencies: + safer-buffer ">= 2.1.2 < 3" + +ignore@^5.2.0: + version "5.2.4" + resolved "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz" + integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ== + +import-fresh@^3.2.1: + version "3.3.1" + resolved "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz" + integrity sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ== + dependencies: + parent-module "^1.0.0" + resolve-from "^4.0.0" + +import-local@^3.0.2: + version "3.2.0" + resolved "https://registry.npmjs.org/import-local/-/import-local-3.2.0.tgz" + integrity sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA== + dependencies: + pkg-dir "^4.2.0" + resolve-cwd "^3.0.0" + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz" + integrity sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA== + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz" + integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@^2.0.1, inherits@~2.0.1, inherits@~2.0.3, inherits@2: + version "2.0.4" + resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +interpret@^1.0.0: + version "1.4.0" + resolved "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz" + integrity sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA== + +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz" + integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg== + +is-binary-path@~2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz" + integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== + dependencies: + binary-extensions "^2.0.0" + +is-core-module@^2.9.0: + version "2.11.0" + resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz" + integrity sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw== + dependencies: + has "^1.0.3" + +is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz" + integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== + +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + +is-generator-fn@^2.0.0: + version "2.1.0" + resolved "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz" + integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== + +is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: + version "4.0.3" + resolved "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz" + integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== + dependencies: + is-extglob "^2.1.1" + +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + +is-path-inside@^3.0.3: + version "3.0.3" + resolved "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz" + integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== + +is-stream@^2.0.0: + version "2.0.1" + resolved "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz" + integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== + +isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" + integrity sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ== + +isarray@0.0.1: + version "0.0.1" + resolved "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz" + integrity sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ== + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz" + integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== + +istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: + version "3.2.2" + resolved "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz" + integrity sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg== + +istanbul-lib-instrument@^5.0.4: + version "5.2.1" + resolved "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz" + integrity sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg== + dependencies: + "@babel/core" "^7.12.3" + "@babel/parser" "^7.14.7" + "@istanbuljs/schema" "^0.1.2" + istanbul-lib-coverage "^3.2.0" + semver "^6.3.0" + +istanbul-lib-instrument@^6.0.0: + version "6.0.3" + resolved "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz" + integrity sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q== + dependencies: + "@babel/core" "^7.23.9" + "@babel/parser" "^7.23.9" + "@istanbuljs/schema" "^0.1.3" + istanbul-lib-coverage "^3.2.0" + semver "^7.5.4" + +istanbul-lib-report@^3.0.0: + version "3.0.1" + resolved "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz" + integrity sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw== + dependencies: + istanbul-lib-coverage "^3.0.0" + make-dir "^4.0.0" + supports-color "^7.1.0" + +istanbul-lib-source-maps@^4.0.0: + version "4.0.1" + resolved "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz" + integrity sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw== + dependencies: + debug "^4.1.1" + istanbul-lib-coverage "^3.0.0" + source-map "^0.6.1" + +istanbul-reports@^3.1.3: + version "3.1.7" + resolved "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz" + integrity sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g== + dependencies: + html-escaper "^2.0.0" + istanbul-lib-report "^3.0.0" + +jest-changed-files@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.7.0.tgz" + integrity sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w== + dependencies: + execa "^5.0.0" + jest-util "^29.7.0" + p-limit "^3.1.0" + +jest-circus@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-circus/-/jest-circus-29.7.0.tgz" + integrity sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw== + dependencies: + "@jest/environment" "^29.7.0" + "@jest/expect" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/node" "*" + chalk "^4.0.0" + co "^4.6.0" + dedent "^1.0.0" + is-generator-fn "^2.0.0" + jest-each "^29.7.0" + jest-matcher-utils "^29.7.0" + jest-message-util "^29.7.0" + jest-runtime "^29.7.0" + jest-snapshot "^29.7.0" + jest-util "^29.7.0" + p-limit "^3.1.0" + pretty-format "^29.7.0" + pure-rand "^6.0.0" + slash "^3.0.0" + stack-utils "^2.0.3" + +jest-cli@^29.3.1: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz" + integrity sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg== + dependencies: + "@jest/core" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/types" "^29.6.3" + chalk "^4.0.0" + create-jest "^29.7.0" + exit "^0.1.2" + import-local "^3.0.2" + jest-config "^29.7.0" + jest-util "^29.7.0" + jest-validate "^29.7.0" + yargs "^17.3.1" + +jest-config@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-config/-/jest-config-29.7.0.tgz" + integrity sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ== + dependencies: + "@babel/core" "^7.11.6" + "@jest/test-sequencer" "^29.7.0" + "@jest/types" "^29.6.3" + babel-jest "^29.7.0" + chalk "^4.0.0" + ci-info "^3.2.0" + deepmerge "^4.2.2" + glob "^7.1.3" + graceful-fs "^4.2.9" + jest-circus "^29.7.0" + jest-environment-node "^29.7.0" + jest-get-type "^29.6.3" + jest-regex-util "^29.6.3" + jest-resolve "^29.7.0" + jest-runner "^29.7.0" + jest-util "^29.7.0" + jest-validate "^29.7.0" + micromatch "^4.0.4" + parse-json "^5.2.0" + pretty-format "^29.7.0" + slash "^3.0.0" + strip-json-comments "^3.1.1" + +jest-diff@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz" + integrity sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw== + dependencies: + chalk "^4.0.0" + diff-sequences "^29.6.3" + jest-get-type "^29.6.3" + pretty-format "^29.7.0" + +jest-docblock@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.7.0.tgz" + integrity sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g== + dependencies: + detect-newline "^3.0.0" + +jest-each@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-each/-/jest-each-29.7.0.tgz" + integrity sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ== + dependencies: + "@jest/types" "^29.6.3" + chalk "^4.0.0" + jest-get-type "^29.6.3" + jest-util "^29.7.0" + pretty-format "^29.7.0" + +jest-environment-node@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz" + integrity sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw== + dependencies: + "@jest/environment" "^29.7.0" + "@jest/fake-timers" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/node" "*" + jest-mock "^29.7.0" + jest-util "^29.7.0" + +jest-get-type@^29.6.3: + version "29.6.3" + resolved "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz" + integrity sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw== + +jest-haste-map@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz" + integrity sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA== + dependencies: + "@jest/types" "^29.6.3" + "@types/graceful-fs" "^4.1.3" + "@types/node" "*" + anymatch "^3.0.3" + fb-watchman "^2.0.0" + graceful-fs "^4.2.9" + jest-regex-util "^29.6.3" + jest-util "^29.7.0" + jest-worker "^29.7.0" + micromatch "^4.0.4" + walker "^1.0.8" + optionalDependencies: + fsevents "^2.3.2" + +jest-leak-detector@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz" + integrity sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw== + dependencies: + jest-get-type "^29.6.3" + pretty-format "^29.7.0" + +jest-matcher-utils@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz" + integrity sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g== + dependencies: + chalk "^4.0.0" + jest-diff "^29.7.0" + jest-get-type "^29.6.3" + pretty-format "^29.7.0" + +jest-message-util@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz" + integrity sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w== + dependencies: + "@babel/code-frame" "^7.12.13" + "@jest/types" "^29.6.3" + "@types/stack-utils" "^2.0.0" + chalk "^4.0.0" + graceful-fs "^4.2.9" + micromatch "^4.0.4" + pretty-format "^29.7.0" + slash "^3.0.0" + stack-utils "^2.0.3" + +jest-mock@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz" + integrity sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw== + dependencies: + "@jest/types" "^29.6.3" + "@types/node" "*" + jest-util "^29.7.0" + +jest-pnp-resolver@^1.2.2: + version "1.2.3" + resolved "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz" + integrity sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w== + +jest-regex-util@^29.6.3: + version "29.6.3" + resolved "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz" + integrity sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg== + +jest-resolve-dependencies@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz" + integrity sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA== + dependencies: + jest-regex-util "^29.6.3" + jest-snapshot "^29.7.0" + +jest-resolve@*, jest-resolve@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz" + integrity sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA== + dependencies: + chalk "^4.0.0" + graceful-fs "^4.2.9" + jest-haste-map "^29.7.0" + jest-pnp-resolver "^1.2.2" + jest-util "^29.7.0" + jest-validate "^29.7.0" + resolve "^1.20.0" + resolve.exports "^2.0.0" + slash "^3.0.0" + +jest-runner@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-runner/-/jest-runner-29.7.0.tgz" + integrity sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ== + dependencies: + "@jest/console" "^29.7.0" + "@jest/environment" "^29.7.0" + "@jest/test-result" "^29.7.0" + "@jest/transform" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/node" "*" + chalk "^4.0.0" + emittery "^0.13.1" + graceful-fs "^4.2.9" + jest-docblock "^29.7.0" + jest-environment-node "^29.7.0" + jest-haste-map "^29.7.0" + jest-leak-detector "^29.7.0" + jest-message-util "^29.7.0" + jest-resolve "^29.7.0" + jest-runtime "^29.7.0" + jest-util "^29.7.0" + jest-watcher "^29.7.0" + jest-worker "^29.7.0" + p-limit "^3.1.0" + source-map-support "0.5.13" + +jest-runtime@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.7.0.tgz" + integrity sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ== + dependencies: + "@jest/environment" "^29.7.0" + "@jest/fake-timers" "^29.7.0" + "@jest/globals" "^29.7.0" + "@jest/source-map" "^29.6.3" + "@jest/test-result" "^29.7.0" + "@jest/transform" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/node" "*" + chalk "^4.0.0" + cjs-module-lexer "^1.0.0" + collect-v8-coverage "^1.0.0" + glob "^7.1.3" + graceful-fs "^4.2.9" + jest-haste-map "^29.7.0" + jest-message-util "^29.7.0" + jest-mock "^29.7.0" + jest-regex-util "^29.6.3" + jest-resolve "^29.7.0" + jest-snapshot "^29.7.0" + jest-util "^29.7.0" + slash "^3.0.0" + strip-bom "^4.0.0" + +jest-snapshot@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz" + integrity sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw== + dependencies: + "@babel/core" "^7.11.6" + "@babel/generator" "^7.7.2" + "@babel/plugin-syntax-jsx" "^7.7.2" + "@babel/plugin-syntax-typescript" "^7.7.2" + "@babel/types" "^7.3.3" + "@jest/expect-utils" "^29.7.0" + "@jest/transform" "^29.7.0" + "@jest/types" "^29.6.3" + babel-preset-current-node-syntax "^1.0.0" + chalk "^4.0.0" + expect "^29.7.0" + graceful-fs "^4.2.9" + jest-diff "^29.7.0" + jest-get-type "^29.6.3" + jest-matcher-utils "^29.7.0" + jest-message-util "^29.7.0" + jest-util "^29.7.0" + natural-compare "^1.4.0" + pretty-format "^29.7.0" + semver "^7.5.3" + +jest-summary-reporter@0.0.2: + version "0.0.2" + resolved "https://registry.npmjs.org/jest-summary-reporter/-/jest-summary-reporter-0.0.2.tgz" + integrity sha512-rZ3ThO57l+ZJCxF74cXIGQU3cV9I7bSBe1ElBp0taE3x2JghgD69bNCKt0LvpVQX5azTRHG7LmcjIpwriVnTng== + dependencies: + chalk "^2.4.1" + +jest-util@^29.0.0, jest-util@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz" + integrity sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA== + dependencies: + "@jest/types" "^29.6.3" + "@types/node" "*" + chalk "^4.0.0" + ci-info "^3.2.0" + graceful-fs "^4.2.9" + picomatch "^2.2.3" + +jest-validate@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz" + integrity sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw== + dependencies: + "@jest/types" "^29.6.3" + camelcase "^6.2.0" + chalk "^4.0.0" + jest-get-type "^29.6.3" + leven "^3.1.0" + pretty-format "^29.7.0" + +jest-watcher@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.7.0.tgz" + integrity sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g== + dependencies: + "@jest/test-result" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/node" "*" + ansi-escapes "^4.2.1" + chalk "^4.0.0" + emittery "^0.13.1" + jest-util "^29.7.0" + string-length "^4.0.1" + +jest-worker@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz" + integrity sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw== + dependencies: + "@types/node" "*" + jest-util "^29.7.0" + merge-stream "^2.0.0" + supports-color "^8.0.0" + +jest@^29.0.0, jest@29.3.1: + version "29.3.1" + resolved "https://registry.npmjs.org/jest/-/jest-29.3.1.tgz" + integrity sha512-6iWfL5DTT0Np6UYs/y5Niu7WIfNv/wRTtN5RSXt2DIEft3dx3zPuw/3WJQBCJfmEzvDiEKwoqMbGD9n49+qLSA== + dependencies: + "@jest/core" "^29.3.1" + "@jest/types" "^29.3.1" + import-local "^3.0.2" + jest-cli "^29.3.1" + +js-tokens@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + +js-yaml@^3.13.1: + version "3.14.1" + resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz" + integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + +js-yaml@^4.1.0: + version "4.1.0" + resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz" + integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== + dependencies: + argparse "^2.0.1" + +jsesc@^3.0.2: + version "3.1.0" + resolved "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz" + integrity sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA== + +json-buffer@3.0.1: + version "3.0.1" + resolved "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz" + integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== + +json-parse-even-better-errors@^2.3.0: + version "2.3.1" + resolved "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz" + integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== + +json-schema-to-typescript@15.0.4: + version "15.0.4" + resolved "https://registry.npmjs.org/json-schema-to-typescript/-/json-schema-to-typescript-15.0.4.tgz" + integrity sha512-Su9oK8DR4xCmDsLlyvadkXzX6+GGXJpbhwoLtOGArAG61dvbW4YQmSEno2y66ahpIdmLMg6YUf/QHLgiwvkrHQ== + dependencies: + "@apidevtools/json-schema-ref-parser" "^11.5.5" + "@types/json-schema" "^7.0.15" + "@types/lodash" "^4.17.7" + is-glob "^4.0.3" + js-yaml "^4.1.0" + lodash "^4.17.21" + minimist "^1.2.8" + prettier "^3.2.5" + tinyglobby "^0.2.9" + +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== + +json-stable-stringify-without-jsonify@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz" + integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== + +json5@^2.2.1, json5@^2.2.3: + version "2.2.3" + resolved "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz" + integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== + +jsonpath@1.1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/jsonpath/-/jsonpath-1.1.1.tgz" + integrity sha512-l6Cg7jRpixfbgoWgkrl77dgEj8RPvND0wMH6TwQmi9Qs4TFfS9u5cUFnbeKTwj5ga5Y3BTGGNI28k117LJ009w== + dependencies: + esprima "1.2.2" + static-eval "2.0.2" + underscore "1.12.1" + +keyv@^4.5.3: + version "4.5.4" + resolved "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz" + integrity sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw== + dependencies: + json-buffer "3.0.1" + +kleur@^3.0.3: + version "3.0.3" + resolved "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz" + integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== + +leven@^3.1.0: + version "3.1.0" + resolved "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz" + integrity sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A== + +levn@^0.4.1: + version "0.4.1" + resolved "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz" + integrity sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ== + dependencies: + prelude-ls "^1.2.1" + type-check "~0.4.0" + +levn@~0.3.0: + version "0.3.0" + resolved "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz" + integrity sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA== + dependencies: + prelude-ls "~1.1.2" + type-check "~0.3.2" + +lines-and-columns@^1.1.6: + version "1.2.4" + resolved "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz" + integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== + +locate-path@^5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz" + integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== + dependencies: + p-locate "^4.1.0" + +locate-path@^6.0.0: + version "6.0.0" + resolved "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz" + integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== + dependencies: + p-locate "^5.0.0" + +lodash.memoize@4.x: + version "4.1.2" + resolved "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz" + integrity sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag== + +lodash.merge@^4.6.2: + version "4.6.2" + resolved "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz" + integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== + +lodash@^4.17.21, lodash@4.17.21: + version "4.17.21" + resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== + +lower-case@^2.0.2: + version "2.0.2" + resolved "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz" + integrity sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg== + dependencies: + tslib "^2.0.3" + +lru-cache@^10.2.0: + version "10.4.3" + resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz" + integrity sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ== + +lru-cache@^5.1.1: + version "5.1.1" + resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz" + integrity sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w== + dependencies: + yallist "^3.0.2" + +lru-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz" + integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== + dependencies: + yallist "^4.0.0" + +make-dir@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz" + integrity sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw== + dependencies: + semver "^7.5.3" + +make-error@^1.1.1, make-error@1.x: + version "1.3.6" + resolved "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz" + integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== + +makeerror@1.0.12: + version "1.0.12" + resolved "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz" + integrity sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg== + dependencies: + tmpl "1.0.5" + +merge-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz" + integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== + +merge2@^1.3.0, merge2@^1.4.1: + version "1.4.1" + resolved "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz" + integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== + +micromatch@^4.0.4: + version "4.0.8" + resolved "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz" + integrity sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA== + dependencies: + braces "^3.0.3" + picomatch "^2.3.1" + +mime-db@1.52.0: + version "1.52.0" + resolved "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz" + integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== + +mime-types@^2.1.12: + version "2.1.35" + resolved "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz" + integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== + dependencies: + mime-db "1.52.0" + +mimic-fn@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz" + integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== + +minimatch@^3.0.3, minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: + version "3.1.2" + resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz" + integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== + dependencies: + brace-expansion "^1.1.7" + +minimatch@^7.4.1: + version "7.4.3" + resolved "https://registry.npmjs.org/minimatch/-/minimatch-7.4.3.tgz" + integrity sha512-5UB4yYusDtkRPbRiy1cqZ1IpGNcJCGlEMG17RKzPddpyiPKoCdwohbED8g4QXT0ewCt8LTkQXuljsUfQ3FKM4A== + dependencies: + brace-expansion "^2.0.1" + +minimist@^1.2.5, minimist@^1.2.6, minimist@^1.2.8: + version "1.2.8" + resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz" + integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== + +minipass@^4.2.4: + version "4.2.5" + resolved "https://registry.npmjs.org/minipass/-/minipass-4.2.5.tgz" + integrity sha512-+yQl7SX3bIT83Lhb4BVorMAHVuqsskxRdlmO9kTpyukp8vsm2Sn/fUOV9xlnG8/a5JsypJzap21lz/y3FBMJ8Q== + +"minipass@^5.0.0 || ^6.0.2 || ^7.0.0": + version "7.1.2" + resolved "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz" + integrity sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw== + +mkdirp@^0.5.3: + version "0.5.6" + resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz" + integrity sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw== + dependencies: + minimist "^1.2.6" + +mkdirp@^1.0.4: + version "1.0.4" + resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz" + integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== + +ms@2.1.2: + version "2.1.2" + resolved "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + +mute-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/mute-stream/-/mute-stream-2.0.0.tgz" + integrity sha512-WWdIxpyjEn+FhQJQQv9aQAYlHoNVdzIzUySNV1gHUPDSdZJ3yZn7pAAbQcV7B56Mvu881q9FZV+0Vx2xC44VWA== + +mylas@^2.1.9: + version "2.1.13" + resolved "https://registry.npmjs.org/mylas/-/mylas-2.1.13.tgz" + integrity sha512-+MrqnJRtxdF+xngFfUUkIMQrUUL0KsxbADUkn23Z/4ibGg192Q+z+CQyiYwvWTsYjJygmMR8+w3ZDa98Zh6ESg== + +natural-compare-lite@^1.4.0: + version "1.4.0" + resolved "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz" + integrity sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g== + +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz" + integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== + +neo-async@^2.6.0: + version "2.6.2" + resolved "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz" + integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== + +no-case@^3.0.4: + version "3.0.4" + resolved "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz" + integrity sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg== + dependencies: + lower-case "^2.0.2" + tslib "^2.0.3" + +node-int64@^0.4.0: + version "0.4.0" + resolved "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz" + integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== + +node-releases@^2.0.19: + version "2.0.19" + resolved "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz" + integrity sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw== + +noms@0.0.0: + version "0.0.0" + resolved "https://registry.npmjs.org/noms/-/noms-0.0.0.tgz" + integrity sha512-lNDU9VJaOPxUmXcLb+HQFeUgQQPtMI24Gt6hgfuMHRJgMRHMF/qZ4HJD3GDru4sSw9IQl2jPjAYnQrdIeLbwow== + dependencies: + inherits "^2.0.1" + readable-stream "~1.0.31" + +normalize-path@^3.0.0, normalize-path@~3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + +npm-run-path@^4.0.1: + version "4.0.1" + resolved "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz" + integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== + dependencies: + path-key "^3.0.0" + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.npmjs.org/once/-/once-1.4.0.tgz" + integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== + dependencies: + wrappy "1" + +onetime@^5.1.2: + version "5.1.2" + resolved "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz" + integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== + dependencies: + mimic-fn "^2.1.0" + +optionator@^0.8.1: + version "0.8.3" + resolved "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz" + integrity sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA== + dependencies: + deep-is "~0.1.3" + fast-levenshtein "~2.0.6" + levn "~0.3.0" + prelude-ls "~1.1.2" + type-check "~0.3.2" + word-wrap "~1.2.3" + +optionator@^0.9.3: + version "0.9.4" + resolved "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz" + integrity sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g== + dependencies: + deep-is "^0.1.3" + fast-levenshtein "^2.0.6" + levn "^0.4.1" + prelude-ls "^1.2.1" + type-check "^0.4.0" + word-wrap "^1.2.5" + +os-tmpdir@~1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz" + integrity sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g== + +p-limit@^2.2.0: + version "2.3.0" + resolved "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz" + integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== + dependencies: + p-try "^2.0.0" + +p-limit@^3.0.2, p-limit@^3.1.0: + version "3.1.0" + resolved "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz" + integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== + dependencies: + yocto-queue "^0.1.0" + +p-locate@^4.1.0: + version "4.1.0" + resolved "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz" + integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== + dependencies: + p-limit "^2.2.0" + +p-locate@^5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz" + integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== + dependencies: + p-limit "^3.0.2" + +p-try@^2.0.0: + version "2.2.0" + resolved "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz" + integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== + +param-case@^3.0.4: + version "3.0.4" + resolved "https://registry.npmjs.org/param-case/-/param-case-3.0.4.tgz" + integrity sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A== + dependencies: + dot-case "^3.0.4" + tslib "^2.0.3" + +parent-module@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz" + integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== + dependencies: + callsites "^3.0.0" + +parse-json@^5.2.0: + version "5.2.0" + resolved "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz" + integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== + dependencies: + "@babel/code-frame" "^7.0.0" + error-ex "^1.3.1" + json-parse-even-better-errors "^2.3.0" + lines-and-columns "^1.1.6" + +pascal-case@^3.1.2: + version "3.1.2" + resolved "https://registry.npmjs.org/pascal-case/-/pascal-case-3.1.2.tgz" + integrity sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g== + dependencies: + no-case "^3.0.4" + tslib "^2.0.3" + +path-case@^3.0.4: + version "3.0.4" + resolved "https://registry.npmjs.org/path-case/-/path-case-3.0.4.tgz" + integrity sha512-qO4qCFjXqVTrcbPt/hQfhTQ+VhFsqNKOPtytgNKkKxSoEp3XPUQ8ObFuePylOIok5gjn69ry8XiULxCwot3Wfg== + dependencies: + dot-case "^3.0.4" + tslib "^2.0.3" + +path-equal@^1.2.5: + version "1.2.5" + resolved "https://registry.npmjs.org/path-equal/-/path-equal-1.2.5.tgz" + integrity sha512-i73IctDr3F2W+bsOWDyyVm/lqsXO47aY9nsFZUjTT/aljSbkxHxxCoyZ9UUrM8jK0JVod+An+rl48RCsvWM+9g== + +path-exists@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz" + integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" + integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== + +path-key@^3.0.0, path-key@^3.1.0: + version "3.1.1" + resolved "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz" + integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== + +path-parse@^1.0.7: + version "1.0.7" + resolved "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz" + integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== + +path-scurry@^1.6.1: + version "1.11.1" + resolved "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz" + integrity sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA== + dependencies: + lru-cache "^10.2.0" + minipass "^5.0.0 || ^6.0.2 || ^7.0.0" + +path-type@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz" + integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== + +picocolors@^1.0.0, picocolors@^1.1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz" + integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA== + +picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3, picomatch@^2.3.1: + version "2.3.1" + resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz" + integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== + +"picomatch@^3 || ^4", picomatch@^4.0.2: + version "4.0.2" + resolved "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz" + integrity sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg== + +pirates@^4.0.4: + version "4.0.6" + resolved "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz" + integrity sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg== + +pkg-dir@^4.2.0: + version "4.2.0" + resolved "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz" + integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== + dependencies: + find-up "^4.0.0" + +plimit-lit@^1.2.6: + version "1.5.0" + resolved "https://registry.npmjs.org/plimit-lit/-/plimit-lit-1.5.0.tgz" + integrity sha512-Eb/MqCb1Iv/ok4m1FqIXqvUKPISufcjZ605hl3KM/n8GaX8zfhtgdLwZU3vKjuHGh2O9Rjog/bHTq8ofIShdng== + dependencies: + queue-lit "^1.5.0" + +prelude-ls@^1.2.1: + version "1.2.1" + resolved "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz" + integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== + +prelude-ls@~1.1.2: + version "1.1.2" + resolved "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz" + integrity sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w== + +prettier-linter-helpers@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz" + integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w== + dependencies: + fast-diff "^1.1.2" + +prettier@^3.2.5: + version "3.3.3" + resolved "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz" + integrity sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew== + +prettier@>=2.0.0, prettier@3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/prettier/-/prettier-3.0.0.tgz" + integrity sha512-zBf5eHpwHOGPC47h0zrPyNn+eAEIdEzfywMoYn2XPi0P44Zp0tSq64rq0xAREh4auw2cJZHo9QUob+NqCQky4g== + +pretty-format@^29.0.0, pretty-format@^29.7.0: + version "29.7.0" + resolved "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz" + integrity sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ== + dependencies: + "@jest/schemas" "^29.6.3" + ansi-styles "^5.0.0" + react-is "^18.0.0" + +process-nextick-args@~2.0.0: + version "2.0.1" + resolved "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz" + integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== + +prompts@^2.0.1: + version "2.4.2" + resolved "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz" + integrity sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q== + dependencies: + kleur "^3.0.3" + sisteransi "^1.0.5" + +proxy-from-env@^1.1.0: + version "1.1.0" + resolved "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz" + integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== + +punycode@^2.1.0: + version "2.3.1" + resolved "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz" + integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== + +pure-rand@^6.0.0: + version "6.1.0" + resolved "https://registry.npmjs.org/pure-rand/-/pure-rand-6.1.0.tgz" + integrity sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA== + +queue-lit@^1.5.0: + version "1.5.0" + resolved "https://registry.npmjs.org/queue-lit/-/queue-lit-1.5.0.tgz" + integrity sha512-IslToJ4eiCEE9xwMzq3viOO5nH8sUWUCwoElrhNMozzr9IIt2qqvB4I+uHu/zJTQVqc9R5DFwok4ijNK1pU3fA== + +queue-microtask@^1.2.2: + version "1.2.3" + resolved "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz" + integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== + +react-is@^18.0.0: + version "18.3.1" + resolved "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz" + integrity sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg== + +readable-stream@~1.0.31: + version "1.0.34" + resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz" + integrity sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg== + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "0.0.1" + string_decoder "~0.10.x" + +readable-stream@~2.3.6: + version "2.3.8" + resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz" + integrity sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA== + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.1.1" + util-deprecate "~1.0.1" + +readdirp@~3.6.0: + version "3.6.0" + resolved "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz" + integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== + dependencies: + picomatch "^2.2.1" + +rechoir@^0.6.2: + version "0.6.2" + resolved "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz" + integrity sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw== + dependencies: + resolve "^1.1.6" + +repeat-string@^1.6.1: + version "1.6.1" + resolved "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz" + integrity sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w== + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz" + integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== + +resolve-cwd@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz" + integrity sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg== + dependencies: + resolve-from "^5.0.0" + +resolve-from@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz" + integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== + +resolve-from@^5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz" + integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== + +resolve.exports@^2.0.0: + version "2.0.3" + resolved "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.3.tgz" + integrity sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A== + +resolve@^1.1.6, resolve@^1.20.0, resolve@^1.3.2: + version "1.22.1" + resolved "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz" + integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== + dependencies: + is-core-module "^2.9.0" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" + +reusify@^1.0.4: + version "1.0.4" + resolved "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz" + integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== + +rimraf@^3.0.2: + version "3.0.2" + resolved "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz" + integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== + dependencies: + glob "^7.1.3" + +rimraf@4.4.1: + version "4.4.1" + resolved "https://registry.npmjs.org/rimraf/-/rimraf-4.4.1.tgz" + integrity sha512-Gk8NlF062+T9CqNGn6h4tls3k6T1+/nXdOcSZVikNVtlRdYpA7wRJJMoXmuvOnLW844rPjdQ7JgXCYM6PPC/og== + dependencies: + glob "^9.2.0" + +run-parallel@^1.1.9: + version "1.2.0" + resolved "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz" + integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== + dependencies: + queue-microtask "^1.2.2" + +safe-buffer@~5.1.0, safe-buffer@~5.1.1: + version "5.1.2" + resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== + +safe-stable-stringify@^2.2.0: + version "2.4.3" + resolved "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.4.3.tgz" + integrity sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g== + +"safer-buffer@>= 2.1.2 < 3": + version "2.1.2" + resolved "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + +semver@^5.3.0: + version "5.7.2" + resolved "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz" + integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== + +semver@^6.3.0: + version "6.3.1" + resolved "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz" + integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== + +semver@^6.3.1: + version "6.3.1" + resolved "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz" + integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== + +semver@^7.3.7, semver@^7.5.3, semver@^7.5.4, semver@7.5.4, semver@7.x: + version "7.5.4" + resolved "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz" + integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== + dependencies: + lru-cache "^6.0.0" + +sentence-case@^3.0.4: + version "3.0.4" + resolved "https://registry.npmjs.org/sentence-case/-/sentence-case-3.0.4.tgz" + integrity sha512-8LS0JInaQMCRoQ7YUytAo/xUu5W2XnQxV2HI/6uM6U7CITS1RqPElr30V6uIqyMKM9lJGRVFy5/4CuzcixNYSg== + dependencies: + no-case "^3.0.4" + tslib "^2.0.3" + upper-case-first "^2.0.2" + +shebang-command@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz" + integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== + dependencies: + shebang-regex "^3.0.0" + +shebang-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz" + integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== + +shelljs@0.8.5: + version "0.8.5" + resolved "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz" + integrity sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow== + dependencies: + glob "^7.0.0" + interpret "^1.0.0" + rechoir "^0.6.2" + +signal-exit@^3.0.3, signal-exit@^3.0.7: + version "3.0.7" + resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz" + integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== + +signal-exit@^4.1.0: + version "4.1.0" + resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz" + integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw== + +sisteransi@^1.0.5: + version "1.0.5" + resolved "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz" + integrity sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg== + +slash@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz" + integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== + +slugify@1.6.6: + version "1.6.6" + resolved "https://registry.npmjs.org/slugify/-/slugify-1.6.6.tgz" + integrity sha512-h+z7HKHYXj6wJU+AnS/+IH8Uh9fdcX1Lrhg1/VMdf9PwoBQXFcXiAdsy2tSK0P6gKwJLXp02r90ahUCqHk9rrw== + +snake-case@^3.0.4: + version "3.0.4" + resolved "https://registry.npmjs.org/snake-case/-/snake-case-3.0.4.tgz" + integrity sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg== + dependencies: + dot-case "^3.0.4" + tslib "^2.0.3" + +socket.io-client@4.7.5: + version "4.7.5" + resolved "https://registry.npmjs.org/socket.io-client/-/socket.io-client-4.7.5.tgz" + integrity sha512-sJ/tqHOCe7Z50JCBCXrsY3I2k03iOiUe+tj1OmKeD2lXPiGH/RUCdTZFoqVyN7l1MnpIzPrGtLcijffmeouNlQ== + dependencies: + "@socket.io/component-emitter" "~3.1.0" + debug "~4.3.2" + engine.io-client "~6.5.2" + socket.io-parser "~4.2.4" + +socket.io-parser@~4.2.4: + version "4.2.4" + resolved "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.4.tgz" + integrity sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew== + dependencies: + "@socket.io/component-emitter" "~3.1.0" + debug "~4.3.1" + +source-map-support@0.5.13: + version "0.5.13" + resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz" + integrity sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: + version "0.6.1" + resolved "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz" + integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g== + +stack-utils@^2.0.3: + version "2.0.6" + resolved "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz" + integrity sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ== + dependencies: + escape-string-regexp "^2.0.0" + +static-eval@2.0.2: + version "2.0.2" + resolved "https://registry.npmjs.org/static-eval/-/static-eval-2.0.2.tgz" + integrity sha512-N/D219Hcr2bPjLxPiV+TQE++Tsmrady7TqAJugLy7Xk1EumfDWS/f5dtBbkRCGE7wKKXuYockQoj8Rm2/pVKyg== + dependencies: + escodegen "^1.8.1" + +string_decoder@~0.10.x: + version "0.10.31" + resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" + integrity sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ== + +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz" + integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== + dependencies: + safe-buffer "~5.1.0" + +string-length@^4.0.1: + version "4.0.2" + resolved "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz" + integrity sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ== + dependencies: + char-regex "^1.0.2" + strip-ansi "^6.0.0" + +string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: + version "4.2.3" + resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-bom@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz" + integrity sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w== + +strip-final-newline@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz" + integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== + +strip-json-comments@^3.1.1: + version "3.1.1" + resolved "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz" + integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== + +supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + +supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + +supports-color@^8.0.0: + version "8.1.1" + resolved "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz" + integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== + dependencies: + has-flag "^4.0.0" + +supports-preserve-symlinks-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz" + integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== + +test-exclude@^6.0.0: + version "6.0.0" + resolved "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz" + integrity sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w== + dependencies: + "@istanbuljs/schema" "^0.1.2" + glob "^7.1.4" + minimatch "^3.0.4" + +text-table@^0.2.0: + version "0.2.0" + resolved "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz" + integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw== + +through2@^2.0.1: + version "2.0.5" + resolved "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz" + integrity sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ== + dependencies: + readable-stream "~2.3.6" + xtend "~4.0.1" + +tinyglobby@^0.2.9: + version "0.2.10" + resolved "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.10.tgz" + integrity sha512-Zc+8eJlFMvgatPZTl6A9L/yht8QqdmUNtURHaKZLmKBE12hNPSrqNkUp2cs3M/UKmNVVAMFQYSjYIVHDjW5zew== + dependencies: + fdir "^6.4.2" + picomatch "^4.0.2" + +title-case@^3.0.3: + version "3.0.3" + resolved "https://registry.npmjs.org/title-case/-/title-case-3.0.3.tgz" + integrity sha512-e1zGYRvbffpcHIrnuqT0Dh+gEJtDaxDSoG4JAIpq4oDFyooziLBIiYQv0GBT4FUAnUop5uZ1hiIAj7oAF6sOCA== + dependencies: + tslib "^2.0.3" + +tmp@^0.0.33: + version "0.0.33" + resolved "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz" + integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== + dependencies: + os-tmpdir "~1.0.2" + +tmpl@1.0.5: + version "1.0.5" + resolved "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz" + integrity sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw== + +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + +ts-jest@29.0.3: + version "29.0.3" + resolved "https://registry.npmjs.org/ts-jest/-/ts-jest-29.0.3.tgz" + integrity sha512-Ibygvmuyq1qp/z3yTh9QTwVVAbFdDy/+4BtIQR2sp6baF2SJU/8CKK/hhnGIDY2L90Az2jIqTwZPnN2p+BweiQ== + dependencies: + bs-logger "0.x" + fast-json-stable-stringify "2.x" + jest-util "^29.0.0" + json5 "^2.2.1" + lodash.memoize "4.x" + make-error "1.x" + semver "7.x" + yargs-parser "^21.0.1" + +ts-node@^10.9.1, ts-node@>=9.0.0: + version "10.9.1" + resolved "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz" + integrity sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw== + dependencies: + "@cspotcode/source-map-support" "^0.8.0" + "@tsconfig/node10" "^1.0.7" + "@tsconfig/node12" "^1.0.7" + "@tsconfig/node14" "^1.0.0" + "@tsconfig/node16" "^1.0.2" + acorn "^8.4.1" + acorn-walk "^8.1.1" + arg "^4.1.0" + create-require "^1.1.0" + diff "^4.0.1" + make-error "^1.1.1" + v8-compile-cache-lib "^3.0.1" + yn "3.1.1" + +tsc-alias@1.8.6: + version "1.8.6" + resolved "https://registry.npmjs.org/tsc-alias/-/tsc-alias-1.8.6.tgz" + integrity sha512-vq+i6VpE83IeMsSJVcFN03ZBofADhr8/gIJXjxpbnTRfN/MFXy0+SBaKG2o7p95QqXBGkeG98HYz3IkOOveFbg== + dependencies: + chokidar "^3.5.3" + commander "^9.0.0" + globby "^11.0.4" + mylas "^2.1.9" + normalize-path "^3.0.0" + plimit-lit "^1.2.6" + +tslib@^1.13.0: + version "1.14.1" + resolved "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz" + integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== + +tslib@^1.8.1: + version "1.14.1" + resolved "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz" + integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== + +tslib@^2.0.3: + version "2.5.0" + resolved "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz" + integrity sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg== + +tslint-config-prettier@1.18.0: + version "1.18.0" + resolved "https://registry.npmjs.org/tslint-config-prettier/-/tslint-config-prettier-1.18.0.tgz" + integrity sha512-xPw9PgNPLG3iKRxmK7DWr+Ea/SzrvfHtjFt5LBl61gk2UBG/DB9kCXRjv+xyIU1rUtnayLeMUVJBcMX8Z17nDg== + +tslint@6.1.3: + version "6.1.3" + resolved "https://registry.npmjs.org/tslint/-/tslint-6.1.3.tgz" + integrity sha512-IbR4nkT96EQOvKE2PW/djGz8iGNeJ4rF2mBfiYaR/nvUWYKJhLwimoJKgjIFEIDibBtOevj7BqCRL4oHeWWUCg== + dependencies: + "@babel/code-frame" "^7.0.0" + builtin-modules "^1.1.1" + chalk "^2.3.0" + commander "^2.12.1" + diff "^4.0.1" + glob "^7.1.1" + js-yaml "^3.13.1" + minimatch "^3.0.4" + mkdirp "^0.5.3" + resolve "^1.3.2" + semver "^5.3.0" + tslib "^1.13.0" + tsutils "^2.29.0" + +tsutils@^2.29.0: + version "2.29.0" + resolved "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz" + integrity sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA== + dependencies: + tslib "^1.8.1" + +tsutils@^3.21.0: + version "3.21.0" + resolved "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz" + integrity sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA== + dependencies: + tslib "^1.8.1" + +type-check@^0.4.0, type-check@~0.4.0: + version "0.4.0" + resolved "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz" + integrity sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew== + dependencies: + prelude-ls "^1.2.1" + +type-check@~0.3.2: + version "0.3.2" + resolved "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz" + integrity sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg== + dependencies: + prelude-ls "~1.1.2" + +type-detect@4.0.8: + version "4.0.8" + resolved "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz" + integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== + +type-fest@^0.20.2: + version "0.20.2" + resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz" + integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== + +type-fest@^0.21.3: + version "0.21.3" + resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz" + integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== + +typescript-json-schema@0.63.0: + version "0.63.0" + resolved "https://registry.npmjs.org/typescript-json-schema/-/typescript-json-schema-0.63.0.tgz" + integrity sha512-vBfMBq4U/rZ5FIRi7u4o/YAdeRHsSabdGHogUlCPi0cYU0CGvS4Bdu8bSzyUsF+Kf5PTQUGh2TictJuQTDK6eQ== + dependencies: + "@types/json-schema" "^7.0.9" + "@types/node" "^16.9.2" + glob "^7.1.7" + path-equal "^1.2.5" + safe-stable-stringify "^2.2.0" + ts-node "^10.9.1" + typescript "~5.1.0" + yargs "^17.1.1" + +"typescript@>=2.1.0 || >=2.1.0-dev || >=2.2.0-dev || >=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev || >= 3.0.0-dev || >= 3.1.0-dev", "typescript@>=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev || >=3.0.0-dev || >= 3.1.0-dev || >= 3.2.0-dev || >= 4.0.0-dev", typescript@>=2.7, "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta", typescript@>=4.3, typescript@~5.1.0, typescript@5.1.6: + version "5.1.6" + resolved "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz" + integrity sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA== + +uglify-js@^3.1.4: + version "3.17.4" + resolved "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz" + integrity sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g== + +underscore@1.12.1: + version "1.12.1" + resolved "https://registry.npmjs.org/underscore/-/underscore-1.12.1.tgz" + integrity sha512-hEQt0+ZLDVUMhebKxL4x1BTtDY7bavVofhZ9KZ4aI26X9SRaE+Y3m83XUL1UP2jn8ynjndwCCpEHdUG+9pP1Tw== + +untildify@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz" + integrity sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw== + +update-browserslist-db@^1.1.1: + version "1.1.3" + resolved "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.3.tgz" + integrity sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw== + dependencies: + escalade "^3.2.0" + picocolors "^1.1.1" + +upper-case-first@^2.0.2: + version "2.0.2" + resolved "https://registry.npmjs.org/upper-case-first/-/upper-case-first-2.0.2.tgz" + integrity sha512-514ppYHBaKwfJRK/pNC6c/OxfGa0obSnAl106u97Ed0I625Nin96KAjttZF6ZL3e1XLtphxnqrOi9iWgm+u+bg== + dependencies: + tslib "^2.0.3" + +upper-case@^2.0.2: + version "2.0.2" + resolved "https://registry.npmjs.org/upper-case/-/upper-case-2.0.2.tgz" + integrity sha512-KgdgDGJt2TpuwBUIjgG6lzw2GWFRCW9Qkfkiv0DxqHHLYJHmtmdUIKcZd8rHgFSjopVTlw6ggzCm1b8MFQwikg== + dependencies: + tslib "^2.0.3" + +uri-js@^4.2.2: + version "4.4.1" + resolved "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz" + integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== + dependencies: + punycode "^2.1.0" + +util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" + integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== + +uuid@9.0.0: + version "9.0.0" + resolved "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz" + integrity sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg== + +v8-compile-cache-lib@^3.0.1: + version "3.0.1" + resolved "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz" + integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== + +v8-to-istanbul@^9.0.1: + version "9.3.0" + resolved "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz" + integrity sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA== + dependencies: + "@jridgewell/trace-mapping" "^0.3.12" + "@types/istanbul-lib-coverage" "^2.0.1" + convert-source-map "^2.0.0" + +validator@13.11.0: + version "13.11.0" + resolved "https://registry.npmjs.org/validator/-/validator-13.11.0.tgz" + integrity sha512-Ii+sehpSfZy+At5nPdnyMhx78fEoPDkR2XW/zimHEL3MyGJQOCQ7WeP20jPYRz7ZCpcKLB21NxuXHF3bxjStBQ== + +walker@^1.0.8: + version "1.0.8" + resolved "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz" + integrity sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ== + dependencies: + makeerror "1.0.12" + +which@^2.0.1: + version "2.0.2" + resolved "https://registry.npmjs.org/which/-/which-2.0.2.tgz" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + +word-wrap@^1.2.5, word-wrap@~1.2.3: + version "1.2.5" + resolved "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz" + integrity sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA== + +wordwrap@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz" + integrity sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q== + +wrap-ansi@^6.2.0: + version "6.2.0" + resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz" + integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +wrappy@1: + version "1.0.2" + resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" + integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== + +write-file-atomic@^4.0.2: + version "4.0.2" + resolved "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz" + integrity sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg== + dependencies: + imurmurhash "^0.1.4" + signal-exit "^3.0.7" + +ws@~8.17.1: + version "8.17.1" + resolved "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz" + integrity sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ== + +xmlhttprequest-ssl@~2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-2.0.0.tgz" + integrity sha512-QKxVRxiRACQcVuQEYFsI1hhkrMlrXHPegbbd1yn9UHOmRxY+si12nQYzri3vbzt8VdTTRviqcKxcyllFas5z2A== + +xtend@~4.0.1: + version "4.0.2" + resolved "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz" + integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== + +y18n@^5.0.5: + version "5.0.8" + resolved "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz" + integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== + +yallist@^3.0.2: + version "3.1.1" + resolved "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz" + integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== + +yallist@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz" + integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== + +yargs-parser@^20.2.2: + version "20.2.9" + resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz" + integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== + +yargs-parser@^21.0.1, yargs-parser@^21.1.1: + version "21.1.1" + resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz" + integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== + +yargs@^16.1.0: + version "16.2.0" + resolved "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz" + integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== + dependencies: + cliui "^7.0.2" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.0" + y18n "^5.0.5" + yargs-parser "^20.2.2" + +yargs@^17.1.1, yargs@^17.3.1, yargs@17.7.1: + version "17.7.1" + resolved "https://registry.npmjs.org/yargs/-/yargs-17.7.1.tgz" + integrity sha512-cwiTb08Xuv5fqF4AovYacTFNxk62th7LKJ6BL9IGUpTJrWoU7/7WdQGTP2SjKf1dUNBGzDd28p/Yfs/GI6JrLw== + dependencies: + cliui "^8.0.1" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.3" + y18n "^5.0.5" + yargs-parser "^21.1.1" + +yn@3.1.1: + version "3.1.1" + resolved "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz" + integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== + +yocto-queue@^0.1.0: + version "0.1.0" + resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz" + integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== + +yoctocolors-cjs@^2.1.2: + version "2.1.2" + resolved "https://registry.npmjs.org/yoctocolors-cjs/-/yoctocolors-cjs-2.1.2.tgz" + integrity sha512-cYVsTjKl8b+FrnidjibDWskAv7UKOfcwaVZdp/it9n1s9fU3IkgDbhdIRKCW4JDsAlECJY0ytoVPT3sK6kideA== From 3d9b82148a7151808781685d75bcb68edfa7bfd4 Mon Sep 17 00:00:00 2001 From: SudiptaTJ Date: Thu, 29 May 2025 00:45:17 +0600 Subject: [PATCH 17/73] 4372 update contexts info from terminal (#8) * # Feature (4107): P3) VSCode Extension: Add a Refresh Button to Tree View - load config now can return value - Add or Update config function added - if contexts is empty then it will not save in .config.env --- package-lock.json | 4 ++-- package.json | 2 +- src/commands/generate/index.ts | 7 ++++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index db55fd5..3127c55 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "polyapi", - "version": "0.23.16", + "version": "0.23.17", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "polyapi", - "version": "0.23.16", + "version": "0.23.17", "license": "MIT", "dependencies": { "@guanghechen/helper-string": "4.7.1", diff --git a/package.json b/package.json index 6e32fec..04ad5ff 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.23.16", + "version": "0.23.17", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { diff --git a/src/commands/generate/index.ts b/src/commands/generate/index.ts index eeeac88..833f330 100644 --- a/src/commands/generate/index.ts +++ b/src/commands/generate/index.ts @@ -393,9 +393,14 @@ const generate = async ({ try { specs = await getSpecs(contexts, names, functionIds, noTypes); + + let lastUsedContexts = ''; + if (contexts) { - addOrUpdateConfig(polyPath, 'LAST_GENERATE_CONTEXTS_USED', contexts?.join(',')); + lastUsedContexts = contexts?.join(','); } + + addOrUpdateConfig(polyPath, 'LAST_GENERATE_CONTEXTS_USED', lastUsedContexts); } catch (error) { showErrGettingSpecs(error); return; From 51748261663ac2f30f75d726aa51e65690a114d0 Mon Sep 17 00:00:00 2001 From: Aaron Goin Date: Wed, 4 Jun 2025 10:35:10 -0700 Subject: [PATCH 18/73] schema generation improvements Supporting $refs defined inline within a schema. Fixing bug where allowing additional attributes on objects by default. Fixing bug where additional attributes generated name was wrapped in extra quotes. Fixing bug where schemas without contexts would fail to be generated. Improving schema generation to remove the extra interfaces which just cause noise for users. Removing yarn.lock since we only use NPM in this repo --- package-lock.json | 4 +- package.json | 2 +- src/commands/generate/schemaTypes.ts | 133 +- src/config.ts | 2 +- test/generateTypes.spec.ts | 343 +-- yarn.lock | 4027 -------------------------- 6 files changed, 249 insertions(+), 4262 deletions(-) delete mode 100644 yarn.lock diff --git a/package-lock.json b/package-lock.json index 3127c55..6360f1c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "polyapi", - "version": "0.23.17", + "version": "0.23.18", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "polyapi", - "version": "0.23.17", + "version": "0.23.18", "license": "MIT", "dependencies": { "@guanghechen/helper-string": "4.7.1", diff --git a/package.json b/package.json index 04ad5ff..242d32b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.23.17", + "version": "0.23.18", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { diff --git a/src/commands/generate/schemaTypes.ts b/src/commands/generate/schemaTypes.ts index 892c191..c5ffa87 100644 --- a/src/commands/generate/schemaTypes.ts +++ b/src/commands/generate/schemaTypes.ts @@ -18,7 +18,10 @@ const wrapUnsafeNames = (name: string) => { return `'${name}'`; }; -const formatName = (name: string, nested = false) => wrapUnsafeNames(nested ? name : toPascalCase(name)); +const formatName = (name: string, nested = false) => + name === '[k: string]' + ? name + : wrapUnsafeNames(nested ? name : toPascalCase(name)); type JsonSchemaType = | 'string' @@ -62,6 +65,7 @@ export type JsonSchema = { nullable?: boolean; enum?: ConstValueT[]; const?: ConstValueT; + definitions?: Record; [k: string]: unknown; }; @@ -390,7 +394,7 @@ const normalizeSchema = (schema: S): S => { } if (schema.type === 'object' || (Array.isArray(schema.type) && schema.type.includes('object'))) { if (schema.additionalProperties == null) { - schema.additionalProperties = {}; + schema.additionalProperties = false; } if (!Array.isArray(schema.required)) { schema.required = []; @@ -484,22 +488,83 @@ const fillInUnresolvedSchemas = (specs: SchemaSpec[]): SchemaSpec[] => { return Array.from(schemas.values()); }; +const replaceJsonSchemasWithPolyAPISchemas = (schema: JsonSchema, mapping: Map): void => { + if (schema['$ref'] && mapping.has(schema['$ref'])) { + schema['x-poly-ref'] = { + path: mapping.get(schema['$ref']), + }; + delete schema['$ref']; + } + let toSearch = []; + if (schema.schemas) toSearch = toSearch.concat(Object.values(schema.schemas)); + if (schema.properties) toSearch = toSearch.concat(Object.values(schema.properties)); + if (schema.patternProperties) toSearch = toSearch.concat(Object.values(schema.patternProperties)); + if (schema.items) { + if (Array.isArray(schema.items)) { + toSearch = toSearch.concat(schema.items); + } else { + toSearch.push(schema.items); + } + } + if (typeof schema.additionalItems === 'object') toSearch.push(schema.items); + if (typeof schema.additionalProperties === 'object') toSearch.push(schema.additionalProperties); + if (Array.isArray(schema.allOf)) toSearch = toSearch.concat(schema.allOf); + if (Array.isArray(schema.anyOf)) toSearch = toSearch.concat(schema.anyOf); + for (const s of toSearch) replaceJsonSchemasWithPolyAPISchemas(s, mapping); +}; + +const flattenDefinitions = (specs: SchemaSpec[]): SchemaSpec[] => { + // Schemas can $refs defined with their definition being inline within the body of the schema itself + // This function will convert them into PolyAPI Schemas and `x-poly-ref`s + const flattened: SchemaSpec[] = []; + const names = new Set(); + for (const spec of specs) { + flattened.push(spec); + names.add(spec.contextName); + if (!spec.definition.definitions) continue; + // Pull out all the definitions as PolyAPI Schemas + const mapping = new Map(); + for (const [name, definition] of Object.entries(spec.definition.definitions)) { + // Make sure contextName is unique + let contextName = ''; + let i = -1; + do { + i++; + contextName = `${spec.context}${spec.context ? '.' : ''}${name}${i || ''}`; + } while (names.has(contextName)); + mapping.set(`#/definitions/${name}`, contextName); + flattened.push({ + id: '', + type: 'schema', + name: `${name}${i || ''}`, + context: spec.context, + contextName, + definition, + visibilityMetadata: { + // @ts-expect-error - it's fine + visibility: 'ENVIRONMENT', + }, + }); + } + delete spec.definition.definitions; + replaceJsonSchemasWithPolyAPISchemas(spec.definition, mapping); + } + return flattened; +}; + type SchemaRoot = { path: string; interfaceName: string; - interfaces: Record; namespaces: SchemaTree; - hasTypes: boolean; }; const printSchemaRoot = (root: SchemaRoot): string => { // print the interfaces - let result = `declare namespace schemas {${EOL}${ws(1)}interface ${root.interfaceName} {${Object.entries(root.interfaces).map(([k, v]) => `${EOL}${ws(2)}${k}: ${v};`).join('') - }${EOL}${ws(1)}}`; + let result = 'declare namespace schemas {'; // print the namespaces for (const [key, tree] of Object.entries(root.namespaces)) { const types = 'type' in tree && tree.type === 'schema' - ? printSchemaAsType(tree as JsonSchema, key, 1) + ? printSchemaAsType(tree.definition as JsonSchema, key, 1) : printSchemaTreeAsTypes(tree as SchemaTree, toPascalCase(key), 1); result = `${result}${EOL}${types}`; } @@ -509,51 +574,27 @@ const printSchemaRoot = (root: SchemaRoot): string => { }; const buildSchemaTree = (specs: SchemaSpec[]): SchemaRoot[] => { - const schemas: Record = { - default: { - path: 'default', - interfaceName: 'Schemas', - interfaces: {}, - namespaces: {}, - hasTypes: false, - }, - }; + const schemas: Record = {}; for (const spec of specs) { - if (!spec.context) { - schemas.default.interfaces[spec.name] = spec.name; - schemas.default.namespaces[spec.name] = spec; - schemas.default.hasTypes = true; - continue; - } - const specInterfaceName = toPascalCase(spec.context); - const contextParts = spec.context.split('.'); - const last = contextParts.length - 1; - for (let i = 0; i <= last; i++) { - const name = contextParts[i]; - const interfaceName = i === last ? specInterfaceName : toPascalCase(contextParts[i]); - const path = contextParts.slice(0, i + 1).join('.'); - const parent = i ? contextParts.slice(0, i).join('.') : 'default'; - if (schemas[path]) continue; - schemas[path] = { - path, - interfaceName, - interfaces: {}, - namespaces: {}, - hasTypes: false, - }; - schemas[parent].interfaces[name] = interfaceName; - set(schemas[parent].namespaces, path, {}); - } - set(schemas[spec.context].namespaces, spec.contextName, spec); - schemas[spec.context].interfaces[spec.name] = spec.contextName.split('.').map(v => toPascalCase(v)).join('.'); - schemas[spec.context].hasTypes = true; + const context = spec.context || 'default'; + const interfaceName = spec.context ? toPascalCase(spec.context) : 'Schemas'; + schemas[context] = schemas[context] || { + path: context, + interfaceName, + namespaces: {}, + }; + set(schemas[context].namespaces, spec.contextName, spec); } return Array.from(Object.values(schemas)); }; const printSchemaSpecs = (specs: SchemaSpec[]): Record => { - // first normalize the schemas and fill in unresolved ones - const normalized = fillInUnresolvedSchemas(specs.map(schema => normalizeSchema(schema))); + // first normalize the schemas, flatten inline schema definitions and fill in unresolved ones + const normalized = fillInUnresolvedSchemas( + flattenDefinitions( + specs.map(schema => normalizeSchema(schema)), + ), + ); // then build schema trees const trees = buildSchemaTree(normalized); // then print all the schema types as strings ready to be saved to disk diff --git a/src/config.ts b/src/config.ts index 5614dd6..54dc357 100644 --- a/src/config.ts +++ b/src/config.ts @@ -37,4 +37,4 @@ export const addOrUpdateConfig = (polyPath: string, key: string, value: string) existingConfig[key] = value; saveConfig(polyPath, existingConfig); -}; \ No newline at end of file +}; diff --git a/test/generateTypes.spec.ts b/test/generateTypes.spec.ts index e520f82..6ab2a95 100644 --- a/test/generateTypes.spec.ts +++ b/test/generateTypes.spec.ts @@ -74,7 +74,7 @@ describe('Generate types from specs', () => { }); }); - test.only('formatName', () => { + test('formatName', () => { expect(formatName('Abc')).toBe('Abc'); expect(formatName('Abc', true)).toBe('Abc'); expect(formatName('AbcDef')).toBe('AbcDef'); @@ -1558,43 +1558,9 @@ describe('Generate types from specs', () => { const specs = [specA, specB, specC, specD, specE] as SchemaSpec[]; const expected = [ - { - path: 'default', - interfaceName: 'Schemas', - interfaces: { - aaron: 'Aaron', - foo: 'Foo', - Goody: 'Goody', - }, - namespaces: { - aaron: {}, - foo: {}, - Goody: specE - }, - hasTypes: true, - }, - { - path: 'aaron', - interfaceName: 'Aaron', - interfaces: { - testing: 'AaronTesting', - AnotherThing: 'Aaron.AnotherThing', - }, - namespaces: { - aaron: { - testing: {}, - AnotherThing: specC - } - }, - hasTypes: true, - }, { path: 'aaron.testing', interfaceName: 'AaronTesting', - interfaces: { - ProjectApiKeyDeleteResponse: 'Aaron.Testing.ProjectApiKeyDeleteResponse', - SomethingElse: 'Aaron.Testing.SomethingElse', - }, namespaces: { aaron: { testing: { @@ -1603,25 +1569,19 @@ describe('Generate types from specs', () => { } } }, - hasTypes: true, }, { - path: 'foo', - interfaceName: 'Foo', - interfaces: { bar: 'FooBar' }, + path: 'aaron', + interfaceName: 'Aaron', namespaces: { - foo: { - bar: {} + aaron: { + AnotherThing: specC } }, - hasTypes: false, }, { path: 'foo.bar', interfaceName: 'FooBar', - interfaces: { - Baz: 'Foo.Bar.Baz' - }, namespaces: { foo: { bar: { @@ -1629,7 +1589,13 @@ describe('Generate types from specs', () => { } } }, - hasTypes: true, + }, + { + path: 'default', + interfaceName: 'Schemas', + namespaces: { + Goody: specE + }, }, ] // Stringify and using jest's `toEqual` to make sure that we match strictly @@ -1683,48 +1649,97 @@ describe('Generate types from specs', () => { expect(result['index.d.ts']).toEqual( multiline( - '/// ', - '/// ', '/// ', ) ); - expect(result['default.d.ts']).toEqual( + expect(result['aaron.testing.d.ts']).toEqual( multiline( 'declare namespace schemas {', - ' interface Schemas {', - ' aaron: Aaron;', - ' }', ' namespace Aaron {', + ' namespace Testing {', + ' type ProjectApiKeyDeleteResponse = {', + ' object: \'organization.project.api_key.deleted\';', + ' id: string;', + ' deleted: boolean;', + ' };', + ' }', ' }', '}', ) ); - expect(result['aaron.d.ts']).toEqual( + }); + + test('single spec with nested definitions', () => { + const specs: SchemaSpec[] = [ + { + 'id': 'ad5edb98-9eeb-4bb5-8122-32f9a6f6b512', + 'name': 'ProjectApiKeyDeleteResponse', + 'context': 'aaron.testing', + 'contextName': 'aaron.testing.ProjectApiKeyDeleteResponse', + 'type': 'schema', + 'definition': { + 'type': 'object', + 'properties': { + 'object': { + '$ref': '#/definitions/ProjectApiKeyDeleteResponse' + }, + 'id': { + '$ref': '#/definitions/Id' + }, + 'deleted': { + '$ref': '#/definitions/Deleted' + } + }, + 'required': [ + 'object', + 'id', + 'deleted' + ], + 'additionalProperties': false, + '$schema': 'http://json-schema.org/draft-06/schema#', + 'title': 'Schema', + 'definitions': { + 'ProjectApiKeyDeleteResponse': { + 'type': 'string', + 'enum': [ + 'organization.project.api_key.deleted' + ] + }, + 'Id': { + 'type': 'string' + }, + 'Deleted': { + 'type': 'boolean' + } + } + }, + 'visibilityMetadata': { + 'visibility': 'ENVIRONMENT' + }, + 'unresolvedPolySchemaRefs': [] + } as SchemaSpec + ]; + + const result = printSchemaSpecs(specs); + + expect(result['index.d.ts']).toEqual( multiline( - 'declare namespace schemas {', - ' interface Aaron {', - ' testing: AaronTesting;', - ' }', - ' namespace Aaron {', - ' namespace Testing {', - ' }', - ' }', - '}', + '/// ', ) ); expect(result['aaron.testing.d.ts']).toEqual( multiline( 'declare namespace schemas {', - ' interface AaronTesting {', - ' ProjectApiKeyDeleteResponse: Aaron.Testing.ProjectApiKeyDeleteResponse;', - ' }', ' namespace Aaron {', ' namespace Testing {', ' type ProjectApiKeyDeleteResponse = {', - ' object: \'organization.project.api_key.deleted\';', - ' id: string;', - ' deleted: boolean;', + ' object: Aaron.Testing.ProjectApiKeyDeleteResponse1;', + ' id: Aaron.Testing.Id;', + ' deleted: Aaron.Testing.Deleted;', ' };', + ' type ProjectApiKeyDeleteResponse1 = \'organization.project.api_key.deleted\';', + ' type Id = string;', + ' type Deleted = boolean;', ' }', ' }', '}', @@ -1732,6 +1747,66 @@ describe('Generate types from specs', () => { ); }); + test('single spec with no context', () => { + const specs: SchemaSpec[] = [ + { + 'id': 'ad5edb98-9eeb-4bb5-8122-32f9a6f6b512', + 'name': 'ProjectApiKeyDeleteResponse', + 'context': '', + 'contextName': 'ProjectApiKeyDeleteResponse', + 'type': 'schema', + 'definition': { + 'type': 'object', + 'properties': { + 'object': { + 'type': 'string', + 'enum': [ + 'organization.project.api_key.deleted' + ] + }, + 'id': { + 'type': 'string' + }, + 'deleted': { + 'type': 'boolean' + } + }, + 'required': [ + 'object', + 'id', + 'deleted' + ], + 'additionalProperties': false, + '$schema': 'http://json-schema.org/draft-06/schema#', + 'title': 'Schema' + }, + 'visibilityMetadata': { + 'visibility': 'ENVIRONMENT' + }, + 'unresolvedPolySchemaRefs': [] + } as SchemaSpec + ]; + + const result = printSchemaSpecs(specs); + + expect(result['index.d.ts']).toEqual( + multiline( + '/// ', + ) + ); + expect(result['default.d.ts']).toEqual( + multiline( + 'declare namespace schemas {', + ' type ProjectApiKeyDeleteResponse = {', + ' object: \'organization.project.api_key.deleted\';', + ' id: string;', + ' deleted: boolean;', + ' };', + '}', + ) + ); + }); + test('multiple specs', () => { const specA = { "id": "ad5edb98-9eeb-4bb5-8122-32f9a6f6b512", @@ -1832,39 +1907,23 @@ describe('Generate types from specs', () => { expect(result['index.d.ts']).toEqual( multiline( - '/// ', - '/// ', '/// ', - '/// ', + '/// ', '/// ', + '/// ', ) ); expect(result['default.d.ts']).toEqual( multiline( 'declare namespace schemas {', - ' interface Schemas {', - ' aaron: Aaron;', - ' foo: Foo;', - ' Goody: Goody;', - ' }', - ' namespace Aaron {', - ' }', - ' namespace Foo {', - ' }', - ' type Goody = unknown;', + ' type Goody = number;', '}', ) ); expect(result['aaron.d.ts']).toEqual( multiline( 'declare namespace schemas {', - ' interface Aaron {', - ' testing: AaronTesting;', - ' AnotherThing: Aaron.AnotherThing;', - ' }', ' namespace Aaron {', - ' namespace Testing {', - ' }', ' type AnotherThing = number;', ' }', '}', @@ -1873,10 +1932,6 @@ describe('Generate types from specs', () => { expect(result['aaron.testing.d.ts']).toEqual( multiline( 'declare namespace schemas {', - ' interface AaronTesting {', - ' ProjectApiKeyDeleteResponse: Aaron.Testing.ProjectApiKeyDeleteResponse;', - ' SomethingElse: Aaron.Testing.SomethingElse;', - ' }', ' namespace Aaron {', ' namespace Testing {', ' type ProjectApiKeyDeleteResponse = {', @@ -1890,6 +1945,18 @@ describe('Generate types from specs', () => { '}', ) ); + + expect(result['foo.bar.d.ts']).toEqual( + multiline( + 'declare namespace schemas {', + ' namespace Foo {', + ' namespace Bar {', + ' type Baz = number;', + ' }', + ' }', + '}', + ) + ); }); test('multiple specs with poly refs', () => { @@ -1950,52 +2017,14 @@ describe('Generate types from specs', () => { expect(result['index.d.ts']).toEqual( multiline( - '/// ', - '/// ', '/// ', - '/// ', '/// ', - '/// ', - '/// ', '/// ', ) ); - expect(result['default.d.ts']).toEqual( - multiline( - 'declare namespace schemas {', - ' interface Schemas {', - ' aaron: Aaron;', - ' other: Other;', - ' polyapi: Polyapi;', - ' }', - ' namespace Aaron {', - ' }', - ' namespace Other {', - ' }', - ' namespace Polyapi {', - ' }', - '}', - ) - ); - expect(result['aaron.d.ts']).toEqual( - multiline( - 'declare namespace schemas {', - ' interface Aaron {', - ' testing: AaronTesting;', - ' }', - ' namespace Aaron {', - ' namespace Testing {', - ' }', - ' }', - '}', - ) - ); expect(result['aaron.testing.d.ts']).toEqual( multiline( 'declare namespace schemas {', - ' interface AaronTesting {', - ' ProjectApiKeyDeleteResponse: Aaron.Testing.ProjectApiKeyDeleteResponse;', - ' }', ' namespace Aaron {', ' namespace Testing {', ' type ProjectApiKeyDeleteResponse = {', @@ -2010,40 +2039,9 @@ describe('Generate types from specs', () => { '}', ) ); - expect(result['polyapi.d.ts']).toEqual( - multiline( - 'declare namespace schemas {', - ' interface Polyapi {', - ' adyen: Adyen;', - ' }', - ' namespace Polyapi {', - ' namespace Adyen {', - ' }', - ' }', - '}', - ) - ); - expect(result['polyapi.adyen.d.ts']).toEqual( - multiline( - 'declare namespace schemas {', - ' interface Adyen {', - ' capital: PolyapiAdyenCapital;', - ' }', - ' namespace Polyapi {', - ' namespace Adyen {', - ' namespace Capital {', - ' }', - ' }', - ' }', - '}', - ) - ); expect(result['polyapi.adyen.capital.d.ts']).toEqual( multiline( 'declare namespace schemas {', - ' interface PolyapiAdyenCapital {', - ' OtherOptions: Polyapi.Adyen.Capital.OtherOptions;', - ' }', ' namespace Polyapi {', ' namespace Adyen {', ' namespace Capital {', @@ -2057,25 +2055,9 @@ describe('Generate types from specs', () => { '}', ) ); - expect(result['other.d.ts']).toEqual( - multiline( - 'declare namespace schemas {', - ' interface Other {', - ' foober: OtherFoober;', - ' }', - ' namespace Other {', - ' namespace Foober {', - ' }', - ' }', - '}', - ) - ); expect(result['other.foober.d.ts']).toEqual( multiline( 'declare namespace schemas {', - ' interface OtherFoober {', - ' Headers: Other.Foober.Headers;', - ' }', ' namespace Other {', ' namespace Foober {', ' /**', @@ -2274,21 +2256,12 @@ describe('Generate types from specs', () => { expect(result['index.d.ts']).toEqual( multiline( - '/// ', - '/// ', '/// ', ) ); expect(result['adyen.capital.d.ts']).toEqual( multiline( 'declare namespace schemas {', - ' interface AdyenCapital {', - ' BankAccountIdentification: Adyen.Capital.BankAccountIdentification;', - ' IbanAccountIdentification: Adyen.Capital.IbanAccountIdentification;', - ' NumberAndBicAccountIdentification: Adyen.Capital.NumberAndBicAccountIdentification;', - ' AdditionalBankIdentification: Adyen.Capital.AdditionalBankIdentification;', - ' AULocalAccountIdentification: Adyen.Capital.AuLocalAccountIdentification;', - ' }', ' namespace Adyen {', ' namespace Capital {', ' type BankAccountIdentification = {', diff --git a/yarn.lock b/yarn.lock deleted file mode 100644 index 6a20968..0000000 --- a/yarn.lock +++ /dev/null @@ -1,4027 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@ampproject/remapping@^2.2.0": - version "2.3.0" - resolved "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz" - integrity sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw== - dependencies: - "@jridgewell/gen-mapping" "^0.3.5" - "@jridgewell/trace-mapping" "^0.3.24" - -"@apidevtools/json-schema-ref-parser@^11.5.5": - version "11.7.0" - resolved "https://registry.npmjs.org/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-11.7.0.tgz" - integrity sha512-pRrmXMCwnmrkS3MLgAIW5dXRzeTv6GLjkjb4HmxNnvAKXN1Nfzp4KmGADBQvlVUcqi+a5D+hfGDLLnd5NnYxog== - dependencies: - "@jsdevtools/ono" "^7.1.3" - "@types/json-schema" "^7.0.15" - js-yaml "^4.1.0" - -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.26.2": - version "7.26.2" - resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz" - integrity sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ== - dependencies: - "@babel/helper-validator-identifier" "^7.25.9" - js-tokens "^4.0.0" - picocolors "^1.0.0" - -"@babel/compat-data@^7.26.5": - version "7.26.8" - resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.8.tgz" - integrity sha512-oH5UPLMWR3L2wEFLnFJ1TZXqHufiTKAiLfqw5zkhS4dKXLJ10yVztfil/twG8EDTA4F/tvVNw9nOl4ZMslB8rQ== - -"@babel/core@^7.0.0", "@babel/core@^7.0.0-0", "@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.23.9", "@babel/core@^7.8.0", "@babel/core@>=7.0.0-beta.0 <8": - version "7.26.10" - resolved "https://registry.npmjs.org/@babel/core/-/core-7.26.10.tgz" - integrity sha512-vMqyb7XCDMPvJFFOaT9kxtiRh42GwlZEg1/uIgtZshS5a/8OaduUfCi7kynKgc3Tw/6Uo2D+db9qBttghhmxwQ== - dependencies: - "@ampproject/remapping" "^2.2.0" - "@babel/code-frame" "^7.26.2" - "@babel/generator" "^7.26.10" - "@babel/helper-compilation-targets" "^7.26.5" - "@babel/helper-module-transforms" "^7.26.0" - "@babel/helpers" "^7.26.10" - "@babel/parser" "^7.26.10" - "@babel/template" "^7.26.9" - "@babel/traverse" "^7.26.10" - "@babel/types" "^7.26.10" - convert-source-map "^2.0.0" - debug "^4.1.0" - gensync "^1.0.0-beta.2" - json5 "^2.2.3" - semver "^6.3.1" - -"@babel/generator@^7.26.10", "@babel/generator@^7.7.2": - version "7.26.10" - resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.26.10.tgz" - integrity sha512-rRHT8siFIXQrAYOYqZQVsAr8vJ+cBNqcVAY6m5V8/4QqzaPl+zDBe6cLEPRDuNOUf3ww8RfJVlOyQMoSI+5Ang== - dependencies: - "@babel/parser" "^7.26.10" - "@babel/types" "^7.26.10" - "@jridgewell/gen-mapping" "^0.3.5" - "@jridgewell/trace-mapping" "^0.3.25" - jsesc "^3.0.2" - -"@babel/helper-compilation-targets@^7.26.5": - version "7.26.5" - resolved "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.26.5.tgz" - integrity sha512-IXuyn5EkouFJscIDuFF5EsiSolseme1s0CZB+QxVugqJLYmKdxI1VfIBOst0SUu4rnk2Z7kqTwmoO1lp3HIfnA== - dependencies: - "@babel/compat-data" "^7.26.5" - "@babel/helper-validator-option" "^7.25.9" - browserslist "^4.24.0" - lru-cache "^5.1.1" - semver "^6.3.1" - -"@babel/helper-module-imports@^7.25.9": - version "7.25.9" - resolved "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz" - integrity sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw== - dependencies: - "@babel/traverse" "^7.25.9" - "@babel/types" "^7.25.9" - -"@babel/helper-module-transforms@^7.26.0": - version "7.26.0" - resolved "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.26.0.tgz" - integrity sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw== - dependencies: - "@babel/helper-module-imports" "^7.25.9" - "@babel/helper-validator-identifier" "^7.25.9" - "@babel/traverse" "^7.25.9" - -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.25.9", "@babel/helper-plugin-utils@^7.8.0": - version "7.26.5" - resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.26.5.tgz" - integrity sha512-RS+jZcRdZdRFzMyr+wcsaqOmld1/EqTghfaBGQQd/WnRdzdlvSZ//kF7U8VQTxf1ynZ4cjUcYgjVGx13ewNPMg== - -"@babel/helper-string-parser@^7.25.9": - version "7.25.9" - resolved "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz" - integrity sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA== - -"@babel/helper-validator-identifier@^7.25.9": - version "7.25.9" - resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz" - integrity sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ== - -"@babel/helper-validator-option@^7.25.9": - version "7.25.9" - resolved "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz" - integrity sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw== - -"@babel/helpers@^7.26.10": - version "7.26.10" - resolved "https://registry.npmjs.org/@babel/helpers/-/helpers-7.26.10.tgz" - integrity sha512-UPYc3SauzZ3JGgj87GgZ89JVdC5dj0AoetR5Bw6wj4niittNyFh6+eOGonYvJ1ao6B8lEa3Q3klS7ADZ53bc5g== - dependencies: - "@babel/template" "^7.26.9" - "@babel/types" "^7.26.10" - -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.23.9", "@babel/parser@^7.26.10", "@babel/parser@^7.26.9": - version "7.26.10" - resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.26.10.tgz" - integrity sha512-6aQR2zGE/QFi8JpDLjUZEPYOs7+mhKXm86VaKFiLP35JQwQb6bwUE+XbvkH0EptsYhbNBSUGaUBLKqxH1xSgsA== - dependencies: - "@babel/types" "^7.26.10" - -"@babel/plugin-syntax-async-generators@^7.8.4": - version "7.8.4" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz" - integrity sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-bigint@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz" - integrity sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-class-properties@^7.12.13": - version "7.12.13" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz" - integrity sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA== - dependencies: - "@babel/helper-plugin-utils" "^7.12.13" - -"@babel/plugin-syntax-class-static-block@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz" - integrity sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-syntax-import-attributes@^7.24.7": - version "7.26.0" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.26.0.tgz" - integrity sha512-e2dttdsJ1ZTpi3B9UYGLw41hifAubg19AtCu/2I/F1QNVclOBr1dYpTdmdyZ84Xiz43BS/tCUkMAZNLv12Pi+A== - dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - -"@babel/plugin-syntax-import-meta@^7.10.4": - version "7.10.4" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz" - integrity sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g== - dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - -"@babel/plugin-syntax-json-strings@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz" - integrity sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-jsx@^7.7.2": - version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.25.9.tgz" - integrity sha512-ld6oezHQMZsZfp6pWtbjaNDF2tiiCYYDqQszHt5VV437lewP9aSi2Of99CK0D0XB21k7FLgnLcmQKyKzynfeAA== - dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - -"@babel/plugin-syntax-logical-assignment-operators@^7.10.4": - version "7.10.4" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz" - integrity sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig== - dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - -"@babel/plugin-syntax-nullish-coalescing-operator@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz" - integrity sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-numeric-separator@^7.10.4": - version "7.10.4" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz" - integrity sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug== - dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - -"@babel/plugin-syntax-object-rest-spread@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz" - integrity sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-optional-catch-binding@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz" - integrity sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-optional-chaining@^7.8.3": - version "7.8.3" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz" - integrity sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-private-property-in-object@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz" - integrity sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-syntax-top-level-await@^7.14.5": - version "7.14.5" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz" - integrity sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-syntax-typescript@^7.7.2": - version "7.25.9" - resolved "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.25.9.tgz" - integrity sha512-hjMgRy5hb8uJJjUcdWunWVcoi9bGpJp8p5Ol1229PoN6aytsLwNMgmdftO23wnCLMfVmTwZDWMPNq/D1SY60JQ== - dependencies: - "@babel/helper-plugin-utils" "^7.25.9" - -"@babel/template@^7.26.9", "@babel/template@^7.3.3": - version "7.26.9" - resolved "https://registry.npmjs.org/@babel/template/-/template-7.26.9.tgz" - integrity sha512-qyRplbeIpNZhmzOysF/wFMuP9sctmh2cFzRAZOn1YapxBsE1i9bJIY586R/WBLfLcmcBlM8ROBiQURnnNy+zfA== - dependencies: - "@babel/code-frame" "^7.26.2" - "@babel/parser" "^7.26.9" - "@babel/types" "^7.26.9" - -"@babel/traverse@^7.25.9", "@babel/traverse@^7.26.10": - version "7.26.10" - resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.26.10.tgz" - integrity sha512-k8NuDrxr0WrPH5Aupqb2LCVURP/S0vBEn5mK6iH+GIYob66U5EtoZvcdudR2jQ4cmTwhEwW1DLB+Yyas9zjF6A== - dependencies: - "@babel/code-frame" "^7.26.2" - "@babel/generator" "^7.26.10" - "@babel/parser" "^7.26.10" - "@babel/template" "^7.26.9" - "@babel/types" "^7.26.10" - debug "^4.3.1" - globals "^11.1.0" - -"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.25.9", "@babel/types@^7.26.10", "@babel/types@^7.26.9", "@babel/types@^7.3.3": - version "7.26.10" - resolved "https://registry.npmjs.org/@babel/types/-/types-7.26.10.tgz" - integrity sha512-emqcG3vHrpxUKTrxcblR36dcrcoRDvKmnL/dCL6ZsHaShW80qxCAcNhzQZrpeM765VzEos+xOi4s+r4IXzTwdQ== - dependencies: - "@babel/helper-string-parser" "^7.25.9" - "@babel/helper-validator-identifier" "^7.25.9" - -"@bcoe/v8-coverage@^0.2.3": - version "0.2.3" - resolved "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz" - integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== - -"@cspotcode/source-map-support@^0.8.0": - version "0.8.1" - resolved "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz" - integrity sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw== - dependencies: - "@jridgewell/trace-mapping" "0.3.9" - -"@eslint-community/eslint-utils@^4.2.0": - version "4.7.0" - resolved "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.7.0.tgz" - integrity sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw== - dependencies: - eslint-visitor-keys "^3.4.3" - -"@eslint-community/regexpp@^4.4.0", "@eslint-community/regexpp@^4.6.1": - version "4.12.1" - resolved "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz" - integrity sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ== - -"@eslint/eslintrc@^2.1.4": - version "2.1.4" - resolved "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz" - integrity sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ== - dependencies: - ajv "^6.12.4" - debug "^4.3.2" - espree "^9.6.0" - globals "^13.19.0" - ignore "^5.2.0" - import-fresh "^3.2.1" - js-yaml "^4.1.0" - minimatch "^3.1.2" - strip-json-comments "^3.1.1" - -"@eslint/js@8.57.1": - version "8.57.1" - resolved "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz" - integrity sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q== - -"@guanghechen/helper-string@4.7.1": - version "4.7.1" - resolved "https://registry.npmjs.org/@guanghechen/helper-string/-/helper-string-4.7.1.tgz" - integrity sha512-D5kKFnqgk+6vVTaGw3QnpMaXxaJrFvmN/6c5Wt6htfyxUyYBl3NR++dh/ugAMRjMex5u6BS/c+biIrGYUtyyvA== - dependencies: - change-case "^4.1.2" - lower-case "^2.0.2" - title-case "^3.0.3" - upper-case "^2.0.2" - -"@humanwhocodes/config-array@^0.13.0": - version "0.13.0" - resolved "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz" - integrity sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw== - dependencies: - "@humanwhocodes/object-schema" "^2.0.3" - debug "^4.3.1" - minimatch "^3.0.5" - -"@humanwhocodes/module-importer@^1.0.1": - version "1.0.1" - resolved "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz" - integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== - -"@humanwhocodes/object-schema@^2.0.3": - version "2.0.3" - resolved "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz" - integrity sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA== - -"@inquirer/checkbox@^4.0.1": - version "4.0.1" - resolved "https://registry.npmjs.org/@inquirer/checkbox/-/checkbox-4.0.1.tgz" - integrity sha512-ehJjmNPdguajc1hStvjN7DJNVjwG5LC1mgGMGFjCmdkn2fxB2GtULftMnlaqNmvMdPpqdaSoOFpl86VkLtG4pQ== - dependencies: - "@inquirer/core" "^10.0.1" - "@inquirer/figures" "^1.0.7" - "@inquirer/type" "^3.0.0" - ansi-escapes "^4.3.2" - yoctocolors-cjs "^2.1.2" - -"@inquirer/confirm@^5.0.1": - version "5.0.1" - resolved "https://registry.npmjs.org/@inquirer/confirm/-/confirm-5.0.1.tgz" - integrity sha512-6ycMm7k7NUApiMGfVc32yIPp28iPKxhGRMqoNDiUjq2RyTAkbs5Fx0TdzBqhabcKvniDdAAvHCmsRjnNfTsogw== - dependencies: - "@inquirer/core" "^10.0.1" - "@inquirer/type" "^3.0.0" - -"@inquirer/core@^10.0.1": - version "10.0.1" - resolved "https://registry.npmjs.org/@inquirer/core/-/core-10.0.1.tgz" - integrity sha512-KKTgjViBQUi3AAssqjUFMnMO3CM3qwCHvePV9EW+zTKGKafFGFF01sc1yOIYjLJ7QU52G/FbzKc+c01WLzXmVQ== - dependencies: - "@inquirer/figures" "^1.0.7" - "@inquirer/type" "^3.0.0" - ansi-escapes "^4.3.2" - cli-width "^4.1.0" - mute-stream "^2.0.0" - signal-exit "^4.1.0" - strip-ansi "^6.0.1" - wrap-ansi "^6.2.0" - yoctocolors-cjs "^2.1.2" - -"@inquirer/editor@^4.0.1": - version "4.0.1" - resolved "https://registry.npmjs.org/@inquirer/editor/-/editor-4.0.1.tgz" - integrity sha512-qAHHJ6hs343eNtCKgV2wV5CImFxYG8J1pl/YCeI5w9VoW7QpulRUU26+4NsMhjR6zDRjKBsH/rRjCIcaAOHsrg== - dependencies: - "@inquirer/core" "^10.0.1" - "@inquirer/type" "^3.0.0" - external-editor "^3.1.0" - -"@inquirer/expand@^4.0.1": - version "4.0.1" - resolved "https://registry.npmjs.org/@inquirer/expand/-/expand-4.0.1.tgz" - integrity sha512-9anjpdc802YInXekwePsa5LWySzVMHbhVS6v6n5IJxrl8w09mODOeP69wZ1d0WrOvot2buQSmYp4lW/pq8y+zQ== - dependencies: - "@inquirer/core" "^10.0.1" - "@inquirer/type" "^3.0.0" - yoctocolors-cjs "^2.1.2" - -"@inquirer/figures@^1.0.7": - version "1.0.7" - resolved "https://registry.npmjs.org/@inquirer/figures/-/figures-1.0.7.tgz" - integrity sha512-m+Trk77mp54Zma6xLkLuY+mvanPxlE4A7yNKs2HBiyZ4UkVs28Mv5c/pgWrHeInx+USHeX/WEPzjrWrcJiQgjw== - -"@inquirer/input@^4.0.1": - version "4.0.1" - resolved "https://registry.npmjs.org/@inquirer/input/-/input-4.0.1.tgz" - integrity sha512-m+SliZ2m43cDRIpAdQxfv5QOeAQCuhS8TGLvtzEP1An4IH1kBES4RLMRgE/fC+z29aN8qYG8Tq/eXQQKTYwqAg== - dependencies: - "@inquirer/core" "^10.0.1" - "@inquirer/type" "^3.0.0" - -"@inquirer/number@^3.0.1": - version "3.0.1" - resolved "https://registry.npmjs.org/@inquirer/number/-/number-3.0.1.tgz" - integrity sha512-gF3erqfm0snpwBjbyKXUUe17QJ7ebm49btXApajrM0rgCCoYX0o9W5NCuYNae87iPxaIJVjtuoQ42DX32IdbMA== - dependencies: - "@inquirer/core" "^10.0.1" - "@inquirer/type" "^3.0.0" - -"@inquirer/password@^4.0.1": - version "4.0.1" - resolved "https://registry.npmjs.org/@inquirer/password/-/password-4.0.1.tgz" - integrity sha512-D7zUuX4l4ZpL3D7/SWu9ibijP09jigwHi/gfUHLx5GMS5oXzuMfPV2xPMG1tskco4enTx70HA0VtMXecerpvbg== - dependencies: - "@inquirer/core" "^10.0.1" - "@inquirer/type" "^3.0.0" - ansi-escapes "^4.3.2" - -"@inquirer/prompts@7.0.1": - version "7.0.1" - resolved "https://registry.npmjs.org/@inquirer/prompts/-/prompts-7.0.1.tgz" - integrity sha512-cu2CpGC2hz7WTt2VBvdkzahDvYice6vYA/8Dm7Fy3tRNzKuQTF2EY3CV4H2GamveWE6tA2XzyXtbWX8+t4WMQg== - dependencies: - "@inquirer/checkbox" "^4.0.1" - "@inquirer/confirm" "^5.0.1" - "@inquirer/editor" "^4.0.1" - "@inquirer/expand" "^4.0.1" - "@inquirer/input" "^4.0.1" - "@inquirer/number" "^3.0.1" - "@inquirer/password" "^4.0.1" - "@inquirer/rawlist" "^4.0.1" - "@inquirer/search" "^3.0.1" - "@inquirer/select" "^4.0.1" - -"@inquirer/rawlist@^4.0.1": - version "4.0.1" - resolved "https://registry.npmjs.org/@inquirer/rawlist/-/rawlist-4.0.1.tgz" - integrity sha512-0LuMOgaWs7W8JNcbiKkoFwyWFDEeCmLqDCygF0hidQUVa6J5grFVRZxrpompiWDFM49Km2rf7WoZwRo1uf1yWQ== - dependencies: - "@inquirer/core" "^10.0.1" - "@inquirer/type" "^3.0.0" - yoctocolors-cjs "^2.1.2" - -"@inquirer/search@^3.0.1": - version "3.0.1" - resolved "https://registry.npmjs.org/@inquirer/search/-/search-3.0.1.tgz" - integrity sha512-ehMqjiO0pAf+KtdONKeCLVy4i3fy3feyRRhDrvzWhiwB8JccgKn7eHFr39l+Nx/FaZAhr0YxIJvkK5NuNvG+Ww== - dependencies: - "@inquirer/core" "^10.0.1" - "@inquirer/figures" "^1.0.7" - "@inquirer/type" "^3.0.0" - yoctocolors-cjs "^2.1.2" - -"@inquirer/select@^4.0.1": - version "4.0.1" - resolved "https://registry.npmjs.org/@inquirer/select/-/select-4.0.1.tgz" - integrity sha512-tVRatFRGU49bxFCKi/3P+C0E13KZduNFbWuHWRx0L2+jbiyKRpXgHp9qiRHWRk/KarhYBXzH/di6w3VQ5aJd5w== - dependencies: - "@inquirer/core" "^10.0.1" - "@inquirer/figures" "^1.0.7" - "@inquirer/type" "^3.0.0" - ansi-escapes "^4.3.2" - yoctocolors-cjs "^2.1.2" - -"@inquirer/type@^3.0.0": - version "3.0.0" - resolved "https://registry.npmjs.org/@inquirer/type/-/type-3.0.0.tgz" - integrity sha512-YYykfbw/lefC7yKj7nanzQXILM7r3suIvyFlCcMskc99axmsSewXWkAfXKwMbgxL76iAFVmRwmYdwNZNc8gjog== - -"@istanbuljs/load-nyc-config@^1.0.0": - version "1.1.0" - resolved "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz" - integrity sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ== - dependencies: - camelcase "^5.3.1" - find-up "^4.1.0" - get-package-type "^0.1.0" - js-yaml "^3.13.1" - resolve-from "^5.0.0" - -"@istanbuljs/schema@^0.1.2", "@istanbuljs/schema@^0.1.3": - version "0.1.3" - resolved "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz" - integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== - -"@jest/console@^29.7.0": - version "29.7.0" - resolved "https://registry.npmjs.org/@jest/console/-/console-29.7.0.tgz" - integrity sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg== - dependencies: - "@jest/types" "^29.6.3" - "@types/node" "*" - chalk "^4.0.0" - jest-message-util "^29.7.0" - jest-util "^29.7.0" - slash "^3.0.0" - -"@jest/core@^29.3.1", "@jest/core@^29.7.0": - version "29.7.0" - resolved "https://registry.npmjs.org/@jest/core/-/core-29.7.0.tgz" - integrity sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg== - dependencies: - "@jest/console" "^29.7.0" - "@jest/reporters" "^29.7.0" - "@jest/test-result" "^29.7.0" - "@jest/transform" "^29.7.0" - "@jest/types" "^29.6.3" - "@types/node" "*" - ansi-escapes "^4.2.1" - chalk "^4.0.0" - ci-info "^3.2.0" - exit "^0.1.2" - graceful-fs "^4.2.9" - jest-changed-files "^29.7.0" - jest-config "^29.7.0" - jest-haste-map "^29.7.0" - jest-message-util "^29.7.0" - jest-regex-util "^29.6.3" - jest-resolve "^29.7.0" - jest-resolve-dependencies "^29.7.0" - jest-runner "^29.7.0" - jest-runtime "^29.7.0" - jest-snapshot "^29.7.0" - jest-util "^29.7.0" - jest-validate "^29.7.0" - jest-watcher "^29.7.0" - micromatch "^4.0.4" - pretty-format "^29.7.0" - slash "^3.0.0" - strip-ansi "^6.0.0" - -"@jest/environment@^29.7.0": - version "29.7.0" - resolved "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz" - integrity sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw== - dependencies: - "@jest/fake-timers" "^29.7.0" - "@jest/types" "^29.6.3" - "@types/node" "*" - jest-mock "^29.7.0" - -"@jest/expect-utils@^29.7.0": - version "29.7.0" - resolved "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz" - integrity sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA== - dependencies: - jest-get-type "^29.6.3" - -"@jest/expect@^29.7.0": - version "29.7.0" - resolved "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz" - integrity sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ== - dependencies: - expect "^29.7.0" - jest-snapshot "^29.7.0" - -"@jest/fake-timers@^29.7.0": - version "29.7.0" - resolved "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz" - integrity sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ== - dependencies: - "@jest/types" "^29.6.3" - "@sinonjs/fake-timers" "^10.0.2" - "@types/node" "*" - jest-message-util "^29.7.0" - jest-mock "^29.7.0" - jest-util "^29.7.0" - -"@jest/globals@^29.7.0": - version "29.7.0" - resolved "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz" - integrity sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ== - dependencies: - "@jest/environment" "^29.7.0" - "@jest/expect" "^29.7.0" - "@jest/types" "^29.6.3" - jest-mock "^29.7.0" - -"@jest/reporters@^29.7.0": - version "29.7.0" - resolved "https://registry.npmjs.org/@jest/reporters/-/reporters-29.7.0.tgz" - integrity sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg== - dependencies: - "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^29.7.0" - "@jest/test-result" "^29.7.0" - "@jest/transform" "^29.7.0" - "@jest/types" "^29.6.3" - "@jridgewell/trace-mapping" "^0.3.18" - "@types/node" "*" - chalk "^4.0.0" - collect-v8-coverage "^1.0.0" - exit "^0.1.2" - glob "^7.1.3" - graceful-fs "^4.2.9" - istanbul-lib-coverage "^3.0.0" - istanbul-lib-instrument "^6.0.0" - istanbul-lib-report "^3.0.0" - istanbul-lib-source-maps "^4.0.0" - istanbul-reports "^3.1.3" - jest-message-util "^29.7.0" - jest-util "^29.7.0" - jest-worker "^29.7.0" - slash "^3.0.0" - string-length "^4.0.1" - strip-ansi "^6.0.0" - v8-to-istanbul "^9.0.1" - -"@jest/schemas@^29.6.3": - version "29.6.3" - resolved "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz" - integrity sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA== - dependencies: - "@sinclair/typebox" "^0.27.8" - -"@jest/source-map@^29.6.3": - version "29.6.3" - resolved "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz" - integrity sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw== - dependencies: - "@jridgewell/trace-mapping" "^0.3.18" - callsites "^3.0.0" - graceful-fs "^4.2.9" - -"@jest/test-result@^29.7.0": - version "29.7.0" - resolved "https://registry.npmjs.org/@jest/test-result/-/test-result-29.7.0.tgz" - integrity sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA== - dependencies: - "@jest/console" "^29.7.0" - "@jest/types" "^29.6.3" - "@types/istanbul-lib-coverage" "^2.0.0" - collect-v8-coverage "^1.0.0" - -"@jest/test-sequencer@^29.7.0": - version "29.7.0" - resolved "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz" - integrity sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw== - dependencies: - "@jest/test-result" "^29.7.0" - graceful-fs "^4.2.9" - jest-haste-map "^29.7.0" - slash "^3.0.0" - -"@jest/transform@^29.7.0": - version "29.7.0" - resolved "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz" - integrity sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw== - dependencies: - "@babel/core" "^7.11.6" - "@jest/types" "^29.6.3" - "@jridgewell/trace-mapping" "^0.3.18" - babel-plugin-istanbul "^6.1.1" - chalk "^4.0.0" - convert-source-map "^2.0.0" - fast-json-stable-stringify "^2.1.0" - graceful-fs "^4.2.9" - jest-haste-map "^29.7.0" - jest-regex-util "^29.6.3" - jest-util "^29.7.0" - micromatch "^4.0.4" - pirates "^4.0.4" - slash "^3.0.0" - write-file-atomic "^4.0.2" - -"@jest/types@^29.0.0", "@jest/types@^29.3.1", "@jest/types@^29.6.3": - version "29.6.3" - resolved "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz" - integrity sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw== - dependencies: - "@jest/schemas" "^29.6.3" - "@types/istanbul-lib-coverage" "^2.0.0" - "@types/istanbul-reports" "^3.0.0" - "@types/node" "*" - "@types/yargs" "^17.0.8" - chalk "^4.0.0" - -"@jridgewell/gen-mapping@^0.3.5": - version "0.3.8" - resolved "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz" - integrity sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA== - dependencies: - "@jridgewell/set-array" "^1.2.1" - "@jridgewell/sourcemap-codec" "^1.4.10" - "@jridgewell/trace-mapping" "^0.3.24" - -"@jridgewell/resolve-uri@^3.0.3", "@jridgewell/resolve-uri@^3.1.0": - version "3.1.1" - resolved "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz" - integrity sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA== - -"@jridgewell/set-array@^1.2.1": - version "1.2.1" - resolved "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz" - integrity sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A== - -"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.14": - version "1.4.15" - resolved "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz" - integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== - -"@jridgewell/trace-mapping@^0.3.12": - version "0.3.25" - resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz" - integrity sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ== - dependencies: - "@jridgewell/resolve-uri" "^3.1.0" - "@jridgewell/sourcemap-codec" "^1.4.14" - -"@jridgewell/trace-mapping@^0.3.18": - version "0.3.25" - resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz" - integrity sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ== - dependencies: - "@jridgewell/resolve-uri" "^3.1.0" - "@jridgewell/sourcemap-codec" "^1.4.14" - -"@jridgewell/trace-mapping@^0.3.24": - version "0.3.25" - resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz" - integrity sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ== - dependencies: - "@jridgewell/resolve-uri" "^3.1.0" - "@jridgewell/sourcemap-codec" "^1.4.14" - -"@jridgewell/trace-mapping@^0.3.25": - version "0.3.25" - resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz" - integrity sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ== - dependencies: - "@jridgewell/resolve-uri" "^3.1.0" - "@jridgewell/sourcemap-codec" "^1.4.14" - -"@jridgewell/trace-mapping@0.3.9": - version "0.3.9" - resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz" - integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== - dependencies: - "@jridgewell/resolve-uri" "^3.0.3" - "@jridgewell/sourcemap-codec" "^1.4.10" - -"@jsdevtools/ono@^7.1.3": - version "7.1.3" - resolved "https://registry.npmjs.org/@jsdevtools/ono/-/ono-7.1.3.tgz" - integrity sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg== - -"@nodelib/fs.scandir@2.1.5": - version "2.1.5" - resolved "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz" - integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== - dependencies: - "@nodelib/fs.stat" "2.0.5" - run-parallel "^1.1.9" - -"@nodelib/fs.stat@^2.0.2", "@nodelib/fs.stat@2.0.5": - version "2.0.5" - resolved "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz" - integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== - -"@nodelib/fs.walk@^1.2.3", "@nodelib/fs.walk@^1.2.8": - version "1.2.8" - resolved "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz" - integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== - dependencies: - "@nodelib/fs.scandir" "2.1.5" - fastq "^1.6.0" - -"@sinclair/typebox@^0.27.8": - version "0.27.8" - resolved "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz" - integrity sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA== - -"@sinonjs/commons@^3.0.0": - version "3.0.1" - resolved "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz" - integrity sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ== - dependencies: - type-detect "4.0.8" - -"@sinonjs/fake-timers@^10.0.2": - version "10.3.0" - resolved "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz" - integrity sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA== - dependencies: - "@sinonjs/commons" "^3.0.0" - -"@socket.io/component-emitter@~3.1.0": - version "3.1.2" - resolved "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.2.tgz" - integrity sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA== - -"@tsconfig/node10@^1.0.7": - version "1.0.9" - resolved "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz" - integrity sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA== - -"@tsconfig/node12@^1.0.7": - version "1.0.11" - resolved "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz" - integrity sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag== - -"@tsconfig/node14@^1.0.0": - version "1.0.3" - resolved "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz" - integrity sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow== - -"@tsconfig/node16@^1.0.2": - version "1.0.4" - resolved "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz" - integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA== - -"@types/adm-zip@0.5.5": - version "0.5.5" - resolved "https://registry.npmjs.org/@types/adm-zip/-/adm-zip-0.5.5.tgz" - integrity sha512-YCGstVMjc4LTY5uK9/obvxBya93axZOVOyf2GSUulADzmLhYE45u2nAssCs/fWBs1Ifq5Vat75JTPwd5XZoPJw== - dependencies: - "@types/node" "*" - -"@types/babel__core@^7.1.14": - version "7.20.5" - resolved "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz" - integrity sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA== - dependencies: - "@babel/parser" "^7.20.7" - "@babel/types" "^7.20.7" - "@types/babel__generator" "*" - "@types/babel__template" "*" - "@types/babel__traverse" "*" - -"@types/babel__generator@*": - version "7.6.8" - resolved "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.8.tgz" - integrity sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw== - dependencies: - "@babel/types" "^7.0.0" - -"@types/babel__template@*": - version "7.4.4" - resolved "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz" - integrity sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A== - dependencies: - "@babel/parser" "^7.1.0" - "@babel/types" "^7.0.0" - -"@types/babel__traverse@*", "@types/babel__traverse@^7.0.6": - version "7.20.6" - resolved "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.6.tgz" - integrity sha512-r1bzfrm0tomOI8g1SzvCaQHo6Lcv6zu0EA+W2kHrt8dyrHQxGzBBL4kdkzIS+jBMV+EYcMAEAqXqYaLJq5rOZg== - dependencies: - "@babel/types" "^7.20.7" - -"@types/graceful-fs@^4.1.3": - version "4.1.9" - resolved "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz" - integrity sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ== - dependencies: - "@types/node" "*" - -"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0", "@types/istanbul-lib-coverage@^2.0.1": - version "2.0.6" - resolved "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz" - integrity sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w== - -"@types/istanbul-lib-report@*": - version "3.0.3" - resolved "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz" - integrity sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA== - dependencies: - "@types/istanbul-lib-coverage" "*" - -"@types/istanbul-reports@^3.0.0": - version "3.0.4" - resolved "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz" - integrity sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ== - dependencies: - "@types/istanbul-lib-report" "*" - -"@types/jest@29.2.4": - version "29.2.4" - resolved "https://registry.npmjs.org/@types/jest/-/jest-29.2.4.tgz" - integrity sha512-PipFB04k2qTRPePduVLTRiPzQfvMeLwUN3Z21hsAKaB/W9IIzgB2pizCL466ftJlcyZqnHoC9ZHpxLGl3fS86A== - dependencies: - expect "^29.0.0" - pretty-format "^29.0.0" - -"@types/json-schema@^7.0.15", "@types/json-schema@^7.0.9": - version "7.0.15" - resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz" - integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== - -"@types/jsonpath@0.2.4": - version "0.2.4" - resolved "https://registry.npmjs.org/@types/jsonpath/-/jsonpath-0.2.4.tgz" - integrity sha512-K3hxB8Blw0qgW6ExKgMbXQv2UPZBoE2GqLpVY+yr7nMD2Pq86lsuIzyAaiQ7eMqFL5B6di6pxSkogLJEyEHoGA== - -"@types/lodash@^4.17.7", "@types/lodash@4.17.9": - version "4.17.9" - resolved "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.9.tgz" - integrity sha512-w9iWudx1XWOHW5lQRS9iKpK/XuRhnN+0T7HvdCCd802FYkT1AMTnxndJHGrNJwRoRHkslGr4S29tjm1cT7x/7w== - -"@types/node@*", "@types/node@>=18", "@types/node@18.11.18": - version "18.11.18" - resolved "https://registry.npmjs.org/@types/node/-/node-18.11.18.tgz" - integrity sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA== - -"@types/node@^16.9.2": - version "16.18.54" - resolved "https://registry.npmjs.org/@types/node/-/node-16.18.54.tgz" - integrity sha512-oTmGy68gxZZ21FhTJVVvZBYpQHEBZxHKTsGshobMqm9qWpbqdZsA5jvsuPZcHu0KwpmLrOHWPdEfg7XDpNT9UA== - -"@types/semver@^7.3.12": - version "7.7.0" - resolved "https://registry.npmjs.org/@types/semver/-/semver-7.7.0.tgz" - integrity sha512-k107IF4+Xr7UHjwDc7Cfd6PRQfbdkiRabXGRjo07b4WyPahFBZCZ1sE+BNxYIJPPg73UkfOsVOLwqVc/6ETrIA== - -"@types/stack-utils@^2.0.0": - version "2.0.3" - resolved "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz" - integrity sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw== - -"@types/validator@13.11.9": - version "13.11.9" - resolved "https://registry.npmjs.org/@types/validator/-/validator-13.11.9.tgz" - integrity sha512-FCTsikRozryfayPuiI46QzH3fnrOoctTjvOYZkho9BTFLCOZ2rgZJHMOVgCOfttjPJcgOx52EpkY0CMfy87MIw== - -"@types/yargs-parser@*": - version "21.0.3" - resolved "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz" - integrity sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ== - -"@types/yargs@^17.0.8": - version "17.0.33" - resolved "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.33.tgz" - integrity sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA== - dependencies: - "@types/yargs-parser" "*" - -"@typescript-eslint/eslint-plugin@5.62.0": - version "5.62.0" - resolved "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz" - integrity sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag== - dependencies: - "@eslint-community/regexpp" "^4.4.0" - "@typescript-eslint/scope-manager" "5.62.0" - "@typescript-eslint/type-utils" "5.62.0" - "@typescript-eslint/utils" "5.62.0" - debug "^4.3.4" - graphemer "^1.4.0" - ignore "^5.2.0" - natural-compare-lite "^1.4.0" - semver "^7.3.7" - tsutils "^3.21.0" - -"@typescript-eslint/parser@^5.0.0", "@typescript-eslint/parser@5.62.0": - version "5.62.0" - resolved "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz" - integrity sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA== - dependencies: - "@typescript-eslint/scope-manager" "5.62.0" - "@typescript-eslint/types" "5.62.0" - "@typescript-eslint/typescript-estree" "5.62.0" - debug "^4.3.4" - -"@typescript-eslint/scope-manager@5.62.0": - version "5.62.0" - resolved "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz" - integrity sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w== - dependencies: - "@typescript-eslint/types" "5.62.0" - "@typescript-eslint/visitor-keys" "5.62.0" - -"@typescript-eslint/type-utils@5.62.0": - version "5.62.0" - resolved "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.62.0.tgz" - integrity sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew== - dependencies: - "@typescript-eslint/typescript-estree" "5.62.0" - "@typescript-eslint/utils" "5.62.0" - debug "^4.3.4" - tsutils "^3.21.0" - -"@typescript-eslint/types@5.62.0": - version "5.62.0" - resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz" - integrity sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ== - -"@typescript-eslint/typescript-estree@5.62.0": - version "5.62.0" - resolved "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz" - integrity sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA== - dependencies: - "@typescript-eslint/types" "5.62.0" - "@typescript-eslint/visitor-keys" "5.62.0" - debug "^4.3.4" - globby "^11.1.0" - is-glob "^4.0.3" - semver "^7.3.7" - tsutils "^3.21.0" - -"@typescript-eslint/utils@5.62.0": - version "5.62.0" - resolved "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.62.0.tgz" - integrity sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ== - dependencies: - "@eslint-community/eslint-utils" "^4.2.0" - "@types/json-schema" "^7.0.9" - "@types/semver" "^7.3.12" - "@typescript-eslint/scope-manager" "5.62.0" - "@typescript-eslint/types" "5.62.0" - "@typescript-eslint/typescript-estree" "5.62.0" - eslint-scope "^5.1.1" - semver "^7.3.7" - -"@typescript-eslint/visitor-keys@5.62.0": - version "5.62.0" - resolved "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz" - integrity sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw== - dependencies: - "@typescript-eslint/types" "5.62.0" - eslint-visitor-keys "^3.3.0" - -"@ungap/structured-clone@^1.2.0": - version "1.3.0" - resolved "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz" - integrity sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g== - -acorn-jsx@^5.3.2: - version "5.3.2" - resolved "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz" - integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== - -acorn-walk@^8.1.1: - version "8.2.0" - resolved "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz" - integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== - -"acorn@^6.0.0 || ^7.0.0 || ^8.0.0", acorn@^8.4.1, acorn@^8.9.0: - version "8.10.0" - resolved "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz" - integrity sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw== - -adm-zip@0.5.16: - version "0.5.16" - resolved "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.16.tgz" - integrity sha512-TGw5yVi4saajsSEgz25grObGHEUaDrniwvA2qwSC060KfqGPdglhvPMA2lPIoxs3PQIItj2iag35fONcQqgUaQ== - -agent-base@^7.0.2, agent-base@^7.1.0: - version "7.1.0" - resolved "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz" - integrity sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg== - dependencies: - debug "^4.3.4" - -ajv@^6.12.4: - version "6.12.6" - resolved "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz" - integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== - dependencies: - fast-deep-equal "^3.1.1" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.4.1" - uri-js "^4.2.2" - -ansi-escapes@^4.2.1, ansi-escapes@^4.3.2: - version "4.3.2" - resolved "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz" - integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== - dependencies: - type-fest "^0.21.3" - -ansi-regex@^5.0.1: - version "5.0.1" - resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz" - integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== - -ansi-styles@^3.2.1: - version "3.2.1" - resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz" - integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== - dependencies: - color-convert "^1.9.0" - -ansi-styles@^4.0.0, ansi-styles@^4.1.0: - version "4.3.0" - resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz" - integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== - dependencies: - color-convert "^2.0.1" - -ansi-styles@^5.0.0: - version "5.2.0" - resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz" - integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== - -anymatch@^3.0.3, anymatch@~3.1.2: - version "3.1.3" - resolved "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz" - integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== - dependencies: - normalize-path "^3.0.0" - picomatch "^2.0.4" - -arg@^4.1.0: - version "4.1.3" - resolved "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz" - integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== - -argparse@^1.0.7: - version "1.0.10" - resolved "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz" - integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== - dependencies: - sprintf-js "~1.0.2" - -argparse@^2.0.1: - version "2.0.1" - resolved "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz" - integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== - -array-timsort@^1.0.3: - version "1.0.3" - resolved "https://registry.npmjs.org/array-timsort/-/array-timsort-1.0.3.tgz" - integrity sha512-/+3GRL7dDAGEfM6TseQk/U+mi18TU2Ms9I3UlLdUMhz2hbvGNTKdj9xniwXfUqgYhHxRx0+8UnKkvlNwVU+cWQ== - -array-union@^2.1.0: - version "2.1.0" - resolved "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz" - integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== - -asynckit@^0.4.0: - version "0.4.0" - resolved "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz" - integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== - -axios@1.8.3: - version "1.8.3" - resolved "https://registry.npmjs.org/axios/-/axios-1.8.3.tgz" - integrity sha512-iP4DebzoNlP/YN2dpwCgb8zoCmhtkajzS48JvwmkSkXvPI3DHc7m+XYL5tGnSlJtR6nImXZmdCuN5aP8dh1d8A== - dependencies: - follow-redirects "^1.15.6" - form-data "^4.0.0" - proxy-from-env "^1.1.0" - -babel-jest@^29.0.0, babel-jest@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz" - integrity sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg== - dependencies: - "@jest/transform" "^29.7.0" - "@types/babel__core" "^7.1.14" - babel-plugin-istanbul "^6.1.1" - babel-preset-jest "^29.6.3" - chalk "^4.0.0" - graceful-fs "^4.2.9" - slash "^3.0.0" - -babel-plugin-istanbul@^6.1.1: - version "6.1.1" - resolved "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz" - integrity sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@istanbuljs/load-nyc-config" "^1.0.0" - "@istanbuljs/schema" "^0.1.2" - istanbul-lib-instrument "^5.0.4" - test-exclude "^6.0.0" - -babel-plugin-jest-hoist@^29.6.3: - version "29.6.3" - resolved "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz" - integrity sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg== - dependencies: - "@babel/template" "^7.3.3" - "@babel/types" "^7.3.3" - "@types/babel__core" "^7.1.14" - "@types/babel__traverse" "^7.0.6" - -babel-preset-current-node-syntax@^1.0.0: - version "1.1.0" - resolved "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.1.0.tgz" - integrity sha512-ldYss8SbBlWva1bs28q78Ju5Zq1F+8BrqBZZ0VFhLBvhh6lCpC2o3gDJi/5DRLs9FgYZCnmPYIVFU4lRXCkyUw== - dependencies: - "@babel/plugin-syntax-async-generators" "^7.8.4" - "@babel/plugin-syntax-bigint" "^7.8.3" - "@babel/plugin-syntax-class-properties" "^7.12.13" - "@babel/plugin-syntax-class-static-block" "^7.14.5" - "@babel/plugin-syntax-import-attributes" "^7.24.7" - "@babel/plugin-syntax-import-meta" "^7.10.4" - "@babel/plugin-syntax-json-strings" "^7.8.3" - "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" - "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" - "@babel/plugin-syntax-numeric-separator" "^7.10.4" - "@babel/plugin-syntax-object-rest-spread" "^7.8.3" - "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" - "@babel/plugin-syntax-optional-chaining" "^7.8.3" - "@babel/plugin-syntax-private-property-in-object" "^7.14.5" - "@babel/plugin-syntax-top-level-await" "^7.14.5" - -babel-preset-jest@^29.6.3: - version "29.6.3" - resolved "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz" - integrity sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA== - dependencies: - babel-plugin-jest-hoist "^29.6.3" - babel-preset-current-node-syntax "^1.0.0" - -balanced-match@^1.0.0: - version "1.0.2" - resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz" - integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== - -binary-extensions@^2.0.0: - version "2.2.0" - resolved "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz" - integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -brace-expansion@^2.0.1: - version "2.0.1" - resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz" - integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== - dependencies: - balanced-match "^1.0.0" - -braces@^3.0.3, braces@~3.0.2: - version "3.0.3" - resolved "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz" - integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA== - dependencies: - fill-range "^7.1.1" - -browserslist@^4.24.0, "browserslist@>= 4.21.0": - version "4.24.4" - resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.24.4.tgz" - integrity sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A== - dependencies: - caniuse-lite "^1.0.30001688" - electron-to-chromium "^1.5.73" - node-releases "^2.0.19" - update-browserslist-db "^1.1.1" - -bs-logger@0.x: - version "0.2.6" - resolved "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz" - integrity sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog== - dependencies: - fast-json-stable-stringify "2.x" - -bser@2.1.1: - version "2.1.1" - resolved "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz" - integrity sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ== - dependencies: - node-int64 "^0.4.0" - -buffer-from@^1.0.0: - version "1.1.2" - resolved "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz" - integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== - -builtin-modules@^1.1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz" - integrity sha512-wxXCdllwGhI2kCC0MnvTGYTMvnVZTvqgypkiTI8Pa5tcz2i6VqsqwYGgqwXji+4RgCzms6EajE4IxiUH6HH8nQ== - -callsites@^3.0.0: - version "3.1.0" - resolved "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz" - integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== - -camel-case@^4.1.2: - version "4.1.2" - resolved "https://registry.npmjs.org/camel-case/-/camel-case-4.1.2.tgz" - integrity sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw== - dependencies: - pascal-case "^3.1.2" - tslib "^2.0.3" - -camelcase@^5.3.1: - version "5.3.1" - resolved "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz" - integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== - -camelcase@^6.2.0: - version "6.3.0" - resolved "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz" - integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== - -caniuse-lite@^1.0.30001688: - version "1.0.30001704" - resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001704.tgz" - integrity sha512-+L2IgBbV6gXB4ETf0keSvLr7JUrRVbIaB/lrQ1+z8mRcQiisG5k+lG6O4n6Y5q6f5EuNfaYXKgymucphlEXQew== - -capital-case@^1.0.4: - version "1.0.4" - resolved "https://registry.npmjs.org/capital-case/-/capital-case-1.0.4.tgz" - integrity sha512-ds37W8CytHgwnhGGTi88pcPyR15qoNkOpYwmMMfnWqqWgESapLqvDx6huFjQ5vqWSn2Z06173XNA7LtMOeUh1A== - dependencies: - no-case "^3.0.4" - tslib "^2.0.3" - upper-case-first "^2.0.2" - -chalk@^2.3.0: - version "2.4.2" - resolved "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - -chalk@^2.4.1: - version "2.4.2" - resolved "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - -chalk@^4.0.0, chalk@4.1.2: - version "4.1.2" - resolved "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz" - integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - -change-case@^4.1.2: - version "4.1.2" - resolved "https://registry.npmjs.org/change-case/-/change-case-4.1.2.tgz" - integrity sha512-bSxY2ws9OtviILG1EiY5K7NNxkqg/JnRnFxLtKQ96JaviiIxi7djMrSd0ECT9AC+lttClmYwKw53BWpOMblo7A== - dependencies: - camel-case "^4.1.2" - capital-case "^1.0.4" - constant-case "^3.0.4" - dot-case "^3.0.4" - header-case "^2.0.4" - no-case "^3.0.4" - param-case "^3.0.4" - pascal-case "^3.1.2" - path-case "^3.0.4" - sentence-case "^3.0.4" - snake-case "^3.0.4" - tslib "^2.0.3" - -char-regex@^1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz" - integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw== - -chardet@^0.7.0: - version "0.7.0" - resolved "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz" - integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== - -chokidar@^3.5.3: - version "3.5.3" - resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz" - integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== - dependencies: - anymatch "~3.1.2" - braces "~3.0.2" - glob-parent "~5.1.2" - is-binary-path "~2.1.0" - is-glob "~4.0.1" - normalize-path "~3.0.0" - readdirp "~3.6.0" - optionalDependencies: - fsevents "~2.3.2" - -ci-info@^3.2.0: - version "3.9.0" - resolved "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz" - integrity sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ== - -cjs-module-lexer@^1.0.0: - version "1.4.3" - resolved "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.4.3.tgz" - integrity sha512-9z8TZaGM1pfswYeXrUpzPrkx8UnWYdhJclsiYMm6x/w5+nN+8Tf/LnAgfLGQCm59qAOxU8WwHEq2vNwF6i4j+Q== - -cli-width@^4.1.0: - version "4.1.0" - resolved "https://registry.npmjs.org/cli-width/-/cli-width-4.1.0.tgz" - integrity sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ== - -cliui@^7.0.2: - version "7.0.4" - resolved "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz" - integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== - dependencies: - string-width "^4.2.0" - strip-ansi "^6.0.0" - wrap-ansi "^7.0.0" - -cliui@^8.0.1: - version "8.0.1" - resolved "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz" - integrity sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ== - dependencies: - string-width "^4.2.0" - strip-ansi "^6.0.1" - wrap-ansi "^7.0.0" - -co@^4.6.0: - version "4.6.0" - resolved "https://registry.npmjs.org/co/-/co-4.6.0.tgz" - integrity sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ== - -collect-v8-coverage@^1.0.0: - version "1.0.2" - resolved "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz" - integrity sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q== - -color-convert@^1.9.0: - version "1.9.3" - resolved "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== - dependencies: - color-name "1.1.3" - -color-convert@^2.0.1: - version "2.0.1" - resolved "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz" - integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== - dependencies: - color-name "~1.1.4" - -color-name@~1.1.4: - version "1.1.4" - resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz" - integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== - -color-name@1.1.3: - version "1.1.3" - resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz" - integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== - -combined-stream@^1.0.8: - version "1.0.8" - resolved "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz" - integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== - dependencies: - delayed-stream "~1.0.0" - -commander@^2.12.1: - version "2.20.3" - resolved "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz" - integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== - -commander@^9.0.0: - version "9.5.0" - resolved "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz" - integrity sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ== - -comment-json@4.2.3: - version "4.2.3" - resolved "https://registry.npmjs.org/comment-json/-/comment-json-4.2.3.tgz" - integrity sha512-SsxdiOf064DWoZLH799Ata6u7iV658A11PlWtZATDlXPpKGJnbJZ5Z24ybixAi+LUUqJ/GKowAejtC5GFUG7Tw== - dependencies: - array-timsort "^1.0.3" - core-util-is "^1.0.3" - esprima "^4.0.1" - has-own-prop "^2.0.0" - repeat-string "^1.6.1" - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" - integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== - -constant-case@^3.0.4: - version "3.0.4" - resolved "https://registry.npmjs.org/constant-case/-/constant-case-3.0.4.tgz" - integrity sha512-I2hSBi7Vvs7BEuJDr5dDHfzb/Ruj3FyvFyh7KLilAjNQw3Be+xgqUBA2W6scVEcL0hL1dwPRtIqEPVUCKkSsyQ== - dependencies: - no-case "^3.0.4" - tslib "^2.0.3" - upper-case "^2.0.2" - -convert-source-map@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz" - integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== - -copyfiles@2.4.1: - version "2.4.1" - resolved "https://registry.npmjs.org/copyfiles/-/copyfiles-2.4.1.tgz" - integrity sha512-fereAvAvxDrQDOXybk3Qu3dPbOoKoysFMWtkY3mv5BsL8//OSZVL5DCLYqgRfY5cWirgRzlC+WSrxp6Bo3eNZg== - dependencies: - glob "^7.0.5" - minimatch "^3.0.3" - mkdirp "^1.0.4" - noms "0.0.0" - through2 "^2.0.1" - untildify "^4.0.0" - yargs "^16.1.0" - -core-util-is@^1.0.3, core-util-is@~1.0.0: - version "1.0.3" - resolved "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz" - integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== - -create-jest@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz" - integrity sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q== - dependencies: - "@jest/types" "^29.6.3" - chalk "^4.0.0" - exit "^0.1.2" - graceful-fs "^4.2.9" - jest-config "^29.7.0" - jest-util "^29.7.0" - prompts "^2.0.1" - -create-require@^1.1.0: - version "1.1.1" - resolved "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz" - integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== - -cross-spawn@^7.0.2, cross-spawn@^7.0.3: - version "7.0.6" - resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz" - integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA== - dependencies: - path-key "^3.1.0" - shebang-command "^2.0.0" - which "^2.0.1" - -debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4, debug@~4.3.1, debug@~4.3.2, debug@4: - version "4.3.4" - resolved "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz" - integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== - dependencies: - ms "2.1.2" - -dedent@^1.0.0: - version "1.5.3" - resolved "https://registry.npmjs.org/dedent/-/dedent-1.5.3.tgz" - integrity sha512-NHQtfOOW68WD8lgypbLA5oT+Bt0xXJhiYvoR6SmmNXZfpzOGXwdKWmcwG8N7PwVVWV3eF/68nmD9BaJSsTBhyQ== - -deep-is@^0.1.3, deep-is@~0.1.3: - version "0.1.4" - resolved "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz" - integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== - -deepmerge@^4.2.2: - version "4.3.1" - resolved "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz" - integrity sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A== - -delayed-stream@~1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz" - integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== - -detect-newline@^3.0.0: - version "3.1.0" - resolved "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz" - integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== - -diff-sequences@^29.6.3: - version "29.6.3" - resolved "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz" - integrity sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q== - -diff@^4.0.1: - version "4.0.2" - resolved "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz" - integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== - -dir-glob@^3.0.1: - version "3.0.1" - resolved "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz" - integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== - dependencies: - path-type "^4.0.0" - -doctrine@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz" - integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== - dependencies: - esutils "^2.0.2" - -dot-case@^3.0.4: - version "3.0.4" - resolved "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz" - integrity sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w== - dependencies: - no-case "^3.0.4" - tslib "^2.0.3" - -dotenv@16.0.3: - version "16.0.3" - resolved "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz" - integrity sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ== - -electron-to-chromium@^1.5.73: - version "1.5.118" - resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.118.tgz" - integrity sha512-yNDUus0iultYyVoEFLnQeei7LOQkL8wg8GQpkPCRrOlJXlcCwa6eGKZkxQ9ciHsqZyYbj8Jd94X1CTPzGm+uIA== - -emittery@^0.13.1: - version "0.13.1" - resolved "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz" - integrity sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ== - -emoji-regex@^8.0.0: - version "8.0.0" - resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz" - integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== - -engine.io-client@~6.5.2: - version "6.5.4" - resolved "https://registry.npmjs.org/engine.io-client/-/engine.io-client-6.5.4.tgz" - integrity sha512-GeZeeRjpD2qf49cZQ0Wvh/8NJNfeXkXXcoGh+F77oEAgo9gUHwT1fCRxSNU+YEEaysOJTnsFHmM5oAcPy4ntvQ== - dependencies: - "@socket.io/component-emitter" "~3.1.0" - debug "~4.3.1" - engine.io-parser "~5.2.1" - ws "~8.17.1" - xmlhttprequest-ssl "~2.0.0" - -engine.io-parser@~5.2.1: - version "5.2.2" - resolved "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.2.2.tgz" - integrity sha512-RcyUFKA93/CXH20l4SoVvzZfrSDMOTUS3bWVpTt2FuFP+XYrL8i8oonHP7WInRyVHXh0n/ORtoeiE1os+8qkSw== - -error-ex@^1.3.1: - version "1.3.2" - resolved "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz" - integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== - dependencies: - is-arrayish "^0.2.1" - -escalade@^3.1.1, escalade@^3.2.0: - version "3.2.0" - resolved "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz" - integrity sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA== - -escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz" - integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== - -escape-string-regexp@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz" - integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== - -escape-string-regexp@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz" - integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== - -escodegen@^1.8.1: - version "1.14.3" - resolved "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz" - integrity sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw== - dependencies: - esprima "^4.0.1" - estraverse "^4.2.0" - esutils "^2.0.2" - optionator "^0.8.1" - optionalDependencies: - source-map "~0.6.1" - -eslint-config-prettier@9.1.0: - version "9.1.0" - resolved "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz" - integrity sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw== - -eslint-plugin-prettier@4.2.1: - version "4.2.1" - resolved "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz" - integrity sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ== - dependencies: - prettier-linter-helpers "^1.0.0" - -eslint-scope@^5.1.1: - version "5.1.1" - resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz" - integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== - dependencies: - esrecurse "^4.3.0" - estraverse "^4.1.1" - -eslint-scope@^7.2.2: - version "7.2.2" - resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz" - integrity sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg== - dependencies: - esrecurse "^4.3.0" - estraverse "^5.2.0" - -eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4.3: - version "3.4.3" - resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz" - integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== - -eslint@*, "eslint@^6.0.0 || ^7.0.0 || ^8.0.0", "eslint@^6.0.0 || ^7.0.0 || >=8.0.0", eslint@>=7.0.0, eslint@>=7.28.0, eslint@8.57.1: - version "8.57.1" - resolved "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz" - integrity sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA== - dependencies: - "@eslint-community/eslint-utils" "^4.2.0" - "@eslint-community/regexpp" "^4.6.1" - "@eslint/eslintrc" "^2.1.4" - "@eslint/js" "8.57.1" - "@humanwhocodes/config-array" "^0.13.0" - "@humanwhocodes/module-importer" "^1.0.1" - "@nodelib/fs.walk" "^1.2.8" - "@ungap/structured-clone" "^1.2.0" - ajv "^6.12.4" - chalk "^4.0.0" - cross-spawn "^7.0.2" - debug "^4.3.2" - doctrine "^3.0.0" - escape-string-regexp "^4.0.0" - eslint-scope "^7.2.2" - eslint-visitor-keys "^3.4.3" - espree "^9.6.1" - esquery "^1.4.2" - esutils "^2.0.2" - fast-deep-equal "^3.1.3" - file-entry-cache "^6.0.1" - find-up "^5.0.0" - glob-parent "^6.0.2" - globals "^13.19.0" - graphemer "^1.4.0" - ignore "^5.2.0" - imurmurhash "^0.1.4" - is-glob "^4.0.0" - is-path-inside "^3.0.3" - js-yaml "^4.1.0" - json-stable-stringify-without-jsonify "^1.0.1" - levn "^0.4.1" - lodash.merge "^4.6.2" - minimatch "^3.1.2" - natural-compare "^1.4.0" - optionator "^0.9.3" - strip-ansi "^6.0.1" - text-table "^0.2.0" - -espree@^9.6.0, espree@^9.6.1: - version "9.6.1" - resolved "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz" - integrity sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ== - dependencies: - acorn "^8.9.0" - acorn-jsx "^5.3.2" - eslint-visitor-keys "^3.4.1" - -esprima@^4.0.0, esprima@^4.0.1: - version "4.0.1" - resolved "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz" - integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== - -esprima@1.2.2: - version "1.2.2" - resolved "https://registry.npmjs.org/esprima/-/esprima-1.2.2.tgz" - integrity sha512-+JpPZam9w5DuJ3Q67SqsMGtiHKENSMRVoxvArfJZK01/BfLEObtZ6orJa/MtoGNR/rfMgp5837T41PAmTwAv/A== - -esquery@^1.4.2: - version "1.6.0" - resolved "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz" - integrity sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg== - dependencies: - estraverse "^5.1.0" - -esrecurse@^4.3.0: - version "4.3.0" - resolved "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz" - integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== - dependencies: - estraverse "^5.2.0" - -estraverse@^4.1.1, estraverse@^4.2.0: - version "4.3.0" - resolved "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz" - integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== - -estraverse@^5.1.0: - version "5.3.0" - resolved "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz" - integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== - -estraverse@^5.2.0: - version "5.3.0" - resolved "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz" - integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== - -esutils@^2.0.2: - version "2.0.3" - resolved "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz" - integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== - -execa@^5.0.0: - version "5.1.1" - resolved "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz" - integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg== - dependencies: - cross-spawn "^7.0.3" - get-stream "^6.0.0" - human-signals "^2.1.0" - is-stream "^2.0.0" - merge-stream "^2.0.0" - npm-run-path "^4.0.1" - onetime "^5.1.2" - signal-exit "^3.0.3" - strip-final-newline "^2.0.0" - -exit@^0.1.2: - version "0.1.2" - resolved "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz" - integrity sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ== - -expect@^29.0.0, expect@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz" - integrity sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw== - dependencies: - "@jest/expect-utils" "^29.7.0" - jest-get-type "^29.6.3" - jest-matcher-utils "^29.7.0" - jest-message-util "^29.7.0" - jest-util "^29.7.0" - -external-editor@^3.1.0: - version "3.1.0" - resolved "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz" - integrity sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew== - dependencies: - chardet "^0.7.0" - iconv-lite "^0.4.24" - tmp "^0.0.33" - -fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: - version "3.1.3" - resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz" - integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== - -fast-diff@^1.1.2: - version "1.3.0" - resolved "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz" - integrity sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw== - -fast-glob@^3.2.9: - version "3.2.12" - resolved "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz" - integrity sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w== - dependencies: - "@nodelib/fs.stat" "^2.0.2" - "@nodelib/fs.walk" "^1.2.3" - glob-parent "^5.1.2" - merge2 "^1.3.0" - micromatch "^4.0.4" - -fast-json-stable-stringify@^2.0.0, fast-json-stable-stringify@^2.1.0, fast-json-stable-stringify@2.x: - version "2.1.0" - resolved "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz" - integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== - -fast-levenshtein@^2.0.6, fast-levenshtein@~2.0.6: - version "2.0.6" - resolved "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz" - integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== - -fastq@^1.6.0: - version "1.15.0" - resolved "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz" - integrity sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw== - dependencies: - reusify "^1.0.4" - -fb-watchman@^2.0.0: - version "2.0.2" - resolved "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz" - integrity sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA== - dependencies: - bser "2.1.1" - -fdir@^6.4.2: - version "6.4.2" - resolved "https://registry.npmjs.org/fdir/-/fdir-6.4.2.tgz" - integrity sha512-KnhMXsKSPZlAhp7+IjUkRZKPb4fUyccpDrdFXbi4QL1qkmFh9kVY09Yox+n4MaOb3lHZ1Tv829C3oaaXoMYPDQ== - -file-entry-cache@^6.0.1: - version "6.0.1" - resolved "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz" - integrity sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg== - dependencies: - flat-cache "^3.0.4" - -fill-range@^7.1.1: - version "7.1.1" - resolved "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz" - integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg== - dependencies: - to-regex-range "^5.0.1" - -find-up@^4.0.0, find-up@^4.1.0: - version "4.1.0" - resolved "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz" - integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== - dependencies: - locate-path "^5.0.0" - path-exists "^4.0.0" - -find-up@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz" - integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== - dependencies: - locate-path "^6.0.0" - path-exists "^4.0.0" - -flat-cache@^3.0.4: - version "3.2.0" - resolved "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz" - integrity sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw== - dependencies: - flatted "^3.2.9" - keyv "^4.5.3" - rimraf "^3.0.2" - -flatted@^3.2.9: - version "3.3.3" - resolved "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz" - integrity sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg== - -follow-redirects@^1.15.6: - version "1.15.6" - resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz" - integrity sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA== - -form-data@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz" - integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.8" - mime-types "^2.1.12" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz" - integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== - -fsevents@^2.3.2, fsevents@~2.3.2: - version "2.3.2" - resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz" - integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== - -function-bind@^1.1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz" - integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== - -gensync@^1.0.0-beta.2: - version "1.0.0-beta.2" - resolved "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz" - integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== - -get-caller-file@^2.0.5: - version "2.0.5" - resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz" - integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== - -get-package-type@^0.1.0: - version "0.1.0" - resolved "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz" - integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q== - -get-stream@^6.0.0: - version "6.0.1" - resolved "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz" - integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== - -glob-parent@^5.1.2, glob-parent@~5.1.2: - version "5.1.2" - resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz" - integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== - dependencies: - is-glob "^4.0.1" - -glob-parent@^6.0.2: - version "6.0.2" - resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz" - integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== - dependencies: - is-glob "^4.0.3" - -glob@^7.0.0, glob@^7.0.5, glob@^7.1.1, glob@^7.1.3, glob@^7.1.4, glob@^7.1.7: - version "7.2.3" - resolved "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz" - integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.1.1" - once "^1.3.0" - path-is-absolute "^1.0.0" - -glob@^9.2.0: - version "9.3.2" - resolved "https://registry.npmjs.org/glob/-/glob-9.3.2.tgz" - integrity sha512-BTv/JhKXFEHsErMte/AnfiSv8yYOLLiyH2lTg8vn02O21zWFgHPTfxtgn1QRe7NRgggUhC8hacR2Re94svHqeA== - dependencies: - fs.realpath "^1.0.0" - minimatch "^7.4.1" - minipass "^4.2.4" - path-scurry "^1.6.1" - -globals@^11.1.0: - version "11.12.0" - resolved "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz" - integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== - -globals@^13.19.0: - version "13.24.0" - resolved "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz" - integrity sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ== - dependencies: - type-fest "^0.20.2" - -globby@^11.0.4, globby@^11.1.0: - version "11.1.0" - resolved "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz" - integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== - dependencies: - array-union "^2.1.0" - dir-glob "^3.0.1" - fast-glob "^3.2.9" - ignore "^5.2.0" - merge2 "^1.4.1" - slash "^3.0.0" - -graceful-fs@^4.2.9: - version "4.2.11" - resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz" - integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== - -graphemer@^1.4.0: - version "1.4.0" - resolved "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz" - integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag== - -handlebars@4.7.7: - version "4.7.7" - resolved "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz" - integrity sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA== - dependencies: - minimist "^1.2.5" - neo-async "^2.6.0" - source-map "^0.6.1" - wordwrap "^1.0.0" - optionalDependencies: - uglify-js "^3.1.4" - -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz" - integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== - -has-flag@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz" - integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== - -has-own-prop@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/has-own-prop/-/has-own-prop-2.0.0.tgz" - integrity sha512-Pq0h+hvsVm6dDEa8x82GnLSYHOzNDt7f0ddFa3FqcQlgzEiptPqL+XrOJNavjOzSYiYWIrgeVYYgGlLmnxwilQ== - -has@^1.0.3: - version "1.0.3" - resolved "https://registry.npmjs.org/has/-/has-1.0.3.tgz" - integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== - dependencies: - function-bind "^1.1.1" - -header-case@^2.0.4: - version "2.0.4" - resolved "https://registry.npmjs.org/header-case/-/header-case-2.0.4.tgz" - integrity sha512-H/vuk5TEEVZwrR0lp2zed9OCo1uAILMlx0JEMgC26rzyJJ3N1v6XkwHHXJQdR2doSjcGPM6OKPYoJgf0plJ11Q== - dependencies: - capital-case "^1.0.4" - tslib "^2.0.3" - -html-escaper@^2.0.0: - version "2.0.2" - resolved "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz" - integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== - -http-proxy-agent@7.0.0: - version "7.0.0" - resolved "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.0.tgz" - integrity sha512-+ZT+iBxVUQ1asugqnD6oWoRiS25AkjNfG085dKJGtGxkdwLQrMKU5wJr2bOOFAXzKcTuqq+7fZlTMgG3SRfIYQ== - dependencies: - agent-base "^7.1.0" - debug "^4.3.4" - -https-proxy-agent@7.0.0: - version "7.0.0" - resolved "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.0.tgz" - integrity sha512-0euwPCRyAPSgGdzD1IVN9nJYHtBhJwb6XPfbpQcYbPCwrBidX6GzxmchnaF4sfF/jPb74Ojx5g4yTg3sixlyPw== - dependencies: - agent-base "^7.0.2" - debug "4" - -human-signals@^2.1.0: - version "2.1.0" - resolved "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz" - integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== - -husky@^8.0.3: - version "8.0.3" - resolved "https://registry.npmjs.org/husky/-/husky-8.0.3.tgz" - integrity sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg== - -iconv-lite@^0.4.24: - version "0.4.24" - resolved "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz" - integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== - dependencies: - safer-buffer ">= 2.1.2 < 3" - -ignore@^5.2.0: - version "5.2.4" - resolved "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz" - integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ== - -import-fresh@^3.2.1: - version "3.3.1" - resolved "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz" - integrity sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ== - dependencies: - parent-module "^1.0.0" - resolve-from "^4.0.0" - -import-local@^3.0.2: - version "3.2.0" - resolved "https://registry.npmjs.org/import-local/-/import-local-3.2.0.tgz" - integrity sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA== - dependencies: - pkg-dir "^4.2.0" - resolve-cwd "^3.0.0" - -imurmurhash@^0.1.4: - version "0.1.4" - resolved "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz" - integrity sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA== - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz" - integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@^2.0.1, inherits@~2.0.1, inherits@~2.0.3, inherits@2: - version "2.0.4" - resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - -interpret@^1.0.0: - version "1.4.0" - resolved "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz" - integrity sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA== - -is-arrayish@^0.2.1: - version "0.2.1" - resolved "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz" - integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg== - -is-binary-path@~2.1.0: - version "2.1.0" - resolved "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz" - integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== - dependencies: - binary-extensions "^2.0.0" - -is-core-module@^2.9.0: - version "2.11.0" - resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz" - integrity sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw== - dependencies: - has "^1.0.3" - -is-extglob@^2.1.1: - version "2.1.1" - resolved "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz" - integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== - -is-fullwidth-code-point@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz" - integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== - -is-generator-fn@^2.0.0: - version "2.1.0" - resolved "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz" - integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== - -is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: - version "4.0.3" - resolved "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz" - integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== - dependencies: - is-extglob "^2.1.1" - -is-number@^7.0.0: - version "7.0.0" - resolved "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz" - integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== - -is-path-inside@^3.0.3: - version "3.0.3" - resolved "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz" - integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== - -is-stream@^2.0.0: - version "2.0.1" - resolved "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz" - integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== - -isarray@~1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" - integrity sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ== - -isarray@0.0.1: - version "0.0.1" - resolved "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz" - integrity sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ== - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz" - integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== - -istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: - version "3.2.2" - resolved "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz" - integrity sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg== - -istanbul-lib-instrument@^5.0.4: - version "5.2.1" - resolved "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz" - integrity sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg== - dependencies: - "@babel/core" "^7.12.3" - "@babel/parser" "^7.14.7" - "@istanbuljs/schema" "^0.1.2" - istanbul-lib-coverage "^3.2.0" - semver "^6.3.0" - -istanbul-lib-instrument@^6.0.0: - version "6.0.3" - resolved "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz" - integrity sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q== - dependencies: - "@babel/core" "^7.23.9" - "@babel/parser" "^7.23.9" - "@istanbuljs/schema" "^0.1.3" - istanbul-lib-coverage "^3.2.0" - semver "^7.5.4" - -istanbul-lib-report@^3.0.0: - version "3.0.1" - resolved "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz" - integrity sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw== - dependencies: - istanbul-lib-coverage "^3.0.0" - make-dir "^4.0.0" - supports-color "^7.1.0" - -istanbul-lib-source-maps@^4.0.0: - version "4.0.1" - resolved "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz" - integrity sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw== - dependencies: - debug "^4.1.1" - istanbul-lib-coverage "^3.0.0" - source-map "^0.6.1" - -istanbul-reports@^3.1.3: - version "3.1.7" - resolved "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz" - integrity sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g== - dependencies: - html-escaper "^2.0.0" - istanbul-lib-report "^3.0.0" - -jest-changed-files@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.7.0.tgz" - integrity sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w== - dependencies: - execa "^5.0.0" - jest-util "^29.7.0" - p-limit "^3.1.0" - -jest-circus@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/jest-circus/-/jest-circus-29.7.0.tgz" - integrity sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw== - dependencies: - "@jest/environment" "^29.7.0" - "@jest/expect" "^29.7.0" - "@jest/test-result" "^29.7.0" - "@jest/types" "^29.6.3" - "@types/node" "*" - chalk "^4.0.0" - co "^4.6.0" - dedent "^1.0.0" - is-generator-fn "^2.0.0" - jest-each "^29.7.0" - jest-matcher-utils "^29.7.0" - jest-message-util "^29.7.0" - jest-runtime "^29.7.0" - jest-snapshot "^29.7.0" - jest-util "^29.7.0" - p-limit "^3.1.0" - pretty-format "^29.7.0" - pure-rand "^6.0.0" - slash "^3.0.0" - stack-utils "^2.0.3" - -jest-cli@^29.3.1: - version "29.7.0" - resolved "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz" - integrity sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg== - dependencies: - "@jest/core" "^29.7.0" - "@jest/test-result" "^29.7.0" - "@jest/types" "^29.6.3" - chalk "^4.0.0" - create-jest "^29.7.0" - exit "^0.1.2" - import-local "^3.0.2" - jest-config "^29.7.0" - jest-util "^29.7.0" - jest-validate "^29.7.0" - yargs "^17.3.1" - -jest-config@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/jest-config/-/jest-config-29.7.0.tgz" - integrity sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ== - dependencies: - "@babel/core" "^7.11.6" - "@jest/test-sequencer" "^29.7.0" - "@jest/types" "^29.6.3" - babel-jest "^29.7.0" - chalk "^4.0.0" - ci-info "^3.2.0" - deepmerge "^4.2.2" - glob "^7.1.3" - graceful-fs "^4.2.9" - jest-circus "^29.7.0" - jest-environment-node "^29.7.0" - jest-get-type "^29.6.3" - jest-regex-util "^29.6.3" - jest-resolve "^29.7.0" - jest-runner "^29.7.0" - jest-util "^29.7.0" - jest-validate "^29.7.0" - micromatch "^4.0.4" - parse-json "^5.2.0" - pretty-format "^29.7.0" - slash "^3.0.0" - strip-json-comments "^3.1.1" - -jest-diff@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz" - integrity sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw== - dependencies: - chalk "^4.0.0" - diff-sequences "^29.6.3" - jest-get-type "^29.6.3" - pretty-format "^29.7.0" - -jest-docblock@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.7.0.tgz" - integrity sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g== - dependencies: - detect-newline "^3.0.0" - -jest-each@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/jest-each/-/jest-each-29.7.0.tgz" - integrity sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ== - dependencies: - "@jest/types" "^29.6.3" - chalk "^4.0.0" - jest-get-type "^29.6.3" - jest-util "^29.7.0" - pretty-format "^29.7.0" - -jest-environment-node@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz" - integrity sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw== - dependencies: - "@jest/environment" "^29.7.0" - "@jest/fake-timers" "^29.7.0" - "@jest/types" "^29.6.3" - "@types/node" "*" - jest-mock "^29.7.0" - jest-util "^29.7.0" - -jest-get-type@^29.6.3: - version "29.6.3" - resolved "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz" - integrity sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw== - -jest-haste-map@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz" - integrity sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA== - dependencies: - "@jest/types" "^29.6.3" - "@types/graceful-fs" "^4.1.3" - "@types/node" "*" - anymatch "^3.0.3" - fb-watchman "^2.0.0" - graceful-fs "^4.2.9" - jest-regex-util "^29.6.3" - jest-util "^29.7.0" - jest-worker "^29.7.0" - micromatch "^4.0.4" - walker "^1.0.8" - optionalDependencies: - fsevents "^2.3.2" - -jest-leak-detector@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz" - integrity sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw== - dependencies: - jest-get-type "^29.6.3" - pretty-format "^29.7.0" - -jest-matcher-utils@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz" - integrity sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g== - dependencies: - chalk "^4.0.0" - jest-diff "^29.7.0" - jest-get-type "^29.6.3" - pretty-format "^29.7.0" - -jest-message-util@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz" - integrity sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w== - dependencies: - "@babel/code-frame" "^7.12.13" - "@jest/types" "^29.6.3" - "@types/stack-utils" "^2.0.0" - chalk "^4.0.0" - graceful-fs "^4.2.9" - micromatch "^4.0.4" - pretty-format "^29.7.0" - slash "^3.0.0" - stack-utils "^2.0.3" - -jest-mock@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz" - integrity sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw== - dependencies: - "@jest/types" "^29.6.3" - "@types/node" "*" - jest-util "^29.7.0" - -jest-pnp-resolver@^1.2.2: - version "1.2.3" - resolved "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz" - integrity sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w== - -jest-regex-util@^29.6.3: - version "29.6.3" - resolved "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz" - integrity sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg== - -jest-resolve-dependencies@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz" - integrity sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA== - dependencies: - jest-regex-util "^29.6.3" - jest-snapshot "^29.7.0" - -jest-resolve@*, jest-resolve@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz" - integrity sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA== - dependencies: - chalk "^4.0.0" - graceful-fs "^4.2.9" - jest-haste-map "^29.7.0" - jest-pnp-resolver "^1.2.2" - jest-util "^29.7.0" - jest-validate "^29.7.0" - resolve "^1.20.0" - resolve.exports "^2.0.0" - slash "^3.0.0" - -jest-runner@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/jest-runner/-/jest-runner-29.7.0.tgz" - integrity sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ== - dependencies: - "@jest/console" "^29.7.0" - "@jest/environment" "^29.7.0" - "@jest/test-result" "^29.7.0" - "@jest/transform" "^29.7.0" - "@jest/types" "^29.6.3" - "@types/node" "*" - chalk "^4.0.0" - emittery "^0.13.1" - graceful-fs "^4.2.9" - jest-docblock "^29.7.0" - jest-environment-node "^29.7.0" - jest-haste-map "^29.7.0" - jest-leak-detector "^29.7.0" - jest-message-util "^29.7.0" - jest-resolve "^29.7.0" - jest-runtime "^29.7.0" - jest-util "^29.7.0" - jest-watcher "^29.7.0" - jest-worker "^29.7.0" - p-limit "^3.1.0" - source-map-support "0.5.13" - -jest-runtime@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.7.0.tgz" - integrity sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ== - dependencies: - "@jest/environment" "^29.7.0" - "@jest/fake-timers" "^29.7.0" - "@jest/globals" "^29.7.0" - "@jest/source-map" "^29.6.3" - "@jest/test-result" "^29.7.0" - "@jest/transform" "^29.7.0" - "@jest/types" "^29.6.3" - "@types/node" "*" - chalk "^4.0.0" - cjs-module-lexer "^1.0.0" - collect-v8-coverage "^1.0.0" - glob "^7.1.3" - graceful-fs "^4.2.9" - jest-haste-map "^29.7.0" - jest-message-util "^29.7.0" - jest-mock "^29.7.0" - jest-regex-util "^29.6.3" - jest-resolve "^29.7.0" - jest-snapshot "^29.7.0" - jest-util "^29.7.0" - slash "^3.0.0" - strip-bom "^4.0.0" - -jest-snapshot@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz" - integrity sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw== - dependencies: - "@babel/core" "^7.11.6" - "@babel/generator" "^7.7.2" - "@babel/plugin-syntax-jsx" "^7.7.2" - "@babel/plugin-syntax-typescript" "^7.7.2" - "@babel/types" "^7.3.3" - "@jest/expect-utils" "^29.7.0" - "@jest/transform" "^29.7.0" - "@jest/types" "^29.6.3" - babel-preset-current-node-syntax "^1.0.0" - chalk "^4.0.0" - expect "^29.7.0" - graceful-fs "^4.2.9" - jest-diff "^29.7.0" - jest-get-type "^29.6.3" - jest-matcher-utils "^29.7.0" - jest-message-util "^29.7.0" - jest-util "^29.7.0" - natural-compare "^1.4.0" - pretty-format "^29.7.0" - semver "^7.5.3" - -jest-summary-reporter@0.0.2: - version "0.0.2" - resolved "https://registry.npmjs.org/jest-summary-reporter/-/jest-summary-reporter-0.0.2.tgz" - integrity sha512-rZ3ThO57l+ZJCxF74cXIGQU3cV9I7bSBe1ElBp0taE3x2JghgD69bNCKt0LvpVQX5azTRHG7LmcjIpwriVnTng== - dependencies: - chalk "^2.4.1" - -jest-util@^29.0.0, jest-util@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz" - integrity sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA== - dependencies: - "@jest/types" "^29.6.3" - "@types/node" "*" - chalk "^4.0.0" - ci-info "^3.2.0" - graceful-fs "^4.2.9" - picomatch "^2.2.3" - -jest-validate@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz" - integrity sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw== - dependencies: - "@jest/types" "^29.6.3" - camelcase "^6.2.0" - chalk "^4.0.0" - jest-get-type "^29.6.3" - leven "^3.1.0" - pretty-format "^29.7.0" - -jest-watcher@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.7.0.tgz" - integrity sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g== - dependencies: - "@jest/test-result" "^29.7.0" - "@jest/types" "^29.6.3" - "@types/node" "*" - ansi-escapes "^4.2.1" - chalk "^4.0.0" - emittery "^0.13.1" - jest-util "^29.7.0" - string-length "^4.0.1" - -jest-worker@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz" - integrity sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw== - dependencies: - "@types/node" "*" - jest-util "^29.7.0" - merge-stream "^2.0.0" - supports-color "^8.0.0" - -jest@^29.0.0, jest@29.3.1: - version "29.3.1" - resolved "https://registry.npmjs.org/jest/-/jest-29.3.1.tgz" - integrity sha512-6iWfL5DTT0Np6UYs/y5Niu7WIfNv/wRTtN5RSXt2DIEft3dx3zPuw/3WJQBCJfmEzvDiEKwoqMbGD9n49+qLSA== - dependencies: - "@jest/core" "^29.3.1" - "@jest/types" "^29.3.1" - import-local "^3.0.2" - jest-cli "^29.3.1" - -js-tokens@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz" - integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== - -js-yaml@^3.13.1: - version "3.14.1" - resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz" - integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" - -js-yaml@^4.1.0: - version "4.1.0" - resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz" - integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== - dependencies: - argparse "^2.0.1" - -jsesc@^3.0.2: - version "3.1.0" - resolved "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz" - integrity sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA== - -json-buffer@3.0.1: - version "3.0.1" - resolved "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz" - integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== - -json-parse-even-better-errors@^2.3.0: - version "2.3.1" - resolved "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz" - integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== - -json-schema-to-typescript@15.0.4: - version "15.0.4" - resolved "https://registry.npmjs.org/json-schema-to-typescript/-/json-schema-to-typescript-15.0.4.tgz" - integrity sha512-Su9oK8DR4xCmDsLlyvadkXzX6+GGXJpbhwoLtOGArAG61dvbW4YQmSEno2y66ahpIdmLMg6YUf/QHLgiwvkrHQ== - dependencies: - "@apidevtools/json-schema-ref-parser" "^11.5.5" - "@types/json-schema" "^7.0.15" - "@types/lodash" "^4.17.7" - is-glob "^4.0.3" - js-yaml "^4.1.0" - lodash "^4.17.21" - minimist "^1.2.8" - prettier "^3.2.5" - tinyglobby "^0.2.9" - -json-schema-traverse@^0.4.1: - version "0.4.1" - resolved "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz" - integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== - -json-stable-stringify-without-jsonify@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz" - integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== - -json5@^2.2.1, json5@^2.2.3: - version "2.2.3" - resolved "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz" - integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== - -jsonpath@1.1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/jsonpath/-/jsonpath-1.1.1.tgz" - integrity sha512-l6Cg7jRpixfbgoWgkrl77dgEj8RPvND0wMH6TwQmi9Qs4TFfS9u5cUFnbeKTwj5ga5Y3BTGGNI28k117LJ009w== - dependencies: - esprima "1.2.2" - static-eval "2.0.2" - underscore "1.12.1" - -keyv@^4.5.3: - version "4.5.4" - resolved "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz" - integrity sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw== - dependencies: - json-buffer "3.0.1" - -kleur@^3.0.3: - version "3.0.3" - resolved "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz" - integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== - -leven@^3.1.0: - version "3.1.0" - resolved "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz" - integrity sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A== - -levn@^0.4.1: - version "0.4.1" - resolved "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz" - integrity sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ== - dependencies: - prelude-ls "^1.2.1" - type-check "~0.4.0" - -levn@~0.3.0: - version "0.3.0" - resolved "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz" - integrity sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA== - dependencies: - prelude-ls "~1.1.2" - type-check "~0.3.2" - -lines-and-columns@^1.1.6: - version "1.2.4" - resolved "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz" - integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== - -locate-path@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz" - integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== - dependencies: - p-locate "^4.1.0" - -locate-path@^6.0.0: - version "6.0.0" - resolved "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz" - integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== - dependencies: - p-locate "^5.0.0" - -lodash.memoize@4.x: - version "4.1.2" - resolved "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz" - integrity sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag== - -lodash.merge@^4.6.2: - version "4.6.2" - resolved "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz" - integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== - -lodash@^4.17.21, lodash@4.17.21: - version "4.17.21" - resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz" - integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== - -lower-case@^2.0.2: - version "2.0.2" - resolved "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz" - integrity sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg== - dependencies: - tslib "^2.0.3" - -lru-cache@^10.2.0: - version "10.4.3" - resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz" - integrity sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ== - -lru-cache@^5.1.1: - version "5.1.1" - resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz" - integrity sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w== - dependencies: - yallist "^3.0.2" - -lru-cache@^6.0.0: - version "6.0.0" - resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz" - integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== - dependencies: - yallist "^4.0.0" - -make-dir@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz" - integrity sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw== - dependencies: - semver "^7.5.3" - -make-error@^1.1.1, make-error@1.x: - version "1.3.6" - resolved "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz" - integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== - -makeerror@1.0.12: - version "1.0.12" - resolved "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz" - integrity sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg== - dependencies: - tmpl "1.0.5" - -merge-stream@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz" - integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== - -merge2@^1.3.0, merge2@^1.4.1: - version "1.4.1" - resolved "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz" - integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== - -micromatch@^4.0.4: - version "4.0.8" - resolved "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz" - integrity sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA== - dependencies: - braces "^3.0.3" - picomatch "^2.3.1" - -mime-db@1.52.0: - version "1.52.0" - resolved "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz" - integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== - -mime-types@^2.1.12: - version "2.1.35" - resolved "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz" - integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== - dependencies: - mime-db "1.52.0" - -mimic-fn@^2.1.0: - version "2.1.0" - resolved "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz" - integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== - -minimatch@^3.0.3, minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: - version "3.1.2" - resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz" - integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== - dependencies: - brace-expansion "^1.1.7" - -minimatch@^7.4.1: - version "7.4.3" - resolved "https://registry.npmjs.org/minimatch/-/minimatch-7.4.3.tgz" - integrity sha512-5UB4yYusDtkRPbRiy1cqZ1IpGNcJCGlEMG17RKzPddpyiPKoCdwohbED8g4QXT0ewCt8LTkQXuljsUfQ3FKM4A== - dependencies: - brace-expansion "^2.0.1" - -minimist@^1.2.5, minimist@^1.2.6, minimist@^1.2.8: - version "1.2.8" - resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz" - integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== - -minipass@^4.2.4: - version "4.2.5" - resolved "https://registry.npmjs.org/minipass/-/minipass-4.2.5.tgz" - integrity sha512-+yQl7SX3bIT83Lhb4BVorMAHVuqsskxRdlmO9kTpyukp8vsm2Sn/fUOV9xlnG8/a5JsypJzap21lz/y3FBMJ8Q== - -"minipass@^5.0.0 || ^6.0.2 || ^7.0.0": - version "7.1.2" - resolved "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz" - integrity sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw== - -mkdirp@^0.5.3: - version "0.5.6" - resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz" - integrity sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw== - dependencies: - minimist "^1.2.6" - -mkdirp@^1.0.4: - version "1.0.4" - resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz" - integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== - -ms@2.1.2: - version "2.1.2" - resolved "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz" - integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== - -mute-stream@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/mute-stream/-/mute-stream-2.0.0.tgz" - integrity sha512-WWdIxpyjEn+FhQJQQv9aQAYlHoNVdzIzUySNV1gHUPDSdZJ3yZn7pAAbQcV7B56Mvu881q9FZV+0Vx2xC44VWA== - -mylas@^2.1.9: - version "2.1.13" - resolved "https://registry.npmjs.org/mylas/-/mylas-2.1.13.tgz" - integrity sha512-+MrqnJRtxdF+xngFfUUkIMQrUUL0KsxbADUkn23Z/4ibGg192Q+z+CQyiYwvWTsYjJygmMR8+w3ZDa98Zh6ESg== - -natural-compare-lite@^1.4.0: - version "1.4.0" - resolved "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz" - integrity sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g== - -natural-compare@^1.4.0: - version "1.4.0" - resolved "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz" - integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== - -neo-async@^2.6.0: - version "2.6.2" - resolved "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz" - integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== - -no-case@^3.0.4: - version "3.0.4" - resolved "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz" - integrity sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg== - dependencies: - lower-case "^2.0.2" - tslib "^2.0.3" - -node-int64@^0.4.0: - version "0.4.0" - resolved "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz" - integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== - -node-releases@^2.0.19: - version "2.0.19" - resolved "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz" - integrity sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw== - -noms@0.0.0: - version "0.0.0" - resolved "https://registry.npmjs.org/noms/-/noms-0.0.0.tgz" - integrity sha512-lNDU9VJaOPxUmXcLb+HQFeUgQQPtMI24Gt6hgfuMHRJgMRHMF/qZ4HJD3GDru4sSw9IQl2jPjAYnQrdIeLbwow== - dependencies: - inherits "^2.0.1" - readable-stream "~1.0.31" - -normalize-path@^3.0.0, normalize-path@~3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz" - integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== - -npm-run-path@^4.0.1: - version "4.0.1" - resolved "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz" - integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== - dependencies: - path-key "^3.0.0" - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.npmjs.org/once/-/once-1.4.0.tgz" - integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== - dependencies: - wrappy "1" - -onetime@^5.1.2: - version "5.1.2" - resolved "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz" - integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== - dependencies: - mimic-fn "^2.1.0" - -optionator@^0.8.1: - version "0.8.3" - resolved "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz" - integrity sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA== - dependencies: - deep-is "~0.1.3" - fast-levenshtein "~2.0.6" - levn "~0.3.0" - prelude-ls "~1.1.2" - type-check "~0.3.2" - word-wrap "~1.2.3" - -optionator@^0.9.3: - version "0.9.4" - resolved "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz" - integrity sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g== - dependencies: - deep-is "^0.1.3" - fast-levenshtein "^2.0.6" - levn "^0.4.1" - prelude-ls "^1.2.1" - type-check "^0.4.0" - word-wrap "^1.2.5" - -os-tmpdir@~1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz" - integrity sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g== - -p-limit@^2.2.0: - version "2.3.0" - resolved "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz" - integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== - dependencies: - p-try "^2.0.0" - -p-limit@^3.0.2, p-limit@^3.1.0: - version "3.1.0" - resolved "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz" - integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== - dependencies: - yocto-queue "^0.1.0" - -p-locate@^4.1.0: - version "4.1.0" - resolved "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz" - integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== - dependencies: - p-limit "^2.2.0" - -p-locate@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz" - integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== - dependencies: - p-limit "^3.0.2" - -p-try@^2.0.0: - version "2.2.0" - resolved "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz" - integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== - -param-case@^3.0.4: - version "3.0.4" - resolved "https://registry.npmjs.org/param-case/-/param-case-3.0.4.tgz" - integrity sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A== - dependencies: - dot-case "^3.0.4" - tslib "^2.0.3" - -parent-module@^1.0.0: - version "1.0.1" - resolved "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz" - integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== - dependencies: - callsites "^3.0.0" - -parse-json@^5.2.0: - version "5.2.0" - resolved "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz" - integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== - dependencies: - "@babel/code-frame" "^7.0.0" - error-ex "^1.3.1" - json-parse-even-better-errors "^2.3.0" - lines-and-columns "^1.1.6" - -pascal-case@^3.1.2: - version "3.1.2" - resolved "https://registry.npmjs.org/pascal-case/-/pascal-case-3.1.2.tgz" - integrity sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g== - dependencies: - no-case "^3.0.4" - tslib "^2.0.3" - -path-case@^3.0.4: - version "3.0.4" - resolved "https://registry.npmjs.org/path-case/-/path-case-3.0.4.tgz" - integrity sha512-qO4qCFjXqVTrcbPt/hQfhTQ+VhFsqNKOPtytgNKkKxSoEp3XPUQ8ObFuePylOIok5gjn69ry8XiULxCwot3Wfg== - dependencies: - dot-case "^3.0.4" - tslib "^2.0.3" - -path-equal@^1.2.5: - version "1.2.5" - resolved "https://registry.npmjs.org/path-equal/-/path-equal-1.2.5.tgz" - integrity sha512-i73IctDr3F2W+bsOWDyyVm/lqsXO47aY9nsFZUjTT/aljSbkxHxxCoyZ9UUrM8jK0JVod+An+rl48RCsvWM+9g== - -path-exists@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz" - integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== - -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" - integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== - -path-key@^3.0.0, path-key@^3.1.0: - version "3.1.1" - resolved "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz" - integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== - -path-parse@^1.0.7: - version "1.0.7" - resolved "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz" - integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== - -path-scurry@^1.6.1: - version "1.11.1" - resolved "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz" - integrity sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA== - dependencies: - lru-cache "^10.2.0" - minipass "^5.0.0 || ^6.0.2 || ^7.0.0" - -path-type@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz" - integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== - -picocolors@^1.0.0, picocolors@^1.1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz" - integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA== - -picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3, picomatch@^2.3.1: - version "2.3.1" - resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz" - integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== - -"picomatch@^3 || ^4", picomatch@^4.0.2: - version "4.0.2" - resolved "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz" - integrity sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg== - -pirates@^4.0.4: - version "4.0.6" - resolved "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz" - integrity sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg== - -pkg-dir@^4.2.0: - version "4.2.0" - resolved "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz" - integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== - dependencies: - find-up "^4.0.0" - -plimit-lit@^1.2.6: - version "1.5.0" - resolved "https://registry.npmjs.org/plimit-lit/-/plimit-lit-1.5.0.tgz" - integrity sha512-Eb/MqCb1Iv/ok4m1FqIXqvUKPISufcjZ605hl3KM/n8GaX8zfhtgdLwZU3vKjuHGh2O9Rjog/bHTq8ofIShdng== - dependencies: - queue-lit "^1.5.0" - -prelude-ls@^1.2.1: - version "1.2.1" - resolved "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz" - integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== - -prelude-ls@~1.1.2: - version "1.1.2" - resolved "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz" - integrity sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w== - -prettier-linter-helpers@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz" - integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w== - dependencies: - fast-diff "^1.1.2" - -prettier@^3.2.5: - version "3.3.3" - resolved "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz" - integrity sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew== - -prettier@>=2.0.0, prettier@3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/prettier/-/prettier-3.0.0.tgz" - integrity sha512-zBf5eHpwHOGPC47h0zrPyNn+eAEIdEzfywMoYn2XPi0P44Zp0tSq64rq0xAREh4auw2cJZHo9QUob+NqCQky4g== - -pretty-format@^29.0.0, pretty-format@^29.7.0: - version "29.7.0" - resolved "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz" - integrity sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ== - dependencies: - "@jest/schemas" "^29.6.3" - ansi-styles "^5.0.0" - react-is "^18.0.0" - -process-nextick-args@~2.0.0: - version "2.0.1" - resolved "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz" - integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== - -prompts@^2.0.1: - version "2.4.2" - resolved "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz" - integrity sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q== - dependencies: - kleur "^3.0.3" - sisteransi "^1.0.5" - -proxy-from-env@^1.1.0: - version "1.1.0" - resolved "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz" - integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== - -punycode@^2.1.0: - version "2.3.1" - resolved "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz" - integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== - -pure-rand@^6.0.0: - version "6.1.0" - resolved "https://registry.npmjs.org/pure-rand/-/pure-rand-6.1.0.tgz" - integrity sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA== - -queue-lit@^1.5.0: - version "1.5.0" - resolved "https://registry.npmjs.org/queue-lit/-/queue-lit-1.5.0.tgz" - integrity sha512-IslToJ4eiCEE9xwMzq3viOO5nH8sUWUCwoElrhNMozzr9IIt2qqvB4I+uHu/zJTQVqc9R5DFwok4ijNK1pU3fA== - -queue-microtask@^1.2.2: - version "1.2.3" - resolved "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz" - integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== - -react-is@^18.0.0: - version "18.3.1" - resolved "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz" - integrity sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg== - -readable-stream@~1.0.31: - version "1.0.34" - resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz" - integrity sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg== - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "0.0.1" - string_decoder "~0.10.x" - -readable-stream@~2.3.6: - version "2.3.8" - resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz" - integrity sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA== - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.3" - isarray "~1.0.0" - process-nextick-args "~2.0.0" - safe-buffer "~5.1.1" - string_decoder "~1.1.1" - util-deprecate "~1.0.1" - -readdirp@~3.6.0: - version "3.6.0" - resolved "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz" - integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== - dependencies: - picomatch "^2.2.1" - -rechoir@^0.6.2: - version "0.6.2" - resolved "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz" - integrity sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw== - dependencies: - resolve "^1.1.6" - -repeat-string@^1.6.1: - version "1.6.1" - resolved "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz" - integrity sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w== - -require-directory@^2.1.1: - version "2.1.1" - resolved "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz" - integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== - -resolve-cwd@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz" - integrity sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg== - dependencies: - resolve-from "^5.0.0" - -resolve-from@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz" - integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== - -resolve-from@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz" - integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== - -resolve.exports@^2.0.0: - version "2.0.3" - resolved "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.3.tgz" - integrity sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A== - -resolve@^1.1.6, resolve@^1.20.0, resolve@^1.3.2: - version "1.22.1" - resolved "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz" - integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== - dependencies: - is-core-module "^2.9.0" - path-parse "^1.0.7" - supports-preserve-symlinks-flag "^1.0.0" - -reusify@^1.0.4: - version "1.0.4" - resolved "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz" - integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== - -rimraf@^3.0.2: - version "3.0.2" - resolved "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz" - integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== - dependencies: - glob "^7.1.3" - -rimraf@4.4.1: - version "4.4.1" - resolved "https://registry.npmjs.org/rimraf/-/rimraf-4.4.1.tgz" - integrity sha512-Gk8NlF062+T9CqNGn6h4tls3k6T1+/nXdOcSZVikNVtlRdYpA7wRJJMoXmuvOnLW844rPjdQ7JgXCYM6PPC/og== - dependencies: - glob "^9.2.0" - -run-parallel@^1.1.9: - version "1.2.0" - resolved "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz" - integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== - dependencies: - queue-microtask "^1.2.2" - -safe-buffer@~5.1.0, safe-buffer@~5.1.1: - version "5.1.2" - resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== - -safe-stable-stringify@^2.2.0: - version "2.4.3" - resolved "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.4.3.tgz" - integrity sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g== - -"safer-buffer@>= 2.1.2 < 3": - version "2.1.2" - resolved "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== - -semver@^5.3.0: - version "5.7.2" - resolved "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz" - integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== - -semver@^6.3.0: - version "6.3.1" - resolved "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz" - integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== - -semver@^6.3.1: - version "6.3.1" - resolved "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz" - integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== - -semver@^7.3.7, semver@^7.5.3, semver@^7.5.4, semver@7.5.4, semver@7.x: - version "7.5.4" - resolved "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz" - integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== - dependencies: - lru-cache "^6.0.0" - -sentence-case@^3.0.4: - version "3.0.4" - resolved "https://registry.npmjs.org/sentence-case/-/sentence-case-3.0.4.tgz" - integrity sha512-8LS0JInaQMCRoQ7YUytAo/xUu5W2XnQxV2HI/6uM6U7CITS1RqPElr30V6uIqyMKM9lJGRVFy5/4CuzcixNYSg== - dependencies: - no-case "^3.0.4" - tslib "^2.0.3" - upper-case-first "^2.0.2" - -shebang-command@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz" - integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== - dependencies: - shebang-regex "^3.0.0" - -shebang-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz" - integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== - -shelljs@0.8.5: - version "0.8.5" - resolved "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz" - integrity sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow== - dependencies: - glob "^7.0.0" - interpret "^1.0.0" - rechoir "^0.6.2" - -signal-exit@^3.0.3, signal-exit@^3.0.7: - version "3.0.7" - resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz" - integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== - -signal-exit@^4.1.0: - version "4.1.0" - resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz" - integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw== - -sisteransi@^1.0.5: - version "1.0.5" - resolved "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz" - integrity sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg== - -slash@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz" - integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== - -slugify@1.6.6: - version "1.6.6" - resolved "https://registry.npmjs.org/slugify/-/slugify-1.6.6.tgz" - integrity sha512-h+z7HKHYXj6wJU+AnS/+IH8Uh9fdcX1Lrhg1/VMdf9PwoBQXFcXiAdsy2tSK0P6gKwJLXp02r90ahUCqHk9rrw== - -snake-case@^3.0.4: - version "3.0.4" - resolved "https://registry.npmjs.org/snake-case/-/snake-case-3.0.4.tgz" - integrity sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg== - dependencies: - dot-case "^3.0.4" - tslib "^2.0.3" - -socket.io-client@4.7.5: - version "4.7.5" - resolved "https://registry.npmjs.org/socket.io-client/-/socket.io-client-4.7.5.tgz" - integrity sha512-sJ/tqHOCe7Z50JCBCXrsY3I2k03iOiUe+tj1OmKeD2lXPiGH/RUCdTZFoqVyN7l1MnpIzPrGtLcijffmeouNlQ== - dependencies: - "@socket.io/component-emitter" "~3.1.0" - debug "~4.3.2" - engine.io-client "~6.5.2" - socket.io-parser "~4.2.4" - -socket.io-parser@~4.2.4: - version "4.2.4" - resolved "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.4.tgz" - integrity sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew== - dependencies: - "@socket.io/component-emitter" "~3.1.0" - debug "~4.3.1" - -source-map-support@0.5.13: - version "0.5.13" - resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz" - integrity sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - -source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: - version "0.6.1" - resolved "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== - -sprintf-js@~1.0.2: - version "1.0.3" - resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz" - integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g== - -stack-utils@^2.0.3: - version "2.0.6" - resolved "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz" - integrity sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ== - dependencies: - escape-string-regexp "^2.0.0" - -static-eval@2.0.2: - version "2.0.2" - resolved "https://registry.npmjs.org/static-eval/-/static-eval-2.0.2.tgz" - integrity sha512-N/D219Hcr2bPjLxPiV+TQE++Tsmrady7TqAJugLy7Xk1EumfDWS/f5dtBbkRCGE7wKKXuYockQoj8Rm2/pVKyg== - dependencies: - escodegen "^1.8.1" - -string_decoder@~0.10.x: - version "0.10.31" - resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" - integrity sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ== - -string_decoder@~1.1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz" - integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== - dependencies: - safe-buffer "~5.1.0" - -string-length@^4.0.1: - version "4.0.2" - resolved "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz" - integrity sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ== - dependencies: - char-regex "^1.0.2" - strip-ansi "^6.0.0" - -string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: - version "4.2.3" - resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - -strip-bom@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz" - integrity sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w== - -strip-final-newline@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz" - integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== - -strip-json-comments@^3.1.1: - version "3.1.1" - resolved "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz" - integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== - -supports-color@^5.3.0: - version "5.5.0" - resolved "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - -supports-color@^7.1.0: - version "7.2.0" - resolved "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz" - integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== - dependencies: - has-flag "^4.0.0" - -supports-color@^8.0.0: - version "8.1.1" - resolved "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz" - integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== - dependencies: - has-flag "^4.0.0" - -supports-preserve-symlinks-flag@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz" - integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== - -test-exclude@^6.0.0: - version "6.0.0" - resolved "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz" - integrity sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w== - dependencies: - "@istanbuljs/schema" "^0.1.2" - glob "^7.1.4" - minimatch "^3.0.4" - -text-table@^0.2.0: - version "0.2.0" - resolved "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz" - integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw== - -through2@^2.0.1: - version "2.0.5" - resolved "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz" - integrity sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ== - dependencies: - readable-stream "~2.3.6" - xtend "~4.0.1" - -tinyglobby@^0.2.9: - version "0.2.10" - resolved "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.10.tgz" - integrity sha512-Zc+8eJlFMvgatPZTl6A9L/yht8QqdmUNtURHaKZLmKBE12hNPSrqNkUp2cs3M/UKmNVVAMFQYSjYIVHDjW5zew== - dependencies: - fdir "^6.4.2" - picomatch "^4.0.2" - -title-case@^3.0.3: - version "3.0.3" - resolved "https://registry.npmjs.org/title-case/-/title-case-3.0.3.tgz" - integrity sha512-e1zGYRvbffpcHIrnuqT0Dh+gEJtDaxDSoG4JAIpq4oDFyooziLBIiYQv0GBT4FUAnUop5uZ1hiIAj7oAF6sOCA== - dependencies: - tslib "^2.0.3" - -tmp@^0.0.33: - version "0.0.33" - resolved "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz" - integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== - dependencies: - os-tmpdir "~1.0.2" - -tmpl@1.0.5: - version "1.0.5" - resolved "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz" - integrity sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw== - -to-regex-range@^5.0.1: - version "5.0.1" - resolved "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz" - integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== - dependencies: - is-number "^7.0.0" - -ts-jest@29.0.3: - version "29.0.3" - resolved "https://registry.npmjs.org/ts-jest/-/ts-jest-29.0.3.tgz" - integrity sha512-Ibygvmuyq1qp/z3yTh9QTwVVAbFdDy/+4BtIQR2sp6baF2SJU/8CKK/hhnGIDY2L90Az2jIqTwZPnN2p+BweiQ== - dependencies: - bs-logger "0.x" - fast-json-stable-stringify "2.x" - jest-util "^29.0.0" - json5 "^2.2.1" - lodash.memoize "4.x" - make-error "1.x" - semver "7.x" - yargs-parser "^21.0.1" - -ts-node@^10.9.1, ts-node@>=9.0.0: - version "10.9.1" - resolved "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz" - integrity sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw== - dependencies: - "@cspotcode/source-map-support" "^0.8.0" - "@tsconfig/node10" "^1.0.7" - "@tsconfig/node12" "^1.0.7" - "@tsconfig/node14" "^1.0.0" - "@tsconfig/node16" "^1.0.2" - acorn "^8.4.1" - acorn-walk "^8.1.1" - arg "^4.1.0" - create-require "^1.1.0" - diff "^4.0.1" - make-error "^1.1.1" - v8-compile-cache-lib "^3.0.1" - yn "3.1.1" - -tsc-alias@1.8.6: - version "1.8.6" - resolved "https://registry.npmjs.org/tsc-alias/-/tsc-alias-1.8.6.tgz" - integrity sha512-vq+i6VpE83IeMsSJVcFN03ZBofADhr8/gIJXjxpbnTRfN/MFXy0+SBaKG2o7p95QqXBGkeG98HYz3IkOOveFbg== - dependencies: - chokidar "^3.5.3" - commander "^9.0.0" - globby "^11.0.4" - mylas "^2.1.9" - normalize-path "^3.0.0" - plimit-lit "^1.2.6" - -tslib@^1.13.0: - version "1.14.1" - resolved "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz" - integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== - -tslib@^1.8.1: - version "1.14.1" - resolved "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz" - integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== - -tslib@^2.0.3: - version "2.5.0" - resolved "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz" - integrity sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg== - -tslint-config-prettier@1.18.0: - version "1.18.0" - resolved "https://registry.npmjs.org/tslint-config-prettier/-/tslint-config-prettier-1.18.0.tgz" - integrity sha512-xPw9PgNPLG3iKRxmK7DWr+Ea/SzrvfHtjFt5LBl61gk2UBG/DB9kCXRjv+xyIU1rUtnayLeMUVJBcMX8Z17nDg== - -tslint@6.1.3: - version "6.1.3" - resolved "https://registry.npmjs.org/tslint/-/tslint-6.1.3.tgz" - integrity sha512-IbR4nkT96EQOvKE2PW/djGz8iGNeJ4rF2mBfiYaR/nvUWYKJhLwimoJKgjIFEIDibBtOevj7BqCRL4oHeWWUCg== - dependencies: - "@babel/code-frame" "^7.0.0" - builtin-modules "^1.1.1" - chalk "^2.3.0" - commander "^2.12.1" - diff "^4.0.1" - glob "^7.1.1" - js-yaml "^3.13.1" - minimatch "^3.0.4" - mkdirp "^0.5.3" - resolve "^1.3.2" - semver "^5.3.0" - tslib "^1.13.0" - tsutils "^2.29.0" - -tsutils@^2.29.0: - version "2.29.0" - resolved "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz" - integrity sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA== - dependencies: - tslib "^1.8.1" - -tsutils@^3.21.0: - version "3.21.0" - resolved "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz" - integrity sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA== - dependencies: - tslib "^1.8.1" - -type-check@^0.4.0, type-check@~0.4.0: - version "0.4.0" - resolved "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz" - integrity sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew== - dependencies: - prelude-ls "^1.2.1" - -type-check@~0.3.2: - version "0.3.2" - resolved "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz" - integrity sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg== - dependencies: - prelude-ls "~1.1.2" - -type-detect@4.0.8: - version "4.0.8" - resolved "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz" - integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== - -type-fest@^0.20.2: - version "0.20.2" - resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz" - integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== - -type-fest@^0.21.3: - version "0.21.3" - resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz" - integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== - -typescript-json-schema@0.63.0: - version "0.63.0" - resolved "https://registry.npmjs.org/typescript-json-schema/-/typescript-json-schema-0.63.0.tgz" - integrity sha512-vBfMBq4U/rZ5FIRi7u4o/YAdeRHsSabdGHogUlCPi0cYU0CGvS4Bdu8bSzyUsF+Kf5PTQUGh2TictJuQTDK6eQ== - dependencies: - "@types/json-schema" "^7.0.9" - "@types/node" "^16.9.2" - glob "^7.1.7" - path-equal "^1.2.5" - safe-stable-stringify "^2.2.0" - ts-node "^10.9.1" - typescript "~5.1.0" - yargs "^17.1.1" - -"typescript@>=2.1.0 || >=2.1.0-dev || >=2.2.0-dev || >=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev || >= 3.0.0-dev || >= 3.1.0-dev", "typescript@>=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev || >=3.0.0-dev || >= 3.1.0-dev || >= 3.2.0-dev || >= 4.0.0-dev", typescript@>=2.7, "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta", typescript@>=4.3, typescript@~5.1.0, typescript@5.1.6: - version "5.1.6" - resolved "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz" - integrity sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA== - -uglify-js@^3.1.4: - version "3.17.4" - resolved "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz" - integrity sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g== - -underscore@1.12.1: - version "1.12.1" - resolved "https://registry.npmjs.org/underscore/-/underscore-1.12.1.tgz" - integrity sha512-hEQt0+ZLDVUMhebKxL4x1BTtDY7bavVofhZ9KZ4aI26X9SRaE+Y3m83XUL1UP2jn8ynjndwCCpEHdUG+9pP1Tw== - -untildify@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz" - integrity sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw== - -update-browserslist-db@^1.1.1: - version "1.1.3" - resolved "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.3.tgz" - integrity sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw== - dependencies: - escalade "^3.2.0" - picocolors "^1.1.1" - -upper-case-first@^2.0.2: - version "2.0.2" - resolved "https://registry.npmjs.org/upper-case-first/-/upper-case-first-2.0.2.tgz" - integrity sha512-514ppYHBaKwfJRK/pNC6c/OxfGa0obSnAl106u97Ed0I625Nin96KAjttZF6ZL3e1XLtphxnqrOi9iWgm+u+bg== - dependencies: - tslib "^2.0.3" - -upper-case@^2.0.2: - version "2.0.2" - resolved "https://registry.npmjs.org/upper-case/-/upper-case-2.0.2.tgz" - integrity sha512-KgdgDGJt2TpuwBUIjgG6lzw2GWFRCW9Qkfkiv0DxqHHLYJHmtmdUIKcZd8rHgFSjopVTlw6ggzCm1b8MFQwikg== - dependencies: - tslib "^2.0.3" - -uri-js@^4.2.2: - version "4.4.1" - resolved "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz" - integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== - dependencies: - punycode "^2.1.0" - -util-deprecate@~1.0.1: - version "1.0.2" - resolved "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" - integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== - -uuid@9.0.0: - version "9.0.0" - resolved "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz" - integrity sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg== - -v8-compile-cache-lib@^3.0.1: - version "3.0.1" - resolved "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz" - integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== - -v8-to-istanbul@^9.0.1: - version "9.3.0" - resolved "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz" - integrity sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA== - dependencies: - "@jridgewell/trace-mapping" "^0.3.12" - "@types/istanbul-lib-coverage" "^2.0.1" - convert-source-map "^2.0.0" - -validator@13.11.0: - version "13.11.0" - resolved "https://registry.npmjs.org/validator/-/validator-13.11.0.tgz" - integrity sha512-Ii+sehpSfZy+At5nPdnyMhx78fEoPDkR2XW/zimHEL3MyGJQOCQ7WeP20jPYRz7ZCpcKLB21NxuXHF3bxjStBQ== - -walker@^1.0.8: - version "1.0.8" - resolved "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz" - integrity sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ== - dependencies: - makeerror "1.0.12" - -which@^2.0.1: - version "2.0.2" - resolved "https://registry.npmjs.org/which/-/which-2.0.2.tgz" - integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== - dependencies: - isexe "^2.0.0" - -word-wrap@^1.2.5, word-wrap@~1.2.3: - version "1.2.5" - resolved "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz" - integrity sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA== - -wordwrap@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz" - integrity sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q== - -wrap-ansi@^6.2.0: - version "6.2.0" - resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz" - integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - -wrappy@1: - version "1.0.2" - resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" - integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== - -write-file-atomic@^4.0.2: - version "4.0.2" - resolved "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz" - integrity sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg== - dependencies: - imurmurhash "^0.1.4" - signal-exit "^3.0.7" - -ws@~8.17.1: - version "8.17.1" - resolved "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz" - integrity sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ== - -xmlhttprequest-ssl@~2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-2.0.0.tgz" - integrity sha512-QKxVRxiRACQcVuQEYFsI1hhkrMlrXHPegbbd1yn9UHOmRxY+si12nQYzri3vbzt8VdTTRviqcKxcyllFas5z2A== - -xtend@~4.0.1: - version "4.0.2" - resolved "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz" - integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== - -y18n@^5.0.5: - version "5.0.8" - resolved "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz" - integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== - -yallist@^3.0.2: - version "3.1.1" - resolved "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz" - integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== - -yallist@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz" - integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== - -yargs-parser@^20.2.2: - version "20.2.9" - resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz" - integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== - -yargs-parser@^21.0.1, yargs-parser@^21.1.1: - version "21.1.1" - resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz" - integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== - -yargs@^16.1.0: - version "16.2.0" - resolved "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz" - integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== - dependencies: - cliui "^7.0.2" - escalade "^3.1.1" - get-caller-file "^2.0.5" - require-directory "^2.1.1" - string-width "^4.2.0" - y18n "^5.0.5" - yargs-parser "^20.2.2" - -yargs@^17.1.1, yargs@^17.3.1, yargs@17.7.1: - version "17.7.1" - resolved "https://registry.npmjs.org/yargs/-/yargs-17.7.1.tgz" - integrity sha512-cwiTb08Xuv5fqF4AovYacTFNxk62th7LKJ6BL9IGUpTJrWoU7/7WdQGTP2SjKf1dUNBGzDd28p/Yfs/GI6JrLw== - dependencies: - cliui "^8.0.1" - escalade "^3.1.1" - get-caller-file "^2.0.5" - require-directory "^2.1.1" - string-width "^4.2.3" - y18n "^5.0.5" - yargs-parser "^21.1.1" - -yn@3.1.1: - version "3.1.1" - resolved "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz" - integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== - -yocto-queue@^0.1.0: - version "0.1.0" - resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz" - integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== - -yoctocolors-cjs@^2.1.2: - version "2.1.2" - resolved "https://registry.npmjs.org/yoctocolors-cjs/-/yoctocolors-cjs-2.1.2.tgz" - integrity sha512-cYVsTjKl8b+FrnidjibDWskAv7UKOfcwaVZdp/it9n1s9fU3IkgDbhdIRKCW4JDsAlECJY0ytoVPT3sK6kideA== From 7acfeaf0c9a751d7b2f76a20c690d7f1f497f622 Mon Sep 17 00:00:00 2001 From: Aaron Goin Date: Wed, 4 Jun 2025 10:39:33 -0700 Subject: [PATCH 19/73] Bumping to 0.23.19 to follow Richard's PR --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6360f1c..be54cd0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "polyapi", - "version": "0.23.18", + "version": "0.23.19", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "polyapi", - "version": "0.23.18", + "version": "0.23.19", "license": "MIT", "dependencies": { "@guanghechen/helper-string": "4.7.1", diff --git a/package.json b/package.json index 242d32b..c18a096 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.23.18", + "version": "0.23.19", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { From e00684a86c568a1f13338bc3a6c1fd2ed021a25d Mon Sep 17 00:00:00 2001 From: SudiptaTJ Date: Thu, 5 Jun 2025 23:30:29 +0600 Subject: [PATCH 20/73] # Feature (2790): P4) Ability to control npx poly generate via an extra view in VS code extension (can repurpose the configuration UI) (#11) - Local config updated - Version updated --- package-lock.json | 4 ++-- package.json | 2 +- src/commands/generate/index.ts | 18 +++++++++++------- src/config.ts | 2 +- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3127c55..6360f1c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "polyapi", - "version": "0.23.17", + "version": "0.23.18", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "polyapi", - "version": "0.23.17", + "version": "0.23.18", "license": "MIT", "dependencies": { "@guanghechen/helper-string": "4.7.1", diff --git a/package.json b/package.json index 04ad5ff..242d32b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.23.17", + "version": "0.23.18", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { diff --git a/src/commands/generate/index.ts b/src/commands/generate/index.ts index 833f330..db13262 100644 --- a/src/commands/generate/index.ts +++ b/src/commands/generate/index.ts @@ -370,6 +370,16 @@ const generateSingleCustomFunction = async (polyPath: string, functionId: string } }; +const updateLocalConfig = (polyPath: string, contexts?: string[], names?: string[], functionIds?: string[], noTypes?: boolean) => { + addOrUpdateConfig(polyPath, 'LAST_GENERATE_CONTEXTS_USED', contexts ? contexts.join(',') : ''); + + addOrUpdateConfig(polyPath, 'LAST_GENERATE_NAMES_USED', names ? names.join(',') : ''); + + addOrUpdateConfig(polyPath, 'LAST_GENERATE_FUNCTION_IDS_USED', functionIds ? functionIds.join(',') : ''); + + addOrUpdateConfig(polyPath, 'LAST_GENERATE_NO_TYPES_USED', noTypes ? 'YES' : 'NO'); +}; + const generate = async ({ polyPath, contexts, @@ -394,13 +404,7 @@ const generate = async ({ try { specs = await getSpecs(contexts, names, functionIds, noTypes); - let lastUsedContexts = ''; - - if (contexts) { - lastUsedContexts = contexts?.join(','); - } - - addOrUpdateConfig(polyPath, 'LAST_GENERATE_CONTEXTS_USED', lastUsedContexts); + updateLocalConfig(polyPath, contexts, names, functionIds, noTypes); } catch (error) { showErrGettingSpecs(error); return; diff --git a/src/config.ts b/src/config.ts index 5614dd6..54dc357 100644 --- a/src/config.ts +++ b/src/config.ts @@ -37,4 +37,4 @@ export const addOrUpdateConfig = (polyPath: string, key: string, value: string) existingConfig[key] = value; saveConfig(polyPath, existingConfig); -}; \ No newline at end of file +}; From 540feeb28e56940dd23716d789705d2f6b3d1c2a Mon Sep 17 00:00:00 2001 From: Dan Fellin Date: Thu, 5 Jun 2025 12:40:01 -0700 Subject: [PATCH 21/73] try new action --- .github/workflows/update-prebuilt-image.yaml | 21 ++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/update-prebuilt-image.yaml diff --git a/.github/workflows/update-prebuilt-image.yaml b/.github/workflows/update-prebuilt-image.yaml new file mode 100644 index 0000000..b19e3f4 --- /dev/null +++ b/.github/workflows/update-prebuilt-image.yaml @@ -0,0 +1,21 @@ +name: Update pre-built node docker image +on: + workflow_dispatch: + +jobs: + manual: + name: Manual Pre-built Development Image + runs-on: ubuntu-latest + if: ${{ github.event_name == 'workflow_dispatch' }} + environment: dev + + steps: + - uses: actions/checkout@v3 + + - name: Hit endpoint and build from scratch pre-built image + run: | + curl --fail-with-body -X POST \ + https://dev.polyapi.io/functions/server/prebuilt-base-image \ + -H "Authorization: Bearer ${{ secrets.POLY_SUPER_ADMIN_USER_KEY }}" \ + -H "Content-Type: application/json" \ + -d '{}' From ae094403321c7c4e932ff416d871bfefafbba430 Mon Sep 17 00:00:00 2001 From: Dan Fellin Date: Thu, 5 Jun 2025 12:47:43 -0700 Subject: [PATCH 22/73] Revert "try new action" This reverts commit 540feeb28e56940dd23716d789705d2f6b3d1c2a. --- .github/workflows/update-prebuilt-image.yaml | 21 -------------------- 1 file changed, 21 deletions(-) delete mode 100644 .github/workflows/update-prebuilt-image.yaml diff --git a/.github/workflows/update-prebuilt-image.yaml b/.github/workflows/update-prebuilt-image.yaml deleted file mode 100644 index b19e3f4..0000000 --- a/.github/workflows/update-prebuilt-image.yaml +++ /dev/null @@ -1,21 +0,0 @@ -name: Update pre-built node docker image -on: - workflow_dispatch: - -jobs: - manual: - name: Manual Pre-built Development Image - runs-on: ubuntu-latest - if: ${{ github.event_name == 'workflow_dispatch' }} - environment: dev - - steps: - - uses: actions/checkout@v3 - - - name: Hit endpoint and build from scratch pre-built image - run: | - curl --fail-with-body -X POST \ - https://dev.polyapi.io/functions/server/prebuilt-base-image \ - -H "Authorization: Bearer ${{ secrets.POLY_SUPER_ADMIN_USER_KEY }}" \ - -H "Content-Type: application/json" \ - -d '{}' From 3ae8deb13eb312d8ff07723e62dfc8b72a8189d7 Mon Sep 17 00:00:00 2001 From: Aaron Goin Date: Thu, 5 Jun 2025 16:28:20 -0700 Subject: [PATCH 23/73] Bug fixes and improvements - Catching axios errors and scrubbing them of polyapi tokens and secrets - Fixing schema generation to remove extra, empty interfaces - Adding support for schemas with refs to inline definitions - Fixing bug where schemas with no contexts would not be generated - Fixing bug where schema public namespace was not Pascal cased --- package-lock.json | 4 +- package.json | 4 +- src/api.ts | 347 ++++++---- src/cli.ts | 509 ++++++++------ src/commands/function.ts | 93 ++- src/commands/generate/index.ts | 354 +++++++--- src/commands/generate/schemaTypes.ts | 621 ++++++++++++------ src/commands/generate/types.ts | 465 +++++++++---- src/commands/model/generate.ts | 192 ++++-- src/commands/model/train.ts | 70 +- src/commands/model/validate.ts | 44 +- src/commands/prepare.ts | 112 +++- src/commands/setup.ts | 53 +- src/commands/snippet.ts | 17 +- src/commands/sync.ts | 88 ++- src/commands/tenant.ts | 57 +- src/config.ts | 15 +- src/dependencies.ts | 81 ++- src/deployables.ts | 196 ++++-- src/transpiler.ts | 353 +++++++--- src/types/functions.ts | 66 +- src/types/shared.ts | 2 +- src/types/specifications.ts | 31 +- src/types/templates.ts | 2 +- src/types/webhooks.ts | 4 +- src/utils.ts | 135 ++-- templates/api-functions.js.hbs | 18 + templates/api-index.js | 153 +++++ templates/api-index.js.hbs | 148 ----- templates/auth-function.js.hbs | 4 +- templates/auth-index.js.hbs | 11 +- templates/{axios.js.hbs => axios.js} | 18 +- templates/constants.js.hbs | 5 + ...{error-handler.js.hbs => error-handler.js} | 0 templates/{index.js.hbs => index.js} | 17 +- templates/server-functions.js.hbs | 7 + templates/server-index.js | 19 + templates/server-index.js.hbs | 30 - templates/vari/index.js.hbs | 10 +- templates/webhook-handles.js.hbs | 11 + ...ebhooks-index.js.hbs => webhooks-index.js} | 21 +- test/generateTypes.spec.ts | 2 +- 42 files changed, 3008 insertions(+), 1381 deletions(-) create mode 100644 templates/api-functions.js.hbs create mode 100644 templates/api-index.js delete mode 100644 templates/api-index.js.hbs rename templates/{axios.js.hbs => axios.js} (77%) create mode 100644 templates/constants.js.hbs rename templates/{error-handler.js.hbs => error-handler.js} (100%) rename templates/{index.js.hbs => index.js} (81%) create mode 100644 templates/server-functions.js.hbs create mode 100644 templates/server-index.js delete mode 100644 templates/server-index.js.hbs create mode 100644 templates/webhook-handles.js.hbs rename templates/{webhooks-index.js.hbs => webhooks-index.js} (74%) diff --git a/package-lock.json b/package-lock.json index 6360f1c..be54cd0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "polyapi", - "version": "0.23.18", + "version": "0.23.19", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "polyapi", - "version": "0.23.18", + "version": "0.23.19", "license": "MIT", "dependencies": { "@guanghechen/helper-string": "4.7.1", diff --git a/package.json b/package.json index 242d32b..f06100a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.23.18", + "version": "0.23.19", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { @@ -21,7 +21,7 @@ "build": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json", "prebuild": "rimraf build", "postbuild": "npm run copy-templates", - "copy-templates": "copyfiles \"templates/**/*.hbs\" build", + "copy-templates": "copyfiles \"templates/**/*\" build", "format": "prettier --write \"src/**/*.ts\"", "lint": "eslint \"src/**/*.ts\" --fix", "prepare": "husky install", diff --git a/src/api.ts b/src/api.ts index 0893c6c..4f96531 100644 --- a/src/api.ts +++ b/src/api.ts @@ -35,8 +35,14 @@ import { POLY_API_VERSION_HEADER } from './constants'; dotenv.config(); -const httpProxy = process.env.HTTP_PROXY || process.env.http_proxy || process.env.npm_config_proxy; -const httpsProxy = process.env.HTTPS_PROXY || process.env.https_proxy || process.env.npm_config_https_proxy; +const httpProxy = + process.env.HTTP_PROXY || + process.env.http_proxy || + process.env.npm_config_proxy; +const httpsProxy = + process.env.HTTPS_PROXY || + process.env.https_proxy || + process.env.npm_config_https_proxy; const nodeEnv = process.env.NODE_ENV; const isDevEnv = nodeEnv === 'development'; @@ -54,9 +60,7 @@ const getApiHeaders = () => ({ }); const axios = Axios.create({ - httpAgent: httpProxy - ? new HttpProxyAgent(httpProxy) - : undefined, + httpAgent: httpProxy ? new HttpProxyAgent(httpProxy) : undefined, httpsAgent: httpsProxy ? new HttpsProxyAgent(httpsProxy, { rejectUnauthorized: !isDevEnv, @@ -67,7 +71,12 @@ const axios = Axios.create({ proxy: false, }); -export const getSpecs = async (contexts?: string[], names?: string[], ids?: string[], noTypes?: boolean) => { +export const getSpecs = async ( + contexts?: string[], + names?: string[], + ids?: string[], + noTypes?: boolean, +) => { return ( await axios.get(`${getApiBaseURL()}/specs`, { headers: getApiHeaders(), @@ -128,23 +137,16 @@ export const getServerFunctionByName = async ( }, }, ) - ).data.find(fn => fn.name === name && fn.context === context); + ).data.find((fn) => fn.name === name && fn.context === context); }; -export const deleteServerFunction = async ( - id: string, -) => { - return ( - await axios.delete( - `${getApiBaseURL()}/functions/server/${id}`, - { - headers: { - 'Content-Type': 'application/json', - ...getApiHeaders(), - }, - }, - ) - ); +export const deleteServerFunction = async (id: string) => { + return await axios.delete(`${getApiBaseURL()}/functions/server/${id}`, { + headers: { + 'Content-Type': 'application/json', + ...getApiHeaders(), + }, + }); }; export const createOrUpdateClientFunction = async ( @@ -190,90 +192,131 @@ export const getClientFunctionByName = async ( }, }, ) - ).data.find(fn => fn.name === name && fn.context === context); + ).data.find((fn) => fn.name === name && fn.context === context); +}; + +export const deleteClientFunction = async (id: string) => { + return await axios.delete(`${getApiBaseURL()}/functions/client/${id}`, { + headers: { + 'Content-Type': 'application/json', + ...getApiHeaders(), + }, + }); }; -export const deleteClientFunction = async ( - id: string, +export const createTenantSignUp = async ( + instance: string, + email: string, + tenantName: string | null = null, ) => { return ( - await axios.delete( - `${getApiBaseURL()}/functions/client/${id}`, + await axios.post>( + `${getInstanceUrl(instance)}/tenants/sign-up`, + { + email, + tenantName, + }, { headers: { 'Content-Type': 'application/json', - ...getApiHeaders(), + [POLY_API_VERSION_HEADER]: process.env.POLY_API_VERSION || '', }, }, ) - ); + ).data; }; -export const createTenantSignUp = async (instance: string, email: string, tenantName: string | null = null) => { +export const verifyTenantSignUp = async ( + instance: string, + email: string, + code: string, +) => { return ( - await axios.post>(`${getInstanceUrl(instance)}/tenants/sign-up`, { - email, - tenantName, - }, { - headers: { - 'Content-Type': 'application/json', - [POLY_API_VERSION_HEADER]: process.env.POLY_API_VERSION || '', + await axios.post>( + `${getInstanceUrl(instance)}/tenants/sign-up/verify`, + { + code, + email, }, - }) + { + headers: { + 'Content-Type': 'application/json', + [POLY_API_VERSION_HEADER]: process.env.POLY_API_VERSION || '', + }, + }, + ) ).data; }; -export const verifyTenantSignUp = async (instance: string, email: string, code: string) => { - return ( - await axios.post>(`${getInstanceUrl(instance)}/tenants/sign-up/verify`, { - code, +export const resendVerificationCode = (instance: string, email: string) => { + return axios.post>( + `${getInstanceUrl(instance)}/tenants/sign-up/resend-verification-code`, + { email, - }, { + }, + { headers: { - 'Content-Type': 'application/json', [POLY_API_VERSION_HEADER]: process.env.POLY_API_VERSION || '', }, - }) - ).data; -}; - -export const resendVerificationCode = (instance: string, email: string) => { - return axios.post>(`${getInstanceUrl(instance)}/tenants/sign-up/resend-verification-code`, { - email, - }, { - headers: { - [POLY_API_VERSION_HEADER]: process.env.POLY_API_VERSION || '', }, - }); + ); }; export const getLastTos = async (instance: string) => { - return (await axios.get>(`${getInstanceUrl(instance)}/tos`, { - headers: { - [POLY_API_VERSION_HEADER]: process.env.POLY_API_VERSION || '', - }, - })).data; + return ( + await axios.get>( + `${getInstanceUrl(instance)}/tos`, + { + headers: { + [POLY_API_VERSION_HEADER]: process.env.POLY_API_VERSION || '', + }, + }, + ) + ).data; }; export const upsertApiFunction = async (data: CreateApiFunctionDto) => { - return (await axios.put>(`${getApiBaseURL()}/functions/api`, data, { - headers: getApiHeaders(), - })).data; + return ( + await axios.put>( + `${getApiBaseURL()}/functions/api`, + data, + { + headers: getApiHeaders(), + }, + ) + ).data; }; export const upsertWebhookHandle = async (data: CreateWebhookHandleDto) => { - return (await axios.put>(`${getApiBaseURL()}/webhooks`, data, { - headers: getApiHeaders(), - })).data; + return ( + await axios.put>( + `${getApiBaseURL()}/webhooks`, + data, + { + headers: getApiHeaders(), + }, + ) + ).data; }; export const upsertSchema = async (data: CreateSchemaDto) => { - return (await axios.put>(`${getApiBaseURL()}/schemas`, data, { - headers: getApiHeaders(), - })).data; + return ( + await axios.put>( + `${getApiBaseURL()}/schemas`, + data, + { + headers: getApiHeaders(), + }, + ) + ).data; }; -export const translateSpecification = async (contents: string, context?: string, hostUrl?: string, hostUrlAsArgument?: string) => { +export const translateSpecification = async ( + contents: string, + context?: string, + hostUrl?: string, + hostUrlAsArgument?: string, +) => { const params = new URLSearchParams(); if (context) params.append('context', context); if (hostUrl) params.append('hostUrl', hostUrl); @@ -281,74 +324,137 @@ export const translateSpecification = async (contents: string, context?: string, const url = `${getApiBaseURL()}/specification-input/oas?${params.toString()}`; - return (await axios.post>(url, contents, { - headers: { - 'Content-Type': 'text/plain', - ...getApiHeaders(), - }, - })).data; + return ( + await axios.post>(url, contents, { + headers: { + 'Content-Type': 'text/plain', + ...getApiHeaders(), + }, + }) + ).data; }; export const validateApiFunctionDto = async (data: CreateApiFunctionDto) => { - return (await axios.post>(`${getApiBaseURL()}/specification-input/validation/api-function`, data, { - headers: getApiHeaders(), - })).data; + return ( + await axios.post>( + `${getApiBaseURL()}/specification-input/validation/api-function`, + data, + { + headers: getApiHeaders(), + }, + ) + ).data; }; -export const validateWebhookHandleDto = async (data: CreateWebhookHandleDto) => { - return (await axios.post>(`${getApiBaseURL()}/specification-input/validation/webhook-handle`, data, { - headers: getApiHeaders(), - })).data; +export const validateWebhookHandleDto = async ( + data: CreateWebhookHandleDto, +) => { + return ( + await axios.post>( + `${getApiBaseURL()}/specification-input/validation/webhook-handle`, + data, + { + headers: getApiHeaders(), + }, + ) + ).data; }; -export const getServerFunctionDescription = async (data: ExecuteCustomFunctionDescriptionGenerationDto) => { - return (await axios.post>(`${getApiBaseURL()}/functions/server/description-generation`, data, { - headers: getApiHeaders(), - })).data; +export const getServerFunctionDescription = async ( + data: ExecuteCustomFunctionDescriptionGenerationDto, +) => { + return ( + await axios.post< + any, + AxiosResponse + >(`${getApiBaseURL()}/functions/server/description-generation`, data, { + headers: getApiHeaders(), + }) + ).data; }; -export const getClientFunctionDescription = async (data: ExecuteCustomFunctionDescriptionGenerationDto) => { - return (await axios.post>(`${getApiBaseURL()}/functions/client/description-generation`, data, { - headers: getApiHeaders(), - })).data; +export const getClientFunctionDescription = async ( + data: ExecuteCustomFunctionDescriptionGenerationDto, +) => { + return ( + await axios.post< + any, + AxiosResponse + >(`${getApiBaseURL()}/functions/client/description-generation`, data, { + headers: getApiHeaders(), + }) + ).data; }; -export const getApiFunctionDescription = async (data: ExecuteApiFunctionDescriptionGenerationDto) => { - return (await axios.post>(`${getApiBaseURL()}/functions/api/description-generation`, data, { - headers: getApiHeaders(), - })).data; +export const getApiFunctionDescription = async ( + data: ExecuteApiFunctionDescriptionGenerationDto, +) => { + return ( + await axios.post>( + `${getApiBaseURL()}/functions/api/description-generation`, + data, + { + headers: getApiHeaders(), + }, + ) + ).data; }; export const upsertSnippet = async (data: CreateSnippetDto) => { - return ( - await axios.put>(`${getApiBaseURL()}/snippets`, data, { + return await axios.put>( + `${getApiBaseURL()}/snippets`, + data, + { headers: getApiHeaders(), - }) + }, ); }; -export const getWebhookHandleDescription = async (data: ExecuteWebhookHandleDescriptionGenerationDto) => { - return (await axios.post>(`${getApiBaseURL()}/webhooks/description-generation`, data, { - headers: getApiHeaders(), - })).data; +export const getWebhookHandleDescription = async ( + data: ExecuteWebhookHandleDescriptionGenerationDto, +) => { + return ( + await axios.post>( + `${getApiBaseURL()}/webhooks/description-generation`, + data, + { + headers: getApiHeaders(), + }, + ) + ).data; }; -export const getAuthData = async (baseUrl: string, apiKey: string): Promise => { - return (await axios.get>(`${baseUrl}/auth`, { - headers: { - Authorization: `Bearer ${apiKey}`, - [POLY_API_VERSION_HEADER]: process.env.POLY_API_VERSION || '', - }, - })).data; +export const getAuthData = async ( + baseUrl: string, + apiKey: string, +): Promise => { + return ( + await axios.get>(`${baseUrl}/auth`, { + headers: { + Authorization: `Bearer ${apiKey}`, + [POLY_API_VERSION_HEADER]: process.env.POLY_API_VERSION || '', + }, + }) + ).data; }; -export const getProjectTemplatesConfig = async (baseUrl: string, apiKey: string, tenantId: string, environmentId: string): Promise => { - return (await axios.get>(`${baseUrl}/tenants/${tenantId}/environments/${environmentId}/config-variables/ProjectTemplates`, { - headers: { - Authorization: `Bearer ${apiKey}`, - [POLY_API_VERSION_HEADER]: process.env.POLY_API_VERSION || '', - }, - })).data.value; +export const getProjectTemplatesConfig = async ( + baseUrl: string, + apiKey: string, + tenantId: string, + environmentId: string, +): Promise => { + return ( + await axios.get>( + `${baseUrl}/tenants/${tenantId}/environments/${environmentId}/config-variables/ProjectTemplates`, + { + headers: { + Authorization: `Bearer ${apiKey}`, + [POLY_API_VERSION_HEADER]: process.env.POLY_API_VERSION || '', + }, + }, + ) + ).data.value; }; export const createOrUpdateWebhook = async ( @@ -387,16 +493,19 @@ export const getWebhookByName = async (context: string, name: string) => { }, }, ) - ).data.find(webhook => webhook.name === name && webhook.context === context); + ).data.find( + (webhook) => webhook.name === name && webhook.context === context, + ); }; export const deleteWebhook = async (webhookId: string) => { - return ( - await axios.delete(`${getApiBaseURL()}/webhooks/${webhookId}`, { + return await axios.delete( + `${getApiBaseURL()}/webhooks/${webhookId}`, + { headers: { 'Content-Type': 'application/json', ...getApiHeaders(), }, - }) + }, ); }; diff --git a/src/cli.ts b/src/cli.ts index 357eaf1..2e6223e 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -26,7 +26,8 @@ const checkPolyConfig = (polyPath: string) => { void yargs .usage('$0 [args]') - .command('setup [baseUrl] [apiKey]', + .command( + 'setup [baseUrl] [apiKey]', 'Setups your Poly connection', (yargs) => { return yargs @@ -47,7 +48,12 @@ void yargs }, async (argv) => { const { default: setup } = await import('./commands/setup'); - await setup(DEFAULT_POLY_PATH, argv.baseUrl, argv.apiKey, argv.apiVersion); + await setup( + DEFAULT_POLY_PATH, + argv.baseUrl, + argv.apiKey, + argv.apiVersion, + ); }, ) .command( @@ -83,10 +89,19 @@ void yargs }, }); }, - async ({ exitWhenNoConfig, contexts, names, functionIds, customPath = DEFAULT_POLY_PATH, noTypes = false }) => { + async ({ + exitWhenNoConfig, + contexts, + names, + functionIds, + customPath = DEFAULT_POLY_PATH, + noTypes = false, + }) => { if (!checkPolyConfig(customPath)) { if (exitWhenNoConfig) { - shell.echo('Poly is not configured. Please run `poly generate` manually.'); + shell.echo( + 'Poly is not configured. Please run `poly generate` manually.', + ); return; } const { default: setup } = await import('./commands/setup'); @@ -103,70 +118,86 @@ void yargs }); }, ) - .command('prepare [options]', 'Find and prepare all Poly deployables', (yargs) => - yargs - .usage('$0 prepare [options]') - .option('lazy', { - describe: 'Skip prepare work if the cache is up to date. (Relies on `git`)', - type: 'boolean', - default: false, - }) - .option('disable-docs', { - describe: 'Don\'t write any JSDocs into the deployable files.', - type: 'boolean', - default: false, - }) - .option('disable-ai', { - describe: 'Don\'t use AI to fill in any missing descriptions.', - type: 'boolean', - default: false, - }), - async ({ disableDocs, disableAi, lazy }) => { - if (!checkPolyConfig(DEFAULT_POLY_PATH)) { - return shell.echo('Poly is not configured. Please run `poly setup` to configure it.'); - } - disableAi = disableAi || process.env.DISABLE_AI === 'true'; - const { prepareDeployables } = await import('./commands/prepare'); - await prepareDeployables(lazy, disableDocs, disableAi); - }) - .command('sync [options]', 'Find and sync all Poly deployables', (yargs) => - yargs - .usage('$0 sync [options]') - .option('dry-run', { - describe: 'Run through sync steps with logging but don\'t make any changes.', - type: 'boolean', - default: false, - }) - .option('custom-path', { - describe: 'Custom path to .poly directory (internal use only)', - default: DEFAULT_POLY_PATH, - type: 'string', - }), - async ({ dryRun, customPath = DEFAULT_POLY_PATH }) => { - if (!checkPolyConfig(customPath)) { - return shell.echo('Poly is not configured. Please run `poly setup` to configure it.'); - } + .command( + 'prepare [options]', + 'Find and prepare all Poly deployables', + (yargs) => + yargs + .usage('$0 prepare [options]') + .option('lazy', { + describe: + 'Skip prepare work if the cache is up to date. (Relies on `git`)', + type: 'boolean', + default: false, + }) + .option('disable-docs', { + describe: "Don't write any JSDocs into the deployable files.", + type: 'boolean', + default: false, + }) + .option('disable-ai', { + describe: "Don't use AI to fill in any missing descriptions.", + type: 'boolean', + default: false, + }), + async ({ disableDocs, disableAi, lazy }) => { + if (!checkPolyConfig(DEFAULT_POLY_PATH)) { + return shell.echo( + 'Poly is not configured. Please run `poly setup` to configure it.', + ); + } + disableAi = disableAi || process.env.DISABLE_AI === 'true'; + const { prepareDeployables } = await import('./commands/prepare'); + await prepareDeployables(lazy, disableDocs, disableAi); + }, + ) + .command( + 'sync [options]', + 'Find and sync all Poly deployables', + (yargs) => + yargs + .usage('$0 sync [options]') + .option('dry-run', { + describe: + "Run through sync steps with logging but don't make any changes.", + type: 'boolean', + default: false, + }) + .option('custom-path', { + describe: 'Custom path to .poly directory (internal use only)', + default: DEFAULT_POLY_PATH, + type: 'string', + }), + async ({ dryRun, customPath = DEFAULT_POLY_PATH }) => { + if (!checkPolyConfig(customPath)) { + return shell.echo( + 'Poly is not configured. Please run `poly setup` to configure it.', + ); + } - const { prepareDeployables } = await import('./commands/prepare'); - // At this point everything should already be prepared - // So we're not going to add anything other than deployment receipts - await prepareDeployables( - true, // lazy! - true, // don't write JSDocs - true, // don't use AI - ); - shell.echo('Syncing Poly deployments...'); - const { syncDeployables } = await import('./commands/sync'); - await syncDeployables(dryRun); - shell.echo('Poly deployments synced.'); - }) + const { prepareDeployables } = await import('./commands/prepare'); + // At this point everything should already be prepared + // So we're not going to add anything other than deployment receipts + await prepareDeployables( + true, // lazy! + true, // don't write JSDocs + true, // don't use AI + ); + shell.echo('Syncing Poly deployments...'); + const { syncDeployables } = await import('./commands/sync'); + await syncDeployables(dryRun); + shell.echo('Poly deployments synced.'); + }, + ) .command('function ', 'Manages functions', (yargs) => { yargs.command( 'add [options]', 'Adds a custom function', (yargs) => yargs - .usage('$0 function add (--server | --client) [options]') + .usage( + '$0 function add (--server | --client) [options]', + ) .default('context', '') .positional('name', { describe: 'Name of the function', @@ -193,44 +224,69 @@ void yargs type: 'boolean', }) .option('logs', { - describe: 'Server function only - `--logs=enabled` or `--logs=disabled` to enable to disable logging respectively', + describe: + 'Server function only - `--logs=enabled` or `--logs=disabled` to enable to disable logging respectively', type: 'string', }) .option('generateContexts', { - describe: 'Server function only - only include certain contexts to speed up function execution', + describe: + 'Server function only - only include certain contexts to speed up function execution', type: 'string', }) .option('execution-api-key', { describe: 'Optional API key for server functions', type: 'string', }), - async ({ name, description, file, context, client, server, logs, generateContexts, executionApiKey }) => { - const logsEnabled = logs === 'enabled' ? true : logs === 'disabled' ? false : undefined; - const err = - !name - ? 'Missing function name.' - : !file - ? 'Missing function file path.' - : (!client && !server) - ? 'You must specify `--server` or `--client`.`' - : (client && server) - ? 'Specify either `--server` or `--client`. Found both.' - : (generateContexts && !server) - ? 'Option `generateContexts` is only for server functions (--server).' - : (logs && !server) - ? 'Option `logs` is only for server functions (--server).' - : (logs && logsEnabled === undefined) - ? 'Invalid value for `logs` option.' - : (executionApiKey && !uuidValidate(executionApiKey)) - ? 'Invalid value for `execution-api-key`. Must be a valid PolyAPI Key.' - : ''; + async ({ + name, + description, + file, + context, + client, + server, + logs, + generateContexts, + executionApiKey, + }) => { + const logsEnabled = + logs === 'enabled' ? true : logs === 'disabled' ? false : undefined; + const err = !name + ? 'Missing function name.' + : !file + ? 'Missing function file path.' + : !client && !server + ? 'You must specify `--server` or `--client`.`' + : client && server + ? 'Specify either `--server` or `--client`. Found both.' + : generateContexts && !server + ? 'Option `generateContexts` is only for server functions (--server).' + : logs && !server + ? 'Option `logs` is only for server functions (--server).' + : logs && logsEnabled === undefined + ? 'Invalid value for `logs` option.' + : executionApiKey && !uuidValidate(executionApiKey) + ? 'Invalid value for `execution-api-key`. Must be a valid PolyAPI Key.' + : ''; if (err) { shell.echo(chalk.redBright('ERROR:'), err); yargs.showHelp(); return; } - const { addOrUpdateCustomFunction } = await import('./commands/function'); - await addOrUpdateCustomFunction(DEFAULT_POLY_PATH, context, name, description, file, client, server, logsEnabled, generateContexts, executionApiKey); + const { addOrUpdateCustomFunction } = await import( + './commands/function' + ); + await addOrUpdateCustomFunction( + DEFAULT_POLY_PATH, + context, + name, + description, + file, + client, + server, + logsEnabled, + generateContexts, + executionApiKey, + ); }, ); }) @@ -240,147 +296,188 @@ void yargs 'Creates a new tenant', { instance: { - describe: 'Instance where you want to create tenant (develop | na1 | local)', + describe: + 'Instance where you want to create tenant (develop | na1 | local)', demandOption: false, type: 'string', }, }, - async ({ - instance = 'na1', - }) => { + async ({ instance = 'na1' }) => { const { create } = await import('./commands/tenant'); await create(instance); }, ); }) .command('model ', 'Manages models.', async (yargs) => { - yargs.command( - 'generate [destination] [options]', - 'Generates a new model.', - (yargs) => yargs.positional('path', { - type: 'string', - demandOption: true, - describe: 'Path to open api specification file.', - }).positional('destination', { - type: 'string', - describe: 'Path to destination poly schema file.', - demandOption: false, - }).option('context', { - describe: 'Context for all api functions.', - type: 'string', - }).option('hostUrl', { - describe: 'Hardcode the hostUrl to use for all api functions. Leave undefined to use the server url specified in the specification file, if one is specified.', - type: 'string', - }).option('hostUrlAsArgument', { - describe: 'Require the host url as an argument to be passed in when calling an api function. Value passed in will be used as the argument name, or if left empty will default to "hostUrl".', - type: 'string', - }).options('disable-ai', { - describe: 'Disable ai generation.', - boolean: true, - }) - .options('rename', { - describe: 'List of name mappings, ex. `--rename foo:bar "Old key:New key"` would rename all instances of "foo" with "bar" and "Old key" with "New key".', - type: 'array', - }), - async ({ - path, - destination, - context, - hostUrl, - hostUrlAsArgument, - disableAi, - rename = [], - }) => { - if (!checkPolyConfig(DEFAULT_POLY_PATH)) { - return shell.echo('Poly is not configured. Please run `poly setup` to configure it.'); - } - if (!path) { - yargs.showHelp(); - return; - } + yargs + .command( + 'generate [destination] [options]', + 'Generates a new model.', + (yargs) => + yargs + .positional('path', { + type: 'string', + demandOption: true, + describe: 'Path to open api specification file.', + }) + .positional('destination', { + type: 'string', + describe: 'Path to destination poly schema file.', + demandOption: false, + }) + .option('context', { + describe: 'Context for all api functions.', + type: 'string', + }) + .option('hostUrl', { + describe: + 'Hardcode the hostUrl to use for all api functions. Leave undefined to use the server url specified in the specification file, if one is specified.', + type: 'string', + }) + .option('hostUrlAsArgument', { + describe: + 'Require the host url as an argument to be passed in when calling an api function. Value passed in will be used as the argument name, or if left empty will default to "hostUrl".', + type: 'string', + }) + .options('disable-ai', { + describe: 'Disable ai generation.', + boolean: true, + }) + .options('rename', { + describe: + 'List of name mappings, ex. `--rename foo:bar "Old key:New key"` would rename all instances of "foo" with "bar" and "Old key" with "New key".', + type: 'array', + }), + async ({ + path, + destination, + context, + hostUrl, + hostUrlAsArgument, + disableAi, + rename = [], + }) => { + if (!checkPolyConfig(DEFAULT_POLY_PATH)) { + return shell.echo( + 'Poly is not configured. Please run `poly setup` to configure it.', + ); + } + if (!path) { + yargs.showHelp(); + return; + } - if (hostUrl && !isValidHttpUrl(hostUrl)) { - return shell.echo(`${hostUrl} is not a valid url`); - } + if (hostUrl && !isValidHttpUrl(hostUrl)) { + return shell.echo(`${hostUrl} is not a valid url`); + } + + const preparedRenames: RenameT = []; + for (const mappings of rename) { + const [prevName = '', newName = ''] = `${mappings}`.split(':'); + if (!prevName || !newName) { + shell.echo( + chalk.redBright('ERROR:'), + `Invalid rename mapping from "${prevName}" to "${newName}".`, + ); + yargs.showHelp(); + return; + } + preparedRenames.push([prevName, newName]); + } - const preparedRenames: RenameT = []; - for (const mappings of rename) { - const [prevName = '', newName = ''] = `${mappings}`.split(':'); - if (!prevName || !newName) { - shell.echo(chalk.redBright('ERROR:'), `Invalid rename mapping from "${prevName}" to "${newName}".`); + const { generateModel } = await import('./commands/model'); + await generateModel( + path, + destination, + context, + hostUrl, + hostUrlAsArgument, + !!disableAi, + preparedRenames, + ); + }, + ) + .command( + 'validate ', + 'Validates a Poly model', + { + path: { + type: 'string', + demandOption: true, + describe: 'Path to Poly model file.', + }, + }, + async ({ path }) => { + if (!checkPolyConfig(DEFAULT_POLY_PATH)) { + return shell.echo( + 'Poly is not configured. Please run `poly setup` to configure it.', + ); + } + if (!path) { yargs.showHelp(); return; } - preparedRenames.push([prevName, newName]); - } - - const { generateModel } = await import('./commands/model'); - await generateModel(path, destination, context, hostUrl, hostUrlAsArgument, !!disableAi, preparedRenames); - }, - ).command('validate ', 'Validates a Poly model', { - path: { - type: 'string', - demandOption: true, - describe: 'Path to Poly model file.', - }, - }, async ({ path }) => { - if (!checkPolyConfig(DEFAULT_POLY_PATH)) { - return shell.echo('Poly is not configured. Please run `poly setup` to configure it.'); - } - if (!path) { - yargs.showHelp(); - return; - } - const { validateModel } = await import('./commands/model'); - validateModel(path); - }).command('train ', 'Train generated Poly model.', { - path: { - type: 'string', - demandOption: true, - describe: 'Path to Poly model file.', - }, - }, async ({ path }) => { - if (!checkPolyConfig(DEFAULT_POLY_PATH)) { - return shell.echo('Poly is not configured. Please run `poly setup` to configure it.'); - } + const { validateModel } = await import('./commands/model'); + validateModel(path); + }, + ) + .command( + 'train ', + 'Train generated Poly model.', + { + path: { + type: 'string', + demandOption: true, + describe: 'Path to Poly model file.', + }, + }, + async ({ path }) => { + if (!checkPolyConfig(DEFAULT_POLY_PATH)) { + return shell.echo( + 'Poly is not configured. Please run `poly setup` to configure it.', + ); + } - if (!path) { - yargs.showHelp(); - return; - } + if (!path) { + yargs.showHelp(); + return; + } - const { train } = await import('./commands/model'); - await train(DEFAULT_POLY_PATH, path); - }); + const { train } = await import('./commands/model'); + await train(DEFAULT_POLY_PATH, path); + }, + ); }) .command('snippet ', 'Manage snippets.', async (yargs) => { yargs.command( 'add [options]', 'Adds a new snippet.', - (yargs) => yargs.positional('name', { - type: 'string', - demandOption: true, - describe: 'Snippet name.', - }).positional('path', { - type: 'string', - demandOption: true, - describe: 'Path to destination that contains snippet.', - }).option('context', { - type: 'string', - describe: 'Assign a context to this snippet', - }).option('description', { - type: 'string', - describe: 'Assign a description to this snippet', - }), - async ({ - name, - path, - context, - description, - }) => { + (yargs) => + yargs + .positional('name', { + type: 'string', + demandOption: true, + describe: 'Snippet name.', + }) + .positional('path', { + type: 'string', + demandOption: true, + describe: 'Path to destination that contains snippet.', + }) + .option('context', { + type: 'string', + describe: 'Assign a context to this snippet', + }) + .option('description', { + type: 'string', + describe: 'Assign a description to this snippet', + }), + async ({ name, path, context, description }) => { if (!checkPolyConfig(DEFAULT_POLY_PATH)) { - return shell.echo('Poly is not configured. Please run `poly setup` to configure it.'); + return shell.echo( + 'Poly is not configured. Please run `poly setup` to configure it.', + ); } if (!path) { yargs.showHelp(); @@ -388,7 +485,13 @@ void yargs } const { addSnippet } = await import('./commands/snippet'); - await addSnippet(DEFAULT_POLY_PATH, name, path, context || '', description || ''); + await addSnippet( + DEFAULT_POLY_PATH, + name, + path, + context || '', + description || '', + ); }, ); }) diff --git a/src/commands/function.ts b/src/commands/function.ts index e5eb154..03f6c5d 100644 --- a/src/commands/function.ts +++ b/src/commands/function.ts @@ -2,11 +2,22 @@ import fs from 'fs'; import chalk from 'chalk'; import shell from 'shelljs'; -import { CreateServerCustomFunctionResponseDto, FunctionDetailsDto } from '../types'; -import { createOrUpdateClientFunction, createOrUpdateServerFunction, getSpecs } from '../api'; +import { + CreateServerCustomFunctionResponseDto, + FunctionDetailsDto, +} from '../types'; +import { + createOrUpdateClientFunction, + createOrUpdateServerFunction, + getSpecs, +} from '../api'; import { loadConfig } from '../config'; import { generateSingleCustomFunction } from './generate'; -import { generateTypeSchemas, getDependencies, getTSBaseUrl } from '../transpiler'; +import { + generateTypeSchemas, + getDependencies, + getTSBaseUrl, +} from '../transpiler'; import { DeployableTypeEntries } from '../deployables'; export const addOrUpdateCustomFunction = async ( @@ -19,7 +30,8 @@ export const addOrUpdateCustomFunction = async ( server: boolean | undefined, logsEnabled: boolean | undefined, generateContexts: string | undefined, - executionApiKey: string | null | undefined) => { + executionApiKey: string | null | undefined, +) => { loadConfig(polyPath); let code = ''; @@ -37,7 +49,9 @@ export const addOrUpdateCustomFunction = async ( let customFunction: FunctionDetailsDto; const specs = await getSpecs([context], [name]); - const functionSpec = specs.find(spec => spec.name === name && spec.context === context); + const functionSpec = specs.find( + (spec) => spec.name === name && spec.context === context, + ); const updating = !!functionSpec; if (updating) { const isConflictingType = @@ -45,37 +59,69 @@ export const addOrUpdateCustomFunction = async ( (server === true && functionSpec.type === 'customFunction'); if (isConflictingType) { - const existingType = functionSpec.type === 'serverFunction' ? 'server' : 'client'; + const existingType = + functionSpec.type === 'serverFunction' ? 'server' : 'client'; const targetType = existingType === 'server' ? 'client' : 'server'; shell.echo( - chalk.redBright(`ERROR: Function already exists as a ${existingType} function.`) + '\n' + - chalk.red(`Please delete it before deploying as a ${targetType} function.`), + chalk.redBright( + `ERROR: Function already exists as a ${existingType} function.`, + ) + + '\n' + + chalk.red( + `Please delete it before deploying as a ${targetType} function.`, + ), ); return; } } - const typeSchemas = generateTypeSchemas(file, tsConfigBaseUrl, DeployableTypeEntries.map(d => d[0])); + const typeSchemas = generateTypeSchemas( + file, + tsConfigBaseUrl, + DeployableTypeEntries.map((d) => d[0]), + ); if (server) { - shell.echo('-n', `${updating ? 'Updating' : 'Adding'} custom server side function...`); + shell.echo( + '-n', + `${updating ? 'Updating' : 'Adding'} custom server side function...`, + ); const dependencies = getDependencies(code, file, tsConfigBaseUrl); if (dependencies.length) { - shell.echo(chalk.yellow('Please note that deploying your functions will take a few minutes because it makes use of libraries other than polyapi.')); + shell.echo( + chalk.yellow( + 'Please note that deploying your functions will take a few minutes because it makes use of libraries other than polyapi.', + ), + ); } const other: Record = {}; - if (generateContexts) other.generateContexts = generateContexts.split(','); + if (generateContexts) { other.generateContexts = generateContexts.split(','); } if (logsEnabled !== undefined) other.logsEnabled = logsEnabled; - customFunction = await createOrUpdateServerFunction(context, name, description, code, typeSchemas, dependencies, other, executionApiKey); - - const traceId: string | undefined = (customFunction as CreateServerCustomFunctionResponseDto).traceId; + customFunction = await createOrUpdateServerFunction( + context, + name, + description, + code, + typeSchemas, + dependencies, + other, + executionApiKey, + ); + + const traceId: string | undefined = ( + customFunction as CreateServerCustomFunctionResponseDto + ).traceId; if (traceId) { - shell.echo(chalk.yellow('\nWarning:'), 'Failed to generate descriptions while deploying the server function, trace id:', chalk.bold(traceId)); + shell.echo( + chalk.yellow('\nWarning:'), + 'Failed to generate descriptions while deploying the server function, trace id:', + chalk.bold(traceId), + ); } shell.echo(chalk.green('DEPLOYED')); @@ -84,8 +130,19 @@ export const addOrUpdateCustomFunction = async ( } if (client) { - shell.echo('-n', `${updating ? 'Updating' : 'Adding'} Client Function to PolyAPI Catalog...`); - customFunction = await createOrUpdateClientFunction(context, name, description, code, typeSchemas); + shell.echo( + '-n', + `${ + updating ? 'Updating' : 'Adding' + } Client Function to PolyAPI Catalog...`, + ); + customFunction = await createOrUpdateClientFunction( + context, + name, + description, + code, + typeSchemas, + ); shell.echo(chalk.green('DONE')); shell.echo(`Client Function ID: ${customFunction.id}`); } diff --git a/src/commands/generate/index.ts b/src/commands/generate/index.ts index db13262..aad4865 100644 --- a/src/commands/generate/index.ts +++ b/src/commands/generate/index.ts @@ -27,9 +27,15 @@ import { echoGenerationError, isPlainObjectPredicate, getContextData, + templateUrl, } from '../../utils'; import { DEFAULT_POLY_PATH } from '../../constants'; -import { generateFunctionsTSDeclarationFile, generateVariablesTSDeclarationFile, getGenerationErrors, setGenerationErrors } from './types'; +import { + generateFunctionsTSDeclarationFile, + generateVariablesTSDeclarationFile, + getGenerationErrors, + setGenerationErrors, +} from './types'; import { generateSchemaTSDeclarationFiles } from './schemaTypes'; // Register the eq helper for equality comparison @@ -37,10 +43,11 @@ handlebars.registerHelper('eq', (a, b) => a === b); const fsWriteAsync = (file: PathOrFileDescriptor, data: string) => new Promise((resolve, reject) => { - fs.writeFile(file, data, (err) => err ? reject(err) : resolve()); + fs.writeFile(file, data, (err) => (err ? reject(err) : resolve())); }); -const getApiBaseUrl = () => process.env.POLY_API_BASE_URL || 'http://localhost:8000'; +const getApiBaseUrl = () => + process.env.POLY_API_BASE_URL || 'http://localhost:8000'; const getApiKey = () => process.env.POLY_API_KEY; @@ -61,7 +68,11 @@ const prepareDir = async (polyPath: string) => { try { await generateRedirectIndexFiles(polyPath); } catch (err) { - shell.echo(chalk.red(`Could not generate redirect index files: ${err.message}, continuing...`)); + shell.echo( + chalk.red( + `Could not generate redirect index files: ${err.message}, continuing...`, + ), + ); } } }; @@ -84,53 +95,96 @@ const generateRedirectIndexFiles = async (polyPath: string) => { fs.rmSync(defaultPolyLib, { recursive: true, force: true }); fs.mkdirSync(defaultPolyLib, { recursive: true }); - const indexRedirectJSTemplate = handlebars.compile(loadTemplate('index-redirect.js.hbs')); - const indexTSRedirectJSTemplate = handlebars.compile(loadTemplate('index-redirect.d.ts.hbs')); + const indexRedirectJSTemplate = handlebars.compile( + loadTemplate('index-redirect.js.hbs'), + ); + const indexTSRedirectJSTemplate = handlebars.compile( + loadTemplate('index-redirect.d.ts.hbs'), + ); await Promise.all([ - fsWriteAsync(`${defaultPolyLib}/index.js`, indexRedirectJSTemplate({ polyPath })), - fsWriteAsync(`${defaultPolyLib}/index.d.ts`, indexTSRedirectJSTemplate({ polyPath })), + fsWriteAsync( + `${defaultPolyLib}/index.js`, + indexRedirectJSTemplate({ polyPath }), + ), + fsWriteAsync( + `${defaultPolyLib}/index.d.ts`, + indexTSRedirectJSTemplate({ polyPath }), + ), ]); }; -const generateJSFiles = async (libPath: string, specs: Specification[]): Promise => { - const apiFunctions = specs.filter((spec) => spec.type === 'apiFunction') as ApiFunctionSpecification[]; +const generateJSFiles = async ( + libPath: string, + specs: Specification[], +): Promise => { + const apiFunctions = specs.filter( + (spec) => spec.type === 'apiFunction', + ) as ApiFunctionSpecification[]; const customFunctions = specs .filter((spec) => spec.type === 'customFunction') - .filter((spec) => (spec as CustomFunctionSpecification).language === 'javascript') as CustomFunctionSpecification[]; - const webhookHandles = specs.filter((spec) => spec.type === 'webhookHandle') as WebhookHandleSpecification[]; - const authFunctions = specs.filter((spec) => spec.type === 'authFunction') as AuthFunctionSpecification[]; - const serverFunctions = specs.filter((spec) => spec.type === 'serverFunction') as ServerFunctionSpecification[]; - const serverVariables = specs.filter((spec) => spec.type === 'serverVariable') as ServerVariableSpecification[]; + .filter( + (spec) => (spec as CustomFunctionSpecification).language === 'javascript', + ) as CustomFunctionSpecification[]; + const webhookHandles = specs.filter( + (spec) => spec.type === 'webhookHandle', + ) as WebhookHandleSpecification[]; + const authFunctions = specs.filter( + (spec) => spec.type === 'authFunction', + ) as AuthFunctionSpecification[]; + const serverFunctions = specs.filter( + (spec) => spec.type === 'serverFunction', + ) as ServerFunctionSpecification[]; + const serverVariables = specs.filter( + (spec) => spec.type === 'serverVariable', + ) as ServerVariableSpecification[]; await generateIndexJSFile(libPath); await generatePolyCustomJSFile(libPath); await generateAxiosJSFile(libPath); await generateErrorHandlerFile(libPath); - await tryAsync(generateApiFunctionJSFiles(libPath, apiFunctions), 'api functions'); - const customFnCodeGenerationErrors = await tryAsync(generateCustomFunctionJSFiles(libPath, customFunctions), 'custom functions'); + await tryAsync( + generateApiFunctionJSFiles(libPath, apiFunctions), + 'api functions', + ); + const customFnCodeGenerationErrors = await tryAsync( + generateCustomFunctionJSFiles(libPath, customFunctions), + 'custom functions', + ); await tryAsync(generateWebhooksJSFiles(libPath, webhookHandles), 'webhooks'); - await tryAsync(generateAuthFunctionJSFiles(libPath, authFunctions), 'auth functions'); - await tryAsync(generateServerFunctionJSFiles(libPath, serverFunctions), 'server functions'); - await tryAsync(generateServerVariableJSFiles(libPath, serverVariables), 'variables'); + await tryAsync( + generateAuthFunctionJSFiles(libPath, authFunctions), + 'auth functions', + ); + await tryAsync( + generateServerFunctionJSFiles(libPath, serverFunctions), + 'server functions', + ); + await tryAsync( + generateServerVariableJSFiles(libPath, serverVariables), + 'variables', + ); return customFnCodeGenerationErrors; }; const generateIndexJSFile = async (libPath: string) => { - const indexJSTemplate = handlebars.compile(loadTemplate('index.js.hbs')); + const indexJSTemplate = handlebars.compile(loadTemplate('constants.js.hbs')); fs.writeFileSync( - `${libPath}/index.js`, + `${libPath}/constants.js`, indexJSTemplate({ clientID: uuidv4(), apiBaseUrl: getApiBaseUrl(), apiKey: getApiKey(), }), ); + fs.copyFileSync(templateUrl('index.js'), `${libPath}/index.js`); }; const generatePolyCustomJSFile = async (libPath: string) => { - const polyCustomJSTemplate = handlebars.compile(loadTemplate('poly-custom.js.hbs')); + const polyCustomJSTemplate = handlebars.compile( + loadTemplate('poly-custom.js.hbs'), + ); fs.writeFileSync( `${libPath}/poly-custom.js`, polyCustomJSTemplate({ @@ -141,87 +195,105 @@ const generatePolyCustomJSFile = async (libPath: string) => { }; const generateAxiosJSFile = async (libPath: string) => { - const axiosJSTemplate = handlebars.compile(loadTemplate('axios.js.hbs')); - fs.writeFileSync( - `${libPath}/axios.js`, - axiosJSTemplate({ - apiBaseUrl: getApiBaseUrl(), - apiKey: getApiKey(), - }), - ); + fs.copyFileSync(templateUrl('axios.js'), `${libPath}/axios.js`); }; const generateErrorHandlerFile = async (libPath: string) => { - const errorHandlerJSTemplate = handlebars.compile(loadTemplate('error-handler.js.hbs')); - fs.writeFileSync( - `${libPath}/error-handler.js`, - errorHandlerJSTemplate({ - }), - ); + fs.copyFileSync(templateUrl('error-handler.js'), `${libPath}/error-handler.js`); }; -const generateApiFunctionJSFiles = async (libPath: string, specifications: ApiFunctionSpecification[]) => { - const template = handlebars.compile(loadTemplate('api-index.js.hbs')); +const generateApiFunctionJSFiles = async ( + libPath: string, + specifications: ApiFunctionSpecification[], +) => { + const template = handlebars.compile(loadTemplate('api-functions.js.hbs')); fs.writeFileSync( - `${libPath}/api/index.js`, + `${libPath}/api/functions.js`, template({ specifications, executionConfig: getExecutionConfig(), }), ); + fs.copyFileSync(templateUrl('api-index.js'), `${libPath}/api/index.js`); }; -const generateCustomFunctionJSFiles = async (libPath: string, specifications: CustomFunctionSpecification[]): Promise => { +const generateCustomFunctionJSFiles = async ( + libPath: string, + specifications: CustomFunctionSpecification[], +): Promise => { const codeGenerationErrors: Record = {}; if (specifications.length) { - const customFunctionJSTemplate = handlebars.compile(loadTemplate('custom-function.js.hbs')); + const customFunctionJSTemplate = handlebars.compile( + loadTemplate('custom-function.js.hbs'), + ); await Promise.all( specifications.map((spec) => - fsWriteAsync(`${libPath}/client/${spec.context ? `${spec.context}-` : ''}${spec.name}.js`, customFunctionJSTemplate(spec)) - .catch(error => { - codeGenerationErrors[spec.id] = { - stack: (error as Error).stack, - specification: spec, - }; - }), + fsWriteAsync( + `${libPath}/client/${spec.context ? `${spec.context}-` : ''}${ + spec.name + }.js`, + customFunctionJSTemplate(spec), + ).catch((error) => { + codeGenerationErrors[spec.id] = { + stack: (error as Error).stack, + specification: spec, + }; + }), ), ); } - const customIndexJSTemplate = handlebars.compile(loadTemplate('custom-index.js.hbs')); + const customIndexJSTemplate = handlebars.compile( + loadTemplate('custom-index.js.hbs'), + ); fs.writeFileSync( `${libPath}/client/index.js`, customIndexJSTemplate({ - specifications: specifications.filter(spec => !codeGenerationErrors[spec.id]), + specifications: specifications.filter( + (spec) => !codeGenerationErrors[spec.id], + ), }), ); return Array.from(Object.values(codeGenerationErrors)); }; -const generateWebhooksJSFiles = async (libPath: string, specifications: WebhookHandleSpecification[]) => { - const template = handlebars.compile(loadTemplate('webhooks-index.js.hbs')); +const generateWebhooksJSFiles = async ( + libPath: string, + specifications: WebhookHandleSpecification[], +) => { + const template = handlebars.compile(loadTemplate('webhook-handles.js.hbs')); fs.writeFileSync( - `${libPath}/webhooks/index.js`, + `${libPath}/webhooks/handles.js`, template({ specifications, apiKey: getApiKey(), }), ); + fs.copyFileSync(templateUrl('webhooks-index.js'), `${libPath}/webhooks/index.js`); }; -const generateServerFunctionJSFiles = async (libPath: string, specifications: ServerFunctionSpecification[]) => { - const serverIndexJSTemplate = handlebars.compile(loadTemplate('server-index.js.hbs')); +const generateServerFunctionJSFiles = async ( + libPath: string, + specifications: ServerFunctionSpecification[], +) => { + const serverIndexJSTemplate = handlebars.compile( + loadTemplate('server-functions.js.hbs'), + ); fs.writeFileSync( - `${libPath}/server/index.js`, + `${libPath}/server/functions.js`, serverIndexJSTemplate({ specifications, }), ); + fs.copyFileSync(templateUrl('server-index.js'), `${libPath}/server/index.js`); }; -const generateServerVariableJSFiles = async (libPath: string, specifications: ServerVariableSpecification[]) => { +const generateServerVariableJSFiles = async ( + libPath: string, + specifications: ServerVariableSpecification[], +) => { const contextData = getContextData(specifications); const contextPaths = getContextPaths(contextData); const template = handlebars.compile(loadTemplate('vari/index.js.hbs')); @@ -229,7 +301,10 @@ const generateServerVariableJSFiles = async (libPath: string, specifications: Se const arrPaths = []; for (const specification of specifications) { - if (isPlainObjectPredicate(specification.variable.value) || Array.isArray(specification.variable.value)) { + if ( + isPlainObjectPredicate(specification.variable.value) || + Array.isArray(specification.variable.value) + ) { arrPaths.push({ context: specification.context || '', paths: getStringPaths(specification.variable.value), @@ -248,15 +323,22 @@ const generateServerVariableJSFiles = async (libPath: string, specifications: Se ); }; -const generateAuthFunctionJSFiles = async (libPath: string, specifications: AuthFunctionSpecification[]): Promise => { +const generateAuthFunctionJSFiles = async ( + libPath: string, + specifications: AuthFunctionSpecification[], +): Promise => { const apiBaseUrl = getApiBaseUrl(); const apiKey = getApiKey(); - const authIndexJSTemplate = handlebars.compile(loadTemplate('auth-index.js.hbs')); + const authIndexJSTemplate = handlebars.compile( + loadTemplate('auth-index.js.hbs'), + ); fs.writeFileSync( `${libPath}/auth/index.js`, authIndexJSTemplate({ - getTokenFunctions: specifications.filter((spec) => spec.name === 'getToken'), + getTokenFunctions: specifications.filter( + (spec) => spec.name === 'getToken', + ), subResourceFunctions: specifications.filter((spec) => spec.subResource), apiBaseUrl, apiKey, @@ -266,24 +348,32 @@ const generateAuthFunctionJSFiles = async (libPath: string, specifications: Auth const specsToGenerate = specifications.filter((spec) => !spec.subResource); if (specsToGenerate.length === 0) return []; - const authFunctionJSTemplate = handlebars.compile(loadTemplate('auth-function.js.hbs')); + const authFunctionJSTemplate = handlebars.compile( + loadTemplate('auth-function.js.hbs'), + ); const codeGenerationErrors: Record = {}; await Promise.all( specifications.map((spec) => - fsWriteAsync(`${libPath}/auth/${spec.context ? `${spec.context}-` : ''}${spec.name}.js`, authFunctionJSTemplate({ - ...spec, - audienceRequired: spec.function.arguments.some((arg) => arg.name === 'audience'), - apiBaseUrl, - apiKey, - })) - .catch(error => { - codeGenerationErrors[spec.id] = { - stack: (error as Error).stack, - specification: spec, - }; + fsWriteAsync( + `${libPath}/auth/${spec.context ? `${spec.context}-` : ''}${ + spec.name + }.js`, + authFunctionJSTemplate({ + ...spec, + audienceRequired: spec.function.arguments.some( + (arg) => arg.name === 'audience', + ), + apiBaseUrl, + apiKey, }), + ).catch((error) => { + codeGenerationErrors[spec.id] = { + stack: (error as Error).stack, + specification: spec, + }; + }), ), ); @@ -310,14 +400,24 @@ const getContextPaths = (contextData: Record) => { const showErrGeneratingFiles = (error: any) => { shell.echo(chalk.red('ERROR')); - shell.echo('Error while generating code files. Make sure the version of library/server is up to date.'); + shell.echo( + 'Error while generating code files. Make sure the version of library/server is up to date.', + ); shell.echo(chalk.red(error.message)); shell.echo(chalk.red(error.stack)); shell.exit(2); }; -const generateSingleCustomFunction = async (polyPath: string, functionId: string, updated: boolean, noTypes = false) => { - shell.echo('-n', updated ? 'Regenerating TypeScript SDK...' : 'Generating TypeScript SDK...'); +const generateSingleCustomFunction = async ( + polyPath: string, + functionId: string, + updated: boolean, + noTypes = false, +) => { + shell.echo( + '-n', + updated ? 'Regenerating TypeScript SDK...' : 'Generating TypeScript SDK...', + ); const libPath = getPolyLibPath(polyPath); let contextData: Record = {}; @@ -364,20 +464,46 @@ const generateSingleCustomFunction = async (polyPath: string, functionId: string await generateSpecs(libPath, specs, noTypes); if (getGenerationErrors()) { - shell.echo(chalk.yellow('Generate DONE with errors. Please investigate the errors and contact support@polyapi.io for assistance.')); + shell.echo( + chalk.yellow( + 'Generate DONE with errors. Please investigate the errors and contact support@polyapi.io for assistance.', + ), + ); } else { shell.echo(chalk.green('DONE')); } }; -const updateLocalConfig = (polyPath: string, contexts?: string[], names?: string[], functionIds?: string[], noTypes?: boolean) => { - addOrUpdateConfig(polyPath, 'LAST_GENERATE_CONTEXTS_USED', contexts ? contexts.join(',') : ''); +const updateLocalConfig = ( + polyPath: string, + contexts?: string[], + names?: string[], + functionIds?: string[], + noTypes?: boolean, +) => { + addOrUpdateConfig( + polyPath, + 'LAST_GENERATE_CONTEXTS_USED', + contexts ? contexts.join(',') : '', + ); - addOrUpdateConfig(polyPath, 'LAST_GENERATE_NAMES_USED', names ? names.join(',') : ''); + addOrUpdateConfig( + polyPath, + 'LAST_GENERATE_NAMES_USED', + names ? names.join(',') : '', + ); - addOrUpdateConfig(polyPath, 'LAST_GENERATE_FUNCTION_IDS_USED', functionIds ? functionIds.join(',') : ''); + addOrUpdateConfig( + polyPath, + 'LAST_GENERATE_FUNCTION_IDS_USED', + functionIds ? functionIds.join(',') : '', + ); - addOrUpdateConfig(polyPath, 'LAST_GENERATE_NO_TYPES_USED', noTypes ? 'YES' : 'NO'); + addOrUpdateConfig( + polyPath, + 'LAST_GENERATE_NO_TYPES_USED', + noTypes ? 'YES' : 'NO', + ); }; const generate = async ({ @@ -395,7 +521,9 @@ const generate = async ({ }) => { let specs: Specification[] = []; - const generateMsg = contexts ? `Generating Poly TypeScript SDK for contexts "${contexts}"...` : 'Generating Poly TypeScript SDK...'; + const generateMsg = contexts + ? `Generating Poly TypeScript SDK for contexts "${contexts}"...` + : 'Generating Poly TypeScript SDK...'; shell.echo('-n', generateMsg); await prepareDir(polyPath); @@ -414,37 +542,71 @@ const generate = async ({ await generateSpecs(getPolyLibPath(polyPath), specs, noTypes); if (getGenerationErrors()) { - shell.echo(chalk.yellow('Generate DONE with errors. Please investigate the errors and contact support@polyapi.io for assistance.')); + shell.echo( + chalk.yellow( + 'Generate DONE with errors. Please investigate the errors and contact support@polyapi.io for assistance.', + ), + ); } else { shell.echo(chalk.green('DONE')); } }; -const tryAsync = async (promise: Promise, generatingName: string): Promise => { +const tryAsync = async ( + promise: Promise, + generatingName: string, +): Promise => { try { return await promise; } catch (err) { shell.echo( - chalk.red(`\nUnexpected error encountered while generating ${generatingName}: ${err}`), + chalk.red( + `\nUnexpected error encountered while generating ${generatingName}: ${err}`, + ), ); } }; -export const generateSpecs = async (libPath: string, specs: Specification[], noTypes: boolean) => { +export const generateSpecs = async ( + libPath: string, + specs: Specification[], + noTypes: boolean, +) => { try { let missingNames: Specification[] = []; - [missingNames, specs] = specs.reduce((acc, s) => { - acc[s.name.trim() ? 1 : 0].push(s); - return acc; - }, [[], []]); + [missingNames, specs] = specs.reduce( + (acc, s) => { + acc[s.name.trim() ? 1 : 0].push(s); + return acc; + }, + [[], []], + ); const jsFilesCodeGenerationErrors = await generateJSFiles(libPath, specs); - const filteredSpecs = specs.filter(spec => !jsFilesCodeGenerationErrors.find(codeGenerationError => codeGenerationError.specification.id === spec.id)); + const filteredSpecs = specs.filter( + (spec) => + !jsFilesCodeGenerationErrors.find( + (codeGenerationError) => + codeGenerationError.specification.id === spec.id, + ), + ); if (!noTypes) { - await tryAsync(generateFunctionsTSDeclarationFile(libPath, filteredSpecs), 'function types'); - await tryAsync(generateVariablesTSDeclarationFile(libPath, filteredSpecs), 'variable types'); - await tryAsync(generateSchemaTSDeclarationFiles(libPath, filteredSpecs.filter(s => s.type === 'schema') as any[]), 'schemas'); + await tryAsync( + generateFunctionsTSDeclarationFile(libPath, filteredSpecs), + 'function types', + ); + await tryAsync( + generateVariablesTSDeclarationFile(libPath, filteredSpecs), + 'variable types', + ); + await tryAsync( + generateSchemaTSDeclarationFiles( + libPath, + filteredSpecs.filter((s) => s.type === 'schema') as any[], + ), + 'schemas', + ); } generateContextDataFile(libPath, filteredSpecs); diff --git a/src/commands/generate/schemaTypes.ts b/src/commands/generate/schemaTypes.ts index c5ffa87..ce77e56 100644 --- a/src/commands/generate/schemaTypes.ts +++ b/src/commands/generate/schemaTypes.ts @@ -2,10 +2,7 @@ import fs from 'fs'; import { memoize, set } from 'lodash'; import { toPascalCase } from '@guanghechen/helper-string'; import { EOL } from 'node:os'; -import { - SchemaRef, - SchemaSpecification, -} from '../../types'; +import { SchemaRef, SchemaSpecification } from '../../types'; import { echoGenerationError } from '../../utils'; import { setGenerationErrors } from './types'; @@ -14,7 +11,7 @@ const unescapedSingleQuote = /\b'\b/gi; const wrapUnsafeNames = (name: string) => { if (!name.match(unsafeCharacters)) return name; - if (name.includes('\'')) name = name.replaceAll(unescapedSingleQuote, '\''); + if (name.includes("'")) name = name.replaceAll(unescapedSingleQuote, "'"); return `'${name}'`; }; @@ -30,8 +27,7 @@ type JsonSchemaType = | 'object' | 'array' | 'boolean' - | 'null' - ; + | 'null'; type JsonSchemaTypeDeclaration = JsonSchemaType | JsonSchemaType[]; @@ -52,13 +48,14 @@ export type JsonSchema = { allOf?: JsonSchema[]; anyOf?: JsonSchema[]; oneOf?: JsonSchema[]; // converted to anyOf - discriminator?: { // technically this is part of OpenAPI--not JSON Schema + discriminator?: { + // technically this is part of OpenAPI--not JSON Schema propertyName: string; mapping: Record; }; - '$id'?: string; - '$ref'?: string; - '$schema'?: string; + $id?: string; + $ref?: string; + $schema?: string; // eslint-disable-next-line @typescript-eslint/naming-convention 'x-poly-ref'?: SchemaRef; deprecated?: boolean; @@ -69,23 +66,29 @@ export type JsonSchema = { [k: string]: unknown; }; -export type SchemaSpec = Omit & { definition: JsonSchema; }; +export type SchemaSpec = Omit & { + definition: JsonSchema; +}; type SchemaTree = Record>; -const ws = memoize((depth = 1) => depth < 0 ? '' : new Array(depth).fill(' ').join('')); -const end = memoize((nested?: NestedT) => !nested || nested === 'object' ? ';' : ''); +const ws = memoize((depth = 1) => + depth < 0 ? '' : new Array(depth).fill(' ').join(''), +); +const end = memoize((nested?: NestedT) => + !nested || nested === 'object' ? ';' : '', +); const wrapParens = (v: string): string => - v.includes('| ') || v.includes('& ') - ? `(${v})` - : v; + v.includes('| ') || v.includes('& ') ? `(${v})` : v; const printComment = (comment = '', depth = 0, deprecated = false) => { if (!comment && !deprecated) return ''; if (!comment && deprecated) { - return `${ws(depth)}/**${EOL}${ws(depth)} * @deprecated${EOL}${ws(depth)} */${EOL}`; + return `${ws(depth)}/**${EOL}${ws(depth)} * @deprecated${EOL}${ws( + depth, + )} */${EOL}`; } const nl = comment.includes(EOL) ? EOL : '\n'; @@ -97,9 +100,20 @@ const printComment = (comment = '', depth = 0, deprecated = false) => { }; type NestedT = undefined | null | 'object' | 'array' | 'union' | 'intersection'; -type PrintSchemaFn = (schema: JsonSchema, key: string, depth: number, nested?: NestedT, optional?: boolean) => string; - -const printTypeName = (title: string | undefined, key: string, nested: NestedT, optional = false) => { +type PrintSchemaFn = ( + schema: JsonSchema, + key: string, + depth: number, + nested?: NestedT, + optional?: boolean, +) => string; + +const printTypeName = ( + title: string | undefined, + key: string, + nested: NestedT, + optional = false, +) => { if (!nested) { return `type ${formatName(title || key)} = `; } @@ -110,66 +124,120 @@ const printTypeName = (title: string | undefined, key: string, nested: NestedT, return ''; }; -const printEnumSchema: PrintSchemaFn = (schema, key, depth, nested, optional = false) => { +const printEnumSchema: PrintSchemaFn = ( + schema, + key, + depth, + nested, + optional = false, +) => { const values = schema.enum || []; if (values.length === 1) { - return printConstSchema({ ...schema, const: values[0] }, key, depth, nested, optional); + return printConstSchema( + { ...schema, const: values[0] }, + key, + depth, + nested, + optional, + ); } if (schema.nullable && !values.includes(null)) values.unshift(null); - return `${printComment(schema.description, depth, schema.deprecated) - }${ws(depth) - }${printTypeName(schema.title, key, nested, optional) - }${values.map(v => `${EOL}${ws(depth + 1)}| ${typeof v === 'string' ? `'${v}'` : v}`).join('') - }${end(nested)}`; -}; - -const printStringSchema: PrintSchemaFn = (schema, key, depth, nested, optional = false) => { - return `${printComment(schema.description, depth, schema.deprecated) - }${ws(depth) - }${printTypeName(schema.title, key, nested, optional) - }${schema.nullable ? 'null | ' : '' - }string${end(nested)}`; -}; - -const printNumberSchema: PrintSchemaFn = (schema, key, depth, nested, optional = false) => { - return `${printComment(schema.description, depth, schema.deprecated) - }${ws(depth) - }${printTypeName(schema.title, key, nested, optional) - }${schema.nullable ? 'null | ' : '' - }number${end(nested)}`; -}; - -const printBooleanSchema: PrintSchemaFn = (schema, key, depth, nested, optional = false) => { - return `${printComment(schema.description, depth, schema.deprecated) - }${ws(depth) - }${printTypeName(schema.title, key, nested, optional) - }${schema.nullable ? 'null | ' : '' - }boolean${end(nested)}`; -}; - -const printNullSchema: PrintSchemaFn = (schema, key, depth, nested, optional = false) => { - return `${printComment(schema.description, depth, schema.deprecated) - }${ws(depth) - }${printTypeName(schema.title, key, nested, optional) - }null${end(nested)}`; -}; - -const printObjectSchema: PrintSchemaFn = (schema, key, depth, nested, optional = false) => { - let result = `${printComment(schema.description, depth, schema.deprecated) - }${ws(depth) - }${printTypeName(schema.title, key, nested, optional) - }{`; - if (schema.properties || schema.patternProperties || schema.additionalProperties) { + return `${printComment(schema.description, depth, schema.deprecated)}${ws( + depth, + )}${printTypeName(schema.title, key, nested, optional)}${values + .map( + (v) => `${EOL}${ws(depth + 1)}| ${typeof v === 'string' ? `'${v}'` : v}`, + ) + .join('')}${end(nested)}`; +}; + +const printStringSchema: PrintSchemaFn = ( + schema, + key, + depth, + nested, + optional = false, +) => { + return `${printComment(schema.description, depth, schema.deprecated)}${ws( + depth, + )}${printTypeName(schema.title, key, nested, optional)}${ + schema.nullable ? 'null | ' : '' + }string${end(nested)}`; +}; + +const printNumberSchema: PrintSchemaFn = ( + schema, + key, + depth, + nested, + optional = false, +) => { + return `${printComment(schema.description, depth, schema.deprecated)}${ws( + depth, + )}${printTypeName(schema.title, key, nested, optional)}${ + schema.nullable ? 'null | ' : '' + }number${end(nested)}`; +}; + +const printBooleanSchema: PrintSchemaFn = ( + schema, + key, + depth, + nested, + optional = false, +) => { + return `${printComment(schema.description, depth, schema.deprecated)}${ws( + depth, + )}${printTypeName(schema.title, key, nested, optional)}${ + schema.nullable ? 'null | ' : '' + }boolean${end(nested)}`; +}; + +const printNullSchema: PrintSchemaFn = ( + schema, + key, + depth, + nested, + optional = false, +) => { + return `${printComment(schema.description, depth, schema.deprecated)}${ws( + depth, + )}${printTypeName(schema.title, key, nested, optional)}null${end(nested)}`; +}; + +const printObjectSchema: PrintSchemaFn = ( + schema, + key, + depth, + nested, + optional = false, +) => { + let result = `${printComment( + schema.description, + depth, + schema.deprecated, + )}${ws(depth)}${printTypeName(schema.title, key, nested, optional)}{`; + if ( + schema.properties || + schema.patternProperties || + schema.additionalProperties + ) { if (schema.properties) { Object.entries(schema.properties).forEach(([k, v]) => { - result = `${result}${EOL}${printSchemaAsType(v, k, depth + 1, 'object', !schema.required?.includes(k))}`; + result = `${result}${EOL}${printSchemaAsType( + v, + k, + depth + 1, + 'object', + !schema.required?.includes(k), + )}`; }); } if (schema.patternProperties) { // If single pattern property or many with same type then printSchemaAsType with key: `[k: string]` // If multiple types then printSchemaAsType with key: `[k: string]` and union type for value const subschemas = Array.from(Object.values(schema.patternProperties)); - const types = new Set(subschemas.map(s => JSON.stringify(s))); + const types = new Set(subschemas.map((s) => JSON.stringify(s))); let subschema; if (typeof schema.additionalProperties === 'object') { subschema = { anyOf: subschemas.concat(schema.additionalProperties) }; @@ -178,10 +246,20 @@ const printObjectSchema: PrintSchemaFn = (schema, key, depth, nested, optional = } else { subschema = { anyOf: subschemas }; } - result = `${result}${EOL}${printSchemaAsType(subschema, '[k: string]', depth + 1, 'object')}`; + result = `${result}${EOL}${printSchemaAsType( + subschema, + '[k: string]', + depth + 1, + 'object', + )}`; } else if (schema.additionalProperties) { if (typeof schema.additionalProperties === 'object') { - result = `${result}${EOL}${printSchemaAsType(schema.additionalProperties, '[k: string]', depth + 1, 'object')}`; + result = `${result}${EOL}${printSchemaAsType( + schema.additionalProperties, + '[k: string]', + depth + 1, + 'object', + )}`; } else { result = `${result}${EOL}${ws(depth + 1)}[k: string]: unknown;`; } @@ -193,20 +271,35 @@ const printObjectSchema: PrintSchemaFn = (schema, key, depth, nested, optional = return result; }; -const printTupleSchema: PrintSchemaFn = (schema, key, depth, nested, optional = false) => { - if (!Array.isArray(schema.items)) throw new Error('schema.items should be an array to use this function'); - let result = `${printComment(schema.description, depth, schema.deprecated) - }${ws(depth) - }${printTypeName(schema.title, key, nested, optional)}`; +const printTupleSchema: PrintSchemaFn = ( + schema, + key, + depth, + nested, + optional = false, +) => { + if (!Array.isArray(schema.items)) { throw new Error('schema.items should be an array to use this function'); } + let result = `${printComment( + schema.description, + depth, + schema.deprecated, + )}${ws(depth)}${printTypeName(schema.title, key, nested, optional)}`; if (!schema.items.length) { result = `${result}void[]${end(nested)}`; } else { // tuple type - result = `${result}[${EOL}${schema.items.map(item => printSchemaAsType(item, '', depth + 1, 'array')).join(`,${EOL}`)}`; + result = `${result}[${EOL}${schema.items + .map((item) => printSchemaAsType(item, '', depth + 1, 'array')) + .join(`,${EOL}`)}`; if (schema.additionalItems) { if (typeof schema.additionalItems === 'object') { - const child = printSchemaAsType(schema.additionalItems, '', depth + 1, 'array').trim(); + const child = printSchemaAsType( + schema.additionalItems, + '', + depth + 1, + 'array', + ).trim(); if (child.includes(EOL)) { result = `${result},${EOL}${ws(depth + 1)}...Array<${child}>`; } else { @@ -221,12 +314,20 @@ const printTupleSchema: PrintSchemaFn = (schema, key, depth, nested, optional = return result; }; -const printArraySchema: PrintSchemaFn = (schema, key, depth, nested, optional = false) => { - if (Array.isArray(schema.items)) return printTupleSchema(schema, key, depth, nested, optional); +const printArraySchema: PrintSchemaFn = ( + schema, + key, + depth, + nested, + optional = false, +) => { + if (Array.isArray(schema.items)) { return printTupleSchema(schema, key, depth, nested, optional); } - let result = `${printComment(schema.description, depth, schema.deprecated) - }${ws(depth) - }${printTypeName(schema.title, key, nested, optional)}`; + let result = `${printComment( + schema.description, + depth, + schema.deprecated, + )}${ws(depth)}${printTypeName(schema.title, key, nested, optional)}`; if (schema.items) { const child = printSchemaAsType(schema.items, '', depth + 1, 'array'); @@ -242,107 +343,201 @@ const printArraySchema: PrintSchemaFn = (schema, key, depth, nested, optional = return result; }; -const printMultiTypeSchema: PrintSchemaFn = (schema, key, depth, nested, optional = false) => { - if (!Array.isArray(schema.type) || !schema.type.length) throw new Error('schema.type should be a non-empty array to use this function'); - return `${printComment(schema.description, depth, schema.deprecated) - }${ws(depth) - }${printTypeName(schema.title, key, nested, optional) - }${schema.type.join(' | ') - }${end(nested)}`; -}; - -const printIntersectionSchema: PrintSchemaFn = (schema, key, depth, nested, optional = false) => { - if (!Array.isArray(schema.allOf) || !schema.allOf.length) throw new Error('schema.allOf should be a non-empty array to use this function'); +const printMultiTypeSchema: PrintSchemaFn = ( + schema, + key, + depth, + nested, + optional = false, +) => { + if (!Array.isArray(schema.type) || !schema.type.length) { + throw new Error( + 'schema.type should be a non-empty array to use this function', + ); + } + return `${printComment(schema.description, depth, schema.deprecated)}${ws( + depth, + )}${printTypeName(schema.title, key, nested, optional)}${schema.type.join( + ' | ', + )}${end(nested)}`; +}; + +const printIntersectionSchema: PrintSchemaFn = ( + schema, + key, + depth, + nested, + optional = false, +) => { + if (!Array.isArray(schema.allOf) || !schema.allOf.length) { + throw new Error( + 'schema.allOf should be a non-empty array to use this function', + ); + } if (schema.allOf.length === 1) { // no need to print as an intersection type since only one value - return printSchemaAsType({ ...schema, ...schema.allOf[0], allOf: undefined }, key, depth, nested, optional); + return printSchemaAsType( + { ...schema, ...schema.allOf[0], allOf: undefined }, + key, + depth, + nested, + optional, + ); } let subtypes = schema.allOf - .map(s => printSchemaAsType(s, '', depth, 'intersection')) + .map((s) => printSchemaAsType(s, '', depth, 'intersection')) // wrap subschemas in parens if needed .map((v) => wrapParens(v.trim())) .join(' & '); if (schema.nullable) { subtypes = `null | (${subtypes})`; } - return `${printComment(schema.description, depth, schema.deprecated) - }${ws(depth) - }${printTypeName(schema.title, key, nested, optional) - }${subtypes - }${end(nested)}`; -}; - -const printUnionSchema: PrintSchemaFn = (schema, key, depth, nested, optional = false) => { - if (!Array.isArray(schema.anyOf) || !schema.anyOf.length) throw new Error('schema.anyOf should be a non-empty array to use this function'); + return `${printComment(schema.description, depth, schema.deprecated)}${ws( + depth, + )}${printTypeName(schema.title, key, nested, optional)}${subtypes}${end( + nested, + )}`; +}; + +const printUnionSchema: PrintSchemaFn = ( + schema, + key, + depth, + nested, + optional = false, +) => { + if (!Array.isArray(schema.anyOf) || !schema.anyOf.length) { + throw new Error( + 'schema.anyOf should be a non-empty array to use this function', + ); + } if (schema.anyOf.length === 1) { // no need to print as a union type since only one value - return printSchemaAsType({ ...schema, ...schema.anyOf[0], anyOf: undefined }, key, depth, nested, optional); + return printSchemaAsType( + { ...schema, ...schema.anyOf[0], anyOf: undefined }, + key, + depth, + nested, + optional, + ); } const subtypes = schema.anyOf - .map(s => printSchemaAsType(s, '', depth + 1, 'union')) - .map((v, i) => `${EOL}${ws(depth + 1)}${i || !nested || nested === 'object' ? '| ' : ''}${wrapParens(v.trim())}`) + .map((s) => printSchemaAsType(s, '', depth + 1, 'union')) + .map( + (v, i) => + `${EOL}${ws(depth + 1)}${ + i || !nested || nested === 'object' ? '| ' : '' + }${wrapParens(v.trim())}`, + ) .join(''); - return `${printComment(schema.description, depth, schema.deprecated) - }${ws(depth) - }${printTypeName(schema.title, key, nested, optional) - }${schema.nullable ? `${EOL}${ws(depth + 1)}| null` : '' - }${subtypes - }${end(nested)}`; -}; - -const printPolyRefSchema: PrintSchemaFn = (schema, key, depth, nested, optional = false) => { - return `${printComment(schema.description, depth, schema.deprecated) - }${ws(depth) - }${printTypeName(schema.title, key, nested, optional) - }${schema['x-poly-ref'].publicNamespace ? `${schema['x-poly-ref'].publicNamespace}.` : ''}${schema['x-poly-ref'].path.split('.').map(v => formatName(v)).join('.') - }${end(nested)}`; -}; - -const printAnySchema: PrintSchemaFn = (schema, key, depth, nested, optional = false) => { - return `${printComment(schema.description, depth, schema.deprecated) - }${ws(depth) - }${printTypeName(schema.title, key, nested, optional) - }unknown${end(nested)}`; -}; - -const printUnresolvedSchema: PrintSchemaFn = (schema, key, depth, nested, optional = false) => { - return `${printComment(schema.description, depth, schema.deprecated) - }${ws(depth) - }${printTypeName(schema.title, key, nested, optional) - }unknown /* Unresolved type */${end(nested)}`; -}; - -const printConstSchema: PrintSchemaFn = (schema, key, depth, nested, optional = false) => { - return `${printComment(schema.description, depth, schema.deprecated) - }${ws(depth) - }${printTypeName(schema.title, key, nested, optional) - }${schema.nullable && schema.const !== null ? 'null | ' : '' - }${typeof schema.const === 'string' ? `'${schema.const}'` : schema.const! - }${end(nested)}`; -}; - -const printSchemaAsType: PrintSchemaFn = (schema: JsonSchema, key, depth = 0, nested, optional = false): string => { - if (schema['x-poly-ref']) return printPolyRefSchema(schema, key, depth, nested, optional); - if (schema.const !== undefined) return printConstSchema(schema, key, depth, nested, optional); - if (Array.isArray(schema.enum) && schema.enum.length) return printEnumSchema(schema, key, depth, nested, optional); - if (Array.isArray(schema.type) && schema.type.length) return printMultiTypeSchema(schema, key, depth, nested, optional); - if (Array.isArray(schema.anyOf) && schema.anyOf.length) return printUnionSchema(schema, key, depth, nested, optional); - if (Array.isArray(schema.allOf) && schema.allOf.length) return printIntersectionSchema(schema, key, depth, nested, optional); + return `${printComment(schema.description, depth, schema.deprecated)}${ws( + depth, + )}${printTypeName(schema.title, key, nested, optional)}${ + schema.nullable ? `${EOL}${ws(depth + 1)}| null` : '' + }${subtypes}${end(nested)}`; +}; + +const printPolyRefSchema: PrintSchemaFn = ( + schema, + key, + depth, + nested, + optional = false, +) => { + const ref = schema['x-poly-ref']; + return `${printComment(schema.description, depth, schema.deprecated)}${ws( + depth, + )}${printTypeName(schema.title, key, nested, optional)}${ + ref.publicNamespace ? `${formatName(ref.publicNamespace)}.` : '' + }${ref.path + .split('.') + .map((v) => formatName(v)) + .join('.')}${end(nested)}`; +}; + +const printAnySchema: PrintSchemaFn = ( + schema, + key, + depth, + nested, + optional = false, +) => { + return `${printComment(schema.description, depth, schema.deprecated)}${ws( + depth, + )}${printTypeName(schema.title, key, nested, optional)}unknown${end(nested)}`; +}; + +const printUnresolvedSchema: PrintSchemaFn = ( + schema, + key, + depth, + nested, + optional = false, +) => { + return `${printComment(schema.description, depth, schema.deprecated)}${ws( + depth, + )}${printTypeName( + schema.title, + key, + nested, + optional, + )}unknown /* Unresolved type */${end(nested)}`; +}; + +const printConstSchema: PrintSchemaFn = ( + schema, + key, + depth, + nested, + optional = false, +) => { + return `${printComment(schema.description, depth, schema.deprecated)}${ws( + depth, + )}${printTypeName(schema.title, key, nested, optional)}${ + schema.nullable && schema.const !== null ? 'null | ' : '' + }${ + typeof schema.const === 'string' ? `'${schema.const}'` : schema.const! + }${end(nested)}`; +}; + +const printSchemaAsType: PrintSchemaFn = ( + schema: JsonSchema, + key, + depth = 0, + nested, + optional = false, +): string => { + if (schema['x-poly-ref']) { return printPolyRefSchema(schema, key, depth, nested, optional); } + if (schema.const !== undefined) { return printConstSchema(schema, key, depth, nested, optional); } + if (Array.isArray(schema.enum) && schema.enum.length) { return printEnumSchema(schema, key, depth, nested, optional); } + if (Array.isArray(schema.type) && schema.type.length) { return printMultiTypeSchema(schema, key, depth, nested, optional); } + if (Array.isArray(schema.anyOf) && schema.anyOf.length) { return printUnionSchema(schema, key, depth, nested, optional); } + if (Array.isArray(schema.allOf) && schema.allOf.length) { return printIntersectionSchema(schema, key, depth, nested, optional); } switch (schema.type) { - case 'object': return printObjectSchema(schema, key, depth, nested, optional); - case 'array': return printArraySchema(schema, key, depth, nested, optional); - case 'string': return printStringSchema(schema, key, depth, nested, optional); + case 'object': + return printObjectSchema(schema, key, depth, nested, optional); + case 'array': + return printArraySchema(schema, key, depth, nested, optional); + case 'string': + return printStringSchema(schema, key, depth, nested, optional); case 'integer': case 'number': return printNumberSchema(schema, key, depth, nested, optional); - case 'boolean': return printBooleanSchema(schema, key, depth, nested, optional); - case 'null': return printNullSchema(schema, key, depth, nested, optional); - case 'unresolved': return printUnresolvedSchema(schema, key, depth, nested, optional); + case 'boolean': + return printBooleanSchema(schema, key, depth, nested, optional); + case 'null': + return printNullSchema(schema, key, depth, nested, optional); + case 'unresolved': + return printUnresolvedSchema(schema, key, depth, nested, optional); } return printAnySchema(schema, key, depth, nested, optional); }; -const printSchemaTreeAsTypes = (schema: SchemaTree, name: string, depth = 0): string => { +const printSchemaTreeAsTypes = ( + schema: SchemaTree, + name: string, + depth = 0, +): string => { let result = `${ws(depth)}namespace ${formatName(name, false)} {`; for (const [key, child] of Object.entries(schema)) { // null/undefined child is placeholder type so that we can generate namespaces with nothing inside them @@ -351,7 +546,11 @@ const printSchemaTreeAsTypes = (schema: SchemaTree, name: string, depth = 0): st let generated = ''; if ('type' in child && child.type === 'schema') { try { - generated = printSchemaAsType(child.definition as JsonSchema, (child.name || key) as string, depth + 1); + generated = printSchemaAsType( + child.definition as JsonSchema, + (child.name || key) as string, + depth + 1, + ); } catch (err) { console.error(err); echoGenerationError(child as SchemaSpec); @@ -369,7 +568,8 @@ const printSchemaTreeAsTypes = (schema: SchemaTree, name: string, depth = 0): st const normalizeSchema = (schema: S): S => { if (schema.type === 'schema') { schema.definition.title = schema.name; - schema.definition.description = schema.definition.description || schema.description; + schema.definition.description = + schema.definition.description || schema.description; schema.definition = normalizeSchema(schema.definition); return schema; } @@ -387,20 +587,30 @@ const normalizeSchema = (schema: S): S => { } } if (Array.isArray(schema.anyOf)) { - schema.anyOf = schema.anyOf!.map(s => normalizeSchema(s)); + schema.anyOf = schema.anyOf!.map((s) => normalizeSchema(s)); } if (Array.isArray(schema.allOf)) { - schema.allOf = schema.allOf!.map(s => normalizeSchema(s)); + schema.allOf = schema.allOf!.map((s) => normalizeSchema(s)); } - if (schema.type === 'object' || (Array.isArray(schema.type) && schema.type.includes('object'))) { + if ( + schema.type === 'object' || + (Array.isArray(schema.type) && schema.type.includes('object')) + ) { if (schema.additionalProperties == null) { schema.additionalProperties = false; } if (!Array.isArray(schema.required)) { schema.required = []; } - } else if (schema.type === 'array' || (Array.isArray(schema.type) && schema.type.includes('array'))) { - if (schema.items && !Array.isArray(schema.items) && schema.additionalItems) { + } else if ( + schema.type === 'array' || + (Array.isArray(schema.type) && schema.type.includes('array')) + ) { + if ( + schema.items && + !Array.isArray(schema.items) && + schema.additionalItems + ) { // Convert schema.items to tuple type schema.items = [schema.items]; } @@ -422,8 +632,8 @@ const getPolySchemaRefs = (schema: JsonSchema): string[] => { if (schema['x-poly-ref']) return [schema['x-poly-ref'].path]; let toSearch = []; if (schema.schemas) toSearch = toSearch.concat(Object.values(schema.schemas)); - if (schema.properties) toSearch = toSearch.concat(Object.values(schema.properties)); - if (schema.patternProperties) toSearch = toSearch.concat(Object.values(schema.patternProperties)); + if (schema.properties) { toSearch = toSearch.concat(Object.values(schema.properties)); } + if (schema.patternProperties) { toSearch = toSearch.concat(Object.values(schema.patternProperties)); } if (schema.items) { if (Array.isArray(schema.items)) { toSearch = toSearch.concat(schema.items); @@ -432,10 +642,10 @@ const getPolySchemaRefs = (schema: JsonSchema): string[] => { } } if (typeof schema.additionalItems === 'object') toSearch.push(schema.items); - if (typeof schema.additionalProperties === 'object') toSearch.push(schema.additionalProperties); + if (typeof schema.additionalProperties === 'object') { toSearch.push(schema.additionalProperties); } if (Array.isArray(schema.allOf)) toSearch = toSearch.concat(schema.allOf); if (Array.isArray(schema.anyOf)) toSearch = toSearch.concat(schema.anyOf); - return toSearch.flatMap(s => getPolySchemaRefs(s)); + return toSearch.flatMap((s) => getPolySchemaRefs(s)); }; const fillInUnresolvedSchemas = (specs: SchemaSpec[]): SchemaSpec[] => { @@ -454,7 +664,11 @@ const fillInUnresolvedSchemas = (specs: SchemaSpec[]): SchemaSpec[] => { name, context: parts.join('.'), contextName: unresolved.path, - definition: { type: 'unresolved', title: name, description: `Unresolved schema, please add schema \`${unresolved.path}\` to complete it.` }, + definition: { + type: 'unresolved', + title: name, + description: `Unresolved schema, please add schema \`${unresolved.path}\` to complete it.`, + }, visibilityMetadata: { // @ts-expect-error - it's fine visibility: 'ENVIRONMENT', @@ -476,7 +690,11 @@ const fillInUnresolvedSchemas = (specs: SchemaSpec[]): SchemaSpec[] => { name, context, contextName, - definition: { type: 'unresolved', title: name, description: `Missing schema, as context \`${context}\` was not generated.` }, + definition: { + type: 'unresolved', + title: name, + description: `Missing schema, as context \`${context}\` was not generated.`, + }, visibilityMetadata: { // @ts-expect-error - it's fine visibility: 'ENVIRONMENT', @@ -488,7 +706,10 @@ const fillInUnresolvedSchemas = (specs: SchemaSpec[]): SchemaSpec[] => { return Array.from(schemas.values()); }; -const replaceJsonSchemasWithPolyAPISchemas = (schema: JsonSchema, mapping: Map): void => { +const replaceJsonSchemasWithPolyAPISchemas = ( + schema: JsonSchema, + mapping: Map, +): void => { if (schema['$ref'] && mapping.has(schema['$ref'])) { schema['x-poly-ref'] = { path: mapping.get(schema['$ref']), @@ -497,8 +718,8 @@ const replaceJsonSchemasWithPolyAPISchemas = (schema: JsonSchema, mapping: Map { if (!spec.definition.definitions) continue; // Pull out all the definitions as PolyAPI Schemas const mapping = new Map(); - for (const [name, definition] of Object.entries(spec.definition.definitions)) { + for (const [name, definition] of Object.entries( + spec.definition.definitions, + )) { // Make sure contextName is unique let contextName = ''; let i = -1; do { i++; - contextName = `${spec.context}${spec.context ? '.' : ''}${name}${i || ''}`; + contextName = `${spec.context}${spec.context ? '.' : ''}${name}${ + i || '' + }`; } while (names.has(contextName)); mapping.set(`#/definitions/${name}`, contextName); flattened.push({ @@ -563,9 +788,10 @@ const printSchemaRoot = (root: SchemaRoot): string => { let result = 'declare namespace schemas {'; // print the namespaces for (const [key, tree] of Object.entries(root.namespaces)) { - const types = 'type' in tree && tree.type === 'schema' - ? printSchemaAsType(tree.definition as JsonSchema, key, 1) - : printSchemaTreeAsTypes(tree as SchemaTree, toPascalCase(key), 1); + const types = + 'type' in tree && tree.type === 'schema' + ? printSchemaAsType(tree.definition as JsonSchema, key, 1) + : printSchemaTreeAsTypes(tree as SchemaTree, toPascalCase(key), 1); result = `${result}${EOL}${types}`; } // close the module @@ -591,31 +817,34 @@ const buildSchemaTree = (specs: SchemaSpec[]): SchemaRoot[] => { const printSchemaSpecs = (specs: SchemaSpec[]): Record => { // first normalize the schemas, flatten inline schema definitions and fill in unresolved ones const normalized = fillInUnresolvedSchemas( - flattenDefinitions( - specs.map(schema => normalizeSchema(schema)), - ), + flattenDefinitions(specs.map((schema) => normalizeSchema(schema))), ); // then build schema trees const trees = buildSchemaTree(normalized); // then print all the schema types as strings ready to be saved to disk - const fileMap = Object.fromEntries(trees.map(tree => [`${tree.path}.d.ts`, printSchemaRoot(tree)])); - fileMap['index.d.ts'] = Object.keys(fileMap).map(file => `/// `).join(EOL); + const fileMap = Object.fromEntries( + trees.map((tree) => [`${tree.path}.d.ts`, printSchemaRoot(tree)]), + ); + fileMap['index.d.ts'] = Object.keys(fileMap) + .map((file) => `/// `) + .join(EOL); return fileMap; }; -export const generateSchemaTSDeclarationFiles = async (libPath: string, specs: SchemaSpec[]): Promise => { +export const generateSchemaTSDeclarationFiles = async ( + libPath: string, + specs: SchemaSpec[], +): Promise => { const files = printSchemaSpecs(specs); await Promise.all( - Object.entries(files) - .map(([file, contents]) => + Object.entries(files).map( + ([file, contents]) => new Promise((resolve, reject) => - fs.writeFile( - `${libPath}/schemas/${file}`, - contents, - (err) => err ? reject(err) : resolve(), + fs.writeFile(`${libPath}/schemas/${file}`, contents, (err) => + err ? reject(err) : resolve(), ), ), - ), + ), ); }; diff --git a/src/commands/generate/types.ts b/src/commands/generate/types.ts index 9ee01f8..3e9aa17 100644 --- a/src/commands/generate/types.ts +++ b/src/commands/generate/types.ts @@ -45,19 +45,26 @@ export const setGenerationErrors = (value: boolean) => { export const getGenerationErrors = () => generationErrors; -const schemaToDeclarations = async (namespace: string, typeName: string, schema: Record, value?: any | undefined, options: { - unknownAny: boolean -} = { - unknownAny: true, -}) => { - const wrapToNamespace = (code: string) => `namespace ${namespace} {\n ${code}\n}`; +const schemaToDeclarations = async ( + namespace: string, + typeName: string, + schema: Record, + value?: any | undefined, + options: { + unknownAny: boolean; + } = { + unknownAny: true, + }, +) => { + const wrapToNamespace = (code: string) => + `namespace ${namespace} {\n ${code}\n}`; const appendPathUnionType = (code: string, value: any) => { if (Array.isArray(value) || isPlainObjectPredicate(value)) { - const unionPath = getStringPaths(value).map(value => `'${value}'`); + const unionPath = getStringPaths(value).map((value) => `'${value}'`); // If the value is an empty array or object we naturally can't get any property paths // So we fallback to an empty string as the type - const pathValue = unionPath.join(' | ') || '\'\''; + const pathValue = unionPath.join(' | ') || "''"; return `${code}\nexport type PathValue = ${pathValue}`; } @@ -73,8 +80,10 @@ const schemaToDeclarations = async (namespace: string, typeName: string, schema: ignoreMinAndMaxItems: true, unknownAny: options.unknownAny, customName(innerSchema, keyNameFromDefinition) { - // eslint-disable-next-line @typescript-eslint/naming-convention - const ref = innerSchema['x-poly-ref'] as (SchemaRef & { 'x-unresolved'?: true }) | undefined; + const ref = innerSchema['x-poly-ref'] as + // eslint-disable-next-line @typescript-eslint/naming-convention + | (SchemaRef & { 'x-unresolved'?: true }) + | undefined; if (ref !== null && typeof ref === 'object' && !Array.isArray(ref)) { const schemaTypeNameParts = ['$PolySchema']; @@ -110,17 +119,29 @@ const schemaToDeclarations = async (namespace: string, typeName: string, schema: }, }); - const sourceFile = ts.createSourceFile('x.ts', result, ts.ScriptTarget.Latest); + const sourceFile = ts.createSourceFile( + 'x.ts', + result, + ts.ScriptTarget.Latest, + ); const polySchemaTypeReferenceSet = new Set(); // used to dedupe references to same schema - const polySchemaTypeReferenceList: { name: string, path: string, replacement: string }[] = []; - const polySchemaInterfaceDeclarationList: { name: string, code: string }[] = []; + const polySchemaTypeReferenceList: { + name: string; + path: string; + replacement: string; + }[] = []; + const polySchemaInterfaceDeclarationList: { name: string; code: string }[] = + []; const visitor = (node: ts.Node) => { if (ts.isTypeReferenceNode(node)) { const name = node.getFullText(sourceFile).trim(); - if (name.match(/^\$PolySchema\$\$\$/) && !polySchemaTypeReferenceSet.has(name)) { + if ( + name.match(/^\$PolySchema\$\$\$/) && + !polySchemaTypeReferenceSet.has(name) + ) { polySchemaTypeReferenceSet.add(name); polySchemaTypeReferenceList.push({ name, @@ -132,14 +153,20 @@ const schemaToDeclarations = async (namespace: string, typeName: string, schema: if (ts.isInterfaceDeclaration(node)) { const children = node.getChildren(sourceFile); - const possibleIdentifier = children.find(node => node.kind === ts.SyntaxKind.Identifier); + const possibleIdentifier = children.find( + (node) => node.kind === ts.SyntaxKind.Identifier, + ); if (possibleIdentifier) { const name = possibleIdentifier.getFullText(sourceFile).trim(); const code = node.getFullText(sourceFile); - if (name.match(/^\$PolySchema\$\$\$/) || (['Argument', 'ReturnType'].includes(name) && code.match(/.+?<\/path>/))) { + if ( + name.match(/^\$PolySchema\$\$\$/) || + (['Argument', 'ReturnType'].includes(name) && + code.match(/.+?<\/path>/)) + ) { polySchemaInterfaceDeclarationList.push({ name, code, @@ -153,15 +180,24 @@ const schemaToDeclarations = async (namespace: string, typeName: string, schema: ts.forEachChild(sourceFile, visitor); - const visitedPaths: { path: string, typeName: string }[] = []; + const visitedPaths: { path: string; typeName: string }[] = []; const getUnresolvedSchemaArg = (path: string, isPublic: boolean): string => { - return isPublic ? `Unresolved public schema \`${path}\`.` : `Unresolved schema, please add schema \`${path}\` to complete it.`; + return isPublic + ? `Unresolved public schema \`${path}\`.` + : `Unresolved schema, please add schema \`${path}\` to complete it.`; }; - type PolySchemaTypeParts = [prefix: '$PolySchema', argOrReturnType: '$Argument' | '$ReturnType' | '___', visibilityStatus: '$Public' | '___', resolvedStatus: '$Resolved' | '$Unresolved', ...realContextParts: string[]]; + type PolySchemaTypeParts = [ + prefix: '$PolySchema', + argOrReturnType: '$Argument' | '$ReturnType' | '___', + visibilityStatus: '$Public' | '___', + resolvedStatus: '$Resolved' | '$Unresolved', + ...realContextParts: string[], + ]; - const getPolySchemaTypeParts = (typeName: string): PolySchemaTypeParts => typeName.split(typeNameContextDelimiter) as PolySchemaTypeParts; + const getPolySchemaTypeParts = (typeName: string): PolySchemaTypeParts => + typeName.split(typeNameContextDelimiter) as PolySchemaTypeParts; /* 1. Remove interfaces from resolved schemas that belong to some object property, also track them to fix each type that point to removed interfaces. @@ -169,12 +205,19 @@ const schemaToDeclarations = async (namespace: string, typeName: string, schema: 3. Replace interfaces from argument/return type that are linked to an unresolved schemas for an `any` type. */ for (const polySchemaInterfaceDeclaration of polySchemaInterfaceDeclarationList) { - const [, argumentOrReturnType, visibilityStatus, resolvedStatus, ...realContextParts] = getPolySchemaTypeParts(polySchemaInterfaceDeclaration.name); + const [ + , + argumentOrReturnType, + visibilityStatus, + resolvedStatus, + ...realContextParts + ] = getPolySchemaTypeParts(polySchemaInterfaceDeclaration.name); const isResolved = resolvedStatus === '$Resolved'; const isPublic = visibilityStatus === '$Public'; - const matchPathNameCommentInCode = polySchemaInterfaceDeclaration.code.match(/(.+?)<\/path>/); + const matchPathNameCommentInCode = + polySchemaInterfaceDeclaration.code.match(/(.+?)<\/path>/); if (matchPathNameCommentInCode === null) { continue; @@ -184,14 +227,35 @@ const schemaToDeclarations = async (namespace: string, typeName: string, schema: if (['$ReturnType', '$Argument'].includes(argumentOrReturnType)) { if (isResolved) { - const typePath = `schemas.${path.split('.').map(toPascalCase).join('.')}`; - - result = result.replace(polySchemaInterfaceDeclaration.code, `export interface ${argumentOrReturnType.replace('$', '')} extends ${typePath} {}`); + const typePath = `schemas.${path + .split('.') + .map(toPascalCase) + .join('.')}`; + + result = result.replace( + polySchemaInterfaceDeclaration.code, + `export interface ${argumentOrReturnType.replace( + '$', + '', + )} extends ${typePath} {}`, + ); } else { - result = result.replace(polySchemaInterfaceDeclaration.code, `/**\n * ${getUnresolvedSchemaArg(path, isPublic)}\n */\n export type ${argumentOrReturnType.replace('$', '')} = any;`); + result = result.replace( + polySchemaInterfaceDeclaration.code, + `/**\n * ${getUnresolvedSchemaArg( + path, + isPublic, + )}\n */\n export type ${argumentOrReturnType.replace( + '$', + '', + )} = any;`, + ); } } else { - const polySchemaTypeReference = polySchemaTypeReferenceList.find(polySchemaTypeReference => polySchemaTypeReference.name === polySchemaInterfaceDeclaration.name); + const polySchemaTypeReference = polySchemaTypeReferenceList.find( + (polySchemaTypeReference) => + polySchemaTypeReference.name === polySchemaInterfaceDeclaration.name, + ); if (polySchemaTypeReference) { polySchemaTypeReference.path = path; @@ -200,7 +264,9 @@ const schemaToDeclarations = async (namespace: string, typeName: string, schema: if (isResolved) { result = result.replace(polySchemaInterfaceDeclaration.code, ''); } else { - const schemaPathVisited = visitedPaths.find(visitedPath => visitedPath.path === path); + const schemaPathVisited = visitedPaths.find( + (visitedPath) => visitedPath.path === path, + ); if (!schemaPathVisited) { visitedPaths.push({ @@ -208,7 +274,15 @@ const schemaToDeclarations = async (namespace: string, typeName: string, schema: typeName: polySchemaInterfaceDeclaration.name, }); - result = result.replace(polySchemaInterfaceDeclaration.code, `/**\n * ${getUnresolvedSchemaArg(path, isPublic)}\n */\n type ${[...realContextParts, 'Schema'].join('$')} = any`); + result = result.replace( + polySchemaInterfaceDeclaration.code, + `/**\n * ${getUnresolvedSchemaArg( + path, + isPublic, + )}\n */\n type ${[...realContextParts, 'Schema'].join( + '$', + )} = any`, + ); } else { polySchemaTypeReference.replacement = schemaPathVisited.typeName; @@ -222,16 +296,23 @@ const schemaToDeclarations = async (namespace: string, typeName: string, schema: * Iterate over all removed interfaces and replace each type reference with proper schema reference. */ for (const polySchemaTypeReference of polySchemaTypeReferenceList) { - const polySchemaTypeReferenceParts = getPolySchemaTypeParts(polySchemaTypeReference.name); + const polySchemaTypeReferenceParts = getPolySchemaTypeParts( + polySchemaTypeReference.name, + ); const [, , , resolvedStatus] = polySchemaTypeReferenceParts; const isResolved = resolvedStatus === '$Resolved'; if (isResolved) { - const realPathParts = polySchemaTypeReference.path.split('.').map(toPascalCase); + const realPathParts = polySchemaTypeReference.path + .split('.') + .map(toPascalCase); - result = result.replace(polySchemaTypeReference.name, `schemas.${realPathParts.join('.')}`); + result = result.replace( + polySchemaTypeReference.name, + `schemas.${realPathParts.join('.')}`, + ); } else { result = result.replace(polySchemaTypeReference.name, 'unknown'); } @@ -246,10 +327,16 @@ const getObjectTypeDeclarations = async ( objectProperty: ObjectPropertyType, typeName: string, ): Promise => { - const declarations = await schemaToDeclarations(namespace, typeName, objectProperty.schema); + const declarations = await schemaToDeclarations( + namespace, + typeName, + objectProperty.schema, + ); // setting typeName to be used when generating return type - objectProperty.typeName = `${namespacePath ? `${namespacePath}.` : ''}${namespace}.${typeName}`; + objectProperty.typeName = `${ + namespacePath ? `${namespacePath}.` : '' + }${namespace}.${typeName}`; return declarations; }; @@ -260,17 +347,25 @@ const getArgumentsTypeDeclarations = async ( typeName = 'Argument', ) => { const typeDeclarations: string[] = []; - const objectProperties = properties.filter((property) => property.type.kind === 'object'); - const functionProperties = properties.filter((property) => property.type.kind === 'function'); + const objectProperties = properties.filter( + (property) => property.type.kind === 'object', + ); + const functionProperties = properties.filter( + (property) => property.type.kind === 'function', + ); for (const property of objectProperties) { const objectProperty = property.type as ObjectPropertyType; if (objectProperty.schema) { const namespace = `${parentType}$${toPascalCase(property.name)}`; // setting typeName to be used when generating arguments type - objectProperty.typeName = `${namespacePath ? `${namespacePath}.` : ''}${namespace}.${typeName}`; + objectProperty.typeName = `${ + namespacePath ? `${namespacePath}.` : '' + }${namespace}.${typeName}`; - typeDeclarations.push(await schemaToDeclarations(namespace, typeName, objectProperty.schema)); + typeDeclarations.push( + await schemaToDeclarations(namespace, typeName, objectProperty.schema), + ); } else if (objectProperty.properties) { typeDeclarations.push( ...(await getArgumentsTypeDeclarations( @@ -293,10 +388,15 @@ const getArgumentsTypeDeclarations = async ( ...(await getArgumentsTypeDeclarations( namespacePath, `${parentType}$${toPascalCase(property.name)}`, - functionProperty.spec.arguments.filter((arg) => arg.type.kind === 'object'), + functionProperty.spec.arguments.filter( + (arg) => arg.type.kind === 'object', + ), )), ); - if (functionProperty.spec.returnType.kind === 'object' && functionProperty.spec.returnType.schema) { + if ( + functionProperty.spec.returnType.kind === 'object' && + functionProperty.spec.returnType.schema + ) { typeDeclarations.push( await getObjectTypeDeclarations( namespacePath, @@ -340,7 +440,9 @@ const getAdditionalComments = (specification: Specification) => { } }; -const getSpecificationWithFunctionComment = (specification: SpecificationWithFunction) => { +const getSpecificationWithFunctionComment = ( + specification: SpecificationWithFunction, +) => { const descriptionComment = specification.description ? specification.description .split('\n') @@ -348,9 +450,15 @@ const getSpecificationWithFunctionComment = (specification: SpecificationWithFun .join('\n') : null; const toArgumentComment = (arg: PropertySpecification, prefix = '') => { - if (arg.name === 'payload' && arg.type.kind === 'object' && arg.type.properties) { + if ( + arg.name === 'payload' && + arg.type.kind === 'object' && + arg.type.properties + ) { return arg.type.properties - .map(payloadProperty => toArgumentComment(payloadProperty, 'payload.')) + .map((payloadProperty) => + toArgumentComment(payloadProperty, 'payload.'), + ) .filter(Boolean) .join('\n'); } @@ -362,29 +470,38 @@ const getSpecificationWithFunctionComment = (specification: SpecificationWithFun }; const argumentsComment = specification.function.arguments - .map(arg => toArgumentComment(arg)) + .map((arg) => toArgumentComment(arg)) .filter(Boolean) .join('\n'); const additionalComments = getAdditionalComments(specification); const idComment = getIDComment(specification); - return `${descriptionComment ? `${descriptionComment}\n` : ''}${argumentsComment ? `${argumentsComment}\n` : ''}${additionalComments ? `${additionalComments}\n` : ''}${idComment ? `*\n${idComment}\n` : ''}`.trim(); + return `${descriptionComment ? `${descriptionComment}\n` : ''}${ + argumentsComment ? `${argumentsComment}\n` : '' + }${additionalComments ? `${additionalComments}\n` : ''}${ + idComment ? `*\n${idComment}\n` : '' + }`.trim(); }; -const getSpecificationWithVariableComment = (specification: SpecificationWithVariable) => { +const getSpecificationWithVariableComment = ( + specification: SpecificationWithVariable, +) => { const descriptionComment = specification.description ? specification.description .split('\n') .map((line) => `* ${line}`) .join('\n') : null; - const secretComment = specification.variable.secrecy === 'SECRET' - ? '* Note: The variable is secret and can be used only within Poly functions.' - : null; + const secretComment = + specification.variable.secrecy === 'SECRET' + ? '* Note: The variable is secret and can be used only within Poly functions.' + : null; const idComment = `* Variable ID: ${specification.id}`; - return `${descriptionComment ? `${descriptionComment}\n` : ''}${secretComment ? `${secretComment}\n` : ''}${idComment ? `*\n${idComment}` : ''}`.trim(); + return `${descriptionComment ? `${descriptionComment}\n` : ''}${ + secretComment ? `${secretComment}\n` : '' + }${idComment ? `*\n${idComment}` : ''}`.trim(); }; const getVariableValueTypeDeclarations = async ( @@ -393,17 +510,28 @@ const getVariableValueTypeDeclarations = async ( objectProperty: ObjectPropertyType, value: any, ): Promise => { - const declarations = await schemaToDeclarations(namespace, 'ValueType', objectProperty.schema, value, { - unknownAny: false, - }); + const declarations = await schemaToDeclarations( + namespace, + 'ValueType', + objectProperty.schema, + value, + { + unknownAny: false, + }, + ); // setting typeName to be used when generating variable value type - objectProperty.typeName = `${namespacePath ? `${namespacePath}.` : ''}${namespace}.ValueType`; + objectProperty.typeName = `${ + namespacePath ? `${namespacePath}.` : '' + }${namespace}.ValueType`; return declarations; }; -const getSpecificationsTypeDeclarations = async (namespacePath: string, specifications: Specification[]): Promise => { +const getSpecificationsTypeDeclarations = async ( + namespacePath: string, + specifications: Specification[], +): Promise => { const errors: GenerationError[] = []; const getDeclarationOrHandleError = async ( getDeclaration: () => Promise, @@ -427,7 +555,12 @@ const getSpecificationsTypeDeclarations = async (namespacePath: string, specific .map((spec) => spec as SpecificationWithFunction) .map((spec) => getDeclarationOrHandleError( - () => getArgumentsTypeDeclarations(namespacePath, toPascalCase(spec.name), spec.function.arguments), + () => + getArgumentsTypeDeclarations( + namespacePath, + toPascalCase(spec.name), + spec.function.arguments, + ), spec, ), ), @@ -435,18 +568,21 @@ const getSpecificationsTypeDeclarations = async (namespacePath: string, specific ).flat(); const returnTypeDeclarations = await Promise.all( specifications - .filter((spec) => - 'function' in spec && - ( - (spec.function.returnType.kind === 'object' && + .filter( + (spec) => + 'function' in spec && + ((spec.function.returnType.kind === 'object' && spec.function.returnType.schema && !isBinary(spec.function.returnType)) || - (spec.type === 'serverFunction' && (spec as ServerFunctionSpecification).serverSideAsync === true) - ), + (spec.type === 'serverFunction' && + (spec as ServerFunctionSpecification).serverSideAsync === true)), ) .map((spec) => spec as SpecificationWithFunction) .map((spec) => { - if (spec.type === 'serverFunction' && (spec as ServerFunctionSpecification).serverSideAsync === true) { + if ( + spec.type === 'serverFunction' && + (spec as ServerFunctionSpecification).serverSideAsync === true + ) { const ns = toPascalCase(spec.name); return Promise.resolve( `namespace ${ns} {\n export type ReturnType = { executionId: string };\n}`, @@ -468,25 +604,46 @@ const getSpecificationsTypeDeclarations = async (namespacePath: string, specific const variableValueDeclarations = await Promise.all( specifications - .filter((spec) => 'variable' in spec && spec.variable.valueType.kind === 'object' && spec.variable.valueType.schema) + .filter( + (spec) => + 'variable' in spec && + spec.variable.valueType.kind === 'object' && + spec.variable.valueType.schema, + ) .map((spec) => spec as SpecificationWithVariable) - .map((spec) => - getDeclarationOrHandleError( - () => getVariableValueTypeDeclarations(namespacePath, toPascalCase(spec.name), spec.variable.valueType as ObjectPropertyType, spec.variable.value), - spec, - ) as Promise, + .map( + (spec) => + getDeclarationOrHandleError( + () => + getVariableValueTypeDeclarations( + namespacePath, + toPascalCase(spec.name), + spec.variable.valueType as ObjectPropertyType, + spec.variable.value, + ), + spec, + ) as Promise, ), ); const schemaDeclarations = await Promise.all( - specifications.filter(specification => specification.type === 'schema') - .map(spec => getDeclarationOrHandleError( - () => getObjectTypeDeclarations(namespacePath, toPascalCase(spec.name), { - schema: (spec as SchemaSpecification).definition as any, - kind: 'object', - }, 'Schema'), - spec, - )), + specifications + .filter((specification) => specification.type === 'schema') + .map((spec) => + getDeclarationOrHandleError( + () => + getObjectTypeDeclarations( + namespacePath, + toPascalCase(spec.name), + { + schema: (spec as SchemaSpecification).definition as any, + kind: 'object', + }, + 'Schema', + ), + spec, + ), + ), ); if (errors.length) { @@ -495,7 +652,12 @@ const getSpecificationsTypeDeclarations = async (namespacePath: string, specific }); } - return [...argumentsTypeDeclarations, ...returnTypeDeclarations, ...variableValueDeclarations, ...schemaDeclarations].join('\n'); + return [ + ...argumentsTypeDeclarations, + ...returnTypeDeclarations, + ...variableValueDeclarations, + ...schemaDeclarations, + ].join('\n'); }; const generateTSContextDeclarationFile = async ( @@ -505,10 +667,16 @@ const generateTSContextDeclarationFile = async ( subContexts: Context[], pathPrefix: string, ) => { - const template = handlebars.compile(loadTemplate(`${pathPrefix}/{{context}}.d.ts.hbs`)); - const contextPaths = context.path === '' ? [] : context.path.split('.').map(toPascalCase); + const template = handlebars.compile( + loadTemplate(`${pathPrefix}/{{context}}.d.ts.hbs`), + ); + const contextPaths = + context.path === '' ? [] : context.path.split('.').map(toPascalCase); - const typeDeclarations = await getSpecificationsTypeDeclarations(contextPaths.join('.'), specifications); + const typeDeclarations = await getSpecificationsTypeDeclarations( + contextPaths.join('.'), + specifications, + ); const toFunctionDeclaration = (specification: SpecificationWithFunction) => { const toArgumentDeclaration = (arg: PropertySpecification) => ({ @@ -523,7 +691,9 @@ const generateTSContextDeclarationFile = async ( ? `GraphqlAPIFunctionResponse<${returnType}>` : `ApiFunctionResponse<${returnType}>`; case 'authFunction': - return specification.name === 'getToken' ? returnType : `AuthFunctionResponse<${returnType}>`; + return specification.name === 'getToken' + ? returnType + : `AuthFunctionResponse<${returnType}>`; } return returnType; }; @@ -533,7 +703,9 @@ const generateTSContextDeclarationFile = async ( specification.type === 'serverFunction' && (specification as ServerFunctionSpecification).serverSideAsync === true ) { - computedReturnType = `${context.interfaceName}.${toPascalCase(specification.name)}.ReturnType`; + computedReturnType = `${context.interfaceName}.${toPascalCase( + specification.name, + )}.ReturnType`; } else { computedReturnType = toTypeDeclaration(specification.function.returnType); } @@ -544,7 +716,10 @@ const generateTSContextDeclarationFile = async ( deprecated: specification.state === 'DEPRECATED', arguments: specification.function.arguments.map(toArgumentDeclaration), returnType: wrapInResponseType(computedReturnType), - synchronous: specification.type === 'serverFunction' ? false : specification.function.synchronous === true, + synchronous: + specification.type === 'serverFunction' + ? false + : specification.function.synchronous === true, }; }; @@ -565,11 +740,16 @@ const generateTSContextDeclarationFile = async ( }; const toSchemaDeclaration = (specification: SchemaSpecification) => { - const contextParts = specification.context.split('.').filter(v => v); + const contextParts = specification.context.split('.').filter((v) => v); return { name: specification.name.split('.').pop(), - typeDeclaration: contextParts.length ? `${specification.context.split('.').map(toPascalCase).join('.')}.${toPascalCase(specification.name)}` : `${toPascalCase(specification.name)}`, + typeDeclaration: contextParts.length + ? `${specification.context + .split('.') + .map(toPascalCase) + .join('.')}.${toPascalCase(specification.name)}` + : `${toPascalCase(specification.name)}`, }; }; @@ -587,7 +767,9 @@ const generateTSContextDeclarationFile = async ( variableDeclarations: specifications .filter((spec) => 'variable' in spec) .map(toVariableDeclaration), - schemaDeclarations: specifications.filter(spec => spec.type === 'schema').map(toSchemaDeclaration), + schemaDeclarations: specifications + .filter((spec) => spec.type === 'schema') + .map(toSchemaDeclaration), subContexts, }), ), @@ -619,7 +801,13 @@ const generateTSDeclarationFilesForContext = async ( }; }); - await generateTSContextDeclarationFile(libPath, context, contextDataSpecifications, contextDataSubContexts, pathPrefix); + await generateTSContextDeclarationFile( + libPath, + context, + contextDataSpecifications, + contextDataSubContexts, + pathPrefix, + ); contextCollector = [...contextCollector, context]; for await (const subContext of contextDataSubContexts) { @@ -635,25 +823,43 @@ const generateTSDeclarationFilesForContext = async ( return contextCollector; }; -const assignUnresolvedRefsToPolySchemaRefObj = (schemaDefinition: any, unresolvedPolySchemaRefs: SchemaRef[] = []) => { - iterateRefs(schemaDefinition, schema => { - const ref = schema['x-poly-ref'] as SchemaRef; +const assignUnresolvedRefsToPolySchemaRefObj = ( + schemaDefinition: any, + unresolvedPolySchemaRefs: SchemaRef[] = [], +) => { + iterateRefs( + schemaDefinition, + (schema) => { + const ref = schema['x-poly-ref'] as SchemaRef; - if (ref !== null && typeof ref === 'object' && !Array.isArray(ref)) { - const foundUnresolved = unresolvedPolySchemaRefs.find(unresolvedPolySchemaRef => unresolvedPolySchemaRef.path === ref.path && unresolvedPolySchemaRef.publicNamespace === ref.publicNamespace); + if (ref !== null && typeof ref === 'object' && !Array.isArray(ref)) { + const foundUnresolved = unresolvedPolySchemaRefs.find( + (unresolvedPolySchemaRef) => + unresolvedPolySchemaRef.path === ref.path && + unresolvedPolySchemaRef.publicNamespace === ref.publicNamespace, + ); + + if (foundUnresolved) { + schema['x-poly-ref']['x-unresolved'] = true; + } - if (foundUnresolved) { - schema['x-poly-ref']['x-unresolved'] = true; + schema.description = `${ + ref.publicNamespace ? `${ref.publicNamespace}.${ref.path}` : ref.path + }`; } - schema.description = `${ref.publicNamespace ? `${ref.publicNamespace}.${ref.path}` : ref.path}`; - } - - return schema; - }, 'x-poly-ref'); + return schema; + }, + 'x-poly-ref', + ); }; -const generateTSDeclarationFiles = async (libPath: string, specs: Specification[], interfaceName: string, pathPrefix: string) => { +const generateTSDeclarationFiles = async ( + libPath: string, + specs: Specification[], + interfaceName: string, + pathPrefix: string, +) => { const contextData = getContextData(specs); const contexts = await generateTSDeclarationFilesForContext( @@ -672,8 +878,14 @@ const generateTSDeclarationFiles = async (libPath: string, specs: Specification[ await generateTSIndexDeclarationFile(libPath, contexts, pathPrefix); }; -const generateTSIndexDeclarationFile = async (libPath: string, contexts: Context[], pathPrefix: string) => { - const template = handlebars.compile(loadTemplate(`${pathPrefix}/index.d.ts.hbs`)); +const generateTSIndexDeclarationFile = async ( + libPath: string, + contexts: Context[], + pathPrefix: string, +) => { + const template = handlebars.compile( + loadTemplate(`${pathPrefix}/index.d.ts.hbs`), + ); fs.writeFileSync( `${libPath}/${pathPrefix}/index.d.ts`, await prettyPrint( @@ -687,41 +899,64 @@ const generateTSIndexDeclarationFile = async (libPath: string, contexts: Context ); }; -export const generateFunctionsTSDeclarationFile = async (libPath: string, specs: Specification[]) => { +export const generateFunctionsTSDeclarationFile = async ( + libPath: string, + specs: Specification[], +) => { const assignUnresolvedRefsRecursive = (fn: FunctionSpecification) => { for (const functionArg of fn.arguments) { if (functionArg.type.kind === 'object' && functionArg.type.schema) { - assignUnresolvedRefsToPolySchemaRefObj(functionArg.type.schema, functionArg.type.unresolvedPolySchemaRefs); - } else if (functionArg.type.kind === 'object' && functionArg.type.properties) { + assignUnresolvedRefsToPolySchemaRefObj( + functionArg.type.schema, + functionArg.type.unresolvedPolySchemaRefs, + ); + } else if ( + functionArg.type.kind === 'object' && + functionArg.type.properties + ) { for (const property of functionArg.type.properties) { if (property.type.kind === 'object') { - assignUnresolvedRefsToPolySchemaRefObj(property.type.schema, functionArg.type.unresolvedPolySchemaRefs); + assignUnresolvedRefsToPolySchemaRefObj( + property.type.schema, + functionArg.type.unresolvedPolySchemaRefs, + ); } } - } else if (functionArg.type.kind === 'function' && typeof functionArg.type.spec === 'object') { + } else if ( + functionArg.type.kind === 'function' && + typeof functionArg.type.spec === 'object' + ) { assignUnresolvedRefsRecursive(functionArg.type.spec); } } if (fn.returnType.kind === 'object' && fn.returnType.schema) { - assignUnresolvedRefsToPolySchemaRefObj(fn.returnType.schema, fn.returnType.unresolvedPolySchemaRefs); + assignUnresolvedRefsToPolySchemaRefObj( + fn.returnType.schema, + fn.returnType.unresolvedPolySchemaRefs, + ); } }; await generateTSDeclarationFiles( libPath, - specs.filter(spec => 'function' in spec).map((spec: SpecificationWithFunction) => { - assignUnresolvedRefsRecursive(spec.function); - return spec; - }), + specs + .filter((spec) => 'function' in spec) + .map((spec: SpecificationWithFunction) => { + assignUnresolvedRefsRecursive(spec.function); + return spec; + }), 'Poly', '.', ); }; -export const generateVariablesTSDeclarationFile = async (libPath: string, specs: Specification[]) => +export const generateVariablesTSDeclarationFile = async ( + libPath: string, + specs: Specification[], +) => await generateTSDeclarationFiles( libPath, - specs.filter(spec => 'variable' in spec), + specs.filter((spec) => 'variable' in spec), 'Vari', 'vari', ); diff --git a/src/commands/model/generate.ts b/src/commands/model/generate.ts index 8ea71c6..ccc5fab 100644 --- a/src/commands/model/generate.ts +++ b/src/commands/model/generate.ts @@ -5,8 +5,16 @@ import shell from 'shelljs'; import { escapeRegExp } from 'lodash'; import Axios from 'axios'; -import { ApiFunctionDescriptionGenerationDto, SpecificationInputDto, WebhookHandleDescriptionGenerationDto } from '../../types'; -import { translateSpecification, getApiFunctionDescription, getWebhookHandleDescription } from '../../api'; +import { + ApiFunctionDescriptionGenerationDto, + SpecificationInputDto, + WebhookHandleDescriptionGenerationDto, +} from '../../types'; +import { + translateSpecification, + getApiFunctionDescription, + getWebhookHandleDescription, +} from '../../api'; import { firstLetterToUppercase } from '../../utils'; import path from 'path'; import { default as slugifyString } from 'slugify'; @@ -19,26 +27,34 @@ const readDir = promisify(fs.readdir); const access = promisify(fs.access); const write = promisify(fs.writeFile); -const slugify = (content: string) => slugifyString(content, { - lower: true, - strict: true, -}); +const slugify = (content: string) => + slugifyString(content, { + lower: true, + strict: true, + }); const axiosClient = Axios.create(); -const writeModelFile = async (title: string, specificationInput: SpecificationInputDto, destination?: string, rename: RenameT = []) => { +const writeModelFile = async ( + title: string, + specificationInput: SpecificationInputDto, + destination?: string, + rename: RenameT = [], +) => { title = slugify(title); const adjustLines = (v: string) => { const lines = v.split('\n'); - return lines.map((line, index) => { - if (index === 0) { - return line; - } + return lines + .map((line, index) => { + if (index === 0) { + return line; + } - return ` ${line}`; - }).join('\n'); + return ` ${line}`; + }) + .join('\n'); }; /* @@ -48,13 +64,22 @@ const writeModelFile = async (title: string, specificationInput: SpecificationIn */ let contents = `{ "functions": [ - ${specificationInput.functions.map(f => JSON.stringify(f, null, 2)).map(adjustLines).join(',\n ')} + ${specificationInput.functions + .map((f) => JSON.stringify(f, null, 2)) + .map(adjustLines) + .join(',\n ')} ], "webhooks": [ - ${specificationInput.webhooks.map(w => JSON.stringify(w, null, 2)).map(adjustLines).join(',\n ')} + ${specificationInput.webhooks + .map((w) => JSON.stringify(w, null, 2)) + .map(adjustLines) + .join(',\n ')} ], "schemas": [ - ${specificationInput.schemas.map(s => JSON.stringify(s, null, 2)).map(adjustLines).join(',\n ')} + ${specificationInput.schemas + .map((s) => JSON.stringify(s, null, 2)) + .map(adjustLines) + .join(',\n ')} ] }`; @@ -64,7 +89,10 @@ const writeModelFile = async (title: string, specificationInput: SpecificationIn // ` foo ` becomes ` bar `, // and `{{foo}}` becomes `{{bar}}`, // but ` foobaz ` stays ` foobaz ` - contents = contents.replaceAll(new RegExp(`\\b${prevName}\\b`, 'g'), newName); + contents = contents.replaceAll( + new RegExp(`\\b${prevName}\\b`, 'g'), + newName, + ); } const writeFile = (fileName: string) => { @@ -76,7 +104,9 @@ const writeModelFile = async (title: string, specificationInput: SpecificationIn return path.join('./', destination); } else { const getFilename = (currentCount: number) => { - return currentCount === 0 ? `${title}.json` : `${title}-${currentCount}.json`; + return currentCount === 0 + ? `${title}.json` + : `${title}-${currentCount}.json`; }; let lastCount = 0; @@ -90,7 +120,9 @@ const writeModelFile = async (title: string, specificationInput: SpecificationIn } for (const file of await readDir('.')) { - const matchResult = file.match(new RegExp(`${escapeRegExp(title)}-([0-9])+`)); + const matchResult = file.match( + new RegExp(`${escapeRegExp(title)}-([0-9])+`), + ); if (matchResult) { const [, count] = matchResult; @@ -101,7 +133,9 @@ const writeModelFile = async (title: string, specificationInput: SpecificationIn } } - const fileName = getFilename(lastCount === 0 && !foundSingleName ? 0 : lastCount + 1); + const fileName = getFilename( + lastCount === 0 && !foundSingleName ? 0 : lastCount + 1, + ); await writeFile(fileName); @@ -112,14 +146,17 @@ const writeModelFile = async (title: string, specificationInput: SpecificationIn type BaseResource = { context: string; name: string; -} +}; type BaseAIData = { - traceId?: string - name: string -} + traceId?: string; + name: string; +}; -const processResources = async ({ +const processResources = async < + Resource extends BaseResource, + AIData extends BaseAIData, +>({ resources, disableAi, context, @@ -128,13 +165,13 @@ const processResources = async AIData, - aiDataProcessor: (resource: Resource, aiData: AIData) => void, - getAIDataFn(resource: Resource): Promise, - context?: string, - resourceName: string, + resources: Resource[]; + disableAi: boolean; + defaultAIDataGenerator: (resource: Resource) => AIData; + aiDataProcessor: (resource: Resource, aiData: AIData) => void; + getAIDataFn(resource: Resource): Promise; + context?: string; + resourceName: string; }) => { const chunkSize = 5; @@ -151,12 +188,24 @@ const processResources = async (resolve => resolve(defaultAIDataGenerator(resource)))); + calls.push( + new Promise((resolve) => + resolve(defaultAIDataGenerator(resource)), + ), + ); } else { calls.push(getAIDataFn(resource)); } @@ -166,8 +215,14 @@ const processResources = async { try { - shell.echo('Translating specification into poly api specification input and generating context, names and descriptions for all resources...'); + shell.echo( + 'Translating specification into poly api specification input and generating context, names and descriptions for all resources...', + ); let contents = ''; @@ -288,9 +367,14 @@ export const generateModel = async ( hostUrlAsArgument = 'hostUrl'; } - const specificationInputDto = await translateSpecification(contents, context, hostUrl, hostUrlAsArgument); + const specificationInputDto = await translateSpecification( + contents, + context, + hostUrl, + hostUrlAsArgument, + ); - await processResources({ + await processResources<(typeof specificationInputDto.functions)[number], ApiFunctionDescriptionGenerationDto>({ resources: specificationInputDto.functions, aiDataProcessor(resource, aiData) { resource.name = aiData.name; @@ -320,7 +404,7 @@ export const generateModel = async ( resourceName: 'function', }); - await processResources({ + await processResources<(typeof specificationInputDto.webhooks)[number], WebhookHandleDescriptionGenerationDto>({ resources: specificationInputDto.webhooks, aiDataProcessor(resource, aiData) { resource.name = aiData.name; @@ -348,9 +432,19 @@ export const generateModel = async ( resourceName: 'webhook', }); - const createdFileName = await writeModelFile(specificationInputDto.title, specificationInputDto, destination, rename); - - shell.echo(chalk.green('Poly api specification input created:'), 'Open file', chalk.blueBright(createdFileName), 'to check details.'); + const createdFileName = await writeModelFile( + specificationInputDto.title, + specificationInputDto, + destination, + rename, + ); + + shell.echo( + chalk.green('Poly api specification input created:'), + 'Open file', + chalk.blueBright(createdFileName), + 'to check details.', + ); } catch (error) { if (error.response?.data?.message) { throw new Error(error.response.data.message); diff --git a/src/commands/model/train.ts b/src/commands/model/train.ts index 7de9482..e4666a3 100644 --- a/src/commands/model/train.ts +++ b/src/commands/model/train.ts @@ -7,7 +7,11 @@ import dotenv from 'dotenv'; import { chunk } from 'lodash'; import { SpecificationInputDto } from '../../types'; -import { upsertApiFunction, upsertSchema, upsertWebhookHandle } from '../../api'; +import { + upsertApiFunction, + upsertSchema, + upsertWebhookHandle, +} from '../../api'; import { firstLetterToUppercase } from '../../utils'; const readFile = promisify(fs.readFile); @@ -18,13 +22,13 @@ dotenv.config(); type BaseResource = { name: string; context: string; -} +}; type BaseResult = { id: string; name: string; context: string; -} +}; const generateClientCode = async (polyPath: string) => { try { @@ -47,9 +51,9 @@ const executeTraining = async ({ resourceName, upsertFn, }: { - resources: T[], - resourceName: string, - upsertFn(resource: T): Promise + resources: T[]; + resourceName: string; + upsertFn(resource: T): Promise; }) => { const chunkSize = 5; @@ -64,7 +68,15 @@ const executeTraining = async ({ const lastResourceNumberInChunk = chunkSize * (chunkIterations + 1); - shell.echo(`Training from ${resourceName} number ${(chunkSize * chunkIterations) + 1} to ${resourceName} number ${lastResourceNumberInChunk <= resources.length ? lastResourceNumberInChunk : resources.length} out of ${resources.length}`); + shell.echo( + `Training from ${resourceName} number ${ + chunkSize * chunkIterations + 1 + } to ${resourceName} number ${ + lastResourceNumberInChunk <= resources.length + ? lastResourceNumberInChunk + : resources.length + } out of ${resources.length}`, + ); for (const resource of resourceChunk) { calls.push(upsertFn(resource)); @@ -74,7 +86,10 @@ const executeTraining = async ({ results.push(...(await Promise.allSettled(calls))); } - const failedResources: (typeof resources[number] & { index: number, reason?: string })[] = []; + const failedResources: ((typeof resources)[number] & { + index: number; + reason?: string; + })[] = []; const createdResources: V[] = []; for (let i = 0; i < results.length; i++) { @@ -89,7 +104,9 @@ const executeTraining = async ({ let message = 'Request failure'; if (httpStatusCode) { - message = `${message} with status code ${chalk.redBright(httpStatusCode)}`; + message = `${message} with status code ${chalk.redBright( + httpStatusCode, + )}`; } if (errMessage) { @@ -112,16 +129,35 @@ const executeTraining = async ({ shell.echo('\n'); shell.echo(chalk.green('Success:'), `Trained ${resourceName}s:`); shell.echo('\n'); - shell.echo(createdResources.map(({ id, name, context }, index) => chalk.blueBright(`${index + 1}. ${context ? context + '.' : ''}${name} - ${id}`)).join('\n')); + shell.echo( + createdResources + .map(({ id, name, context }, index) => + chalk.blueBright( + `${index + 1}. ${context ? context + '.' : ''}${name} - ${id}`, + ), + ) + .join('\n'), + ); shell.echo('\n'); } if (failedResources.length) { shell.echo('\n'); - shell.echo(chalk.redBright('Danger:'), `Failed to train ${resourceName}s for:`); + shell.echo( + chalk.redBright('Danger:'), + `Failed to train ${resourceName}s for:`, + ); shell.echo('\n'); for (const failedResource of failedResources) { - shell.echo(`${firstLetterToUppercase(resourceName)} with context`, `"${failedResource.context || ''}" and`, 'name', `"${failedResource.name || ''}"`, 'at index:', chalk.yellow(`${failedResource.index}`), `- Reason: ${failedResource.reason}`); + shell.echo( + `${firstLetterToUppercase(resourceName)} with context`, + `"${failedResource.context || ''}" and`, + 'name', + `"${failedResource.name || ''}"`, + 'at index:', + chalk.yellow(`${failedResource.index}`), + `- Reason: ${failedResource.reason}`, + ); } shell.echo('\n'); } @@ -141,7 +177,9 @@ export const train = async (polyPath: string, path: string) => { } try { - const specificationInput: SpecificationInputDto = JSON.parse(contents) as SpecificationInputDto; + const specificationInput: SpecificationInputDto = JSON.parse( + contents, + ) as SpecificationInputDto; const createdApiFunctionsCount = await executeTraining({ resources: specificationInput.functions, @@ -167,7 +205,11 @@ export const train = async (polyPath: string, path: string) => { }, }); - if (createdApiFunctionsCount > 0 || createdWebhooksCount > 0 || createdSchemasCount > 0) { + if ( + createdApiFunctionsCount > 0 || + createdWebhooksCount > 0 || + createdSchemasCount > 0 + ) { await generateClientCode(polyPath); } } catch (error) { diff --git a/src/commands/model/validate.ts b/src/commands/model/validate.ts index d922aa3..299645e 100644 --- a/src/commands/model/validate.ts +++ b/src/commands/model/validate.ts @@ -14,15 +14,24 @@ class DuplicatedIdentifierError extends Error { } } -const getDuplicatedIdentifier = (apiFunctions: { name: string, context: string }[]): string | null => { +const getDuplicatedIdentifier = ( + apiFunctions: { name: string; context: string }[], +): string | null => { for (let i = 0; i < apiFunctions.length; i++) { const firstApiFunction = apiFunctions[i]; for (let c = 0; c < apiFunctions.length; c++) { const secondApiFunction = apiFunctions[c]; - if (firstApiFunction.name && firstApiFunction.context === secondApiFunction.context && firstApiFunction.name === secondApiFunction.name && c !== i) { - return firstApiFunction.context ? `${firstApiFunction.context}.${firstApiFunction.name}` : firstApiFunction.name; + if ( + firstApiFunction.name && + firstApiFunction.context === secondApiFunction.context && + firstApiFunction.name === secondApiFunction.name && + c !== i + ) { + return firstApiFunction.context + ? `${firstApiFunction.context}.${firstApiFunction.name}` + : firstApiFunction.name; } } } @@ -42,14 +51,23 @@ export const validateModel = async (path: string) => { } try { - const specificationInput: SpecificationInputDto = JSON.parse(contents) as SpecificationInputDto; - - if (!('functions' in specificationInput) && !('webhooks' in specificationInput)) { - throw new Error('Expected specification to contain "webhooks" and/or "functions", but found neither.'); + const specificationInput: SpecificationInputDto = JSON.parse( + contents, + ) as SpecificationInputDto; + + if ( + !('functions' in specificationInput) && + !('webhooks' in specificationInput) + ) { + throw new Error( + 'Expected specification to contain "webhooks" and/or "functions", but found neither.', + ); } if ('functions' in specificationInput) { - const duplicatedIdentifier = getDuplicatedIdentifier(specificationInput.functions); + const duplicatedIdentifier = getDuplicatedIdentifier( + specificationInput.functions, + ); if (duplicatedIdentifier) { throw new DuplicatedIdentifierError(duplicatedIdentifier); @@ -67,7 +85,9 @@ export const validateModel = async (path: string) => { } if ('webhooks' in specificationInput) { - const duplicatedIdentifier = getDuplicatedIdentifier(specificationInput.webhooks); + const duplicatedIdentifier = getDuplicatedIdentifier( + specificationInput.webhooks, + ); if (duplicatedIdentifier) { throw new DuplicatedIdentifierError(duplicatedIdentifier); @@ -87,7 +107,11 @@ export const validateModel = async (path: string) => { shell.echo(chalk.green('Poly specification input is valid.')); } catch (error) { if (error instanceof DuplicatedIdentifierError) { - shell.echo(chalk.red('Error:'), error.message, chalk.red(error.identifier)); + shell.echo( + chalk.red('Error:'), + error.message, + chalk.red(error.identifier), + ); } else if (error.response?.status === 400) { shell.echo(chalk.red('Error:'), error.response.data?.message); } else { diff --git a/src/commands/prepare.ts b/src/commands/prepare.ts index 3d5855c..5226e3b 100644 --- a/src/commands/prepare.ts +++ b/src/commands/prepare.ts @@ -12,28 +12,44 @@ import { writeCacheRevision, writeUpdatedDeployable, } from '../deployables'; -import { getClientFunctionDescription, getServerFunctionDescription } from '../api'; +import { + getClientFunctionDescription, + getServerFunctionDescription, +} from '../api'; -const getFunctionDescription = (type: DeployableTypes, description: string, args: FunctionArgumentDto[], code: string) => +const getFunctionDescription = ( + type: DeployableTypes, + description: string, + args: FunctionArgumentDto[], + code: string, +) => type === 'server-function' ? getServerFunctionDescription({ description, arguments: args, code }) : getClientFunctionDescription({ description, arguments: args, code }); -const fillInMissingFunctionDetails = async (deployable: DeployableRecord, code: string): Promise => { - const isMissingDescriptions = !deployable.types.description || +const fillInMissingFunctionDetails = async ( + deployable: DeployableRecord, + code: string, +): Promise => { + const isMissingDescriptions = + !deployable.types.description || !deployable.types.returns.description || - deployable.types.params.some(p => !p.description); + deployable.types.params.some((p) => !p.description); if (isMissingDescriptions) { try { const aiGenerated = await getFunctionDescription( - deployable.type, deployable.types.description, deployable.types.params.map(p => ({ ...p, key: p.name })), code); + deployable.type, + deployable.types.description, + deployable.types.params.map((p) => ({ ...p, key: p.name })), + code, + ); if (!deployable.types.description && aiGenerated.description) { deployable.types.description = aiGenerated.description; deployable.dirty = true; } - deployable.types.params = deployable.types.params.map(p => { + deployable.types.params = deployable.types.params.map((p) => { if (p.description) return p; - const aiArg = aiGenerated.arguments.find(a => a.name === p.name); + const aiArg = aiGenerated.arguments.find((a) => a.name === p.name); if (!aiArg || !aiArg.description) return p; deployable.dirty = true; return { ...p, description: aiArg.description }; @@ -43,7 +59,10 @@ const fillInMissingFunctionDetails = async (deployable: DeployableRecord, code: return deployable; }; -const fillInMissingDetails = async (deployable: DeployableRecord, code: string): Promise => { +const fillInMissingDetails = async ( + deployable: DeployableRecord, + code: string, +): Promise => { switch (deployable.type) { case 'server-function': case 'client-function': @@ -52,21 +71,48 @@ const fillInMissingDetails = async (deployable: DeployableRecord, code: string): throw new Error(`Unsupported deployable type: '${deployable.type}'`); }; -const getAllDeployables = async (disableDocs: boolean, disableAi: boolean, gitRevision: string): Promise => { +const getAllDeployables = async ( + disableDocs: boolean, + disableAi: boolean, + gitRevision: string, +): Promise => { console.log('Searching for poly deployables.'); const baseUrl = getTSBaseUrl() || '.'; const possibleDeployables = getAllDeployableFiles({ includeDirs: [baseUrl] }); - console.log(`Found ${possibleDeployables.length} possible deployable file${possibleDeployables.length === 1 ? '' : 's'}.`); + console.log( + `Found ${possibleDeployables.length} possible deployable file${ + possibleDeployables.length === 1 ? '' : 's' + }.`, + ); // Iterate through each type to get us all the files separated by deployable type const found = new Map(); for (const possible of possibleDeployables) { try { - const [deployable, code] = await parseDeployable(possible, baseUrl, gitRevision); + const [deployable, code] = await parseDeployable( + possible, + baseUrl, + gitRevision, + ); const fullName = `${deployable.context}.${deployable.name}`; - if (found.has(fullName)) console.error(`Prepared ${deployable.type.replaceAll('-', ' ')} ${fullName}: DUPLICATE`); - else { - found.set(fullName, disableAi || deployable.disableAi || deployable.type === 'webhook' ? deployable : await fillInMissingDetails(deployable, code)); - console.log(`Prepared ${deployable.type.replaceAll('-', ' ')} ${fullName}: ${deployable.dirty && !disableDocs ? 'UPDATED' : 'OK'}`); + if (found.has(fullName)) { + console.error( + `Prepared ${deployable.type.replaceAll( + '-', + ' ', + )} ${fullName}: DUPLICATE`, + ); + } else { + found.set( + fullName, + disableAi || deployable.disableAi || deployable.type === 'webhook' + ? deployable + : await fillInMissingDetails(deployable, code), + ); + console.log( + `Prepared ${deployable.type.replaceAll('-', ' ')} ${fullName}: ${ + deployable.dirty && !disableDocs ? 'UPDATED' : 'OK' + }`, + ); } } catch (err) { console.error(`ERROR parsing ${possible}`); @@ -76,7 +122,11 @@ const getAllDeployables = async (disableDocs: boolean, disableAi: boolean, gitRe return Array.from(found.values()); }; -export const prepareDeployables = async (lazy: boolean, disableDocs: boolean, disableAi: boolean) => { +export const prepareDeployables = async ( + lazy: boolean, + disableDocs: boolean, + disableAi: boolean, +) => { if (lazy && (await isCacheUpToDate())) { console.log('Poly deployments are prepared.'); return; @@ -85,20 +135,36 @@ export const prepareDeployables = async (lazy: boolean, disableDocs: boolean, di await prepareDeployableDirectory(); const gitRevision = getGitRevision(); // Parse deployable files - const parsedDeployables = await getAllDeployables(disableDocs, disableAi, gitRevision); + const parsedDeployables = await getAllDeployables( + disableDocs, + disableAi, + gitRevision, + ); if (!parsedDeployables.length) { - console.warn('No deployable files found. Did you define a `polyConfig` within your deployment?'); + console.warn( + 'No deployable files found. Did you define a `polyConfig` within your deployment?', + ); return process.exit(1); } - const dirtyDeployables = parsedDeployables.filter(d => !!d.dirty); + const dirtyDeployables = parsedDeployables.filter((d) => !!d.dirty); if (dirtyDeployables.length) { // Write back deployables files with updated comments - console.log(`Fixing ${dirtyDeployables.length} deployable file${dirtyDeployables.length === 1 ? '' : 's'}.`); + console.log( + `Fixing ${dirtyDeployables.length} deployable file${ + dirtyDeployables.length === 1 ? '' : 's' + }.`, + ); // NOTE: writeUpdatedDeployable has side effects that update deployable.fileRevision which is in both this list and parsedDeployables - await Promise.all(dirtyDeployables.map(deployable => writeUpdatedDeployable(deployable, disableDocs))); + await Promise.all( + dirtyDeployables.map((deployable) => + writeUpdatedDeployable(deployable, disableDocs), + ), + ); } console.log('Poly deployments are prepared.'); await saveDeployableRecords(parsedDeployables); await writeCacheRevision(gitRevision); - console.log('Cached deployables and generated typedefs into node_modules/.poly/deployables directory.'); + console.log( + 'Cached deployables and generated typedefs into node_modules/.poly/deployables directory.', + ); }; diff --git a/src/commands/setup.ts b/src/commands/setup.ts index f539ed8..5f902c8 100644 --- a/src/commands/setup.ts +++ b/src/commands/setup.ts @@ -16,7 +16,12 @@ import { import { getAuthData, getProjectTemplatesConfig } from '../api'; import { handleAxiosError, validateBaseUrl, URL_REGEX } from '../utils'; -const setup = async (polyPath: string, baseUrl?: string, apiKey?: string, apiVersion = '1') => { +const setup = async ( + polyPath: string, + baseUrl?: string, + apiKey?: string, + apiVersion = '1', +) => { try { loadConfig(polyPath); process.env.POLY_API_KEY = process.env.POLY_API_KEY || apiVersion; @@ -53,13 +58,24 @@ const setup = async (polyPath: string, baseUrl?: string, apiKey?: string, apiVer }); if (process.env.ENVIRONMENT_SETUP_COMPLETE !== 'true') { - const { tenant: { id: tenantId }, environment: { id: environmentId } } = await getAuthData(polyApiBaseUrl, polyApiKey); - const projectTemplatesConfig = await getProjectTemplatesConfig(polyApiBaseUrl, polyApiKey, tenantId, environmentId); + const { + tenant: { id: tenantId }, + environment: { id: environmentId }, + } = await getAuthData(polyApiBaseUrl, polyApiKey); + const projectTemplatesConfig = await getProjectTemplatesConfig( + polyApiBaseUrl, + polyApiKey, + tenantId, + environmentId, + ); const templateChoices = [ { name: 'No (empty project)', value: null }, ...projectTemplatesConfig.templates - .filter(template => template.typescript) - .map(template => ({ name: template.name, value: template.typescript })), + .filter((template) => template.typescript) + .map((template) => ({ + name: template.name, + value: template.typescript, + })), ]; const projectTemplateFileUrl = await rawlist({ @@ -67,7 +83,10 @@ const setup = async (polyPath: string, baseUrl?: string, apiKey?: string, apiVer choices: templateChoices, }); - if (projectTemplateFileUrl && typeof projectTemplateFileUrl === 'string') { + if ( + projectTemplateFileUrl && + typeof projectTemplateFileUrl === 'string' + ) { await initProjectStructure(projectTemplateFileUrl); } } @@ -111,7 +130,10 @@ const initProjectStructure = async (fileUrl: string) => { const extractedDirPath = path.join(process.cwd(), zipBaseName); // Check if single directory with same name as zip file exists - if (fs.existsSync(extractedDirPath) && fs.statSync(extractedDirPath).isDirectory()) { + if ( + fs.existsSync(extractedDirPath) && + fs.statSync(extractedDirPath).isDirectory() + ) { // Move all contents to current directory and remove extracted directory shell.mv(`${extractedDirPath}/*`, process.cwd()); fs.rmdirSync(extractedDirPath); @@ -120,7 +142,11 @@ const initProjectStructure = async (fileUrl: string) => { fs.unlinkSync(filePath); } catch (error) { shell.echo(chalk.red('ERROR')); - shell.echo(chalk.red('Project template cannot be downloaded or extracted. Continuing...')); + shell.echo( + chalk.red( + 'Project template cannot be downloaded or extracted. Continuing...', + ), + ); } }; @@ -170,7 +196,8 @@ const setupEnvironment = async (polyPath: string) => { }, async requestUserPermissionToUpdateTsConfig() { const updateTsConfig = await confirm({ - message: 'tsconfig.json does not have esModuleInterop set to true. Do you want to update it?', + message: + 'tsconfig.json does not have esModuleInterop set to true. Do you want to update it?', default: true, }); @@ -190,7 +217,9 @@ const getPackageJson = () => { try { packageJson = fs.readFileSync(`${process.cwd()}/package.json`); } catch (error) { - throw new Error(`Failed to open package.json file, details: ${error.message}`); + throw new Error( + `Failed to open package.json file, details: ${error.message}`, + ); } try { @@ -198,7 +227,9 @@ const getPackageJson = () => { return contents; } catch (error) { - throw new Error('package.json file contains JSON syntax errors, please fix and try again.'); + throw new Error( + 'package.json file contains JSON syntax errors, please fix and try again.', + ); } }; diff --git a/src/commands/snippet.ts b/src/commands/snippet.ts index 586d83c..7e3e6a9 100644 --- a/src/commands/snippet.ts +++ b/src/commands/snippet.ts @@ -14,7 +14,13 @@ const languageFormatMap = { python: ['py'], }; -export const addSnippet = async (polyPath: string, name: string, path: string, context: string, description: string) => { +export const addSnippet = async ( + polyPath: string, + name: string, + path: string, + context: string, + description: string, +) => { let code = ''; let language = ''; @@ -44,7 +50,10 @@ export const addSnippet = async (polyPath: string, name: string, path: string, c code, language, } as any); - shell.echo(`${chalk.greenBright('Success:')}`, 'Snippet successfully added.'); + shell.echo( + `${chalk.greenBright('Success:')}`, + 'Snippet successfully added.', + ); shell.echo(`Snippet ID: ${response.data.id}`); upsertResourceInSpec(polyPath, { @@ -60,7 +69,9 @@ export const addSnippet = async (polyPath: string, name: string, path: string, c let finalMessage = ''; if (httpStatusCode === 400) { - const messages = Array.isArray(error.response.data.message) ? error.response.data.message : [`Failed with status code ${chalk.redBright(400)}`]; + const messages = Array.isArray(error.response.data.message) + ? error.response.data.message + : [`Failed with status code ${chalk.redBright(400)}`]; finalMessage = messages[0]; } else if (httpStatusCode) { finalMessage = errMessage; diff --git a/src/commands/sync.ts b/src/commands/sync.ts index aa54f5f..bf1a927 100644 --- a/src/commands/sync.ts +++ b/src/commands/sync.ts @@ -30,22 +30,33 @@ const DEPLOY_ORDER: DeployableTypes[] = [ 'webhook', ]; -const removeDeployable = async (deployable: SyncDeployment | Deployment): Promise => { +const removeDeployable = async ( + deployable: SyncDeployment | Deployment, +): Promise => { switch (deployable.type) { case 'server-function': { - const instance = await getServerFunctionByName(deployable.context, deployable.name); + const instance = await getServerFunctionByName( + deployable.context, + deployable.name, + ); if (!instance) return false; await deleteServerFunction(instance.id); return true; } case 'client-function': { - const instance = await getClientFunctionByName(deployable.context, deployable.name); + const instance = await getClientFunctionByName( + deployable.context, + deployable.name, + ); if (!instance) return false; await deleteClientFunction(instance.id); return true; } case 'webhook': { - const webhook = await getWebhookByName(deployable.context, deployable.name); + const webhook = await getWebhookByName( + deployable.context, + deployable.name, + ); if (!webhook) return false; await deleteWebhook(webhook.id); return true; @@ -60,21 +71,43 @@ const syncDeployableAndGetId = async (deployable, code) => { switch (deployable.type) { case 'server-function': return ( - await createOrUpdateServerFunction(deployable.context, deployable.name, deployable.description, code, deployable.typeSchemas, deployable.dependencies, deployable.config) + await createOrUpdateServerFunction( + deployable.context, + deployable.name, + deployable.description, + code, + deployable.typeSchemas, + deployable.dependencies, + deployable.config, + ) ).id; case 'client-function': return ( - await createOrUpdateClientFunction(deployable.context, deployable.name, deployable.description, code, deployable.typeSchemas, deployable.config) + await createOrUpdateClientFunction( + deployable.context, + deployable.name, + deployable.description, + code, + deployable.typeSchemas, + deployable.config, + ) ).id; case 'webhook': return ( - await createOrUpdateWebhook(deployable.context, deployable.name, deployable.description, deployable.config) + await createOrUpdateWebhook( + deployable.context, + deployable.name, + deployable.description, + deployable.config, + ) ).id; } throw new Error(`Unsupported deployable type: '${deployable.type}'`); }; -const syncDeployable = async (deployable: SyncDeployment): Promise => { +const syncDeployable = async ( + deployable: SyncDeployment, +): Promise => { const code = fs.readFileSync(deployable.file, 'utf8'); const id = await syncDeployableAndGetId(deployable, code); return { @@ -90,7 +123,10 @@ const syncDeployable = async (deployable: SyncDeployment): Promise = type GroupedDeployables = Record; -export const syncDeployables = async (dryRun: boolean, instance = process.env.POLY_API_BASE_URL) => { +export const syncDeployables = async ( + dryRun: boolean, + instance = process.env.POLY_API_BASE_URL, +) => { await prepareDeployableDirectory(); const gitRevision = await getCacheDeploymentsRevision(); const allDeployables = await loadDeployableRecords(); @@ -103,13 +139,19 @@ export const syncDeployables = async (dryRun: boolean, instance = process.env.PO // Right now we're doing rudimentary ordering by type // But this does not safely handle cases where one server function may reference another // We should parse the functions bodies for references to other Poly deployables and work them into a DAG - const groupedDeployables = groupBy(allDeployables, 'type') as unknown as GroupedDeployables; + const groupedDeployables = groupBy( + allDeployables, + 'type', + ) as unknown as GroupedDeployables; for (const type of DEPLOY_ORDER) { const deployables = groupedDeployables[type] || []; for (const deployable of deployables) { - const previousDeployment = deployable.deployments.find(i => i.instance === instance); + const previousDeployment = deployable.deployments.find( + (i) => i.instance === instance, + ); const gitRevisionChanged = gitRevision !== deployable.gitRevision; - const fileRevisionChanged = previousDeployment?.fileRevision !== deployable.fileRevision; + const fileRevisionChanged = + previousDeployment?.fileRevision !== deployable.fileRevision; let action = gitRevisionChanged ? 'REMOVED' : !previousDeployment?.id @@ -149,16 +191,32 @@ export const syncDeployables = async (dryRun: boolean, instance = process.env.PO // This deployable no longer exists so let's remove it const found = await removeDeployable(syncDeployment); if (!found) action = 'NOT FOUND'; - const removeIndex = allDeployables.findIndex(d => d.name === deployable.name && d.context === deployable.context && d.file === deployable.file); + const removeIndex = allDeployables.findIndex( + (d) => + d.name === deployable.name && + d.context === deployable.context && + d.file === deployable.file, + ); toRemove.push(...allDeployables.splice(removeIndex, 1)); } } - console.log(`${dryRun ? 'Would sync' : 'Synced'} ${deployable.type.replaceAll('-', ' ')} ${deployable.context}.${deployable.name}: ${dryRun ? 'TO BE ' : ''}${action}`); + console.log( + `${dryRun ? 'Would sync' : 'Synced'} ${deployable.type.replaceAll( + '-', + ' ', + )} ${deployable.context}.${deployable.name}: ${ + dryRun ? 'TO BE ' : '' + }${action}`, + ); } } if (dryRun) return; - await Promise.all(allDeployables.map(deployable => writeUpdatedDeployable(deployable, true))); + await Promise.all( + allDeployables.map((deployable) => + writeUpdatedDeployable(deployable, true), + ), + ); await saveDeployableRecords(allDeployables); if (toRemove.length) await removeDeployableRecords(toRemove); }; diff --git a/src/commands/tenant.ts b/src/commands/tenant.ts index a459079..b9f7f0a 100644 --- a/src/commands/tenant.ts +++ b/src/commands/tenant.ts @@ -1,7 +1,11 @@ import shell from 'shelljs'; import { input, confirm } from '@inquirer/prompts'; import chalk from 'chalk'; -import { createTenantSignUp, resendVerificationCode, verifyTenantSignUp } from '../api'; +import { + createTenantSignUp, + resendVerificationCode, + verifyTenantSignUp, +} from '../api'; import { SignUpDto } from '../types'; import { saveConfig } from '../config'; import { exec as execCommand } from 'child_process'; @@ -10,12 +14,15 @@ import isEmail from 'validator/lib/isEmail'; const exec = promisify(execCommand); -export const create = async (instance: string, loadedTenantSignUp: SignUpDto | null = null) => { +export const create = async ( + instance: string, + loadedTenantSignUp: SignUpDto | null = null, +) => { let tenantSignUp: SignUpDto | null = loadedTenantSignUp; let credentials: { - apiKey: string, - apiBaseUrl: string + apiKey: string; + apiBaseUrl: string; } | null = null; let email = ''; @@ -43,7 +50,7 @@ export const create = async (instance: string, loadedTenantSignUp: SignUpDto | n tenantName = result || null; }; - const signUp = async (data : 'tenant' | '' = '') => { + const signUp = async (data: 'tenant' | '' = '') => { try { if (data === 'tenant') { await requestTenant(); @@ -51,7 +58,8 @@ export const create = async (instance: string, loadedTenantSignUp: SignUpDto | n await requestEmail(); await requestTenant(); const acceptedTos = await confirm({ - message: 'Do you agree with our terms of service expressed here: https://polyapi.io/terms-of-service ?', + message: + 'Do you agree with our terms of service expressed here: https://polyapi.io/terms-of-service ?', }); if (!acceptedTos) { @@ -83,7 +91,7 @@ export const create = async (instance: string, loadedTenantSignUp: SignUpDto | n }; try { - if (!await signUp()) { + if (!(await signUp())) { return; } } catch (err) { @@ -92,13 +100,19 @@ export const create = async (instance: string, loadedTenantSignUp: SignUpDto | n const verifyTenant = async (showDescription = true) => { if (showDescription) { - shell.echo('A verification code has been sent to your email address', chalk.bold(`(${tenantSignUp.email}),`), 'check your email and enter your verification code. \nIf you didn\'t receive your verification code you can enter', chalk.bold('resend'), 'to send it again\n'); + shell.echo( + 'A verification code has been sent to your email address', + chalk.bold(`(${tenantSignUp.email}),`), + "check your email and enter your verification code. \nIf you didn't receive your verification code you can enter", + chalk.bold('resend'), + 'to send it again\n', + ); } const code = await input({ message: 'Enter your verification code:', - transformer: value => value.trim(), - validate: verificationCode => !!verificationCode.length, + transformer: (value) => value.trim(), + validate: (verificationCode) => !!verificationCode.length, }); if (code === 'resend') { @@ -108,7 +122,11 @@ export const create = async (instance: string, loadedTenantSignUp: SignUpDto | n await resendVerificationCode(instance, tenantSignUp.email); } catch (error) { shell.echo(chalk.red('ERROR\n')); - shell.echo('Error sending verification code to', `${chalk.bold(tenantSignUp.email)}.`, '\n'); + shell.echo( + 'Error sending verification code to', + `${chalk.bold(tenantSignUp.email)}.`, + '\n', + ); throw error; } @@ -118,7 +136,11 @@ export const create = async (instance: string, loadedTenantSignUp: SignUpDto | n shell.echo('-n', 'Verifying your code...\n\n'); try { - const response = await verifyTenantSignUp(instance, tenantSignUp.email, code); + const response = await verifyTenantSignUp( + instance, + tenantSignUp.email, + code, + ); shell.echo(chalk.green('Tenant created successfully, details:\n')); shell.echo(chalk.bold('Instance url:'), response.apiBaseUrl, '\n'); @@ -132,7 +154,11 @@ export const create = async (instance: string, loadedTenantSignUp: SignUpDto | n shell.echo(chalk.red('ERROR\n')); if (error.response?.status === 409) { if (error.response?.data?.code === 'INVALID_VERIFICATION_CODE') { - shell.echo('Wrong verification code. If you didn\'t receive your verification code, you can type', chalk.bold('resend'), 'to send a new one.'); + shell.echo( + "Wrong verification code. If you didn't receive your verification code, you can type", + chalk.bold('resend'), + 'to send a new one.', + ); } if (error.response?.data?.code === 'EXPIRED_VERIFICATION_CODE') { @@ -157,7 +183,7 @@ export const create = async (instance: string, loadedTenantSignUp: SignUpDto | n }; try { - if (!await verifyTenant()) { + if (!(await verifyTenant())) { return; } } catch (error) { @@ -165,7 +191,8 @@ export const create = async (instance: string, loadedTenantSignUp: SignUpDto | n } const generate = await confirm({ - message: 'Would you like to generate the poly client library using the new tenant key?', + message: + 'Would you like to generate the poly client library using the new tenant key?', }); if (generate) { diff --git a/src/config.ts b/src/config.ts index 54dc357..b8101d1 100644 --- a/src/config.ts +++ b/src/config.ts @@ -8,7 +8,9 @@ const getPolyConfigDirPath = (polyPath: string) => const getPolyConfigFilePath = (polyPath: string) => `${getPolyConfigDirPath(polyPath)}/.config.env`; -export const loadConfig = (polyPath: string): Record | undefined => { +export const loadConfig = ( + polyPath: string, +): Record | undefined => { const configFilePath = getPolyConfigFilePath(polyPath); if (fs.existsSync(configFilePath)) { const result = dotenv.config({ @@ -21,7 +23,10 @@ export const loadConfig = (polyPath: string): Record | undefined return undefined; }; -export const saveConfig = (polyPath: string, config: Record) => { +export const saveConfig = ( + polyPath: string, + config: Record, +) => { fs.mkdirSync(getPolyConfigDirPath(polyPath), { recursive: true }); fs.writeFileSync( getPolyConfigFilePath(polyPath), @@ -31,7 +36,11 @@ export const saveConfig = (polyPath: string, config: Record) => ); }; -export const addOrUpdateConfig = (polyPath: string, key: string, value: string) => { +export const addOrUpdateConfig = ( + polyPath: string, + key: string, + value: string, +) => { const existingConfig = loadConfig(polyPath) ?? {}; existingConfig[key] = value; diff --git a/src/dependencies.ts b/src/dependencies.ts index 6568b62..6f616b7 100644 --- a/src/dependencies.ts +++ b/src/dependencies.ts @@ -20,8 +20,10 @@ const DEFAULT_TS_CONFIG = { }; export const MESSAGES = { - TS_CONFIG_DO_NOT_EXIST: 'tsconfig.json does not exist in this project. Do you want to create it?', - TS_CONFIG_UPDATE: 'tsconfig.json does not have esModuleInterop set to true in this project. Do you want to update it?', + TS_CONFIG_DO_NOT_EXIST: + 'tsconfig.json does not exist in this project. Do you want to create it?', + TS_CONFIG_UPDATE: + 'tsconfig.json does not have esModuleInterop set to true in this project. Do you want to update it?', }; type TsConfigSetupSteps = { @@ -29,20 +31,28 @@ type TsConfigSetupSteps = { requestUserPermissionToCreateTsConfig(): Promise; requestUserPermissionToUpdateTsConfig(): Promise; saveTsConfig(tsConfig: string): Promise; -} +}; type CheckLibraryVersionSteps = { - requestUserPermissionToUpdateLib(library: string, version: string, minVersion: string): Promise; + requestUserPermissionToUpdateLib( + library: string, + version: string, + minVersion: string, + ): Promise; createOrUpdateLib(library: string, create: boolean): Promise; -} +}; type CheckNodeVersionOpts = { onOldVersion(message: string): any; onMissingNode?(message: string): void; onSuccess?(): void; -} +}; -export const getUpdateLibraryVersionMessage = (version: string, minVersion: string, library: string) => { +export const getUpdateLibraryVersionMessage = ( + version: string, + minVersion: string, + library: string, +) => { return version ? `${library} version is lower than ${minVersion} in this project. Do you want to update it to the latest version?` : `${library} is not installed in this project. Do you want to install it?`; @@ -63,11 +73,14 @@ export const checkTsConfig = async (steps: TsConfigSetupSteps) => { try { tsConfig = parse(currentConfig, undefined, false) as any; } catch (error) { - throw new Error('tsconfig.json has invalid JSON syntax, please fix and try again'); + throw new Error( + 'tsconfig.json has invalid JSON syntax, please fix and try again', + ); } if (!tsConfig.compilerOptions?.esModuleInterop) { - const updateTsConfig = await steps.requestUserPermissionToUpdateTsConfig(); + const updateTsConfig = + await steps.requestUserPermissionToUpdateTsConfig(); if (!updateTsConfig) { return; } @@ -89,7 +102,10 @@ export const checkTsConfig = async (steps: TsConfigSetupSteps) => { } }; -const getSafeVersion = (version: string, defaultVersion: VersionT): VersionT => { +const getSafeVersion = ( + version: string, + defaultVersion: VersionT, +): VersionT => { // npm and yarn are more lax on version specification than the semver library is // We need to be able to handle wildcard versions like 'latest', '*', 'x', '1.x', or '3.0.x' // We also need to handle only partially specified versions like '5' or '5.1' @@ -97,22 +113,31 @@ const getSafeVersion = (version: string, defaultVersion: VersionT): VersionT => if (version === 'latest' || version === '*') { return defaultVersion; } - const [expectedMajor, expectedMinor, expectedPatch] = defaultVersion.split('.'); + const [expectedMajor, expectedMinor, expectedPatch] = + defaultVersion.split('.'); const [major, minor, patch] = version.replace(/[^0-9.x]/g, '').split('.'); - return `${ - major === 'x' ? expectedMajor : major || '0' - }.${ + return `${major === 'x' ? expectedMajor : major || '0'}.${ minor === 'x' ? expectedMinor : minor || '0' - }.${ - patch === 'x' ? expectedPatch : patch || '0' - }`; + }.${patch === 'x' ? expectedPatch : patch || '0'}`; }; -const checkLibraryVersion = async (packageJson: Record, library: string, minVersion: VersionT, steps: CheckLibraryVersionSteps) => { - const version: string = packageJson.devDependencies?.[library] || packageJson.dependencies?.[library] || ''; +const checkLibraryVersion = async ( + packageJson: Record, + library: string, + minVersion: VersionT, + steps: CheckLibraryVersionSteps, +) => { + const version: string = + packageJson.devDependencies?.[library] || + packageJson.dependencies?.[library] || + ''; if (!version || semver.lt(getSafeVersion(version, minVersion), minVersion)) { - const updateVersion = await steps.requestUserPermissionToUpdateLib(library, version, minVersion); + const updateVersion = await steps.requestUserPermissionToUpdateLib( + library, + version, + minVersion, + ); if (updateVersion) { await steps.createOrUpdateLib(library, !version); @@ -120,9 +145,17 @@ const checkLibraryVersion = async (packageJson: Record, library: st } }; -export const checkLibraryVersions = async (packageJson: Record, steps: CheckLibraryVersionSteps) => { +export const checkLibraryVersions = async ( + packageJson: Record, + steps: CheckLibraryVersionSteps, +) => { for (const library of librariesToCheck) { - await checkLibraryVersion(packageJson, library, libraryMinVersionMap[library], steps); + await checkLibraryVersion( + packageJson, + library, + libraryMinVersionMap[library], + steps, + ); } }; @@ -149,7 +182,9 @@ export const checkNodeVersion = (opts: CheckNodeVersionOpts) => { } if (semver.lt(currentVersion, MIN_NODE_VERSION)) { - opts.onOldVersion(`Node.js version is too old. The minimum required version is ${MIN_NODE_VERSION}. Please update Node.js to a newer version.`); + opts.onOldVersion( + `Node.js version is too old. The minimum required version is ${MIN_NODE_VERSION}. Please update Node.js to a newer version.`, + ); } else { opts.onSuccess?.(); } diff --git a/src/deployables.ts b/src/deployables.ts index 7d5d1af..a4b72b5 100644 --- a/src/deployables.ts +++ b/src/deployables.ts @@ -8,10 +8,7 @@ export const CACHE_VERSION_FILE = './node_modules/.poly/deployments_revision'; export const CACHE_DIR = './node_modules/.poly/deployables'; // NOTE: DeployableTypes should be the string used for these types within the Canopy url. -export type DeployableTypes = - | 'server-function' - | 'client-function' - | 'webhook' +export type DeployableTypes = 'server-function' | 'client-function' | 'webhook'; // | "api-function" // | "variable" // | "webhook" @@ -30,7 +27,8 @@ export type DeployableTypeNames = export type SyncFn = (deployable: SyncDeployment) => Promise; export type RemoveFn = (deployable: SyncDeployment) => Promise; // returns true if found and removed -export const DeployableTypeEntries: [DeployableTypeNames, DeployableTypes][] = []; +export const DeployableTypeEntries: [DeployableTypeNames, DeployableTypes][] = + []; DeployableTypeEntries.push(['PolyServerFunction', 'server-function']); DeployableTypeEntries.push(['PolyClientFunction', 'client-function']); @@ -47,7 +45,7 @@ export type ParsedDeployableConfig = { type: DeployableTypes; disableAi?: boolean; config: Record; -} +}; export type Deployment = { // Deployments can be across several instances (or environments) @@ -60,7 +58,7 @@ export type Deployment = { id: string; // uuid of deployed thing deployed: string; // ISO timestamp fileRevision: string; // ex. "a3f9b02" -} +}; export type DeployableRecord = ParsedDeployableConfig & { gitRevision: string; // ex. "343c0e67", output from `git rev-parse --short HEAD` @@ -72,11 +70,11 @@ export type DeployableRecord = ParsedDeployableConfig & { name: string; type: string; description: string; - }> + }>; returns: { type: string; description: string; - } + }; }; typeSchemas?: Record; dependencies?: string[]; @@ -86,7 +84,7 @@ export type DeployableRecord = ParsedDeployableConfig & { docStartIndex?: number; docEndIndex?: number; dirty?: boolean; -} +}; export type SyncDeployment = { context: string; @@ -101,33 +99,45 @@ export type SyncDeployment = { instance: string; // ex. "https://na1.polyapi.io" id?: string; // uuid of deployed thing deployed?: string; // ISO timestamp -} +}; export const prepareDeployableDirectory = async () => { try { await mkdir(CACHE_DIR, { recursive: true }); - } catch { } + } catch {} }; export const loadDeployableRecords = async (): Promise => { // Load in all JSON records found in node_modules/.poly/deployables/ const cachedRecords = (await readdir(CACHE_DIR, { withFileTypes: true })) - .filter(d => d.isFile() && d.name.endsWith('.json')) - .map(d => d.name); + .filter((d) => d.isFile() && d.name.endsWith('.json')) + .map((d) => d.name); - return Promise.all(cachedRecords.map(name => - readJsonFile(`${CACHE_DIR}/${name}`)), + return Promise.all( + cachedRecords.map((name) => + readJsonFile(`${CACHE_DIR}/${name}`), + ), ); }; export const saveDeployableRecords = async (records: DeployableRecord[]) => { - await Promise.all(records.map(record => - writeJsonFile(`${CACHE_DIR}/${record.context}.${record.name}.json`, record), - )); + await Promise.all( + records.map((record) => + writeJsonFile( + `${CACHE_DIR}/${record.context}.${record.name}.json`, + record, + ), + ), + ); }; export const removeDeployableRecords = async (records: DeployableRecord[]) => { - shell.rm('-f', ...records.map(record => `${CACHE_DIR}/${record.context}.${record.name}.json`)); + shell.rm( + '-f', + ...records.map( + (record) => `${CACHE_DIR}/${record.context}.${record.name}.json`, + ), + ); }; const readJsonFile = async (path): Promise => { @@ -135,9 +145,15 @@ const readJsonFile = async (path): Promise => { return JSON.parse(file); }; -const writeJsonFile = async (path: string, contents: T): Promise => { +const writeJsonFile = async ( + path: string, + contents: T, +): Promise => { await open(path, 'w'); - return writeFile(path, JSON.stringify(contents, undefined, 2), { encoding: 'utf8', flag: 'w' }); + return writeFile(path, JSON.stringify(contents, undefined, 2), { + encoding: 'utf8', + flag: 'w', + }); }; type PolyDeployConfig = { @@ -145,7 +161,7 @@ type PolyDeployConfig = { includeDirs: string[]; includeFilesOrExtensions: string[]; excludeDirs: string[]; -} +}; export const getAllDeployableFilesWindows = ({ typeNames, @@ -154,13 +170,21 @@ export const getAllDeployableFilesWindows = ({ excludeDirs, }: PolyDeployConfig): string[] => { // To get the equivalent of grep in Windows we use a combination of `dir` and `findstr` - const includePattern = includeFilesOrExtensions.length > 0 ? includeFilesOrExtensions.map(f => f.includes('.') ? f : `*.${f}`).join(' ') : '*'; + const includePattern = + includeFilesOrExtensions.length > 0 + ? includeFilesOrExtensions + .map((f) => (f.includes('.') ? f : `*.${f}`)) + .join(' ') + : '*'; const excludePattern = excludeDirs.length > 0 ? excludeDirs.join('|') : ''; - const pattern = typeNames.length > 0 - ? typeNames.map((name) => `polyConfig: ${name}`).join('|') - : 'polyConfig'; + const pattern = + typeNames.length > 0 + ? typeNames.map((name) => `polyConfig: ${name}`).join('|') + : 'polyConfig'; - const excludeCommand = excludePattern ? ` | findstr /V /I "${excludePattern}"` : ''; + const excludeCommand = excludePattern + ? ` | findstr /V /I "${excludePattern}"` + : ''; const searchCommand = ` | findstr /M /I /F:/ /C:"${pattern}"`; let result: string[] = []; @@ -170,7 +194,7 @@ export const getAllDeployableFilesWindows = ({ try { const output = shell.exec(fullCommand).toString('utf8'); result = result.concat(output.split(/\r?\n/).filter(Boolean)); - } catch { } + } catch {} } return result; }; @@ -183,27 +207,35 @@ export const getAllDeployableFilesLinux = ({ }: PolyDeployConfig): string[] => { // In Linux we can just use `grep` to find possible poly deployables const include = includeFilesOrExtensions.length - ? includeFilesOrExtensions.map((f) => { - return `--include=${f.includes('.') ? f : `*.${f}`}`; - }).join(' ') + ? includeFilesOrExtensions + .map((f) => { + return `--include=${f.includes('.') ? f : `*.${f}`}`; + }) + .join(' ') : ''; - const excludeDir = excludeDirs.length ? excludeDirs.map(dir => `--exclude-dir=${dir}`).join(' ') : ''; - - const searchPath = includeDirs.length - ? includeDirs.join(' ') - : '.'; - const patterns = typeNames.length > 0 - ? typeNames.map((name) => `-e 'polyConfig: ${name}'`).join(' ') - : '-e \'polyConfig\''; + const excludeDir = excludeDirs.length + ? excludeDirs.map((dir) => `--exclude-dir=${dir}`).join(' ') + : ''; + + const searchPath = includeDirs.length ? includeDirs.join(' ') : '.'; + const patterns = + typeNames.length > 0 + ? typeNames.map((name) => `-e 'polyConfig: ${name}'`).join(' ') + : "-e 'polyConfig'"; const grepCommand = `grep ${include} ${excludeDir} -Rl ${patterns} ${searchPath}`; const output: string = shell.exec(grepCommand).toString('utf8'); return output.split('\n').filter(Boolean) as string[]; }; -export const getAllDeployableFiles = (config: Partial = {}): string[] => { - config.typeNames = config.typeNames = DeployableTypeEntries.map(p => p[0]); +export const getAllDeployableFiles = ( + config: Partial = {}, +): string[] => { + config.typeNames = config.typeNames = DeployableTypeEntries.map((p) => p[0]); config.includeDirs = config.includeDirs = ['.']; - config.includeFilesOrExtensions = config.includeFilesOrExtensions = ['ts', 'js']; + config.includeFilesOrExtensions = config.includeFilesOrExtensions = [ + 'ts', + 'js', + ]; config.excludeDirs = config.excludeDirs = [ 'node_modules', 'dist', @@ -235,12 +267,17 @@ export const getDeployableFileRevision = (fileContents: string): string => export const getGitRevision = (branchOrTag = 'HEAD'): string => { try { - const result = shell.exec(`git rev-parse --short ${branchOrTag}`).toString('utf8').trim(); + const result = shell + .exec(`git rev-parse --short ${branchOrTag}`) + .toString('utf8') + .trim(); if (!result) throw new Error('Failed to get git revision.'); return result; } catch (err) { console.warn('Failed to get git revision. Falling back to random hash.'); - return Array.from({ length: 8 }, () => Math.floor(Math.random() * 16).toString(16)).join(''); + return Array.from({ length: 8 }, () => + Math.floor(Math.random() * 16).toString(16), + ).join(''); } }; @@ -252,7 +289,9 @@ export const getCacheDeploymentsRevision = (): Promise => { }); }; -export const writeCacheRevision = async (gitRevision: string = getGitRevision()) => { +export const writeCacheRevision = async ( + gitRevision: string = getGitRevision(), +) => { await writeFile(CACHE_VERSION_FILE, gitRevision, { flag: 'w', encoding: 'utf8', @@ -271,48 +310,73 @@ export const writeDeployComments = (deployments: Deployment[]): string => { : 'canopy/polyui/collections'; return deployments - .map(d => - `// Poly deployed @ ${d.deployed} - ${d.context}.${d.name} - ${d.instance.endsWith(':8000') ? d.instance.replace(':8000', ':3000') : d.instance}/${canopyPath}/${d.type}s/${d.id} - ${d.fileRevision}`, - ).join('\n'); + .map( + (d) => + `// Poly deployed @ ${d.deployed} - ${d.context}.${d.name} - ${ + d.instance.endsWith(':8000') + ? d.instance.replace(':8000', ':3000') + : d.instance + }/${canopyPath}/${d.type}s/${d.id} - ${d.fileRevision}`, + ) + .join('\n'); }; const printJSDocFunctionComment = ({ description, params, returns }) => { return `/**\n${[ ...description.split('\n').filter(Boolean), - ...params.map(p => `@param {${p.type}} ${p.name}${p.description ? ' - ' : ''}${p.description}`), + ...params.map( + (p) => + `@param {${p.type}} ${p.name}${p.description ? ' - ' : ''}${ + p.description + }`, + ), `@returns {${returns.type}} ${returns.description}`, - ].map(l => ` * ${l}`).join('\n')}\n */\n`; + ] + .map((l) => ` * ${l}`) + .join('\n')}\n */\n`; }; -const updateDeploymentComments = (fileContent: string, deployable: DeployableRecord): string => { +const updateDeploymentComments = ( + fileContent: string, + deployable: DeployableRecord, +): string => { while (deployable.deploymentCommentRanges.length > 0) { const range = deployable.deploymentCommentRanges.pop(); - fileContent = `${fileContent.substring(0, range[0])}${fileContent.substring(range[1])}`; + fileContent = `${fileContent.substring(0, range[0])}${fileContent.substring( + range[1], + )}`; } if (deployable.deployments.length) { const deploymentComments = writeDeployComments(deployable.deployments); // +1 because of the newline character we insert afterwards deployable.deploymentCommentRanges.push([0, deploymentComments.length + 1]); // Then add deploy comments to the top - fileContent = `${deploymentComments - }\n${fileContent - }`; + fileContent = `${deploymentComments}\n${fileContent}`; } return fileContent; }; -const updateDeployableFunctionComments = (fileContent: string, deployable: DeployableRecord, disableDocs = false): string => { +const updateDeployableFunctionComments = ( + fileContent: string, + deployable: DeployableRecord, + disableDocs = false, +): string => { if (!disableDocs) { // First write/overwrite the JSDoc comment - fileContent = `${fileContent.substring(0, deployable.docStartIndex) - }${printJSDocFunctionComment(deployable.types) - }${fileContent.substring(deployable.docEndIndex) - }`; + fileContent = `${fileContent.substring( + 0, + deployable.docStartIndex, + )}${printJSDocFunctionComment(deployable.types)}${fileContent.substring( + deployable.docEndIndex, + )}`; } return fileContent; }; -export const writeUpdatedDeployable = async (deployable: DeployableRecord, disableDocs = false): Promise => { +export const writeUpdatedDeployable = async ( + deployable: DeployableRecord, + disableDocs = false, +): Promise => { let fileContents = await readFile(deployable.file, { flag: 'r', encoding: 'utf8', @@ -320,7 +384,11 @@ export const writeUpdatedDeployable = async (deployable: DeployableRecord, disab switch (deployable.type) { case 'client-function': case 'server-function': { - fileContents = updateDeployableFunctionComments(fileContents, deployable, disableDocs); + fileContents = updateDeployableFunctionComments( + fileContents, + deployable, + disableDocs, + ); break; } case 'webhook': @@ -329,7 +397,7 @@ export const writeUpdatedDeployable = async (deployable: DeployableRecord, disab throw new Error(`Unsupported deployable type: '${deployable.type}'`); } // Then write/overwrite any deployment comments (must happen last to prevent the JSDoc comment ranges from breaking) - if (deployable.type !== 'webhook') fileContents = updateDeploymentComments(fileContents, deployable); + if (deployable.type !== 'webhook') { fileContents = updateDeploymentComments(fileContents, deployable); } await writeFile(deployable.file, fileContents, { flag: 'w', encoding: 'utf8', diff --git a/src/transpiler.ts b/src/transpiler.ts index a3c449b..96f522e 100644 --- a/src/transpiler.ts +++ b/src/transpiler.ts @@ -66,7 +66,8 @@ export const getTSConfig = () => { return {}; }; -export const getTSBaseUrl = (config = getTSConfig()) => config.compilerOptions?.baseUrl || undefined; +export const getTSBaseUrl = (config = getTSConfig()) => + config.compilerOptions?.baseUrl || undefined; interface SchemaDef { schema: Record; @@ -75,11 +76,21 @@ interface SchemaDef { const loadTsSourceFile = (filePath: string): ts.SourceFile => { const fileContent = fs.readFileSync(filePath, 'utf8'); - const sourceFile = ts.createSourceFile(filePath, fileContent, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS); + const sourceFile = ts.createSourceFile( + filePath, + fileContent, + ts.ScriptTarget.Latest, + true, + ts.ScriptKind.TS, + ); return sourceFile; }; -export const getDependencies = (code: string, fileName: string, baseUrl: string | undefined) => { +export const getDependencies = ( + code: string, + fileName: string, + baseUrl: string | undefined, +) => { const importedLibraries = new Set(); const compilerOptions = { @@ -98,8 +109,14 @@ export const getDependencies = (code: string, fileName: string, baseUrl: string return (sourceFile) => { const visitor = (node: ts.Node): ts.Node => { if (ts.isImportDeclaration(node)) { - const moduleName = (node.moduleSpecifier as ts.StringLiteral).text; - const resolvedModule = ts.resolveModuleName(moduleName, fileName, compilerOptions, compilerHost); + const moduleName = (node.moduleSpecifier as ts.StringLiteral) + .text; + const resolvedModule = ts.resolveModuleName( + moduleName, + fileName, + compilerOptions, + compilerHost, + ); if (resolvedModule.resolvedModule) { if (resolvedModule.resolvedModule.isExternalLibraryImport) { @@ -121,23 +138,33 @@ export const getDependencies = (code: string, fileName: string, baseUrl: string }, }); - let dependencies = Array.from(importedLibraries) - .filter(library => !EXCLUDED_REQUIREMENTS.includes(library)); + let dependencies = Array.from(importedLibraries).filter( + (library) => !EXCLUDED_REQUIREMENTS.includes(library), + ); if (dependencies.length) { - let packageJson: any = fs.readFileSync(path.join(process.cwd(), 'package.json'), 'utf-8'); + let packageJson: any = fs.readFileSync( + path.join(process.cwd(), 'package.json'), + 'utf-8', + ); try { packageJson = JSON.parse(packageJson); } catch (error) { - shell.echo(chalk.yellow('\nWarning:'), 'Failed to parse package.json file in order to read dependencies, there could be issues with some dependencies at the time of deploying the server function.'); + shell.echo( + chalk.yellow('\nWarning:'), + 'Failed to parse package.json file in order to read dependencies, there could be issues with some dependencies at the time of deploying the server function.', + ); } const packageJsonDependencies = packageJson.dependencies || {}; const packageJsonDevDependencies = packageJson.devDependencies || {}; for (const dependency of dependencies) { - if (packageJsonDependencies[dependency] || packageJsonDevDependencies[dependency]) { + if ( + packageJsonDependencies[dependency] || + packageJsonDevDependencies[dependency] + ) { continue; } @@ -148,8 +175,11 @@ export const getDependencies = (code: string, fileName: string, baseUrl: string const newDependencyPath = dependencyParts.join('/'); - if (packageJsonDependencies[newDependencyPath] || packageJsonDevDependencies[newDependencyPath]) { - dependencies = dependencies.map(currentDependency => { + if ( + packageJsonDependencies[newDependencyPath] || + packageJsonDevDependencies[newDependencyPath] + ) { + dependencies = dependencies.map((currentDependency) => { if (currentDependency === dependency) { return dependencyParts.join('/'); } @@ -165,17 +195,18 @@ export const getDependencies = (code: string, fileName: string, baseUrl: string return dependencies; }; -export const generateTypeSchemas = (fileName: string, baseUrl: string | undefined, ignoredTypeNames?: string[]): { [typeName: string]: any } => { +export const generateTypeSchemas = ( + fileName: string, + baseUrl: string | undefined, + ignoredTypeNames?: string[], +): { [typeName: string]: any } => { const compilerOptions: ts.CompilerOptions = { allowJs: true, lib: ['es2015'], baseUrl, }; const sourceFile = loadTsSourceFile(fileName); - const program = ts.createProgram( - [fileName], - compilerOptions, - ); + const program = ts.createProgram([fileName], compilerOptions); const schemaDefs: { [typeName: string]: SchemaDef } = {}; const settings: TJS.PartialArgs = { required: true, @@ -192,14 +223,21 @@ export const generateTypeSchemas = (fileName: string, baseUrl: string | undefine * @param typeName * @param symbolRefs */ - const consolidateGeneratorSymbolType = (typeName: string, symbolRefs: SymbolRef[]) => { + const consolidateGeneratorSymbolType = ( + typeName: string, + symbolRefs: SymbolRef[], + ) => { const tryConsolidationByFile = (fileName: string) => { - const symbolRef = symbolRefs.find(symbolRef => { - return symbolRef.symbol.declarations.some(declaration => declaration.getSourceFile().fileName.includes(fileName)); + const symbolRef = symbolRefs.find((symbolRef) => { + return symbolRef.symbol.declarations.some((declaration) => + declaration.getSourceFile().fileName.includes(fileName), + ); }); if (symbolRef) { - const declaredType = program.getTypeChecker().getDeclaredTypeOfSymbol(symbolRef.symbol); + const declaredType = program + .getTypeChecker() + .getDeclaredTypeOfSymbol(symbolRef.symbol); if (declaredType) { // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore hack to replace the symbol with the preferred one @@ -224,7 +262,10 @@ export const generateTypeSchemas = (fileName: string, baseUrl: string | undefine while (parent) { if (parent.kind === ts.SyntaxKind.Block) { insideBlock = true; - } else if (parent.kind === ts.SyntaxKind.FunctionDeclaration && insideBlock) { + } else if ( + parent.kind === ts.SyntaxKind.FunctionDeclaration && + insideBlock + ) { return true; } parent = parent.parent; @@ -243,7 +284,10 @@ export const generateTypeSchemas = (fileName: string, baseUrl: string | undefine const tempSource = `type ${combinedTypeName} = ${typeName};`; const tempDir = os.tmpdir(); - const tempFilePath = path.join(tempDir, `${crypto.randomBytes(16).toString('hex')}.ts`); + const tempFilePath = path.join( + tempDir, + `${crypto.randomBytes(16).toString('hex')}.ts`, + ); fs.writeFileSync(tempFilePath, tempSource); try { @@ -252,9 +296,17 @@ export const generateTypeSchemas = (fileName: string, baseUrl: string | undefine compilerOptions, ); - let schema = TJS.generateSchema(tempCombinedTypeProgram, combinedTypeName, settings, undefined, TJS.buildGenerator(tempCombinedTypeProgram, settings)); + let schema = TJS.generateSchema( + tempCombinedTypeProgram, + combinedTypeName, + settings, + undefined, + TJS.buildGenerator(tempCombinedTypeProgram, settings), + ); if (schema) { - const hasVoidType = node.types.some(type => type.getText() === 'void'); + const hasVoidType = node.types.some( + (type) => type.getText() === 'void', + ); if (hasVoidType && ts.isUnionTypeNode(node)) { // Check if the union contains 'void' type and if so, add nullable type to the schema if (schema.anyOf) { @@ -262,10 +314,7 @@ export const generateTypeSchemas = (fileName: string, baseUrl: string | undefine } else { schema = { $schema: schema.$schema, - anyOf: [ - { ...schema, $schema: undefined }, - { type: 'null' }, - ], + anyOf: [{ ...schema, $schema: undefined }, { type: 'null' }], }; } } @@ -296,7 +345,8 @@ export const generateTypeSchemas = (fileName: string, baseUrl: string | undefine consolidateGeneratorSymbolType(typeName, symbolRefs); - const typeParameterVariations = schemaDefs[typeName]?.typeParameterVariations || []; + const typeParameterVariations = + schemaDefs[typeName]?.typeParameterVariations || []; if (isGenericType) { const symbolRef = symbolRefs[0]; @@ -304,13 +354,25 @@ export const generateTypeSchemas = (fileName: string, baseUrl: string | undefine if (typeParameters.length === 0 && symbolRef) { // read type parameters from declaration - symbolRef.symbol.declarations.forEach(declaration => { - if (ts.isTypeAliasDeclaration(declaration) || ts.isInterfaceDeclaration(declaration) || ts.isClassDeclaration(declaration)) { - if (declaration.parent && ts.isSourceFile(declaration.parent) && declaration.parent.hasNoDefaultLib) { + symbolRef.symbol.declarations.forEach((declaration) => { + if ( + ts.isTypeAliasDeclaration(declaration) || + ts.isInterfaceDeclaration(declaration) || + ts.isClassDeclaration(declaration) + ) { + if ( + declaration.parent && + ts.isSourceFile(declaration.parent) && + declaration.parent.hasNoDefaultLib + ) { // skipping, this is a default lib return; } - typeParameters.push(...declaration.typeParameters?.map(typeParameter => typeParameter.name.text) || []); + typeParameters.push( + ...(declaration.typeParameters?.map( + (typeParameter) => typeParameter.name.text, + ) || []), + ); } }); } @@ -329,7 +391,9 @@ export const generateTypeSchemas = (fileName: string, baseUrl: string | undefine } } - const schema = schemaDefs[typeName]?.schema || TJS.generateSchema(program, typeName, settings, undefined, generator); + const schema = + schemaDefs[typeName]?.schema || + TJS.generateSchema(program, typeName, settings, undefined, generator); if (schema) { schemaDefs[typeName] = { schema, @@ -348,50 +412,52 @@ export const generateTypeSchemas = (fileName: string, baseUrl: string | undefine return extractSchemas(schemaDefs); }; -const enhanceWithParameterTypeSchemas = (schemaDefs: Record) => { - Object.keys(schemaDefs) - .forEach(typeName => { - const schemaDef = schemaDefs[typeName]; - const typeVariations = schemaDef.typeParameterVariations; +const enhanceWithParameterTypeSchemas = ( + schemaDefs: Record, +) => { + Object.keys(schemaDefs).forEach((typeName) => { + const schemaDef = schemaDefs[typeName]; + const typeVariations = schemaDef.typeParameterVariations; - if (!typeVariations.length) { + if (!typeVariations.length) { + return; + } + typeVariations.forEach((typeVariation) => { + const typeParameters = Object.keys(typeVariation); // e.g. + if (!typeParameters.length) { return; } - typeVariations.forEach(typeVariation => { - const typeParameters = Object.keys(typeVariation); // e.g. - if (!typeParameters.length) { - return; - } - const parameterTypes = `${Object.values(typeVariation).join(', ')}`; - const updatedDefinitions = { - ...schemaDef.schema.definitions, - ...typeParameters.reduce((acc, typeParameter) => { - const typeParameterSchemaDef = schemaDefs[typeVariation[typeParameter]]; - - return ({ - ...acc, - ...typeParameterSchemaDef?.schema.definitions, - [typeParameter]: { - ...typeParameterSchemaDef?.schema, - $schema: undefined, - definitions: undefined, - }, - }); - }, {}), - }; + const parameterTypes = `${Object.values(typeVariation).join(', ')}`; + const updatedDefinitions = { + ...schemaDef.schema.definitions, + ...typeParameters.reduce((acc, typeParameter) => { + const typeParameterSchemaDef = + schemaDefs[typeVariation[typeParameter]]; + + return { + ...acc, + ...typeParameterSchemaDef?.schema.definitions, + [typeParameter]: { + ...typeParameterSchemaDef?.schema, + $schema: undefined, + definitions: undefined, + }, + }; + }, {}), + }; - schemaDefs[`${typeName}<${parameterTypes}>`] = { - schema: { - ...schemaDef.schema, - definitions: updatedDefinitions, - }, - }; - }); + schemaDefs[`${typeName}<${parameterTypes}>`] = { + schema: { + ...schemaDef.schema, + definitions: updatedDefinitions, + }, + }; }); + }); }; -const extractSchemas = (schemaDefs: Record) => Object.keys(schemaDefs) - .reduce((acc, typeName) => { +const extractSchemas = (schemaDefs: Record) => + Object.keys(schemaDefs).reduce((acc, typeName) => { return { ...acc, [typeName]: schemaDefs[typeName].schema, @@ -400,7 +466,9 @@ const extractSchemas = (schemaDefs: Record) => Object.keys(sc export const parseDeployComment = (comment: string): Deployment => { // Poly deployed @ 2024-08-29T22:46:46.791Z - test.weeklyReport - https://develop-k8s.polyapi.io/canopy/polyui/collections/server-functions/f0630f95-eac8-4c7d-9d23-639d39034bb6 - e3b0c44 - const match = comment.match(/^\s*(?:\/\/\s*)*Poly deployed @ (\S+) - (\S+)\.([^.]+) - (https?:\/\/[^/]+)\/\S+\/(\S+)s\/(\S+) - (\S+)$/); + const match = comment.match( + /^\s*(?:\/\/\s*)*Poly deployed @ (\S+) - (\S+)\.([^.]+) - (https?:\/\/[^/]+)\/\S+\/(\S+)s\/(\S+) - (\S+)$/, + ); if (!match) return null; const [, deployed, context, name, instance, type, id, fileRevision] = match; return { @@ -411,14 +479,18 @@ export const parseDeployComment = (comment: string): Deployment => { deployed, fileRevision, // Local development puts canopy on a different port than the poly-server - instance: instance.endsWith('localhost:3000') ? instance.replace(':3000', ':8000') : instance, + instance: instance.endsWith('localhost:3000') + ? instance.replace(':3000', ':8000') + : instance, }; }; type Ranges = Array<[start: number, end: number]>; // Function to extract leading comments from the source file -const getDeployComments = (sourceFile: ts.SourceFile): [Deployment[], Ranges] => { +const getDeployComments = ( + sourceFile: ts.SourceFile, +): [Deployment[], Ranges] => { const text = sourceFile.getFullText(); const matches: Deployment[] = []; const ranges = [] as Ranges; @@ -429,7 +501,10 @@ const getDeployComments = (sourceFile: ts.SourceFile): [Deployment[], Ranges] => const match = parseDeployComment(comment.trim()); if (match) { matches.push(match); - ranges.push([range.pos, range.end + (range.hasTrailingNewLine ? 1 : 0)]); + ranges.push([ + range.pos, + range.end + (range.hasTrailingNewLine ? 1 : 0), + ]); } } } @@ -482,14 +557,17 @@ const parseJSDoc = (node: ts.FunctionDeclaration): any => { }, }; const firstJsDoc = jsDoc[0]; - jsDocTags.description = firstJsDoc.comment ? ts.getTextOfJSDocComment(firstJsDoc.comment) : ''; - firstJsDoc.tags?.forEach(tag => { + jsDocTags.description = firstJsDoc.comment + ? ts.getTextOfJSDocComment(firstJsDoc.comment) + : ''; + firstJsDoc.tags?.forEach((tag) => { const tagName = tag.tagName.text; const tagComment = ts.getTextOfJSDocComment(tag.comment) || ''; if (tagName === 'param' && ts.isJSDocParameterTag(tag)) { const paramDetails = tagComment.split(/[\s-]+/); const paramName = tag.name.getText(); - const paramType = tag.typeExpression?.getText().replace(/^{|}$/g, '') || ''; + const paramType = + tag.typeExpression?.getText().replace(/^{|}$/g, '') || ''; const paramDescription = paramDetails.join(' ').trim(); jsDocTags.params.push({ @@ -511,11 +589,18 @@ const parseJSDoc = (node: ts.FunctionDeclaration): any => { return jsDocTags; }; -const parseTSTypes = (node: ts.FunctionDeclaration, sourceFile: ts.SourceFile): any => { - const params = node.parameters.map(param => { +const parseTSTypes = ( + node: ts.FunctionDeclaration, + sourceFile: ts.SourceFile, +): any => { + const params = node.parameters.map((param) => { const name = param.name.getText(sourceFile); const type = param.type?.getText(sourceFile); - if (!type) throw new Error(`Missing type for function argument '${name}' in file '${sourceFile.fileName}'.`); + if (!type) { + throw new Error( + `Missing type for function argument '${name}' in file '${sourceFile.fileName}'.`, + ); + } return { name, type, @@ -524,7 +609,11 @@ const parseTSTypes = (node: ts.FunctionDeclaration, sourceFile: ts.SourceFile): }); const type = node.type?.getText(sourceFile); - if (!type) throw new Error(`Missing return type for function in file '${sourceFile.fileName}'. Use 'void' if no return type.`); + if (!type) { + throw new Error( + `Missing return type for function in file '${sourceFile.fileName}'. Use 'void' if no return type.`, + ); + } const returns = { type, description: '', @@ -537,16 +626,28 @@ const parseTSTypes = (node: ts.FunctionDeclaration, sourceFile: ts.SourceFile): }; // Function to extract function details including JSDoc, arguments, and return type -const getFunctionDetails = (sourceFile: ts.SourceFile, functionName: string) => { - let functionDetails: null | Pick = null; +const getFunctionDetails = ( + sourceFile: ts.SourceFile, + functionName: string, +) => { + let functionDetails: null | Pick< + DeployableRecord, + 'types' | 'docStartIndex' | 'docEndIndex' | 'dirty' + > = null; let dirty = false; // Dirty means that something needs fixed in the file const visit = (node: ts.Node) => { - if (ts.isFunctionDeclaration(node) && node.name?.getText(sourceFile) === functionName) { + if ( + ts.isFunctionDeclaration(node) && + node.name?.getText(sourceFile) === functionName + ) { const jsDoc = parseJSDoc(node); const types = parseTSTypes(node, sourceFile); if ( jsDoc && - types.params.every((p, i) => p.type === jsDoc.params[i].type && p.name === jsDoc.params[i].name) && + types.params.every( + (p, i) => + p.type === jsDoc.params[i].type && p.name === jsDoc.params[i].name, + ) && types.returns.type === jsDoc.returns.type ) { // Try to preserve JSDoc descriptions if things haven't changed @@ -555,7 +656,10 @@ const getFunctionDetails = (sourceFile: ts.SourceFile, functionName: string) => }); types.returns.description = jsDoc.returns.description; types.description = jsDoc.description; - dirty = types.params.some((p, i) => p.type !== jsDoc.params[i].type || p.name !== jsDoc.params[i].name); + dirty = types.params.some( + (p, i) => + p.type !== jsDoc.params[i].type || p.name !== jsDoc.params[i].name, + ); } else { dirty = true; } @@ -575,15 +679,33 @@ const getFunctionDetails = (sourceFile: ts.SourceFile, functionName: string) => }; visit(sourceFile); - if (!functionDetails) throw new Error(`Failed to find a function named '${functionName}' within file '${sourceFile.fileName}'. Verify that your polyConfig name matches a valid function declared within the same file.`); + if (!functionDetails) { + throw new Error( + `Failed to find a function named '${functionName}' within file '${sourceFile.fileName}'. Verify that your polyConfig name matches a valid function declared within the same file.`, + ); + } return functionDetails; }; -const parseDeployableFunction = (sourceFile: ts.SourceFile, polyConfig: ParsedDeployableConfig, baseUrl: string, fileRevision: string, gitRevision: string): DeployableRecord => { +const parseDeployableFunction = ( + sourceFile: ts.SourceFile, + polyConfig: ParsedDeployableConfig, + baseUrl: string, + fileRevision: string, + gitRevision: string, +): DeployableRecord => { const [deployments, deploymentCommentRanges] = getDeployComments(sourceFile); const functionDetails = getFunctionDetails(sourceFile, polyConfig.name); - const dependencies = getDependencies(sourceFile.getFullText(), sourceFile.fileName, baseUrl); - const typeSchemas = generateTypeSchemas(sourceFile.fileName, baseUrl, DeployableTypeEntries.map(d => d[0])); + const dependencies = getDependencies( + sourceFile.getFullText(), + sourceFile.fileName, + baseUrl, + ); + const typeSchemas = generateTypeSchemas( + sourceFile.fileName, + baseUrl, + DeployableTypeEntries.map((d) => d[0]), + ); return { ...polyConfig, ...functionDetails, @@ -597,7 +719,13 @@ const parseDeployableFunction = (sourceFile: ts.SourceFile, polyConfig: ParsedDe }; }; -const parseWebhook = (sourceFile: ts.SourceFile, polyConfig: ParsedDeployableConfig, baseUrl: string, fileRevision: string, gitRevision: string): DeployableRecord => { +const parseWebhook = ( + sourceFile: ts.SourceFile, + polyConfig: ParsedDeployableConfig, + baseUrl: string, + fileRevision: string, + gitRevision: string, +): DeployableRecord => { const [deployments] = getDeployComments(sourceFile); return { ...polyConfig, @@ -608,10 +736,17 @@ const parseWebhook = (sourceFile: ts.SourceFile, polyConfig: ParsedDeployableCon }; }; -export const parseDeployable = async (filePath: string, baseUrl: string, gitRevision: string): Promise<[DeployableRecord, string]> => { +export const parseDeployable = async ( + filePath: string, + baseUrl: string, + gitRevision: string, +): Promise<[DeployableRecord, string]> => { const sourceFile = await loadTsSourceFile(filePath); - const polyConfig = getPolyConfig(DeployableTypeEntries.map(e => e[0]), sourceFile); + const polyConfig = getPolyConfig( + DeployableTypeEntries.map((e) => e[0]), + sourceFile, + ); polyConfig.type = DeployableTsTypeToName[polyConfig.type]; const fileContents = sourceFile.getFullText(); const fileRevision = getDeployableFileRevision(fileContents); @@ -619,13 +754,35 @@ export const parseDeployable = async (filePath: string, baseUrl: string, gitRevi switch (polyConfig.type) { case 'server-function': case 'client-function': - return [parseDeployableFunction(sourceFile, polyConfig, baseUrl, fileRevision, gitRevision), fileContents]; + return [ + parseDeployableFunction( + sourceFile, + polyConfig, + baseUrl, + fileRevision, + gitRevision, + ), + fileContents, + ]; case 'webhook': - return [parseWebhook(sourceFile, polyConfig, baseUrl, fileRevision, gitRevision), fileContents]; + return [ + parseWebhook( + sourceFile, + polyConfig, + baseUrl, + fileRevision, + gitRevision, + ), + fileContents, + ]; } throw new Error('Invalid Poly deployment with unsupported type'); } catch (err) { - console.error(`Prepared ${polyConfig.type.replaceAll('-', ' ')} ${polyConfig.context}.${polyConfig.name}: ERROR`); + console.error( + `Prepared ${polyConfig.type.replaceAll('-', ' ')} ${polyConfig.context}.${ + polyConfig.name + }: ERROR`, + ); console.error(err); } }; diff --git a/src/types/functions.ts b/src/types/functions.ts index 4efee29..6831cae 100644 --- a/src/types/functions.ts +++ b/src/types/functions.ts @@ -44,7 +44,10 @@ export interface FunctionArgument { unresolvedPolySchemaRefs?: SchemaRef[]; } -export type FunctionArgumentDto = Omit; +export type FunctionArgumentDto = Omit< + FunctionArgument, + 'location' | 'typeObject' +>; export interface FunctionDetailsDto extends FunctionBasicDto { ownerUserId?: string | null; @@ -72,27 +75,27 @@ export interface BodySource { } export interface EmptyBodySource extends BodySource { -mode: 'empty'; + mode: 'empty'; } export interface FileBodySource extends BodySource { -mode: 'file'; + mode: 'file'; } export interface RawBodySource extends BodySource { -mode: 'raw'; -raw: string; -language: 'html' | 'xml' | 'text' | 'json' | 'javascript'; + mode: 'raw'; + raw: string; + language: 'html' | 'xml' | 'text' | 'json' | 'javascript'; } export interface FormDataBodySource extends BodySource { -mode: 'formdata'; -formdata: FormDataEntrySource[]; + mode: 'formdata'; + formdata: FormDataEntrySource[]; } export interface UrlEncodedBodySource extends BodySource { -mode: 'urlencoded'; -urlencoded: EntrySource[]; + mode: 'urlencoded'; + urlencoded: EntrySource[]; } export interface UpdateAuthSource { @@ -111,7 +114,7 @@ export interface BasicAuthSource extends UpdateAuthSource { export interface ApiKeyAuthSource extends UpdateAuthSource { type: 'apikey'; - apikey: { key: string, value: string }[]; + apikey: { key: string; value: string }[]; } export interface BearerAuthSourceEntry { @@ -125,14 +128,19 @@ export interface BearerAuthSource extends UpdateAuthSource { } export interface NoAuthSource extends UpdateAuthSource { -type: 'noauth'; + type: 'noauth'; } export interface SourceDto { url: string; headers: EntrySource[]; method: string; - body: EmptyBodySource | RawBodySource | UrlEncodedBodySource | FormDataBodySource | FileBodySource; + body: + | EmptyBodySource + | RawBodySource + | UrlEncodedBodySource + | FormDataBodySource + | FileBodySource; auth: NoAuthSource | BasicAuthSource | BearerAuthSource | ApiKeyAuthSource; } @@ -141,7 +149,12 @@ export interface CreateSourceDto { method: string; headers?: EntrySource[]; auth: BasicAuthSource | BearerAuthSource | ApiKeyAuthSource | NoAuthSource; - body: UrlEncodedBodySource | FormDataBodySource | RawBodySource | EmptyBodySource | FileBodySource; + body: + | UrlEncodedBodySource + | FormDataBodySource + | RawBodySource + | EmptyBodySource + | FileBodySource; } export interface ApiFunctionDetailsDto extends FunctionDetailsDto { @@ -150,17 +163,17 @@ export interface ApiFunctionDetailsDto extends FunctionDetailsDto { } export interface ArgumentsMetadataDto { - name: string; - description?: string; - required?: boolean; - secure?: boolean; - type?: string; - typeSchema?: Record; - typeObject?: object; - payload?: boolean; - variable?: string | null; - removeIfNotPresentOnExecute?: boolean; - serialization?: ArgumentSerializationDto; + name: string; + description?: string; + required?: boolean; + secure?: boolean; + type?: string; + typeSchema?: Record; + typeObject?: object; + payload?: boolean; + variable?: string | null; + removeIfNotPresentOnExecute?: boolean; + serialization?: ArgumentSerializationDto; } export interface CreateApiFunctionDto { @@ -201,7 +214,8 @@ export interface ExecuteApiFunctionDescriptionGenerationDto { source: CreateSourceDto; } -export interface CreateServerCustomFunctionResponseDto extends FunctionDetailsDto { +export interface CreateServerCustomFunctionResponseDto + extends FunctionDetailsDto { traceId?: string; } diff --git a/src/types/shared.ts b/src/types/shared.ts index 4fe7e4c..4004fca 100644 --- a/src/types/shared.ts +++ b/src/types/shared.ts @@ -1,7 +1,7 @@ export enum Visibility { Environment = 'ENVIRONMENT', Tenant = 'TENANT', - Public = 'PUBLIC' + Public = 'PUBLIC', } export enum LifecycleState { diff --git a/src/types/specifications.ts b/src/types/specifications.ts index d49bfc2..a483beb 100644 --- a/src/types/specifications.ts +++ b/src/types/specifications.ts @@ -6,7 +6,7 @@ import { CreateWebhookHandleDto } from './webhooks'; export type ValueType = string | number | boolean | object | null | any[]; export type SpecificationType = - 'apiFunction' + | 'apiFunction' | 'customFunction' | 'authFunction' | 'webhookHandle' @@ -52,7 +52,7 @@ interface IPropertyType { } export type PropertyType = - VoidPropertyType + | VoidPropertyType | PrimitivePropertyType | ArrayPropertyType | ObjectPropertyType @@ -95,7 +95,7 @@ export interface PlainPropertyType extends IPropertyType { export interface ApiFunctionSpecification extends ISpecification { type: 'apiFunction'; function: FunctionSpecification; - apiType: 'graphql' | 'rest' + apiType: 'graphql' | 'rest'; } export interface CustomFunctionSpecification extends ISpecification { @@ -132,14 +132,14 @@ export interface ServerVariableSpecification extends ISpecification { export interface VariableSpecification { environmentId: string; - secrecy: 'SECRET' | 'OBSCURED' | 'NONE' + secrecy: 'SECRET' | 'OBSCURED' | 'NONE'; valueType: PropertyType; value?: ValueType; } -export interface SnippetSpecification extends ISpecification{ - type: 'snippet' - language: string +export interface SnippetSpecification extends ISpecification { + type: 'snippet'; + language: string; description: string; } @@ -150,12 +150,12 @@ export interface SchemaRef { export interface SchemaSpecification extends ISpecification { type: 'schema'; - definition: Record - unresolvedPolySchemaRefs?: SchemaRef[] + definition: Record; + unresolvedPolySchemaRefs?: SchemaRef[]; } export type Specification = - ApiFunctionSpecification + | ApiFunctionSpecification | CustomFunctionSpecification | ServerFunctionSpecification | AuthFunctionSpecification @@ -164,7 +164,8 @@ export type Specification = | SnippetSpecification | SchemaSpecification; -interface CreateWebhookHandleDtoForSpecificationInput extends CreateWebhookHandleDto { +interface CreateWebhookHandleDtoForSpecificationInput + extends CreateWebhookHandleDto { context: string; } @@ -179,6 +180,10 @@ export interface SpecificationInputDto { schemas: CreateSchemaDtoForSpecificationInput[]; } -export type SpecificationWithFunction = Specification & { function: FunctionSpecification }; +export type SpecificationWithFunction = Specification & { + function: FunctionSpecification; +}; -export type SpecificationWithVariable = Specification & { variable: VariableSpecification }; +export type SpecificationWithVariable = Specification & { + variable: VariableSpecification; +}; diff --git a/src/types/templates.ts b/src/types/templates.ts index 8d4560c..f02c19d 100644 --- a/src/types/templates.ts +++ b/src/types/templates.ts @@ -10,5 +10,5 @@ export interface ProjectTemplatesConfig { } export interface ProjectTemplatesConfigVariable { - value: ProjectTemplatesConfig + value: ProjectTemplatesConfig; } diff --git a/src/types/webhooks.ts b/src/types/webhooks.ts index 4b80c52..80a9a61 100644 --- a/src/types/webhooks.ts +++ b/src/types/webhooks.ts @@ -12,12 +12,12 @@ export interface WebhookHandleXmlParserOptions { /** * If is enabled, it will send webhook xml request body as a json object to server functions and webhook listeners, otherwise it will send it as string. * Default: `true`. - */ + */ enabled?: boolean; /** * Always put child nodes in an array if true; otherwise an array is created only if there is more than one. * Default: `false`. - */ + */ explicitArray?: boolean; /** * Trim the whitespace at the beginning and end of text nodes. diff --git a/src/utils.ts b/src/utils.ts index 4ba4235..fb85dba 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -5,14 +5,21 @@ import prettier from 'prettier'; import chalk from 'chalk'; import shell from 'shelljs'; -import { ObjectPropertyType, PropertySpecification, PropertyType, Specification, SpecificationType } from './types'; +import { + ObjectPropertyType, + PropertySpecification, + PropertyType, + Specification, + SpecificationType, +} from './types'; import { getSpecs } from './api'; import { INSTANCE_URL_MAP } from './constants'; -export const getPolyLibPath = (polyPath: string) => polyPath.startsWith('/') - ? `${polyPath}/lib` - : `${__dirname}/../../../${polyPath}/lib`; +export const getPolyLibPath = (polyPath: string) => + polyPath.startsWith('/') + ? `${polyPath}/lib` + : `${__dirname}/../../../${polyPath}/lib`; export const getContextDataFileContent = (libPath: string) => { try { @@ -42,9 +49,9 @@ export const getSpecsFromContextData = (contextData) => { }; export type GenerationError = { - specification: Specification - stack: string -} + specification: Specification; + stack: string; +}; export const echoGenerationError = (specification: Specification) => { const typeMap = { @@ -61,11 +68,16 @@ export const echoGenerationError = (specification: Specification) => { const type = typeMap[specification.type]; shell.echo( - chalk.red(`\nError encountered while processing ${type} '${specification.contextName}' (id: '${specification.id}'). ${type} is unavailable.`), + chalk.red( + `\nError encountered while processing ${type} '${specification.contextName}' (id: '${specification.id}'). ${type} is unavailable.`, + ), ); }; -export const loadTemplate = (fileName: string) => fs.readFileSync(`${__dirname}/templates/${fileName}`, 'utf8'); +export const templateUrl = (fileName: string): string => `${__dirname}/templates/${fileName}`; + +export const loadTemplate = (fileName: string) => + fs.readFileSync(templateUrl(fileName), 'utf8'); export const prettyPrint = (code: string, parser = 'typescript') => prettier.format(code, { @@ -76,32 +88,57 @@ export const prettyPrint = (code: string, parser = 'typescript') => export const showErrGettingSpecs = (error: any) => { shell.echo(chalk.red('ERROR')); - shell.echo('Error while getting data from Poly server. Make sure the version of library/server is up to date.'); - shell.echo(chalk.red(error.message), chalk.red(JSON.stringify(error.response?.data))); + shell.echo( + 'Error while getting data from Poly server. Make sure the version of library/server is up to date.', + ); + shell.echo( + chalk.red(error.message), + chalk.red(JSON.stringify(error.response?.data)), + ); shell.exit(1); }; -export const generateContextDataFile = (libPath: string, specs: Specification[]) => { - fs.writeFileSync(`${libPath}/specs.json`, JSON.stringify(specs.filter(spec => { - if (spec.type === 'snippet') { - return spec.language === 'javascript'; - } - if (spec.type === 'customFunction') { - return spec.language === 'javascript'; - } - - return true; - }), null, 2)); +export const generateContextDataFile = ( + libPath: string, + specs: Specification[], +) => { + fs.writeFileSync( + `${libPath}/specs.json`, + JSON.stringify( + specs.filter((spec) => { + if (spec.type === 'snippet') { + return spec.language === 'javascript'; + } + if (spec.type === 'customFunction') { + return spec.language === 'javascript'; + } + + return true; + }), + null, + 2, + ), + ); }; -export const upsertResourceInSpec = async (polyPath: string, { - resourceId, - resourceName, - updated, -}: { - resourceId: string, resourceName: string, updated: boolean -}) => { - shell.echo('-n', updated ? `Updating ${resourceName} in specs...` : `Adding ${resourceName} to SDK...`); +export const upsertResourceInSpec = async ( + polyPath: string, + { + resourceId, + resourceName, + updated, + }: { + resourceId: string; + resourceName: string; + updated: boolean; + }, +) => { + shell.echo( + '-n', + updated + ? `Updating ${resourceName} in specs...` + : `Adding ${resourceName} to SDK...`, + ); let contextData: Record = {}; @@ -154,7 +191,7 @@ export const getStringPaths = (data: Record | any[]) => { let stringPath = ''; for (const part of paths[i]) { const isString = typeof part === 'string'; - const delimiter = (stringPath.length > 0 && isString) ? '.' : ''; + const delimiter = stringPath.length > 0 && isString ? '.' : ''; if (isString) { stringPath = `${stringPath}${delimiter}${part}`; } else { @@ -167,7 +204,8 @@ export const getStringPaths = (data: Record | any[]) => { return stringPaths; }; -export const firstLetterToUppercase = (value: string) => `${value.charAt(0).toUpperCase()}${value.slice(1)}`; +export const firstLetterToUppercase = (value: string) => + `${value.charAt(0).toUpperCase()}${value.slice(1)}`; export const isValidHttpUrl = (url: any) => { try { @@ -185,7 +223,8 @@ const sanitizeUrl = (url: any) => { return url; }; -export const URL_REGEX = /^(https?:\/\/)?(?:w{1,3}\.)?((localhost|(\d{1,3}(\.\d{1,3}){3})|[^\s.]+\.[a-z]{2,})(?:\.[a-z]{2,})?)(:\d+)?(\/[^\s]*)?(?![^<]*(?:<\/\w+>|\/?>))$/; +export const URL_REGEX = + /^(https?:\/\/)?(?:w{1,3}\.)?((localhost|(\d{1,3}(\.\d{1,3}){3})|[^\s.]+\.[a-z]{2,})(?:\.[a-z]{2,})?)(:\d+)?(\/[^\s]*)?(?![^<]*(?:<\/\w+>|\/?>))$/; export const validateBaseUrl = (url: any): string => { const sanitizedUrl = sanitizeUrl(url); @@ -232,7 +271,8 @@ export const isPlainObjectPredicate = (value: unknown): value is object => { return typeof value === 'object' && value !== null && !Array.isArray(value); }; -export const isBinary = (type: ObjectPropertyType) => type.schema?.type === 'string' && type.schema?.format === 'binary'; +export const isBinary = (type: ObjectPropertyType) => + type.schema?.type === 'string' && type.schema?.format === 'binary'; /** * Iterate all schemas that contain `$ref` key and pass them to {@link cb}, {@link cb} return value will replace current schema being iterated. @@ -240,7 +280,11 @@ export const isBinary = (type: ObjectPropertyType) => type.schema?.type === 'str * If you want to iterate over refs defined in an [annotation](https://json-schema.org/blog/posts/custom-annotations-will-continue#how-did-we-arrive-at-as-the-prefix-of-choice) * you can specify the annotation name through {@link refIdentifier} option which by default is `$ref`. */ -export const iterateRefs = (schema: any, cb: (schema: any) => any, refIdentifier = '$ref') => { +export const iterateRefs = ( + schema: any, + cb: (schema: any) => any, + refIdentifier = '$ref', +) => { if (isPlainObjectPredicate(schema)) { if (typeof schema[refIdentifier] !== 'undefined') { return cb(schema); @@ -278,7 +322,8 @@ export const getContextData = ( }; export const toTypeDeclaration = (type: PropertyType, synchronous = true) => { - const wrapInPromiseIfNeeded = (code: string) => (synchronous ? code : `Promise<${code}>`); + const wrapInPromiseIfNeeded = (code: string) => + synchronous ? code : `Promise<${code}>`; switch (type.kind) { case 'plain': return type.value; @@ -289,13 +334,17 @@ export const toTypeDeclaration = (type: PropertyType, synchronous = true) => { case 'array': return wrapInPromiseIfNeeded(`${toTypeDeclaration(type.items)}[]`); case 'object': - if (type.typeName && !isBinary(type)) { return wrapInPromiseIfNeeded(type.typeName); } else if (type.properties) { return wrapInPromiseIfNeeded( `{ ${type.properties - .map((prop) => `'${prop.name}'${prop.required === false ? '?' : ''}: ${toTypeDeclaration(prop.type)}`) + .map( + (prop) => + `'${prop.name}'${ + prop.required === false ? '?' : '' + }: ${toTypeDeclaration(prop.type)}`, + ) .join(';\n')} }`, ); } else { @@ -306,11 +355,13 @@ export const toTypeDeclaration = (type: PropertyType, synchronous = true) => { return type.name; } const toArgument = (arg: PropertySpecification) => - `${arg.name}${arg.required === false ? '?' : ''}: ${toTypeDeclaration(arg.type)}${ - arg.nullable === true ? ' | null' : '' - }`; + `${arg.name}${arg.required === false ? '?' : ''}: ${toTypeDeclaration( + arg.type, + )}${arg.nullable === true ? ' | null' : ''}`; - return `(${type.spec.arguments.map(toArgument).join(', ')}) => ${toTypeDeclaration( + return `(${type.spec.arguments + .map(toArgument) + .join(', ')}) => ${toTypeDeclaration( type.spec.returnType, type.spec.synchronous === true, )}`; diff --git a/templates/api-functions.js.hbs b/templates/api-functions.js.hbs new file mode 100644 index 0000000..6321cb3 --- /dev/null +++ b/templates/api-functions.js.hbs @@ -0,0 +1,18 @@ +// Environment variables injected during generation +const env = { + directExecute: {{executionConfig.directExecute}}, + mtls: { + certPath: '{{executionConfig.mtls.certPath}}', + keyPath: '{{executionConfig.mtls.keyPath}}', + caPath: '{{executionConfig.mtls.caPath}}', + rejectUnauthorized: {{executionConfig.mtls.rejectUnauthorized}}, + } +}; + +const functions = [ +{{#each specifications}} + ['{{#if context}}{{context}}.{{/if}}{{name}}', '{{id}}',{{#each function.arguments}}'{{name}}',{{/each}}], +{{/each}} +]; + +module.exports = { env, functions }; \ No newline at end of file diff --git a/templates/api-index.js b/templates/api-index.js new file mode 100644 index 0000000..4e2bb25 --- /dev/null +++ b/templates/api-index.js @@ -0,0 +1,153 @@ +const { axios } = require('../axios'); +const set = require('lodash/set'); +const https = require('https'); +const fs = require('fs'); +const { env, functions } = require('./functions'); + + +// Create MTLS agent if paths are provided +let httpsAgent = undefined; +const getHttpsAgent = () => { + if (httpsAgent) { + return httpsAgent; + } + + const { mtls } = env; + if (!mtls.certPath || !mtls.keyPath || !mtls.caPath) { + return undefined; + } + + httpsAgent = new https.Agent({ + cert: fs.readFileSync(mtls.certPath), + key: fs.readFileSync(mtls.keyPath), + ca: fs.readFileSync(mtls.caPath), + rejectUnauthorized: mtls.rejectUnauthorized, + }); + + return httpsAgent; +}; + + +const handleError = (err) => { + if (err.response) { + // The request was made and the server responded with a status code + // that falls out of the range of 2xx + return { + data: err.response.data, + status: err.response.status, + headers: { ...err.response.headers }, + metrics: {}, + }; + } + // Either the request was made but no response was received + // Or something happened in setting up the request that triggered an Error + return { + data: err.message, + status: err.request ? 500 : 400, + headers: {}, + metrics: {}, + }; +} + +const executeApiFunction = (id, clientID, polyCustom, requestArgs) => { + const requestServerStartTime = Date.now(); + + // Check if direct execution is enabled + const { directExecute } = env; + + if (directExecute === true) { + // Make direct API call + + let polyHeaders; + let serverPreperationTimeMs; + let roundTripServerNetworkLatencyMs; + let requestApiStartTime; + + return axios.post( + `/functions/api/${id}/direct-execute?clientId=${clientID}`, + requestArgs, + { + headers: { + 'x-poly-execution-id': polyCustom.executionId, + } + } + ).then(({ headers, data }) => { + polyHeaders = headers; + if (data && (data.status < 200 || data.status >= 300)) { + let responseData = data.data; + try { + responseData = JSON.stringify(data.data); + } catch (err) {} + console.error('Error executing api function with id:', id, 'Status code:', data.status, 'Request data:', requestArgs, 'Response data:', responseData); + } + + serverPreperationTimeMs = Number(polyHeaders['x-poly-execution-duration']); + roundTripServerNetworkLatencyMs = Date.now() - requestServerStartTime - serverPreperationTimeMs; + + requestApiStartTime = Date.now(); + const httpsAgent = getHttpsAgent(); + + return axios({ + ...data, + headers: { + ...data.headers, + }, + httpsAgent, + }) + }).then(({ headers, data, status }) => { + if (status && (status < 200 || status >= 300)) { + console.error('Error direct executing api function with id:', id, 'Status code:', status, 'Request data:', requestArgs, 'Response data:', data.data); + } + const apiExecutionTimeMs = Date.now() - requestApiStartTime; + return { + data: data, + status: status, + headers: { ...headers }, + metrics: { + roundTripServerNetworkLatencyMs, + serverPreperationTimeMs, + apiExecutionTimeMs, + } + }; + }).catch(handleError); + } + + // default indirect execution + return axios.post( + `/functions/api/${id}/execute?clientId=${clientID}`, + requestArgs, + { + headers: { + 'x-poly-execution-id': polyCustom.executionId, + } + } + ).then(({ headers, data }) => { + if (data && (data.status < 200 || data.status >= 300)) { + let responseData = data.data; + try { + responseData = JSON.stringify(data.data); + } catch (err) {} + console.error('Error executing api function with id:', id, 'Status code:', data.status, 'Request data:', requestArgs, 'Response data:', responseData); + } + const serverExecutionTimeMs = Number(headers['x-poly-execution-duration']); + const roundTripNetworkLatencyMs = Date.now() - requestServerStartTime - serverExecutionTimeMs; + return { + ...data, + metrics: { + roundTripNetworkLatencyMs, + serverExecutionTimeMs, + } + }; + }).catch(handleError); +} + +module.exports = (clientID, polyCustom) => functions.reduce( + (acc, [path, id, ...argKeys]) => set( + acc, + path, + (...args) => { + const requestArgs = argKeys.reduce((acc, key, index) => set(acc, key, args[index]), {}); + return executeApiFunction(id, clientID, polyCustom, requestArgs); + }), + {} +); \ No newline at end of file diff --git a/templates/api-index.js.hbs b/templates/api-index.js.hbs deleted file mode 100644 index f144f89..0000000 --- a/templates/api-index.js.hbs +++ /dev/null @@ -1,148 +0,0 @@ -const axios = require('../axios'); -const set = require('lodash/set'); -const merge = require('lodash/merge'); -const https = require('https'); -const fs = require('fs'); - -// Environment variables injected during generation -const env = { - directExecute: {{executionConfig.directExecute}}, - mtls: { - certPath: '{{executionConfig.mtls.certPath}}', - keyPath: '{{executionConfig.mtls.keyPath}}', - caPath: '{{executionConfig.mtls.caPath}}', - rejectUnauthorized: {{executionConfig.mtls.rejectUnauthorized}}, - } -}; - -const functions = [ -{{#each specifications}} - ['{{#if context}}{{context}}.{{/if}}{{name}}', '{{id}}',{{#each function.arguments}}'{{name}}',{{/each}}], -{{/each}} -]; - -// Create MTLS agent if paths are provided -let httpsAgent = undefined; -const getHttpsAgent = () => { - if (httpsAgent) { - return httpsAgent; - } - - const { mtls } = env; - if (!mtls.certPath || !mtls.keyPath || !mtls.caPath) { - return undefined; - } - - httpsAgent = new https.Agent({ - cert: fs.readFileSync(mtls.certPath), - key: fs.readFileSync(mtls.keyPath), - ca: fs.readFileSync(mtls.caPath), - rejectUnauthorized: mtls.rejectUnauthorized, - }); - - return httpsAgent; -}; - -module.exports = (clientID, polyCustom) => merge( - {}, - functions.reduce( - (acc, [path, id, ...argKeys]) => set( - acc, - path, - (...args) => { - const requestServerStartTime = Date.now(); - const requestArgs = argKeys.reduce((acc, key, index) => ({ ...acc, [key]: args[index] }), {}); - - // Check if direct execution is enabled - const { directExecute } = env; - - if (directExecute === true) { - // Make direct API call - - let polyHeaders; - let serverPreperationTimeMs; - let roundTripServerNetworkLatencyMs; - let requestApiStartTime; - - return axios.post( - `/functions/api/${id}/direct-execute?clientId=${clientID}`, - requestArgs, - { - headers: { - 'x-poly-execution-id': polyCustom.executionId, - } - } - ).then(({ headers, data }) => { - polyHeaders = headers; - if (data && (data.status < 200 || data.status >= 300)) { - let responseData = data.data; - try { - responseData = JSON.stringify(data.data); - } catch (err) {} - console.error('Error executing api function with id:', id, 'Status code:', data.status, 'Request data:', requestArgs, 'Response data:', responseData); - } - - serverPreperationTimeMs = Number(polyHeaders['x-poly-execution-duration']); - roundTripServerNetworkLatencyMs = Date.now() - requestServerStartTime - serverPreperationTimeMs; - - requestApiStartTime = Date.now(); - const httpsAgent = getHttpsAgent(); - - return axios({ - ...data, - headers: { - ...data.headers, - }, - httpsAgent, - }) - }).then(({ headers, data, status, ...args }) => { - if (status && (status < 200 || status >= 300)) { - console.error('Error direct executing api function with id:', id, 'Status code:', status, 'Request data:', requestArgs, 'Response data:', data.data); - } - const apiExecutionTimeMs = Date.now() - requestApiStartTime; - return { - data: data, - status: status, - headers: { ...headers }, - metrics: { - roundTripServerNetworkLatencyMs, - serverPreperationTimeMs, - apiExecutionTimeMs, - } - }; - }); - } - - // default indirect execution - return axios.post( - `/functions/api/${id}/execute?clientId=${clientID}`, - { - ...requestArgs, - }, - { - headers: { - 'x-poly-execution-id': polyCustom.executionId, - } - } - ).then(({ headers, data }) => { - if (data && (data.status < 200 || data.status >= 300)) { - let responseData = data.data; - try { - responseData = JSON.stringify(data.data); - } catch (err) {} - console.error('Error executing api function with id:', id, 'Status code:', data.status, 'Request data:', requestArgs, 'Response data:', responseData); - } - const serverExecutionTimeMs = Number(headers['x-poly-execution-duration']); - const roundTripNetworkLatencyMs = Date.now() - requestServerStartTime - serverExecutionTimeMs; - return { - ...data, - metrics: { - roundTripNetworkLatencyMs, - serverExecutionTimeMs, - } - }; - }); - }), - {} - ) -); diff --git a/templates/auth-function.js.hbs b/templates/auth-function.js.hbs index 01de2b0..ca1ad73 100644 --- a/templates/auth-function.js.hbs +++ b/templates/auth-function.js.hbs @@ -1,4 +1,4 @@ -const axios = require('../axios'); +const { axios, scrubKeys } = require('../axios'); module.exports = function(eventsClientId, getSocket, getApiKey, clientId, clientSecret, {{#if audienceRequired}}audience, scopes, callback, { callbackUrl, timeout = 120000, autoCloseOnToken = true, autoCloseOnUrl = false, userId } = {}{{else}}scopes, callback, { audience, callbackUrl, timeout = 120000, autoCloseOnToken = true, autoCloseOnUrl = false, userId } = {}{{/if}}) { if (userId) { @@ -60,7 +60,7 @@ module.exports = function(eventsClientId, getSocket, getApiKey, clientId, client callback(null, null, { message: 'Timeout reached' }); }, timeout); } - }); + }).catch(scrubKeys); return { close: closeEventHandler, diff --git a/templates/auth-index.js.hbs b/templates/auth-index.js.hbs index 301e252..6b40b85 100644 --- a/templates/auth-index.js.hbs +++ b/templates/auth-index.js.hbs @@ -1,4 +1,4 @@ -const axios = require('../axios'); +const { axios, scrubKeys } = require('../axios'); const set = require('lodash/set'); const merge = require('lodash/merge'); @@ -28,7 +28,14 @@ module.exports = (clientID, getSocket, getApiKey) => merge( {} ), subResourceFunctions.reduce( - (acc, [path, resource]) => set(acc, path, (token) => axios.post(`/auth-providers/${resource}`, { clientID, token }).then(({ data }) => data)), + (acc, [path, resource]) => set( + acc, + path, + (token) => + axios.post(`/auth-providers/${resource}`, { clientID, token }) + .then(({ data }) => data) + .catch(scrubKeys) + ), {} ) ); diff --git a/templates/axios.js.hbs b/templates/axios.js similarity index 77% rename from templates/axios.js.hbs rename to templates/axios.js index 90c366c..be6c9d8 100644 --- a/templates/axios.js.hbs +++ b/templates/axios.js @@ -4,6 +4,7 @@ const { HttpsProxyAgent } = require('https-proxy-agent'); const https = require('https'); const dotenv = require('dotenv'); const polyCustom = require('./poly-custom'); +const { API_KEY, API_BASE_URL } = require('./constants'); dotenv.config(); @@ -12,7 +13,7 @@ const httpsProxy = process.env.HTTPS_PROXY || process.env.https_proxy || process const nodeEnv = process.env.NODE_ENV; const isDevEnv = nodeEnv === 'development'; -let baseURL = '{{apiBaseUrl}}'; +let baseURL = API_BASE_URL; if (!isDevEnv) { baseURL = baseURL.replace(/^http:/, 'https:'); } @@ -33,7 +34,7 @@ const axios = Axios.create({ }); axios.interceptors.request.use( config => { - config.headers['Authorization'] = `Bearer ${polyCustom.executionApiKey || '{{apiKey}}'}`; + config.headers['Authorization'] = `Bearer ${polyCustom.executionApiKey || API_KEY}`; return config; }, error => { @@ -41,4 +42,15 @@ axios.interceptors.request.use( } ); -module.exports = axios; +const scrubKeys = (err) => { + if (err.request) { + // Scrub the api key in the authorization header + err.request.headers['Authorization'] = `Bearer ********`; + } + throw err; +}; + +module.exports = { + axios, + scrubKeys +}; diff --git a/templates/constants.js.hbs b/templates/constants.js.hbs new file mode 100644 index 0000000..306c562 --- /dev/null +++ b/templates/constants.js.hbs @@ -0,0 +1,5 @@ +module.exports = { + CLIENT_ID: '{{clientID}}', + API_KEY: '{{apiKey}}', + API_BASE_URL: '{{apiBaseUrl}}', +}; \ No newline at end of file diff --git a/templates/error-handler.js.hbs b/templates/error-handler.js similarity index 100% rename from templates/error-handler.js.hbs rename to templates/error-handler.js diff --git a/templates/index.js.hbs b/templates/index.js similarity index 81% rename from templates/index.js.hbs rename to templates/index.js index 2e8117c..0c04213 100644 --- a/templates/index.js.hbs +++ b/templates/index.js @@ -1,4 +1,3 @@ -const set = require('lodash/set'); const merge = require('lodash/merge'); const { io } = require('socket.io-client'); const apiFunctions = require('./api'); @@ -9,8 +8,8 @@ const serverFunctions = require('./server'); const vari = require('./vari'); const polyCustom = require('./poly-custom'); const { createErrorHandler, sendLocalErrorEvent } = require('./error-handler'); +const { CLIENT_ID, API_KEY, API_BASE_URL } = require('./constants'); -const clientID = '{{clientID}}'; const nodeEnv = process.env.NODE_ENV; const isDevEnv = nodeEnv === 'development'; @@ -18,7 +17,7 @@ let socket = null; let listenersCount = 0; const getSocket = () => { - let apiBaseUrl = '{{apiBaseUrl}}'; + let apiBaseUrl = API_BASE_URL; if (!isDevEnv) { apiBaseUrl = apiBaseUrl.replace(/^http:/, 'https:'); } @@ -58,20 +57,20 @@ const getSocket = () => { } }); }; -const getApiKey = () => polyCustom.executionApiKey || '{{apiKey}}'; +const getApiKey = () => polyCustom.executionApiKey || API_KEY; const poly = {}; merge( poly, - apiFunctions(clientID, polyCustom), + apiFunctions(CLIENT_ID, polyCustom), clientFunctions(poly, sendLocalErrorEvent), - serverFunctions(clientID, polyCustom), - authFunctions(clientID, getSocket, getApiKey), - webhooks(clientID, getSocket, getApiKey), + serverFunctions(CLIENT_ID, polyCustom), + authFunctions(CLIENT_ID, getSocket, getApiKey), + webhooks(CLIENT_ID, getSocket, getApiKey), ), module.exports = { ...poly, errorHandler: createErrorHandler(getApiKey, getSocket), - vari: vari(clientID, getSocket, getApiKey), + vari: vari(CLIENT_ID, getSocket, getApiKey), polyCustom, }; diff --git a/templates/server-functions.js.hbs b/templates/server-functions.js.hbs new file mode 100644 index 0000000..648ee51 --- /dev/null +++ b/templates/server-functions.js.hbs @@ -0,0 +1,7 @@ +module.exports = { + functions: [ +{{#each specifications}} + ['{{#if context}}{{context}}.{{/if}}{{name}}', '{{id}}',{{#each function.arguments}}`{{name}}`,{{/each}}], +{{/each}} +]; +} \ No newline at end of file diff --git a/templates/server-index.js b/templates/server-index.js new file mode 100644 index 0000000..47ae6c5 --- /dev/null +++ b/templates/server-index.js @@ -0,0 +1,19 @@ +const { axios, scrubKeys } = require('../axios'); +const set = require('lodash/set'); +const { functions } = require('./functions'); + +module.exports = (clientID, polyCustom) => functions.reduce( + (acc, [path, id, ...argKeys]) => set( + acc, + path, + (...args) => axios.post( + `/functions/server/${id}/execute?clientId=${clientID}`, + argKeys.reduce((acc, key, index) => set(acc, key, args[index]), {}), + { + headers: { + 'x-poly-execution-id': polyCustom.executionId, + } + } + ).then(({ data }) => data)).catch(scrubKeys), + {} +); diff --git a/templates/server-index.js.hbs b/templates/server-index.js.hbs deleted file mode 100644 index 31ef2f6..0000000 --- a/templates/server-index.js.hbs +++ /dev/null @@ -1,30 +0,0 @@ -const axios = require('../axios'); -const set = require('lodash/set'); -const merge = require('lodash/merge'); - -const serverFunctions = [ -{{#each specifications}} - ['{{#if context}}{{context}}.{{/if}}{{name}}', '{{id}}',{{#each function.arguments}}`{{name}}`,{{/each}}], -{{/each}} -]; - -module.exports = (clientID, polyCustom) => merge( - {}, - serverFunctions.reduce( - (acc, [path, id, ...argKeys]) => set( - acc, - path, - (...args) => axios.post( - `/functions/server/${id}/execute?clientId=${clientID}`, - { - ...argKeys.reduce((acc, key, index) => ({ ...acc, [key]: args[index] }), {}) - }, - { - headers: { - 'x-poly-execution-id': polyCustom.executionId, - } - } - ).then(({ data }) => data)), - {} - ) -); diff --git a/templates/vari/index.js.hbs b/templates/vari/index.js.hbs index 2a0dbdc..3a0651a 100644 --- a/templates/vari/index.js.hbs +++ b/templates/vari/index.js.hbs @@ -1,4 +1,4 @@ -const axios = require('../axios'); +const { axios, scrubKeys } = require('../axios'); const set = require('lodash/set'); const get = require('lodash/get'); const merge = require('lodash/merge'); @@ -49,7 +49,7 @@ const getVariableHandlers = (clientID, getSocket, getApiKey) => { } else { return axios.get( `/variables/${id}/value` - ).then(({data}) => data); + ).then(({data}) => data).catch(scrubKeys); } }, update: (value) => { @@ -62,7 +62,7 @@ const getVariableHandlers = (clientID, getSocket, getApiKey) => { status: response.status, headers: response.headers, }; - }); + }).catch(scrubKeys); }, onUpdate: (callback) => { const socket = getSocket(); @@ -181,7 +181,7 @@ const getPathHandlers = () => { get: () => { return axios.get( `/variables/context/values` - ).then(({data}) => data); + ).then(({data}) => data).catch(scrubKeys); } }; contextPaths.forEach(path => { @@ -189,7 +189,7 @@ const getPathHandlers = () => { get: () => { return axios.get( `/variables/context/${path}/values` - ).then(({data}) => data); + ).then(({data}) => data).catch(scrubKeys); }, }); }); diff --git a/templates/webhook-handles.js.hbs b/templates/webhook-handles.js.hbs new file mode 100644 index 0000000..127bf84 --- /dev/null +++ b/templates/webhook-handles.js.hbs @@ -0,0 +1,11 @@ +module.exports = { + handles: [ + {{#each specifications}} + {{#if context}} + ['{{context}}.{{name}}', '{{id}}'], + {{else}} + ['{{name}}', '{{id}}'], + {{/if}} + {{/each}} + ]; +} diff --git a/templates/webhooks-index.js.hbs b/templates/webhooks-index.js similarity index 74% rename from templates/webhooks-index.js.hbs rename to templates/webhooks-index.js index 36045d6..4832a26 100644 --- a/templates/webhooks-index.js.hbs +++ b/templates/webhooks-index.js @@ -1,15 +1,5 @@ const set = require('lodash/set'); -const merge = require('lodash/merge'); - -const webhookHandles = [ -{{#each specifications}} - {{#if context}} - ['{{context}}.{{name}}', '{{id}}'], - {{else}} - ['{{name}}', '{{id}}'], - {{/if}} -{{/each}} -]; +const { handles } = require('./handles'); const registerWebhookEventListener = (clientID, getSocket, getApiKey, webhookHandleID, options, callback) => { const socket = getSocket(); @@ -55,10 +45,7 @@ const registerWebhookEventListener = (clientID, getSocket, getApiKey, webhookHan } }; -module.exports = (clientID, getSocket, getApiKey) => merge( - {}, - webhookHandles.reduce( - (acc, [path, id]) => set(acc, path, (callback, options = {}) => registerWebhookEventListener(clientID, getSocket, getApiKey, id, options, callback)), - {} - ), +module.exports = (clientID, getSocket, getApiKey) => handles.reduce( + (acc, [path, id]) => set(acc, path, (callback, options = {}) => registerWebhookEventListener(clientID, getSocket, getApiKey, id, options, callback)), + {} ); diff --git a/test/generateTypes.spec.ts b/test/generateTypes.spec.ts index 6ab2a95..b016393 100644 --- a/test/generateTypes.spec.ts +++ b/test/generateTypes.spec.ts @@ -114,7 +114,7 @@ describe('Generate types from specs', () => { publicNamespace: 'OOB' } }; - const expected = 'type Foo = OOB.Polyapi.Adyen.Capital.AccountBalance;'; + const expected = 'type Foo = Oob.Polyapi.Adyen.Capital.AccountBalance;'; expect(printSchemaAsType(schema, 'foo', 0)).toEqual(expected); }); test('unresolved poly schema', () => { From ae1bc2070c09317962b39017925ac68f599552b8 Mon Sep 17 00:00:00 2001 From: Aaron Goin Date: Mon, 9 Jun 2025 17:16:46 -0700 Subject: [PATCH 24/73] fixing generated webhooks and server functions --- package-lock.json | 4 ++-- package.json | 2 +- templates/server-functions.js.hbs | 8 ++++---- templates/webhook-handles.js.hbs | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index be54cd0..789c52f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "polyapi", - "version": "0.23.19", + "version": "0.23.20", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "polyapi", - "version": "0.23.19", + "version": "0.23.20", "license": "MIT", "dependencies": { "@guanghechen/helper-string": "4.7.1", diff --git a/package.json b/package.json index f06100a..d6d7293 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.23.19", + "version": "0.23.20", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { diff --git a/templates/server-functions.js.hbs b/templates/server-functions.js.hbs index 648ee51..f294642 100644 --- a/templates/server-functions.js.hbs +++ b/templates/server-functions.js.hbs @@ -1,7 +1,7 @@ module.exports = { functions: [ -{{#each specifications}} - ['{{#if context}}{{context}}.{{/if}}{{name}}', '{{id}}',{{#each function.arguments}}`{{name}}`,{{/each}}], -{{/each}} -]; + {{#each specifications}} + ['{{#if context}}{{context}}.{{/if}}{{name}}', '{{id}}',{{#each function.arguments}}`{{name}}`,{{/each}}], + {{/each}} + ] } \ No newline at end of file diff --git a/templates/webhook-handles.js.hbs b/templates/webhook-handles.js.hbs index 127bf84..fe09e33 100644 --- a/templates/webhook-handles.js.hbs +++ b/templates/webhook-handles.js.hbs @@ -7,5 +7,5 @@ module.exports = { ['{{name}}', '{{id}}'], {{/if}} {{/each}} - ]; + ] } From 858fc8904f6726b6cd436df4eb5f94c4b1198f86 Mon Sep 17 00:00:00 2001 From: Dan Fellin Date: Tue, 10 Jun 2025 06:02:44 -0700 Subject: [PATCH 25/73] try a KISS version of auto deploy prebuilt (#12) --- .github/workflows/deploy-npm-package.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/deploy-npm-package.yaml b/.github/workflows/deploy-npm-package.yaml index f249188..5d169a6 100644 --- a/.github/workflows/deploy-npm-package.yaml +++ b/.github/workflows/deploy-npm-package.yaml @@ -49,3 +49,11 @@ jobs: npm install --include=dev npm publish --tag develop fi + + - name: Hit endpoint and build from scratch pre-built image + run: | + curl --fail-with-body -X POST \ + https://dev.polyapi.io/functions/server/prebuilt-base-image \ + -H "Authorization: Bearer ${{ secrets.POLY_SUPER_ADMIN_USER_KEY }}" \ + -H "Content-Type: application/json" \ + -d '{}' From 67b878add8f3360ffe59c82c5991920df650db65 Mon Sep 17 00:00:00 2001 From: Richard Date: Wed, 11 Jun 2025 19:39:05 +0200 Subject: [PATCH 26/73] P1) Update typescript client to remove warnings (#7) * ts-json-schema-generator used instead of outdated package + eslint upgrade * eslint hardcode * eslintignore removed * eslint.config.js renamed to eslint.config.mjs to prevent errors * lock file updated * fix complex types --- .eslintignore | 2 - eslint.config.mjs | 294 +++++ package-lock.json | 2282 +++++++++++++++++++++----------------- package.json | 16 +- src/commands/function.ts | 8 +- src/transpiler.ts | 546 +++++---- 6 files changed, 1833 insertions(+), 1315 deletions(-) delete mode 100644 .eslintignore create mode 100644 eslint.config.mjs diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 053082e..0000000 --- a/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -index.js -index.d.ts diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..13e68a6 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,294 @@ +import eslint from '@eslint/js'; +import tseslint from '@typescript-eslint/eslint-plugin'; +import tsParser from '@typescript-eslint/parser'; +import prettier from 'eslint-config-prettier'; + +const nodeGlobals = { + process: 'readonly', + console: 'readonly', + __dirname: 'readonly', + __filename: 'readonly', + Buffer: 'readonly', + global: 'readonly', + URL: 'readonly', + URLSearchParams: 'readonly', + setTimeout: 'readonly', + setInterval: 'readonly', + clearTimeout: 'readonly', + clearInterval: 'readonly', +}; + +export default [ + eslint.configs.recommended, + { + files: ['**/*.ts'], + languageOptions: { + parser: tsParser, + parserOptions: { + project: 'tsconfig.json', + tsconfigRootDir: '.', + sourceType: 'module', + }, + globals: { + ...nodeGlobals, + jest: 'readonly', + }, + }, + plugins: { + '@typescript-eslint': tseslint, + }, + rules: { + ...tseslint.configs.recommended.rules, + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/no-unused-vars': 'off', + 'no-var': 'warn', + 'object-shorthand': ['warn', 'properties'], + 'accessor-pairs': ['error', { setWithoutGet: true, enforceForClassMembers: true }], + 'array-bracket-spacing': ['error', 'never'], + 'array-bracket-newline': ['error', { multiline: true }], + 'array-callback-return': ['error', { + allowImplicit: false, + checkForEach: false, + }], + 'arrow-spacing': ['error', { before: true, after: true }], + 'block-spacing': ['error', 'always'], + 'brace-style': ['error', '1tbs', { allowSingleLine: true }], + 'camelcase': ['error', { + allow: ['^UNSAFE_'], + properties: 'never', + ignoreGlobals: true, + }], + 'comma-dangle': ['error', { + arrays: 'always-multiline', + objects: 'always-multiline', + imports: 'always-multiline', + exports: 'always-multiline', + functions: 'always-multiline', + }], + 'comma-spacing': ['error', { before: false, after: true }], + 'comma-style': ['error', 'last'], + 'computed-property-spacing': ['error', 'never', { enforceForClassMembers: true }], + 'constructor-super': 'error', + 'curly': ['error', 'multi-line'], + 'default-case-last': 'error', + 'dot-location': ['error', 'property'], + 'eol-last': 'error', + 'eqeqeq': ['error', 'always', { null: 'ignore' }], + 'func-call-spacing': ['error', 'never'], + 'func-style': ['error', 'expression', { allowArrowFunctions: true }], + 'generator-star-spacing': ['error', { before: true, after: true }], + 'indent': ['error', 2, { + SwitchCase: 1, + VariableDeclarator: 1, + outerIIFEBody: 1, + MemberExpression: 1, + FunctionDeclaration: { parameters: 1, body: 1 }, + FunctionExpression: { parameters: 1, body: 1 }, + CallExpression: { arguments: 1 }, + ArrayExpression: 1, + ObjectExpression: 1, + ImportDeclaration: 1, + flatTernaryExpressions: false, + ignoreComments: false, + ignoredNodes: [ + 'TemplateLiteral *', + 'JSXElement', + 'JSXElement > *', + 'JSXAttribute', + 'JSXIdentifier', + 'JSXNamespacedName', + 'JSXMemberExpression', + 'JSXSpreadAttribute', + 'JSXExpressionContainer', + 'JSXOpeningElement', + 'JSXClosingElement', + 'JSXFragment', + 'JSXOpeningFragment', + 'JSXClosingFragment', + 'JSXText', + 'JSXEmptyExpression', + 'JSXSpreadChild', + 'PropertyDefinition[decorators]' + ], + offsetTernaryExpressions: true, + }], + 'key-spacing': ['error', { beforeColon: false, afterColon: true }], + 'keyword-spacing': ['error', { before: true, after: true }], + 'lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true }], + 'multiline-ternary': ['error', 'always-multiline'], + 'new-cap': ['error', { newIsCap: true, capIsNew: false, properties: true }], + 'new-parens': 'error', + 'no-array-constructor': 'error', + 'no-async-promise-executor': 'error', + 'no-caller': 'error', + 'no-case-declarations': 'error', + 'no-class-assign': 'error', + 'no-compare-neg-zero': 'error', + 'no-cond-assign': 'error', + 'no-const-assign': 'error', + 'no-constant-condition': ['error', { checkLoops: false }], + 'no-control-regex': 'error', + 'no-debugger': 'error', + 'no-delete-var': 'error', + 'no-dupe-args': 'error', + 'no-dupe-class-members': 'error', + 'no-dupe-keys': 'error', + 'no-duplicate-case': 'error', + 'no-useless-backreference': 'error', + 'no-empty': ['error', { allowEmptyCatch: true }], + 'no-empty-character-class': 'error', + 'no-empty-pattern': 'error', + 'no-eval': 'error', + 'no-ex-assign': 'error', + 'no-extend-native': 'error', + 'no-extra-bind': 'error', + 'no-extra-boolean-cast': 'error', + 'no-extra-parens': ['error', 'functions'], + 'no-fallthrough': 'error', + 'no-floating-decimal': 'error', + 'no-func-assign': 'error', + 'no-global-assign': 'error', + 'no-implied-eval': 'error', + 'no-import-assign': 'error', + 'no-invalid-regexp': 'error', + 'no-irregular-whitespace': 'error', + 'no-iterator': 'error', + 'no-labels': ['error', { allowLoop: false, allowSwitch: false }], + 'no-lone-blocks': 'error', + 'no-loss-of-precision': 'error', + 'no-misleading-character-class': 'error', + 'no-useless-catch': 'error', + 'no-mixed-operators': ['error', { + groups: [ + ['==', '!=', '===', '!==', '>', '>=', '<', '<='], + ['&&', '||'], + ['in', 'instanceof'], + ], + allowSamePrecedence: true, + }], + 'no-mixed-spaces-and-tabs': 'error', + 'no-multi-spaces': 'error', + 'no-multi-str': 'error', + 'no-multiple-empty-lines': ['error', { max: 1, maxBOF: 0, maxEOF: 0 }], + 'no-new': 'error', + 'no-new-func': 'error', + 'no-new-object': 'error', + 'no-new-symbol': 'error', + 'no-new-wrappers': 'error', + 'no-obj-calls': 'error', + 'no-octal': 'error', + 'no-octal-escape': 'error', + 'no-proto': 'error', + 'no-redeclare': ['error', { builtinGlobals: false }], + 'no-regex-spaces': 'error', + 'no-return-assign': ['error', 'except-parens'], + 'no-self-assign': ['error', { props: true }], + 'no-self-compare': 'error', + 'no-sequences': 'error', + 'no-shadow-restricted-names': 'error', + 'no-sparse-arrays': 'error', + 'no-tabs': 'error', + 'no-template-curly-in-string': 'error', + 'no-this-before-super': 'error', + 'no-throw-literal': 'error', + 'no-trailing-spaces': 'error', + 'no-undef': 'error', + 'no-undef-init': 'error', + 'no-unexpected-multiline': 'error', + 'no-unmodified-loop-condition': 'error', + 'no-unneeded-ternary': ['error', { defaultAssignment: false }], + 'no-unreachable': 'error', + 'no-unreachable-loop': 'error', + 'no-unsafe-finally': 'error', + 'no-unsafe-negation': 'error', + 'no-unused-expressions': ['error', { + allowShortCircuit: true, + allowTernary: true, + allowTaggedTemplates: true, + }], + 'no-useless-call': 'error', + 'no-useless-computed-key': 'error', + 'no-useless-rename': 'error', + 'no-useless-return': 'error', + 'no-void': ['error', { allowAsStatement: true }], + 'no-whitespace-before-property': 'error', + 'no-with': 'error', + 'object-curly-newline': ['error', { multiline: true, consistent: true }], + 'object-curly-spacing': ['error', 'always'], + 'object-property-newline': ['error', { allowMultiplePropertiesPerLine: true }], + 'one-var': ['error', { initialized: 'never' }], + 'operator-linebreak': ['error', 'after', { overrides: { '?': 'before', ':': 'before', '|>': 'before' } }], + 'padded-blocks': ['error', { blocks: 'never', switches: 'never', classes: 'never' }], + 'prefer-const': ['error', { destructuring: 'all' }], + 'prefer-promise-reject-errors': 'error', + 'prefer-regex-literals': ['error', { disallowRedundantWrapping: true }], + 'quote-props': ['error', 'as-needed'], + 'quotes': ['error', 'single', { avoidEscape: true, allowTemplateLiterals: false }], + 'rest-spread-spacing': ['error', 'never'], + 'semi': ['error', 'always'], + 'semi-spacing': ['error', { before: false, after: true }], + 'space-before-blocks': ['error', 'always'], + 'space-before-function-paren': ['error', { + 'anonymous': 'always', + 'named': 'never', + 'asyncArrow': 'always', + }], + 'space-in-parens': ['error', 'never'], + 'space-infix-ops': 'error', + 'space-unary-ops': ['error', { words: true, nonwords: false }], + 'spaced-comment': ['error', 'always', { + line: { markers: ['*package', '!', '/', ',', '='] }, + block: { balanced: true, markers: ['*package', '!', ',', ':', '::', 'flow-include'], exceptions: ['*'] }, + }], + 'symbol-description': 'error', + 'template-curly-spacing': ['error', 'never'], + 'template-tag-spacing': ['error', 'never'], + 'unicode-bom': ['error', 'never'], + 'use-isnan': ['error', { + enforceForSwitchCase: true, + enforceForIndexOf: true, + }], + 'valid-typeof': ['error', { requireStringLiterals: true }], + 'wrap-iife': ['error', 'any', { functionPrototypeMethods: true }], + 'yield-star-spacing': ['error', 'both'], + '@typescript-eslint/interface-name-prefix': 'off', + '@typescript-eslint/explicit-function-return-type': 'off', + '@typescript-eslint/explicit-module-boundary-types': 'off', + '@typescript-eslint/no-non-null-assertion': 'off', + '@typescript-eslint/naming-convention': [ + 'error', + { + 'selector': [ + 'classProperty', + 'typeProperty', + 'classMethod', + 'objectLiteralMethod', + 'typeMethod', + 'accessor', + 'enumMember' + ], + 'format': ['strictCamelCase'], + 'modifiers': ['requiresQuotes'], + 'filter': { + 'regex': '^(x-poly-ref|x-unresolved)$', + 'match': false + } + } + ], + + }, + settings: {}, + }, + { + ignores: [ + 'node_modules/**', + 'dist/**', + 'coverage/**', + '*.js', + '*.d.ts', + '.eslintrc.js', + 'scripts/**' + ], + }, + prettier, +]; \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 789c52f..2ee6ae8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,24 +1,24 @@ { "name": "polyapi", - "version": "0.23.20", + "version": "0.23.21", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "polyapi", - "version": "0.23.20", + "version": "0.23.21", "license": "MIT", "dependencies": { "@guanghechen/helper-string": "4.7.1", "@inquirer/prompts": "7.0.1", - "@typescript-eslint/eslint-plugin": "5.62.0", - "@typescript-eslint/parser": "5.62.0", + "@typescript-eslint/eslint-plugin": "8.32.1", + "@typescript-eslint/parser": "8.32.1", "adm-zip": "0.5.16", "axios": "1.8.3", "chalk": "4.1.2", "comment-json": "4.2.3", "dotenv": "16.0.3", - "eslint": "8.57.1", + "eslint": "9.27.0", "eslint-config-prettier": "9.1.0", "eslint-plugin-prettier": "4.2.1", "handlebars": "4.7.7", @@ -33,8 +33,8 @@ "shelljs": "0.8.5", "slugify": "1.6.6", "socket.io-client": "4.7.5", + "ts-json-schema-generator": "2.4.0", "typescript": "5.1.6", - "typescript-json-schema": "0.63.0", "uuid": "9.0.0", "validator": "13.11.0", "yargs": "17.7.1" @@ -54,9 +54,7 @@ "jest-summary-reporter": "0.0.2", "rimraf": "4.4.1", "ts-jest": "29.0.3", - "tsc-alias": "1.8.6", - "tslint": "6.1.3", - "tslint-config-prettier": "1.18.0" + "tsc-alias": "1.8.6" }, "engines": { "node": ">=18.20.5" @@ -657,6 +655,9 @@ "version": "0.8.1", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "optional": true, + "peer": true, "dependencies": { "@jridgewell/trace-mapping": "0.3.9" }, @@ -691,16 +692,51 @@ "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, + "node_modules/@eslint/config-array": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.20.0.tgz", + "integrity": "sha512-fxlS1kkIjx8+vy2SjuCB94q3htSNrufYTXubwiBFeaQHbH6Ipi43gFJq2zCMt6PHhImH3Xmr0NksKDvchWlpQQ==", + "license": "Apache-2.0", + "dependencies": { + "@eslint/object-schema": "^2.1.6", + "debug": "^4.3.1", + "minimatch": "^3.1.2" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/config-helpers": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.2.2.tgz", + "integrity": "sha512-+GPzk8PlG0sPpzdU5ZvIRMPidzAnZDl/s9L+y13iodqvb8leL53bTannOrQ/Im7UkpsmFU5Ily5U60LWixnmLg==", + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/core": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.14.0.tgz", + "integrity": "sha512-qIbV0/JZr7iSDjqAc60IqbLdsj9GDt16xQtWD+B78d/HAlvysGdZZ6rpJHGAc2T0FQx1X6thsSPdnoiGKdNtdg==", + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, "node_modules/@eslint/eslintrc": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", - "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.1.tgz", + "integrity": "sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==", "license": "MIT", "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.6.0", - "globals": "^13.19.0", + "espree": "^10.0.1", + "globals": "^14.0.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", @@ -708,7 +744,7 @@ "strip-json-comments": "^3.1.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" @@ -721,15 +757,12 @@ "license": "Python-2.0" }, "node_modules/@eslint/eslintrc/node_modules/globals": { - "version": "13.24.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", - "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", "license": "MIT", - "dependencies": { - "type-fest": "^0.20.2" - }, "engines": { - "node": ">=8" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -747,25 +780,72 @@ "js-yaml": "bin/js-yaml.js" } }, - "node_modules/@eslint/eslintrc/node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "license": "(MIT OR CC0-1.0)", + "node_modules/@eslint/js": { + "version": "9.27.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.27.0.tgz", + "integrity": "sha512-G5JD9Tu5HJEu4z2Uo4aHY2sLV64B7CDMXxFzqzjl3NKd6RVzSXNoE80jk7Y0lJkTTkjiIhBAqmlYwjuBY3tvpA==", + "license": "MIT", "engines": { - "node": ">=10" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://eslint.org/donate" } }, - "node_modules/@eslint/js": { - "version": "8.57.1", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz", - "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==", + "node_modules/@eslint/object-schema": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.6.tgz", + "integrity": "sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==", + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/plugin-kit": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.3.1.tgz", + "integrity": "sha512-0J+zgWxHN+xXONWIyPWKFMgVuJoZuGiIFu8yxk7RJjxkzpGmyja5wRFqZIVtjDVOQpV+Rw0iOAjYPE2eQyjr0w==", + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.14.0", + "levn": "^0.4.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/plugin-kit/node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": ">= 0.8.0" + } + }, + "node_modules/@eslint/plugin-kit/node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/@eslint/plugin-kit/node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" } }, "node_modules/@guanghechen/helper-string": { @@ -782,19 +862,39 @@ "node": ">= 16.0.0" } }, - "node_modules/@humanwhocodes/config-array": { - "version": "0.13.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz", - "integrity": "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==", - "deprecated": "Use @eslint/config-array instead", + "node_modules/@humanfs/core": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", + "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", + "license": "Apache-2.0", + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node": { + "version": "0.16.6", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.6.tgz", + "integrity": "sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==", "license": "Apache-2.0", "dependencies": { - "@humanwhocodes/object-schema": "^2.0.3", - "debug": "^4.3.1", - "minimatch": "^3.0.5" + "@humanfs/core": "^0.19.1", + "@humanwhocodes/retry": "^0.3.0" }, "engines": { - "node": ">=10.10.0" + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node/node_modules/@humanwhocodes/retry": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz", + "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==", + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" } }, "node_modules/@humanwhocodes/module-importer": { @@ -810,12 +910,18 @@ "url": "https://github.com/sponsors/nzakas" } }, - "node_modules/@humanwhocodes/object-schema": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", - "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", - "deprecated": "Use @eslint/object-schema instead", - "license": "BSD-3-Clause" + "node_modules/@humanwhocodes/retry": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", + "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } }, "node_modules/@inquirer/checkbox": { "version": "4.0.1", @@ -1080,6 +1186,102 @@ "@types/node": ">=18" } }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "license": "ISC", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "license": "MIT" + }, + "node_modules/@isaacs/cliui/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@isaacs/cliui/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, "node_modules/@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", @@ -1462,6 +1664,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "dev": true, "engines": { "node": ">=6.0.0" } @@ -1479,12 +1682,16 @@ "node_modules/@jridgewell/sourcemap-codec": { "version": "1.4.15", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true }, "node_modules/@jridgewell/trace-mapping": { "version": "0.3.9", "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "optional": true, + "peer": true, "dependencies": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" @@ -1562,22 +1769,34 @@ "node_modules/@tsconfig/node10": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", - "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==" + "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", + "dev": true, + "optional": true, + "peer": true }, "node_modules/@tsconfig/node12": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", - "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==" + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "dev": true, + "optional": true, + "peer": true }, "node_modules/@tsconfig/node14": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", - "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==" + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "dev": true, + "optional": true, + "peer": true }, "node_modules/@tsconfig/node16": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", - "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==" + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", + "dev": true, + "optional": true, + "peer": true }, "node_modules/@types/adm-zip": { "version": "0.5.5", @@ -1634,6 +1853,12 @@ "@babel/types": "^7.20.7" } }, + "node_modules/@types/estree": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.7.tgz", + "integrity": "sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ==", + "license": "MIT" + }, "node_modules/@types/graceful-fs": { "version": "4.1.9", "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz", @@ -1704,12 +1929,6 @@ "integrity": "sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA==", "license": "MIT" }, - "node_modules/@types/semver": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.7.0.tgz", - "integrity": "sha512-k107IF4+Xr7UHjwDc7Cfd6PRQfbdkiRabXGRjo07b4WyPahFBZCZ1sE+BNxYIJPPg73UkfOsVOLwqVc/6ETrIA==", - "license": "MIT" - }, "node_modules/@types/stack-utils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz", @@ -1741,98 +1960,78 @@ "license": "MIT" }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz", - "integrity": "sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==", + "version": "8.32.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.32.1.tgz", + "integrity": "sha512-6u6Plg9nP/J1GRpe/vcjjabo6Uc5YQPAMxsgQyGC/I0RuukiG1wIe3+Vtg3IrSCVJDmqK3j8adrtzXSENRtFgg==", "license": "MIT", "dependencies": { - "@eslint-community/regexpp": "^4.4.0", - "@typescript-eslint/scope-manager": "5.62.0", - "@typescript-eslint/type-utils": "5.62.0", - "@typescript-eslint/utils": "5.62.0", - "debug": "^4.3.4", + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "8.32.1", + "@typescript-eslint/type-utils": "8.32.1", + "@typescript-eslint/utils": "8.32.1", + "@typescript-eslint/visitor-keys": "8.32.1", "graphemer": "^1.4.0", - "ignore": "^5.2.0", - "natural-compare-lite": "^1.4.0", - "semver": "^7.3.7", - "tsutils": "^3.21.0" + "ignore": "^7.0.0", + "natural-compare": "^1.4.0", + "ts-api-utils": "^2.1.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^5.0.0", - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.9.0" } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "license": "0BSD" - }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.4.tgz", + "integrity": "sha512-gJzzk+PQNznz8ysRrC0aOkBNVRBDtE1n53IqyqEf3PXrYwomFs5q4pGMizBMJF+ykh03insJ27hB8gSrD2Hn8A==", "license": "MIT", - "dependencies": { - "tslib": "^1.8.1" - }, "engines": { - "node": ">= 6" - }, - "peerDependencies": { - "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + "node": ">= 4" } }, "node_modules/@typescript-eslint/parser": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz", - "integrity": "sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==", - "license": "BSD-2-Clause", + "version": "8.32.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.32.1.tgz", + "integrity": "sha512-LKMrmwCPoLhM45Z00O1ulb6jwyVr2kr3XJp+G+tSEZcbauNnScewcQwtJqXDhXeYPDEjZ8C1SjXm015CirEmGg==", + "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "5.62.0", - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/typescript-estree": "5.62.0", + "@typescript-eslint/scope-manager": "8.32.1", + "@typescript-eslint/types": "8.32.1", + "@typescript-eslint/typescript-estree": "8.32.1", + "@typescript-eslint/visitor-keys": "8.32.1", "debug": "^4.3.4" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.9.0" } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz", - "integrity": "sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==", + "version": "8.32.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.32.1.tgz", + "integrity": "sha512-7IsIaIDeZn7kffk7qXC3o6Z4UblZJKV3UBpkvRNpr5NSyLji7tvTcvmnMNYuYLyh26mN8W723xpo3i4MlD33vA==", "license": "MIT", "dependencies": { - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/visitor-keys": "5.62.0" + "@typescript-eslint/types": "8.32.1", + "@typescript-eslint/visitor-keys": "8.32.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -1840,60 +2039,35 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.62.0.tgz", - "integrity": "sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==", + "version": "8.32.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.32.1.tgz", + "integrity": "sha512-mv9YpQGA8iIsl5KyUPi+FGLm7+bA4fgXaeRcFKRDRwDMu4iwrSHeDPipwueNXhdIIZltwCJv+NkxftECbIZWfA==", "license": "MIT", "dependencies": { - "@typescript-eslint/typescript-estree": "5.62.0", - "@typescript-eslint/utils": "5.62.0", + "@typescript-eslint/typescript-estree": "8.32.1", + "@typescript-eslint/utils": "8.32.1", "debug": "^4.3.4", - "tsutils": "^3.21.0" + "ts-api-utils": "^2.1.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "*" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/type-utils/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "license": "0BSD" - }, - "node_modules/@typescript-eslint/type-utils/node_modules/tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "license": "MIT", - "dependencies": { - "tslib": "^1.8.1" - }, - "engines": { - "node": ">= 6" - }, - "peerDependencies": { - "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.9.0" } }, "node_modules/@typescript-eslint/types": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz", - "integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==", + "version": "8.32.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.32.1.tgz", + "integrity": "sha512-YmybwXUJcgGqgAp6bEsgpPXEg6dcCyPyCSr0CAAueacR/CCBi25G3V8gGQ2kRzQRBNol7VQknxMs9HvVa9Rvfg==", "license": "MIT", "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", @@ -1901,119 +2075,124 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz", - "integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==", - "license": "BSD-2-Clause", + "version": "8.32.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.32.1.tgz", + "integrity": "sha512-Y3AP9EIfYwBb4kWGb+simvPaqQoT5oJuzzj9m0i6FCY6SPvlomY2Ei4UEMm7+FXtlNJbor80ximyslzaQF6xhg==", + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/visitor-keys": "5.62.0", + "@typescript-eslint/types": "8.32.1", + "@typescript-eslint/visitor-keys": "8.32.1", "debug": "^4.3.4", - "globby": "^11.1.0", + "fast-glob": "^3.3.2", "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^2.1.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "peerDependencies": { + "typescript": ">=4.8.4 <5.9.0" } }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "license": "0BSD" - }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "license": "MIT", "dependencies": { - "tslib": "^1.8.1" + "balanced-match": "^1.0.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" }, "engines": { - "node": ">= 6" + "node": ">=16 || 14 >=14.17" }, - "peerDependencies": { - "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", + "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" } }, "node_modules/@typescript-eslint/utils": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.62.0.tgz", - "integrity": "sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==", + "version": "8.32.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.32.1.tgz", + "integrity": "sha512-DsSFNIgLSrc89gpq1LJB7Hm1YpuhK086DRDJSNrewcGvYloWW1vZLHBTIvarKZDcAORIy/uWNx8Gad+4oMpkSA==", "license": "MIT", "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", - "@types/json-schema": "^7.0.9", - "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.62.0", - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/typescript-estree": "5.62.0", - "eslint-scope": "^5.1.1", - "semver": "^7.3.7" + "@eslint-community/eslint-utils": "^4.7.0", + "@typescript-eslint/scope-manager": "8.32.1", + "@typescript-eslint/types": "8.32.1", + "@typescript-eslint/typescript-estree": "8.32.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, - "node_modules/@typescript-eslint/utils/node_modules/eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "license": "BSD-2-Clause", - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - }, - "engines": { - "node": ">=8.0.0" + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.9.0" } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz", - "integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==", + "version": "8.32.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.32.1.tgz", + "integrity": "sha512-ar0tjQfObzhSaW3C3QNmTc5ofj0hDoNQ5XWrCy6zDyabdr0TWhCkClp+rywGNj/odAFBVzzJrK4tEq5M4Hmu4w==", "license": "MIT", "dependencies": { - "@typescript-eslint/types": "5.62.0", - "eslint-visitor-keys": "^3.3.0" + "@typescript-eslint/types": "8.32.1", + "eslint-visitor-keys": "^4.2.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@ungap/structured-clone": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz", - "integrity": "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==", - "license": "ISC" + "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } }, "node_modules/acorn": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", - "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", + "version": "8.14.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz", + "integrity": "sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==", + "license": "MIT", "bin": { "acorn": "bin/acorn" }, @@ -2034,6 +2213,9 @@ "version": "8.2.0", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "dev": true, + "optional": true, + "peer": true, "engines": { "node": ">=0.4.0" } @@ -2126,7 +2308,10 @@ "node_modules/arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", - "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==" + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true, + "optional": true, + "peer": true }, "node_modules/argparse": { "version": "1.0.10", @@ -2146,6 +2331,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, "engines": { "node": ">=8" } @@ -2385,18 +2571,9 @@ "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/builtin-modules": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", - "integrity": "sha512-wxXCdllwGhI2kCC0MnvTGYTMvnVZTvqgypkiTI8Pa5tcz2i6VqsqwYGgqwXji+4RgCzms6EajE4IxiUH6HH8nQ==", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true, - "engines": { - "node": ">=0.10.0" - } + "license": "MIT" }, "node_modules/callsites": { "version": "3.1.0", @@ -2614,12 +2791,6 @@ "node": ">= 0.8" } }, - "node_modules/commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true - }, "node_modules/comment-json": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/comment-json/-/comment-json-4.2.3.tgz", @@ -2744,7 +2915,10 @@ "node_modules/create-require": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", - "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==" + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true, + "optional": true, + "peer": true }, "node_modules/cross-spawn": { "version": "7.0.6", @@ -2828,6 +3002,9 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true, + "optional": true, + "peer": true, "engines": { "node": ">=0.3.1" } @@ -2846,6 +3023,7 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, "dependencies": { "path-type": "^4.0.0" }, @@ -2853,18 +3031,6 @@ "node": ">=8" } }, - "node_modules/doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "license": "Apache-2.0", - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/dot-case": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz", @@ -2882,6 +3048,12 @@ "node": ">=12" } }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "license": "MIT" + }, "node_modules/electron-to-chromium": { "version": "1.5.118", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.118.tgz", @@ -2977,59 +3149,63 @@ } }, "node_modules/eslint": { - "version": "8.57.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz", - "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", - "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", + "version": "9.27.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.27.0.tgz", + "integrity": "sha512-ixRawFQuMB9DZ7fjU3iGGganFDp3+45bPOdaRurcFHSXO1e/sYwUX/FtQZpLZJR6SjMoJH8hR2pPEAfDyCoU2Q==", "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.57.1", - "@humanwhocodes/config-array": "^0.13.0", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.20.0", + "@eslint/config-helpers": "^0.2.1", + "@eslint/core": "^0.14.0", + "@eslint/eslintrc": "^3.3.1", + "@eslint/js": "9.27.0", + "@eslint/plugin-kit": "^0.3.1", + "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", - "@nodelib/fs.walk": "^1.2.8", - "@ungap/structured-clone": "^1.2.0", + "@humanwhocodes/retry": "^0.4.2", + "@types/estree": "^1.0.6", + "@types/json-schema": "^7.0.15", "ajv": "^6.12.4", "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", + "cross-spawn": "^7.0.6", "debug": "^4.3.2", - "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.2.2", - "eslint-visitor-keys": "^3.4.3", - "espree": "^9.6.1", - "esquery": "^1.4.2", + "eslint-scope": "^8.3.0", + "eslint-visitor-keys": "^4.2.0", + "espree": "^10.3.0", + "esquery": "^1.5.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", + "file-entry-cache": "^8.0.0", "find-up": "^5.0.0", "glob-parent": "^6.0.2", - "globals": "^13.19.0", - "graphemer": "^1.4.0", "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", - "is-path-inside": "^3.0.3", - "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.3", - "strip-ansi": "^6.0.1", - "text-table": "^0.2.0" + "optionator": "^0.9.3" }, "bin": { "eslint": "bin/eslint.js" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://opencollective.com/eslint" + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } } }, "node_modules/eslint-config-prettier": { @@ -3066,16 +3242,16 @@ } }, "node_modules/eslint-scope": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", - "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.3.0.tgz", + "integrity": "sha512-pUNxi75F8MJ/GdeKtVLSbYg4ZI34J6C0C7sbL4YOp2exGwen7ZsuBqKzUhXd0qMQ362yET3z+uPwKeg/0C2XCQ==", "license": "BSD-2-Clause", "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" @@ -3102,12 +3278,6 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/eslint/node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "license": "Python-2.0" - }, "node_modules/eslint/node_modules/escape-string-regexp": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", @@ -3120,6 +3290,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/eslint/node_modules/eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/eslint/node_modules/find-up": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", @@ -3148,33 +3330,6 @@ "node": ">=10.13.0" } }, - "node_modules/eslint/node_modules/globals": { - "version": "13.24.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", - "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", - "license": "MIT", - "dependencies": { - "type-fest": "^0.20.2" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/eslint/node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "license": "MIT", - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, "node_modules/eslint/node_modules/levn": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", @@ -3256,30 +3411,30 @@ "node": ">= 0.8.0" } }, - "node_modules/eslint/node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "license": "(MIT OR CC0-1.0)", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/espree": { - "version": "9.6.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", - "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz", + "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==", "license": "BSD-2-Clause", "dependencies": { - "acorn": "^8.9.0", + "acorn": "^8.14.0", "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.4.1" + "eslint-visitor-keys": "^4.2.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/espree/node_modules/eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" @@ -3431,15 +3586,16 @@ "license": "Apache-2.0" }, "node_modules/fast-glob": { - "version": "3.2.12", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", - "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", + "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", + "license": "MIT", "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", "glob-parent": "^5.1.2", "merge2": "^1.3.0", - "micromatch": "^4.0.4" + "micromatch": "^4.0.8" }, "engines": { "node": ">=8.6.0" @@ -3475,15 +3631,15 @@ } }, "node_modules/file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", "license": "MIT", "dependencies": { - "flat-cache": "^3.0.4" + "flat-cache": "^4.0.0" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": ">=16.0.0" } }, "node_modules/fill-range": { @@ -3512,33 +3668,16 @@ } }, "node_modules/flat-cache": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", - "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", "license": "MIT", "dependencies": { "flatted": "^3.2.9", - "keyv": "^4.5.3", - "rimraf": "^3.0.2" + "keyv": "^4.5.4" }, "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/flat-cache/node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "deprecated": "Rimraf versions prior to v4 are no longer supported", - "license": "ISC", - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "node": ">=16" } }, "node_modules/flatted": { @@ -3566,6 +3705,34 @@ } } }, + "node_modules/foreground-child": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", + "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.6", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/foreground-child/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/form-data": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", @@ -3688,6 +3855,7 @@ "version": "11.1.0", "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, "dependencies": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", @@ -3998,15 +4166,6 @@ "node": ">=0.12.0" } }, - "node_modules/is-path-inside": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/is-stream": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", @@ -4103,6 +4262,21 @@ "node": ">=8" } }, + "node_modules/jackspeak": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.1.1.tgz", + "integrity": "sha512-zptv57P3GpL+O0I7VdMJNBZCu+BPHVQUk55Ft8/QCJjTVxrnJHuVuX/0Bl2A6/+2oyR/ZMEuFKwmzqqZ/U5nPQ==", + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/jest": { "version": "29.3.1", "resolved": "https://registry.npmjs.org/jest/-/jest-29.3.1.tgz", @@ -4878,7 +5052,6 @@ "version": "2.2.3", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", - "dev": true, "license": "MIT", "bin": { "json5": "lib/cli.js" @@ -5021,7 +5194,8 @@ "node_modules/make-error": { "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", - "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==" + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true }, "node_modules/makeerror": { "version": "1.0.12", @@ -5153,12 +5327,6 @@ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "license": "MIT" }, - "node_modules/natural-compare-lite": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", - "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", - "license": "MIT" - }, "node_modules/neo-async": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", @@ -5201,7 +5369,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -5321,6 +5488,12 @@ "node": ">=6" } }, + "node_modules/package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + "license": "BlueOak-1.0.0" + }, "node_modules/param-case": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/param-case/-/param-case-3.0.4.tgz", @@ -5379,11 +5552,6 @@ "tslib": "^2.0.3" } }, - "node_modules/path-equal": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/path-equal/-/path-equal-1.2.5.tgz", - "integrity": "sha512-i73IctDr3F2W+bsOWDyyVm/lqsXO47aY9nsFZUjTT/aljSbkxHxxCoyZ9UUrM8jK0JVod+An+rl48RCsvWM+9g==" - }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -5444,6 +5612,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, "engines": { "node": ">=8" } @@ -5835,9 +6004,10 @@ } }, "node_modules/safe-stable-stringify": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.4.3.tgz", - "integrity": "sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.5.0.tgz", + "integrity": "sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==", + "license": "MIT", "engines": { "node": ">=10" } @@ -5937,6 +6107,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, "engines": { "node": ">=8" } @@ -6073,6 +6244,21 @@ "node": ">=8" } }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -6084,6 +6270,19 @@ "node": ">=8" } }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/strip-bom": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", @@ -6153,12 +6352,6 @@ "node": ">=8" } }, - "node_modules/text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "license": "MIT" - }, "node_modules/through2": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", @@ -6278,6 +6471,18 @@ "node": ">=8.0" } }, + "node_modules/ts-api-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.1.0.tgz", + "integrity": "sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==", + "license": "MIT", + "engines": { + "node": ">=18.12" + }, + "peerDependencies": { + "typescript": ">=4.8.4" + } + }, "node_modules/ts-jest": { "version": "29.0.3", "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.0.3.tgz", @@ -6322,10 +6527,138 @@ } } }, + "node_modules/ts-json-schema-generator": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/ts-json-schema-generator/-/ts-json-schema-generator-2.4.0.tgz", + "integrity": "sha512-HbmNsgs58CfdJq0gpteRTxPXG26zumezOs+SB9tgky6MpqiFgQwieCn2MW70+sxpHouZ/w9LW0V6L4ZQO4y1Ug==", + "license": "MIT", + "dependencies": { + "@types/json-schema": "^7.0.15", + "commander": "^13.1.0", + "glob": "^11.0.1", + "json5": "^2.2.3", + "normalize-path": "^3.0.0", + "safe-stable-stringify": "^2.5.0", + "tslib": "^2.8.1", + "typescript": "^5.8.2" + }, + "bin": { + "ts-json-schema-generator": "bin/ts-json-schema-generator.js" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/ts-json-schema-generator/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/ts-json-schema-generator/node_modules/commander": { + "version": "13.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-13.1.0.tgz", + "integrity": "sha512-/rFeCpNJQbhSZjGVwO9RFV3xPqbnERS8MmIQzCtD/zl6gpJuV/bMLuN92oG3F7d8oDEHHRrujSXNUr8fpjntKw==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/ts-json-schema-generator/node_modules/glob": { + "version": "11.0.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.2.tgz", + "integrity": "sha512-YT7U7Vye+t5fZ/QMkBFrTJ7ZQxInIUjwyAjVj84CYXqgBdv30MFUPGnBR6sQaVq6Is15wYJUsnzTuWaGRBhBAQ==", + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^4.0.1", + "minimatch": "^10.0.0", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^2.0.0" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/ts-json-schema-generator/node_modules/lru-cache": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.1.0.tgz", + "integrity": "sha512-QIXZUBJUx+2zHUdQujWejBkcD9+cs94tLn0+YL8UrCh+D5sCXZ4c7LaEH48pNwRY3MLDgqUFyhlCyjJPf1WP0A==", + "license": "ISC", + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/ts-json-schema-generator/node_modules/minimatch": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.1.tgz", + "integrity": "sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/ts-json-schema-generator/node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/ts-json-schema-generator/node_modules/path-scurry": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz", + "integrity": "sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==", + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^11.0.0", + "minipass": "^7.1.2" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/ts-json-schema-generator/node_modules/typescript": { + "version": "5.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", + "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, "node_modules/ts-node": { "version": "10.9.1", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", + "dev": true, + "optional": true, + "peer": true, "dependencies": { "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", @@ -6391,159 +6724,10 @@ } }, "node_modules/tslib": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", - "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==" - }, - "node_modules/tslint": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/tslint/-/tslint-6.1.3.tgz", - "integrity": "sha512-IbR4nkT96EQOvKE2PW/djGz8iGNeJ4rF2mBfiYaR/nvUWYKJhLwimoJKgjIFEIDibBtOevj7BqCRL4oHeWWUCg==", - "deprecated": "TSLint has been deprecated in favor of ESLint. Please see https://github.com/palantir/tslint/issues/4534 for more information.", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.0.0", - "builtin-modules": "^1.1.1", - "chalk": "^2.3.0", - "commander": "^2.12.1", - "diff": "^4.0.1", - "glob": "^7.1.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", - "mkdirp": "^0.5.3", - "resolve": "^1.3.2", - "semver": "^5.3.0", - "tslib": "^1.13.0", - "tsutils": "^2.29.0" - }, - "bin": { - "tslint": "bin/tslint" - }, - "engines": { - "node": ">=4.8.0" - }, - "peerDependencies": { - "typescript": ">=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev || >=3.0.0-dev || >= 3.1.0-dev || >= 3.2.0-dev || >= 4.0.0-dev" - } - }, - "node_modules/tslint-config-prettier": { - "version": "1.18.0", - "resolved": "https://registry.npmjs.org/tslint-config-prettier/-/tslint-config-prettier-1.18.0.tgz", - "integrity": "sha512-xPw9PgNPLG3iKRxmK7DWr+Ea/SzrvfHtjFt5LBl61gk2UBG/DB9kCXRjv+xyIU1rUtnayLeMUVJBcMX8Z17nDg==", - "dev": true, - "bin": { - "tslint-config-prettier-check": "bin/check.js" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/tslint/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/tslint/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/tslint/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/tslint/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "node_modules/tslint/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/tslint/node_modules/mkdirp": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", - "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", - "dev": true, - "dependencies": { - "minimist": "^1.2.6" - }, - "bin": { - "mkdirp": "bin/cmd.js" - } - }, - "node_modules/tslint/node_modules/semver": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", - "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", - "dev": true, - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/tslint/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/tslint/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, - "node_modules/tsutils": { - "version": "2.29.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", - "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", - "dev": true, - "dependencies": { - "tslib": "^1.8.1" - }, - "peerDependencies": { - "typescript": ">=2.1.0 || >=2.1.0-dev || >=2.2.0-dev || >=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev || >= 3.0.0-dev || >= 3.1.0-dev" - } - }, - "node_modules/tsutils/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" }, "node_modules/type-check": { "version": "0.3.2", @@ -6581,6 +6765,7 @@ "version": "5.1.6", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", + "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -6589,29 +6774,6 @@ "node": ">=14.17" } }, - "node_modules/typescript-json-schema": { - "version": "0.63.0", - "resolved": "https://registry.npmjs.org/typescript-json-schema/-/typescript-json-schema-0.63.0.tgz", - "integrity": "sha512-vBfMBq4U/rZ5FIRi7u4o/YAdeRHsSabdGHogUlCPi0cYU0CGvS4Bdu8bSzyUsF+Kf5PTQUGh2TictJuQTDK6eQ==", - "dependencies": { - "@types/json-schema": "^7.0.9", - "@types/node": "^16.9.2", - "glob": "^7.1.7", - "path-equal": "^1.2.5", - "safe-stable-stringify": "^2.2.0", - "ts-node": "^10.9.1", - "typescript": "~5.1.0", - "yargs": "^17.1.1" - }, - "bin": { - "typescript-json-schema": "bin/typescript-json-schema" - } - }, - "node_modules/typescript-json-schema/node_modules/@types/node": { - "version": "16.18.54", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.54.tgz", - "integrity": "sha512-oTmGy68gxZZ21FhTJVVvZBYpQHEBZxHKTsGshobMqm9qWpbqdZsA5jvsuPZcHu0KwpmLrOHWPdEfg7XDpNT9UA==" - }, "node_modules/uglify-js": { "version": "3.17.4", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz", @@ -6711,7 +6873,10 @@ "node_modules/v8-compile-cache-lib": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", - "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==" + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "dev": true, + "optional": true, + "peer": true }, "node_modules/v8-to-istanbul": { "version": "9.3.0", @@ -6801,6 +6966,24 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -6899,6 +7082,9 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true, + "optional": true, + "peer": true, "engines": { "node": ">=6" } @@ -7347,6 +7533,9 @@ "version": "0.8.1", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "optional": true, + "peer": true, "requires": { "@jridgewell/trace-mapping": "0.3.9" } @@ -7364,15 +7553,38 @@ "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==" }, + "@eslint/config-array": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.20.0.tgz", + "integrity": "sha512-fxlS1kkIjx8+vy2SjuCB94q3htSNrufYTXubwiBFeaQHbH6Ipi43gFJq2zCMt6PHhImH3Xmr0NksKDvchWlpQQ==", + "requires": { + "@eslint/object-schema": "^2.1.6", + "debug": "^4.3.1", + "minimatch": "^3.1.2" + } + }, + "@eslint/config-helpers": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.2.2.tgz", + "integrity": "sha512-+GPzk8PlG0sPpzdU5ZvIRMPidzAnZDl/s9L+y13iodqvb8leL53bTannOrQ/Im7UkpsmFU5Ily5U60LWixnmLg==" + }, + "@eslint/core": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.14.0.tgz", + "integrity": "sha512-qIbV0/JZr7iSDjqAc60IqbLdsj9GDt16xQtWD+B78d/HAlvysGdZZ6rpJHGAc2T0FQx1X6thsSPdnoiGKdNtdg==", + "requires": { + "@types/json-schema": "^7.0.15" + } + }, "@eslint/eslintrc": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", - "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.1.tgz", + "integrity": "sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==", "requires": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.6.0", - "globals": "^13.19.0", + "espree": "^10.0.1", + "globals": "^14.0.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", @@ -7386,12 +7598,9 @@ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" }, "globals": { - "version": "13.24.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", - "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", - "requires": { - "type-fest": "^0.20.2" - } + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==" }, "js-yaml": { "version": "4.1.0", @@ -7400,18 +7609,51 @@ "requires": { "argparse": "^2.0.1" } - }, - "type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==" } } }, "@eslint/js": { - "version": "8.57.1", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz", - "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==" + "version": "9.27.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.27.0.tgz", + "integrity": "sha512-G5JD9Tu5HJEu4z2Uo4aHY2sLV64B7CDMXxFzqzjl3NKd6RVzSXNoE80jk7Y0lJkTTkjiIhBAqmlYwjuBY3tvpA==" + }, + "@eslint/object-schema": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.6.tgz", + "integrity": "sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==" + }, + "@eslint/plugin-kit": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.3.1.tgz", + "integrity": "sha512-0J+zgWxHN+xXONWIyPWKFMgVuJoZuGiIFu8yxk7RJjxkzpGmyja5wRFqZIVtjDVOQpV+Rw0iOAjYPE2eQyjr0w==", + "requires": { + "@eslint/core": "^0.14.0", + "levn": "^0.4.1" + }, + "dependencies": { + "levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==" + }, + "type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "requires": { + "prelude-ls": "^1.2.1" + } + } + } }, "@guanghechen/helper-string": { "version": "4.7.1", @@ -7424,14 +7666,25 @@ "upper-case": "^2.0.2" } }, - "@humanwhocodes/config-array": { - "version": "0.13.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz", - "integrity": "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==", + "@humanfs/core": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", + "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==" + }, + "@humanfs/node": { + "version": "0.16.6", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.6.tgz", + "integrity": "sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==", "requires": { - "@humanwhocodes/object-schema": "^2.0.3", - "debug": "^4.3.1", - "minimatch": "^3.0.5" + "@humanfs/core": "^0.19.1", + "@humanwhocodes/retry": "^0.3.0" + }, + "dependencies": { + "@humanwhocodes/retry": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz", + "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==" + } } }, "@humanwhocodes/module-importer": { @@ -7439,10 +7692,10 @@ "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==" }, - "@humanwhocodes/object-schema": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", - "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==" + "@humanwhocodes/retry": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", + "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==" }, "@inquirer/checkbox": { "version": "4.0.1", @@ -7617,6 +7870,64 @@ "integrity": "sha512-YYykfbw/lefC7yKj7nanzQXILM7r3suIvyFlCcMskc99axmsSewXWkAfXKwMbgxL76iAFVmRwmYdwNZNc8gjog==", "requires": {} }, + "@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "requires": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==" + }, + "ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==" + }, + "emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" + }, + "string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "requires": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + } + }, + "strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "requires": { + "ansi-regex": "^6.0.1" + } + }, + "wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "requires": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + } + } + } + }, "@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", @@ -7918,7 +8229,8 @@ "@jridgewell/resolve-uri": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", - "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==" + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "dev": true }, "@jridgewell/set-array": { "version": "1.2.1", @@ -7929,12 +8241,16 @@ "@jridgewell/sourcemap-codec": { "version": "1.4.15", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true }, "@jridgewell/trace-mapping": { "version": "0.3.9", "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "optional": true, + "peer": true, "requires": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" @@ -8000,22 +8316,34 @@ "@tsconfig/node10": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", - "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==" + "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", + "dev": true, + "optional": true, + "peer": true }, "@tsconfig/node12": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", - "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==" + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "dev": true, + "optional": true, + "peer": true }, "@tsconfig/node14": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", - "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==" + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "dev": true, + "optional": true, + "peer": true }, "@tsconfig/node16": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", - "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==" + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", + "dev": true, + "optional": true, + "peer": true }, "@types/adm-zip": { "version": "0.5.5", @@ -8067,6 +8395,11 @@ "@babel/types": "^7.20.7" } }, + "@types/estree": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.7.tgz", + "integrity": "sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ==" + }, "@types/graceful-fs": { "version": "4.1.9", "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz", @@ -8131,11 +8464,6 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.18.tgz", "integrity": "sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA==" }, - "@types/semver": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.7.0.tgz", - "integrity": "sha512-k107IF4+Xr7UHjwDc7Cfd6PRQfbdkiRabXGRjo07b4WyPahFBZCZ1sE+BNxYIJPPg73UkfOsVOLwqVc/6ETrIA==" - }, "@types/stack-utils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz", @@ -8164,161 +8492,134 @@ "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz", - "integrity": "sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==", - "requires": { - "@eslint-community/regexpp": "^4.4.0", - "@typescript-eslint/scope-manager": "5.62.0", - "@typescript-eslint/type-utils": "5.62.0", - "@typescript-eslint/utils": "5.62.0", - "debug": "^4.3.4", + "version": "8.32.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.32.1.tgz", + "integrity": "sha512-6u6Plg9nP/J1GRpe/vcjjabo6Uc5YQPAMxsgQyGC/I0RuukiG1wIe3+Vtg3IrSCVJDmqK3j8adrtzXSENRtFgg==", + "requires": { + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "8.32.1", + "@typescript-eslint/type-utils": "8.32.1", + "@typescript-eslint/utils": "8.32.1", + "@typescript-eslint/visitor-keys": "8.32.1", "graphemer": "^1.4.0", - "ignore": "^5.2.0", - "natural-compare-lite": "^1.4.0", - "semver": "^7.3.7", - "tsutils": "^3.21.0" + "ignore": "^7.0.0", + "natural-compare": "^1.4.0", + "ts-api-utils": "^2.1.0" }, "dependencies": { - "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" - }, - "tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "requires": { - "tslib": "^1.8.1" - } + "ignore": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.4.tgz", + "integrity": "sha512-gJzzk+PQNznz8ysRrC0aOkBNVRBDtE1n53IqyqEf3PXrYwomFs5q4pGMizBMJF+ykh03insJ27hB8gSrD2Hn8A==" } } }, "@typescript-eslint/parser": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz", - "integrity": "sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==", - "requires": { - "@typescript-eslint/scope-manager": "5.62.0", - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/typescript-estree": "5.62.0", + "version": "8.32.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.32.1.tgz", + "integrity": "sha512-LKMrmwCPoLhM45Z00O1ulb6jwyVr2kr3XJp+G+tSEZcbauNnScewcQwtJqXDhXeYPDEjZ8C1SjXm015CirEmGg==", + "requires": { + "@typescript-eslint/scope-manager": "8.32.1", + "@typescript-eslint/types": "8.32.1", + "@typescript-eslint/typescript-estree": "8.32.1", + "@typescript-eslint/visitor-keys": "8.32.1", "debug": "^4.3.4" } }, "@typescript-eslint/scope-manager": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz", - "integrity": "sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==", + "version": "8.32.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.32.1.tgz", + "integrity": "sha512-7IsIaIDeZn7kffk7qXC3o6Z4UblZJKV3UBpkvRNpr5NSyLji7tvTcvmnMNYuYLyh26mN8W723xpo3i4MlD33vA==", "requires": { - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/visitor-keys": "5.62.0" + "@typescript-eslint/types": "8.32.1", + "@typescript-eslint/visitor-keys": "8.32.1" } }, "@typescript-eslint/type-utils": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.62.0.tgz", - "integrity": "sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==", + "version": "8.32.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.32.1.tgz", + "integrity": "sha512-mv9YpQGA8iIsl5KyUPi+FGLm7+bA4fgXaeRcFKRDRwDMu4iwrSHeDPipwueNXhdIIZltwCJv+NkxftECbIZWfA==", "requires": { - "@typescript-eslint/typescript-estree": "5.62.0", - "@typescript-eslint/utils": "5.62.0", + "@typescript-eslint/typescript-estree": "8.32.1", + "@typescript-eslint/utils": "8.32.1", "debug": "^4.3.4", - "tsutils": "^3.21.0" - }, - "dependencies": { - "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" - }, - "tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "requires": { - "tslib": "^1.8.1" - } - } + "ts-api-utils": "^2.1.0" } }, "@typescript-eslint/types": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz", - "integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==" + "version": "8.32.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.32.1.tgz", + "integrity": "sha512-YmybwXUJcgGqgAp6bEsgpPXEg6dcCyPyCSr0CAAueacR/CCBi25G3V8gGQ2kRzQRBNol7VQknxMs9HvVa9Rvfg==" }, "@typescript-eslint/typescript-estree": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz", - "integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==", + "version": "8.32.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.32.1.tgz", + "integrity": "sha512-Y3AP9EIfYwBb4kWGb+simvPaqQoT5oJuzzj9m0i6FCY6SPvlomY2Ei4UEMm7+FXtlNJbor80ximyslzaQF6xhg==", "requires": { - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/visitor-keys": "5.62.0", + "@typescript-eslint/types": "8.32.1", + "@typescript-eslint/visitor-keys": "8.32.1", "debug": "^4.3.4", - "globby": "^11.1.0", + "fast-glob": "^3.3.2", "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^2.1.0" }, "dependencies": { - "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "requires": { + "balanced-match": "^1.0.0" + } }, - "tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "requires": { - "tslib": "^1.8.1" + "brace-expansion": "^2.0.1" } + }, + "semver": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", + "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==" } } }, "@typescript-eslint/utils": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.62.0.tgz", - "integrity": "sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==", + "version": "8.32.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.32.1.tgz", + "integrity": "sha512-DsSFNIgLSrc89gpq1LJB7Hm1YpuhK086DRDJSNrewcGvYloWW1vZLHBTIvarKZDcAORIy/uWNx8Gad+4oMpkSA==", "requires": { - "@eslint-community/eslint-utils": "^4.2.0", - "@types/json-schema": "^7.0.9", - "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.62.0", - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/typescript-estree": "5.62.0", - "eslint-scope": "^5.1.1", - "semver": "^7.3.7" - }, - "dependencies": { - "eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "requires": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - } - } + "@eslint-community/eslint-utils": "^4.7.0", + "@typescript-eslint/scope-manager": "8.32.1", + "@typescript-eslint/types": "8.32.1", + "@typescript-eslint/typescript-estree": "8.32.1" } }, "@typescript-eslint/visitor-keys": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz", - "integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==", + "version": "8.32.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.32.1.tgz", + "integrity": "sha512-ar0tjQfObzhSaW3C3QNmTc5ofj0hDoNQ5XWrCy6zDyabdr0TWhCkClp+rywGNj/odAFBVzzJrK4tEq5M4Hmu4w==", "requires": { - "@typescript-eslint/types": "5.62.0", - "eslint-visitor-keys": "^3.3.0" + "@typescript-eslint/types": "8.32.1", + "eslint-visitor-keys": "^4.2.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==" + } } }, - "@ungap/structured-clone": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz", - "integrity": "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==" - }, "acorn": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", - "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==" + "version": "8.14.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz", + "integrity": "sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==" }, "acorn-jsx": { "version": "5.3.2", @@ -8329,7 +8630,10 @@ "acorn-walk": { "version": "8.2.0", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", - "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==" + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "dev": true, + "optional": true, + "peer": true }, "adm-zip": { "version": "0.5.16", @@ -8389,7 +8693,10 @@ "arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", - "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==" + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true, + "optional": true, + "peer": true }, "argparse": { "version": "1.0.10", @@ -8408,7 +8715,8 @@ "array-union": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==" + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true }, "asynckit": { "version": "0.4.0", @@ -8583,12 +8891,6 @@ "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true }, - "builtin-modules": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", - "integrity": "sha512-wxXCdllwGhI2kCC0MnvTGYTMvnVZTvqgypkiTI8Pa5tcz2i6VqsqwYGgqwXji+4RgCzms6EajE4IxiUH6HH8nQ==", - "dev": true - }, "callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -8735,12 +9037,6 @@ "delayed-stream": "~1.0.0" } }, - "commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true - }, "comment-json": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/comment-json/-/comment-json-4.2.3.tgz", @@ -8846,7 +9142,10 @@ "create-require": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", - "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==" + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true, + "optional": true, + "peer": true }, "cross-spawn": { "version": "7.0.6", @@ -8898,7 +9197,10 @@ "diff": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==" + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true, + "optional": true, + "peer": true }, "diff-sequences": { "version": "29.6.3", @@ -8910,18 +9212,11 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, "requires": { "path-type": "^4.0.0" } }, - "doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "requires": { - "esutils": "^2.0.2" - } - }, "dot-case": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz", @@ -8936,6 +9231,11 @@ "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz", "integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==" }, + "eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" + }, "electron-to-chromium": { "version": "1.5.118", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.118.tgz", @@ -9003,60 +9303,57 @@ } }, "eslint": { - "version": "8.57.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz", - "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", + "version": "9.27.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.27.0.tgz", + "integrity": "sha512-ixRawFQuMB9DZ7fjU3iGGganFDp3+45bPOdaRurcFHSXO1e/sYwUX/FtQZpLZJR6SjMoJH8hR2pPEAfDyCoU2Q==", "requires": { "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.57.1", - "@humanwhocodes/config-array": "^0.13.0", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.20.0", + "@eslint/config-helpers": "^0.2.1", + "@eslint/core": "^0.14.0", + "@eslint/eslintrc": "^3.3.1", + "@eslint/js": "9.27.0", + "@eslint/plugin-kit": "^0.3.1", + "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", - "@nodelib/fs.walk": "^1.2.8", - "@ungap/structured-clone": "^1.2.0", + "@humanwhocodes/retry": "^0.4.2", + "@types/estree": "^1.0.6", + "@types/json-schema": "^7.0.15", "ajv": "^6.12.4", "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", + "cross-spawn": "^7.0.6", "debug": "^4.3.2", - "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.2.2", - "eslint-visitor-keys": "^3.4.3", - "espree": "^9.6.1", - "esquery": "^1.4.2", + "eslint-scope": "^8.3.0", + "eslint-visitor-keys": "^4.2.0", + "espree": "^10.3.0", + "esquery": "^1.5.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", + "file-entry-cache": "^8.0.0", "find-up": "^5.0.0", "glob-parent": "^6.0.2", - "globals": "^13.19.0", - "graphemer": "^1.4.0", "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", - "is-path-inside": "^3.0.3", - "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.3", - "strip-ansi": "^6.0.1", - "text-table": "^0.2.0" + "optionator": "^0.9.3" }, "dependencies": { - "argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" - }, "escape-string-regexp": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==" }, + "eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==" + }, "find-up": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", @@ -9074,22 +9371,6 @@ "is-glob": "^4.0.3" } }, - "globals": { - "version": "13.24.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", - "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", - "requires": { - "type-fest": "^0.20.2" - } - }, - "js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "requires": { - "argparse": "^2.0.1" - } - }, "levn": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", @@ -9140,11 +9421,6 @@ "requires": { "prelude-ls": "^1.2.1" } - }, - "type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==" } } }, @@ -9163,9 +9439,9 @@ } }, "eslint-scope": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", - "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.3.0.tgz", + "integrity": "sha512-pUNxi75F8MJ/GdeKtVLSbYg4ZI34J6C0C7sbL4YOp2exGwen7ZsuBqKzUhXd0qMQ362yET3z+uPwKeg/0C2XCQ==", "requires": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" @@ -9184,13 +9460,20 @@ "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==" }, "espree": { - "version": "9.6.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", - "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz", + "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==", "requires": { - "acorn": "^8.9.0", + "acorn": "^8.14.0", "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.4.1" + "eslint-visitor-keys": "^4.2.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==" + } } }, "esprima": { @@ -9295,15 +9578,15 @@ "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==" }, "fast-glob": { - "version": "3.2.12", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", - "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", + "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", "requires": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", "glob-parent": "^5.1.2", "merge2": "^1.3.0", - "micromatch": "^4.0.4" + "micromatch": "^4.0.8" } }, "fast-json-stable-stringify": { @@ -9334,11 +9617,11 @@ } }, "file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", "requires": { - "flat-cache": "^3.0.4" + "flat-cache": "^4.0.0" } }, "fill-range": { @@ -9360,23 +9643,12 @@ } }, "flat-cache": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", - "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", "requires": { "flatted": "^3.2.9", - "keyv": "^4.5.3", - "rimraf": "^3.0.2" - }, - "dependencies": { - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "requires": { - "glob": "^7.1.3" - } - } + "keyv": "^4.5.4" } }, "flatted": { @@ -9389,6 +9661,22 @@ "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==" }, + "foreground-child": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", + "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", + "requires": { + "cross-spawn": "^7.0.6", + "signal-exit": "^4.0.1" + }, + "dependencies": { + "signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==" + } + } + }, "form-data": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", @@ -9470,6 +9758,7 @@ "version": "11.1.0", "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, "requires": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", @@ -9679,11 +9968,6 @@ "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" }, - "is-path-inside": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==" - }, "is-stream": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", @@ -9752,6 +10036,14 @@ "istanbul-lib-report": "^3.0.0" } }, + "jackspeak": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.1.1.tgz", + "integrity": "sha512-zptv57P3GpL+O0I7VdMJNBZCu+BPHVQUk55Ft8/QCJjTVxrnJHuVuX/0Bl2A6/+2oyR/ZMEuFKwmzqqZ/U5nPQ==", + "requires": { + "@isaacs/cliui": "^8.0.2" + } + }, "jest": { "version": "29.3.1", "resolved": "https://registry.npmjs.org/jest/-/jest-29.3.1.tgz", @@ -10321,8 +10613,7 @@ "json5": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", - "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", - "dev": true + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==" }, "jsonpath": { "version": "1.1.1", @@ -10427,7 +10718,8 @@ "make-error": { "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", - "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==" + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true }, "makeerror": { "version": "1.0.12", @@ -10518,11 +10810,6 @@ "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==" }, - "natural-compare-lite": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", - "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==" - }, "neo-async": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", @@ -10562,8 +10849,7 @@ "normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" }, "npm-run-path": { "version": "4.0.1", @@ -10643,6 +10929,11 @@ "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true }, + "package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==" + }, "param-case": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/param-case/-/param-case-3.0.4.tgz", @@ -10690,11 +10981,6 @@ "tslib": "^2.0.3" } }, - "path-equal": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/path-equal/-/path-equal-1.2.5.tgz", - "integrity": "sha512-i73IctDr3F2W+bsOWDyyVm/lqsXO47aY9nsFZUjTT/aljSbkxHxxCoyZ9UUrM8jK0JVod+An+rl48RCsvWM+9g==" - }, "path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -10736,7 +11022,8 @@ "path-type": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==" + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true }, "picocolors": { "version": "1.1.1", @@ -10984,9 +11271,9 @@ } }, "safe-stable-stringify": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.4.3.tgz", - "integrity": "sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g==" + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.5.0.tgz", + "integrity": "sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==" }, "safer-buffer": { "version": "2.1.2", @@ -11059,7 +11346,8 @@ "slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==" + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true }, "slugify": { "version": "1.6.6", @@ -11167,6 +11455,16 @@ "strip-ansi": "^6.0.1" } }, + "string-width-cjs": { + "version": "npm:string-width@4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, "strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -11175,6 +11473,14 @@ "ansi-regex": "^5.0.1" } }, + "strip-ansi-cjs": { + "version": "npm:strip-ansi@6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "requires": { + "ansi-regex": "^5.0.1" + } + }, "strip-bom": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", @@ -11216,11 +11522,6 @@ "minimatch": "^3.0.4" } }, - "text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==" - }, "through2": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", @@ -11321,6 +11622,12 @@ "is-number": "^7.0.0" } }, + "ts-api-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.1.0.tgz", + "integrity": "sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==", + "requires": {} + }, "ts-jest": { "version": "29.0.3", "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.0.3.tgz", @@ -11337,10 +11644,88 @@ "yargs-parser": "^21.0.1" } }, + "ts-json-schema-generator": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/ts-json-schema-generator/-/ts-json-schema-generator-2.4.0.tgz", + "integrity": "sha512-HbmNsgs58CfdJq0gpteRTxPXG26zumezOs+SB9tgky6MpqiFgQwieCn2MW70+sxpHouZ/w9LW0V6L4ZQO4y1Ug==", + "requires": { + "@types/json-schema": "^7.0.15", + "commander": "^13.1.0", + "glob": "^11.0.1", + "json5": "^2.2.3", + "normalize-path": "^3.0.0", + "safe-stable-stringify": "^2.5.0", + "tslib": "^2.8.1", + "typescript": "^5.8.2" + }, + "dependencies": { + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "requires": { + "balanced-match": "^1.0.0" + } + }, + "commander": { + "version": "13.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-13.1.0.tgz", + "integrity": "sha512-/rFeCpNJQbhSZjGVwO9RFV3xPqbnERS8MmIQzCtD/zl6gpJuV/bMLuN92oG3F7d8oDEHHRrujSXNUr8fpjntKw==" + }, + "glob": { + "version": "11.0.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.2.tgz", + "integrity": "sha512-YT7U7Vye+t5fZ/QMkBFrTJ7ZQxInIUjwyAjVj84CYXqgBdv30MFUPGnBR6sQaVq6Is15wYJUsnzTuWaGRBhBAQ==", + "requires": { + "foreground-child": "^3.1.0", + "jackspeak": "^4.0.1", + "minimatch": "^10.0.0", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^2.0.0" + } + }, + "lru-cache": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.1.0.tgz", + "integrity": "sha512-QIXZUBJUx+2zHUdQujWejBkcD9+cs94tLn0+YL8UrCh+D5sCXZ4c7LaEH48pNwRY3MLDgqUFyhlCyjJPf1WP0A==" + }, + "minimatch": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.1.tgz", + "integrity": "sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==", + "requires": { + "brace-expansion": "^2.0.1" + } + }, + "minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==" + }, + "path-scurry": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz", + "integrity": "sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==", + "requires": { + "lru-cache": "^11.0.0", + "minipass": "^7.1.2" + } + }, + "typescript": { + "version": "5.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", + "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==" + } + } + }, "ts-node": { "version": "10.9.1", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", + "dev": true, + "optional": true, + "peer": true, "requires": { "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", @@ -11380,126 +11765,9 @@ } }, "tslib": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", - "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==" - }, - "tslint": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/tslint/-/tslint-6.1.3.tgz", - "integrity": "sha512-IbR4nkT96EQOvKE2PW/djGz8iGNeJ4rF2mBfiYaR/nvUWYKJhLwimoJKgjIFEIDibBtOevj7BqCRL4oHeWWUCg==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "builtin-modules": "^1.1.1", - "chalk": "^2.3.0", - "commander": "^2.12.1", - "diff": "^4.0.1", - "glob": "^7.1.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", - "mkdirp": "^0.5.3", - "resolve": "^1.3.2", - "semver": "^5.3.0", - "tslib": "^1.13.0", - "tsutils": "^2.29.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true - }, - "mkdirp": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", - "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", - "dev": true, - "requires": { - "minimist": "^1.2.6" - } - }, - "semver": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", - "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - }, - "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - } - } - }, - "tslint-config-prettier": { - "version": "1.18.0", - "resolved": "https://registry.npmjs.org/tslint-config-prettier/-/tslint-config-prettier-1.18.0.tgz", - "integrity": "sha512-xPw9PgNPLG3iKRxmK7DWr+Ea/SzrvfHtjFt5LBl61gk2UBG/DB9kCXRjv+xyIU1rUtnayLeMUVJBcMX8Z17nDg==", - "dev": true - }, - "tsutils": { - "version": "2.29.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", - "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", - "dev": true, - "requires": { - "tslib": "^1.8.1" - }, - "dependencies": { - "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - } - } + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==" }, "type-check": { "version": "0.3.2", @@ -11525,28 +11793,6 @@ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==" }, - "typescript-json-schema": { - "version": "0.63.0", - "resolved": "https://registry.npmjs.org/typescript-json-schema/-/typescript-json-schema-0.63.0.tgz", - "integrity": "sha512-vBfMBq4U/rZ5FIRi7u4o/YAdeRHsSabdGHogUlCPi0cYU0CGvS4Bdu8bSzyUsF+Kf5PTQUGh2TictJuQTDK6eQ==", - "requires": { - "@types/json-schema": "^7.0.9", - "@types/node": "^16.9.2", - "glob": "^7.1.7", - "path-equal": "^1.2.5", - "safe-stable-stringify": "^2.2.0", - "ts-node": "^10.9.1", - "typescript": "~5.1.0", - "yargs": "^17.1.1" - }, - "dependencies": { - "@types/node": { - "version": "16.18.54", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.54.tgz", - "integrity": "sha512-oTmGy68gxZZ21FhTJVVvZBYpQHEBZxHKTsGshobMqm9qWpbqdZsA5jvsuPZcHu0KwpmLrOHWPdEfg7XDpNT9UA==" - } - } - }, "uglify-js": { "version": "3.17.4", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz", @@ -11612,7 +11858,10 @@ "v8-compile-cache-lib": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", - "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==" + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "dev": true, + "optional": true, + "peer": true }, "v8-to-istanbul": { "version": "9.3.0", @@ -11679,6 +11928,16 @@ "strip-ansi": "^6.0.0" } }, + "wrap-ansi-cjs": { + "version": "npm:wrap-ansi@7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -11743,7 +12002,10 @@ "yn": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", - "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==" + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true, + "optional": true, + "peer": true }, "yocto-queue": { "version": "0.1.0", diff --git a/package.json b/package.json index d6d7293..ba1d0db 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.23.20", + "version": "0.23.21", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { @@ -35,28 +35,26 @@ "@types/jest": "29.2.4", "@types/jsonpath": "0.2.4", "@types/lodash": "4.17.9", - "@types/validator": "13.11.9", "@types/node": "18.11.18", + "@types/validator": "13.11.9", "copyfiles": "2.4.1", "jest": "29.3.1", "jest-summary-reporter": "0.0.2", "rimraf": "4.4.1", - "tsc-alias": "1.8.6", "ts-jest": "29.0.3", - "tslint": "6.1.3", - "tslint-config-prettier": "1.18.0" + "tsc-alias": "1.8.6" }, "dependencies": { "@guanghechen/helper-string": "4.7.1", "@inquirer/prompts": "7.0.1", - "@typescript-eslint/eslint-plugin": "5.62.0", - "@typescript-eslint/parser": "5.62.0", + "@typescript-eslint/eslint-plugin": "8.32.1", + "@typescript-eslint/parser": "8.32.1", "adm-zip": "0.5.16", "axios": "1.8.3", "chalk": "4.1.2", "comment-json": "4.2.3", "dotenv": "16.0.3", - "eslint": "8.57.1", + "eslint": "9.27.0", "eslint-config-prettier": "9.1.0", "eslint-plugin-prettier": "4.2.1", "handlebars": "4.7.7", @@ -71,8 +69,8 @@ "shelljs": "0.8.5", "slugify": "1.6.6", "socket.io-client": "4.7.5", + "ts-json-schema-generator": "2.4.0", "typescript": "5.1.6", - "typescript-json-schema": "0.63.0", "uuid": "9.0.0", "validator": "13.11.0", "yargs": "17.7.1" diff --git a/src/commands/function.ts b/src/commands/function.ts index 03f6c5d..c340a7d 100644 --- a/src/commands/function.ts +++ b/src/commands/function.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/ban-ts-comment */ + import fs from 'fs'; import chalk from 'chalk'; import shell from 'shelljs'; @@ -76,11 +76,7 @@ export const addOrUpdateCustomFunction = async ( } } - const typeSchemas = generateTypeSchemas( - file, - tsConfigBaseUrl, - DeployableTypeEntries.map((d) => d[0]), - ); + const typeSchemas = generateTypeSchemas(file, DeployableTypeEntries.map(d => d[0]), name); if (server) { shell.echo( diff --git a/src/transpiler.ts b/src/transpiler.ts index 96f522e..0ece9ab 100644 --- a/src/transpiler.ts +++ b/src/transpiler.ts @@ -2,9 +2,8 @@ import fs from 'fs'; import chalk from 'chalk'; import shell from 'shelljs'; import ts from 'typescript'; -import * as TJS from 'typescript-json-schema'; -import { SymbolRef } from 'typescript-json-schema'; import path from 'path'; +import { createGenerator } from 'ts-json-schema-generator'; import { DeployableRecord, DeployableTsTypeToName, @@ -14,8 +13,6 @@ import { getDeployableFileRevision, ParsedDeployableConfig, } from './deployables'; -import os from 'os'; -import crypto from 'crypto'; // NodeJS built-in libraries + polyapi // https://www.w3schools.com/nodejs/ref_modules.asp @@ -69,11 +66,6 @@ export const getTSConfig = () => { export const getTSBaseUrl = (config = getTSConfig()) => config.compilerOptions?.baseUrl || undefined; -interface SchemaDef { - schema: Record; - typeParameterVariations?: Record[]; -} - const loadTsSourceFile = (filePath: string): ts.SourceFile => { const fileContent = fs.readFileSync(filePath, 'utf8'); const sourceFile = ts.createSourceFile( @@ -195,275 +187,6 @@ export const getDependencies = ( return dependencies; }; -export const generateTypeSchemas = ( - fileName: string, - baseUrl: string | undefined, - ignoredTypeNames?: string[], -): { [typeName: string]: any } => { - const compilerOptions: ts.CompilerOptions = { - allowJs: true, - lib: ['es2015'], - baseUrl, - }; - const sourceFile = loadTsSourceFile(fileName); - const program = ts.createProgram([fileName], compilerOptions); - const schemaDefs: { [typeName: string]: SchemaDef } = {}; - const settings: TJS.PartialArgs = { - required: true, - noExtraProps: true, - ignoreErrors: true, - strictNullChecks: true, - }; - const generator = TJS.buildGenerator(program, settings); - - /** - * This functions looks for the type declaration by priority and replaces the data in generator, - * so the correct schema is generated. - * - * @param typeName - * @param symbolRefs - */ - const consolidateGeneratorSymbolType = ( - typeName: string, - symbolRefs: SymbolRef[], - ) => { - const tryConsolidationByFile = (fileName: string) => { - const symbolRef = symbolRefs.find((symbolRef) => { - return symbolRef.symbol.declarations.some((declaration) => - declaration.getSourceFile().fileName.includes(fileName), - ); - }); - - if (symbolRef) { - const declaredType = program - .getTypeChecker() - .getDeclaredTypeOfSymbol(symbolRef.symbol); - if (declaredType) { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore hack to replace the symbol with the preferred one - generator.allSymbols[typeName] = declaredType; - return true; - } - } - - return false; - }; - - if (tryConsolidationByFile(fileName)) { - return; - } - - tryConsolidationByFile('/node_modules/.poly/'); - }; - - const isInnerFunctionNode = (node: ts.Node) => { - let parent = node.parent; - let insideBlock = false; - while (parent) { - if (parent.kind === ts.SyntaxKind.Block) { - insideBlock = true; - } else if ( - parent.kind === ts.SyntaxKind.FunctionDeclaration && - insideBlock - ) { - return true; - } - parent = parent.parent; - } - return false; - }; - - const visitor = (node: ts.Node) => { - if (ts.isUnionTypeNode(node) || ts.isIntersectionTypeNode(node)) { - // create a temporary combined type to get the schema for the union/intersection - const combinedTypeName = 'CombinedTempType'; - const typeName = node.getText(); - if (ignoredTypeNames?.includes(typeName)) { - return; - } - - const tempSource = `type ${combinedTypeName} = ${typeName};`; - const tempDir = os.tmpdir(); - const tempFilePath = path.join( - tempDir, - `${crypto.randomBytes(16).toString('hex')}.ts`, - ); - fs.writeFileSync(tempFilePath, tempSource); - - try { - const tempCombinedTypeProgram = ts.createProgram( - [fileName, tempFilePath], - compilerOptions, - ); - - let schema = TJS.generateSchema( - tempCombinedTypeProgram, - combinedTypeName, - settings, - undefined, - TJS.buildGenerator(tempCombinedTypeProgram, settings), - ); - if (schema) { - const hasVoidType = node.types.some( - (type) => type.getText() === 'void', - ); - if (hasVoidType && ts.isUnionTypeNode(node)) { - // Check if the union contains 'void' type and if so, add nullable type to the schema - if (schema.anyOf) { - schema.anyOf.push({ type: 'null' }); - } else { - schema = { - $schema: schema.$schema, - anyOf: [{ ...schema, $schema: undefined }, { type: 'null' }], - }; - } - } - - schemaDefs[typeName] = { - schema, - typeParameterVariations: [], - }; - } - } finally { - fs.unlinkSync(tempFilePath); - } - } - - if (ts.isTypeReferenceNode(node) && !isInnerFunctionNode(node)) { - const typeName = node.typeName.getText(); - - if (ignoredTypeNames?.includes(typeName)) { - return; - } - - const symbolRefs = generator.getSymbols(typeName); - const isGenericType = node.typeArguments?.length > 0; - if (!symbolRefs.length) { - // not a reference to a type - return; - } - - consolidateGeneratorSymbolType(typeName, symbolRefs); - - const typeParameterVariations = - schemaDefs[typeName]?.typeParameterVariations || []; - - if (isGenericType) { - const symbolRef = symbolRefs[0]; - const typeParameters = []; - - if (typeParameters.length === 0 && symbolRef) { - // read type parameters from declaration - symbolRef.symbol.declarations.forEach((declaration) => { - if ( - ts.isTypeAliasDeclaration(declaration) || - ts.isInterfaceDeclaration(declaration) || - ts.isClassDeclaration(declaration) - ) { - if ( - declaration.parent && - ts.isSourceFile(declaration.parent) && - declaration.parent.hasNoDefaultLib - ) { - // skipping, this is a default lib - return; - } - typeParameters.push( - ...(declaration.typeParameters?.map( - (typeParameter) => typeParameter.name.text, - ) || []), - ); - } - }); - } - - if (typeParameters.length) { - const parameterSchemaTypes: Record = {}; - - typeParameters.forEach((typeParameter, index) => { - const typeArgument = node.typeArguments[index]; - if (typeArgument) { - parameterSchemaTypes[typeParameter] = typeArgument.getText(); - } - }); - - typeParameterVariations.push(parameterSchemaTypes); - } - } - - const schema = - schemaDefs[typeName]?.schema || - TJS.generateSchema(program, typeName, settings, undefined, generator); - if (schema) { - schemaDefs[typeName] = { - schema, - typeParameterVariations, - }; - } - } - - ts.forEachChild(node, visitor); - }; - - ts.forEachChild(sourceFile, visitor); - - enhanceWithParameterTypeSchemas(schemaDefs); - - return extractSchemas(schemaDefs); -}; - -const enhanceWithParameterTypeSchemas = ( - schemaDefs: Record, -) => { - Object.keys(schemaDefs).forEach((typeName) => { - const schemaDef = schemaDefs[typeName]; - const typeVariations = schemaDef.typeParameterVariations; - - if (!typeVariations.length) { - return; - } - typeVariations.forEach((typeVariation) => { - const typeParameters = Object.keys(typeVariation); // e.g. - if (!typeParameters.length) { - return; - } - const parameterTypes = `${Object.values(typeVariation).join(', ')}`; - const updatedDefinitions = { - ...schemaDef.schema.definitions, - ...typeParameters.reduce((acc, typeParameter) => { - const typeParameterSchemaDef = - schemaDefs[typeVariation[typeParameter]]; - - return { - ...acc, - ...typeParameterSchemaDef?.schema.definitions, - [typeParameter]: { - ...typeParameterSchemaDef?.schema, - $schema: undefined, - definitions: undefined, - }, - }; - }, {}), - }; - - schemaDefs[`${typeName}<${parameterTypes}>`] = { - schema: { - ...schemaDef.schema, - definitions: updatedDefinitions, - }, - }; - }); - }); -}; - -const extractSchemas = (schemaDefs: Record) => - Object.keys(schemaDefs).reduce((acc, typeName) => { - return { - ...acc, - [typeName]: schemaDefs[typeName].schema, - }; - }, {}); - export const parseDeployComment = (comment: string): Deployment => { // Poly deployed @ 2024-08-29T22:46:46.791Z - test.weeklyReport - https://develop-k8s.polyapi.io/canopy/polyui/collections/server-functions/f0630f95-eac8-4c7d-9d23-639d39034bb6 - e3b0c44 const match = comment.match( @@ -696,16 +419,8 @@ const parseDeployableFunction = ( ): DeployableRecord => { const [deployments, deploymentCommentRanges] = getDeployComments(sourceFile); const functionDetails = getFunctionDetails(sourceFile, polyConfig.name); - const dependencies = getDependencies( - sourceFile.getFullText(), - sourceFile.fileName, - baseUrl, - ); - const typeSchemas = generateTypeSchemas( - sourceFile.fileName, - baseUrl, - DeployableTypeEntries.map((d) => d[0]), - ); + const dependencies = getDependencies(sourceFile.getFullText(), sourceFile.fileName, baseUrl); + const typeSchemas = generateTypeSchemas(sourceFile.fileName, DeployableTypeEntries.map(d => d[0]), polyConfig.name); return { ...polyConfig, ...functionDetails, @@ -786,3 +501,258 @@ export const parseDeployable = async ( console.error(err); } }; + +const dereferenceSchema = (obj: any, definitions: any, visited: Set = new Set()): any => { + if (!obj || typeof obj !== 'object') return obj; + + if (Array.isArray(obj)) { + return obj.map(item => dereferenceSchema(item, definitions, visited)); + } + + const result: any = {}; + + for (const [key, value] of Object.entries(obj)) { + if (key === '$ref' && typeof value === 'string') { + const match = value.match(/^#\/definitions\/(.+)$/); + if (match) { + const defName = match[1]; + + // Prevent infinite recursion + if (visited.has(defName)) { + return { $ref: value }; + } + + const definition = definitions[defName]; + if (definition) { + // Inspired by old flattenDefinitions logic: Check if this looks like a "real" type + // vs a utility type by examining the definition structure + const shouldInline = isInlineableDefinition(definition, defName); + + if (shouldInline) { + // Inline the definition + visited.add(defName); + const { definitions: _, ...inlinedDef } = definition; + const result = dereferenceSchema(inlinedDef, definitions, visited); + visited.delete(defName); + return result; + } else { + // Keep as reference (utility types, complex mapped types, etc.) + return { $ref: value }; + } + } + } + return { $ref: value }; + } else { + result[key] = dereferenceSchema(value, definitions, visited); + } + } + + return result; +}; + +const isInlineableDefinition = (definition: any, defName: string): boolean => { + const decodedDefName = decodeURIComponent(defName); + + // If it has "real" object properties, it's probably a real interface that should be inlined + if (definition.type === 'object' && definition.properties && + Object.keys(definition.properties).length > 0) { + return true; + } + + // If it has array items with concrete structure, inline it + if (definition.type === 'array' && definition.items && + typeof definition.items === 'object' && definition.items.type) { + return true; + } + + // If it's a simple type (string, number, boolean), inline it + if (['string', 'number', 'boolean', 'integer'].includes(definition.type)) { + return true; + } + + // If it has enum values, it's a real type, inline it + if (definition.enum && definition.enum.length > 0) { + return true; + } + + // If it's a union/intersection of concrete types, inline it + if ((definition.anyOf || definition.allOf) && !decodedDefName.includes('<')) { + return true; + } + + // Keep as reference if it looks like a utility type (contains < > or other TypeScript operators) + if (decodedDefName.includes('<') || decodedDefName.includes('>') || + decodedDefName.includes('|') || decodedDefName.includes('&')) { + return false; + } + + // If we can't determine, err on the side of inlining for "normal" looking names + return !/[<>%|&]/.test(decodedDefName); +}; + +const dereferenceRoot = (schema: any): any => { + if (!schema || !schema.definitions) return schema; + + // If schema has a root $ref, dereference it first + let rootSchema = schema; + if (schema.$ref) { + const match = schema.$ref.match(/^#\/definitions\/(.+)$/); + if (match) { + const defName = match[1]; + const root = schema.definitions[defName]; + if (root) { + const { definitions, $schema, $ref, ...rest } = schema; + rootSchema = { + ...root, + definitions, + $schema, + ...rest, + }; + } + } + } + + // Now recursively dereference based on intelligent heuristics + const { definitions, $schema, ...rest } = rootSchema; + const dereferencedRest = dereferenceSchema(rest, definitions); + + // Collect remaining references that weren't inlined + const filteredDefinitions: any = {}; + const findReferences = (obj: any, visited: Set = new Set()): void => { + if (!obj || typeof obj !== 'object') return; + if (Array.isArray(obj)) { + obj.forEach(item => findReferences(item, visited)); + return; + } + for (const [key, value] of Object.entries(obj)) { + if (key === '$ref' && typeof value === 'string') { + const match = value.match(/^#\/definitions\/(.+)$/); + if (match) { + const encodedDefName = match[1]; + const decodedDefName = decodeURIComponent(encodedDefName); + + // Try both encoded and decoded versions + const actualDefName = definitions[encodedDefName] ? encodedDefName : + definitions[decodedDefName] ? decodedDefName : null; + + if (actualDefName && !visited.has(actualDefName)) { + visited.add(actualDefName); + filteredDefinitions[actualDefName] = definitions[actualDefName]; + // Also recursively find references within this definition + findReferences(definitions[actualDefName], visited); + } + } + } else { + findReferences(value, visited); + } + } + }; + + findReferences(dereferencedRest); + + return { + ...dereferencedRest, + ...(Object.keys(filteredDefinitions).length > 0 && { definitions: filteredDefinitions }), + $schema, + }; +}; + +export const extractTypesFromAST = (filePath: string, functionName: string): string[] => { + const program = ts.createProgram([filePath], { + target: ts.ScriptTarget.ESNext, + module: ts.ModuleKind.CommonJS, + }); + + const sourceFile = program.getSourceFile(filePath); + if (!sourceFile) throw new Error(`Could not load file: ${filePath}`); + + const extractedTypes: Set = new Set(); + + const extractFromTypeNode = (typeNode: ts.TypeNode) => { + if (ts.isTypeReferenceNode(typeNode)) { + const typeName = typeNode.typeName.getText(sourceFile); + + // Skip primitive and built-in types + const primitives = ['Promise', 'Array', 'Record', 'string', 'number', 'boolean', 'void', 'any', 'unknown', 'object', 'undefined', 'null']; + if (!primitives.includes(typeName)) { + extractedTypes.add(typeName); + } + + // Extract type arguments from generics (like Promise -> extract T) + if (typeNode.typeArguments) { + for (const typeArg of typeNode.typeArguments) { + extractFromTypeNode(typeArg); + } + } + } else if (ts.isUnionTypeNode(typeNode) || ts.isIntersectionTypeNode(typeNode)) { + // Handle union/intersection types + for (const type of typeNode.types) { + extractFromTypeNode(type); + } + } + }; + + const visit = (node: ts.Node) => { + if (ts.isFunctionDeclaration(node) && node.name?.text === functionName) { + // Extract types from parameters + for (const param of node.parameters) { + if (param.type) { + extractFromTypeNode(param.type); + } + } + + // Extract types from return type + if (node.type) { + extractFromTypeNode(node.type); + } + } + ts.forEachChild(node, visit); + }; + + visit(sourceFile); + return Array.from(extractedTypes); +}; + +export const generateTypeSchemas = ( + filePath: string, + ignoredTypeNames: string[] = [], + functionName?: string, +): Record => { + const tsconfigPath = path.resolve('tsconfig.json'); + // Use provided function name or default to filename + const actualFunctionName = functionName || path.basename(filePath, '.ts'); + + // FIXED: Use AST-based type extraction instead of string manipulation + const extractedTypes = extractTypesFromAST(filePath, actualFunctionName); + + // Filter ignored types + const typeNames = extractedTypes.filter(typeName => + !ignoredTypeNames.includes(typeName) + ); + + const output: Record = {}; + + for (const typeName of typeNames) { + if (ignoredTypeNames.includes(typeName)) continue; + + try { + const generator = createGenerator({ + path: filePath, + tsconfig: tsconfigPath, + type: typeName, + expose: 'all', + topRef: true, + skipTypeCheck: true, + }); + + const schema = generator.createSchema(typeName); + output[typeName] = dereferenceRoot(schema); + } catch (err: any) { + if (!/No root type.*found/.test(err.message)) { + console.warn(`⚠️ Error generating schema for "${typeName}":`, err.message); + } + } + } + + return output; +}; From 1c1424d5c146e273db0e6ee1fb00831a50553019 Mon Sep 17 00:00:00 2001 From: Aaron Goin Date: Wed, 11 Jun 2025 14:09:02 -0700 Subject: [PATCH 27/73] fix server function runtime --- package-lock.json | 4 ++-- package.json | 2 +- templates/server-index.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2ee6ae8..70dad22 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "polyapi", - "version": "0.23.21", + "version": "0.23.22", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "polyapi", - "version": "0.23.21", + "version": "0.23.22", "license": "MIT", "dependencies": { "@guanghechen/helper-string": "4.7.1", diff --git a/package.json b/package.json index ba1d0db..b2ca1c5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.23.21", + "version": "0.23.22", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { diff --git a/templates/server-index.js b/templates/server-index.js index 47ae6c5..985f732 100644 --- a/templates/server-index.js +++ b/templates/server-index.js @@ -14,6 +14,6 @@ module.exports = (clientID, polyCustom) => functions.reduce( 'x-poly-execution-id': polyCustom.executionId, } } - ).then(({ data }) => data)).catch(scrubKeys), + ).then(({ data }) => data).catch(scrubKeys)), {} ); From cd07681c69ca980aeb4778c43cb7f4a4a3635555 Mon Sep 17 00:00:00 2001 From: Richard Date: Thu, 12 Jun 2025 17:19:33 +0200 Subject: [PATCH 28/73] downgrade package to fix the wrong export of subpackage issue (#14) --- package-lock.json | 353 +++++++++++++++++++--------------------------- package.json | 6 +- 2 files changed, 149 insertions(+), 210 deletions(-) diff --git a/package-lock.json b/package-lock.json index 70dad22..7d66cef 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "polyapi", - "version": "0.23.22", + "version": "0.23.23", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "polyapi", - "version": "0.23.22", + "version": "0.23.23", "license": "MIT", "dependencies": { "@guanghechen/helper-string": "4.7.1", @@ -30,10 +30,10 @@ "lodash": "4.17.21", "prettier": "3.0.0", "semver": "7.5.4", - "shelljs": "0.8.5", + "shelljs": "0.10.0", "slugify": "1.6.6", "socket.io-client": "4.7.5", - "ts-json-schema-generator": "2.4.0", + "ts-json-schema-generator": "2.3.0", "typescript": "5.1.6", "uuid": "9.0.0", "validator": "13.11.0", @@ -1734,6 +1734,16 @@ "node": ">= 8" } }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=14" + } + }, "node_modules/@sinclair/typebox": { "version": "0.27.8", "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", @@ -2791,6 +2801,15 @@ "node": ">= 0.8" } }, + "node_modules/commander": { + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", + "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, "node_modules/comment-json": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/comment-json/-/comment-json-4.2.3.tgz", @@ -3514,7 +3533,6 @@ "version": "5.1.1", "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", - "dev": true, "license": "MIT", "dependencies": { "cross-spawn": "^7.0.3", @@ -3749,7 +3767,8 @@ "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true }, "node_modules/fsevents": { "version": "2.3.2", @@ -3768,7 +3787,8 @@ "node_modules/function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true }, "node_modules/gensync": { "version": "1.0.0-beta.2", @@ -3802,7 +3822,6 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", - "dev": true, "license": "MIT", "engines": { "node": ">=10" @@ -3815,6 +3834,7 @@ "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -3908,6 +3928,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, "dependencies": { "function-bind": "^1.1.1" }, @@ -3975,7 +3996,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", - "dev": true, "license": "Apache-2.0", "engines": { "node": ">=10.17.0" @@ -4073,6 +4093,7 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -4081,15 +4102,8 @@ "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "node_modules/interpret": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", - "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", - "engines": { - "node": ">= 0.10" - } + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true }, "node_modules/is-arrayish": { "version": "0.2.1", @@ -4114,6 +4128,7 @@ "version": "2.11.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz", "integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==", + "dev": true, "dependencies": { "has": "^1.0.3" }, @@ -4170,7 +4185,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -4263,18 +4277,18 @@ } }, "node_modules/jackspeak": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.1.1.tgz", - "integrity": "sha512-zptv57P3GpL+O0I7VdMJNBZCu+BPHVQUk55Ft8/QCJjTVxrnJHuVuX/0Bl2A6/+2oyR/ZMEuFKwmzqqZ/U5nPQ==", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", "license": "BlueOak-1.0.0", "dependencies": { "@isaacs/cliui": "^8.0.2" }, - "engines": { - "node": "20 || >=22" - }, "funding": { "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" } }, "node_modules/jest": { @@ -5172,8 +5186,7 @@ "node_modules/lru-cache": { "version": "10.4.3", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", - "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", - "dev": true + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==" }, "node_modules/make-dir": { "version": "4.0.0", @@ -5211,7 +5224,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true, "license": "MIT" }, "node_modules/merge2": { @@ -5257,7 +5269,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true, "license": "MIT", "engines": { "node": ">=6" @@ -5377,7 +5388,6 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", - "dev": true, "license": "MIT", "dependencies": { "path-key": "^3.0.0" @@ -5390,6 +5400,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, "dependencies": { "wrappy": "1" } @@ -5398,7 +5409,6 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "dev": true, "license": "MIT", "dependencies": { "mimic-fn": "^2.1.0" @@ -5565,6 +5575,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -5581,13 +5592,13 @@ "node_modules/path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true }, "node_modules/path-scurry": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", - "dev": true, "dependencies": { "lru-cache": "^10.2.0", "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" @@ -5603,7 +5614,6 @@ "version": "7.1.2", "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", - "dev": true, "engines": { "node": ">=16 || 14 >=14.17" } @@ -5836,17 +5846,6 @@ "node": ">=8.10.0" } }, - "node_modules/rechoir": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", - "integrity": "sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==", - "dependencies": { - "resolve": "^1.1.6" - }, - "engines": { - "node": ">= 0.10" - } - }, "node_modules/repeat-string": { "version": "1.6.1", "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", @@ -5867,6 +5866,7 @@ "version": "1.22.1", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", + "dev": true, "dependencies": { "is-core-module": "^2.9.0", "path-parse": "^1.0.7", @@ -6074,26 +6074,22 @@ } }, "node_modules/shelljs": { - "version": "0.8.5", - "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz", - "integrity": "sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==", + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.10.0.tgz", + "integrity": "sha512-Jex+xw5Mg2qMZL3qnzXIfaxEtBaC4n7xifqaqtrZDdlheR70OGkydrPJWT0V1cA1k3nanC86x9FwAmQl6w3Klw==", + "license": "BSD-3-Clause", "dependencies": { - "glob": "^7.0.0", - "interpret": "^1.0.0", - "rechoir": "^0.6.2" - }, - "bin": { - "shjs": "bin/shjs" + "execa": "^5.1.1", + "fast-glob": "^3.3.2" }, "engines": { - "node": ">=4" + "node": ">=18" } }, "node_modules/signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true, "license": "ISC" }, "node_modules/sisteransi": { @@ -6297,7 +6293,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", - "dev": true, "license": "MIT", "engines": { "node": ">=6" @@ -6330,6 +6325,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, "engines": { "node": ">= 0.4" }, @@ -6528,19 +6524,19 @@ } }, "node_modules/ts-json-schema-generator": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/ts-json-schema-generator/-/ts-json-schema-generator-2.4.0.tgz", - "integrity": "sha512-HbmNsgs58CfdJq0gpteRTxPXG26zumezOs+SB9tgky6MpqiFgQwieCn2MW70+sxpHouZ/w9LW0V6L4ZQO4y1Ug==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/ts-json-schema-generator/-/ts-json-schema-generator-2.3.0.tgz", + "integrity": "sha512-t4lBQAwZc0sOJq9LJt3NgbznIcslVnm0JeEMFq8qIRklpMRY8jlYD0YmnRWbqBKANxkby91P1XanSSlSOFpUmg==", "license": "MIT", "dependencies": { "@types/json-schema": "^7.0.15", - "commander": "^13.1.0", - "glob": "^11.0.1", + "commander": "^12.0.0", + "glob": "^10.3.12", "json5": "^2.2.3", "normalize-path": "^3.0.0", - "safe-stable-stringify": "^2.5.0", - "tslib": "^2.8.1", - "typescript": "^5.8.2" + "safe-stable-stringify": "^2.4.3", + "tslib": "^2.6.2", + "typescript": "^5.4.5" }, "bin": { "ts-json-schema-generator": "bin/ts-json-schema-generator.js" @@ -6550,65 +6546,44 @@ } }, "node_modules/ts-json-schema-generator/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } }, - "node_modules/ts-json-schema-generator/node_modules/commander": { - "version": "13.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-13.1.0.tgz", - "integrity": "sha512-/rFeCpNJQbhSZjGVwO9RFV3xPqbnERS8MmIQzCtD/zl6gpJuV/bMLuN92oG3F7d8oDEHHRrujSXNUr8fpjntKw==", - "license": "MIT", - "engines": { - "node": ">=18" - } - }, "node_modules/ts-json-schema-generator/node_modules/glob": { - "version": "11.0.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.2.tgz", - "integrity": "sha512-YT7U7Vye+t5fZ/QMkBFrTJ7ZQxInIUjwyAjVj84CYXqgBdv30MFUPGnBR6sQaVq6Is15wYJUsnzTuWaGRBhBAQ==", + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", "license": "ISC", "dependencies": { "foreground-child": "^3.1.0", - "jackspeak": "^4.0.1", - "minimatch": "^10.0.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", "minipass": "^7.1.2", "package-json-from-dist": "^1.0.0", - "path-scurry": "^2.0.0" + "path-scurry": "^1.11.1" }, "bin": { "glob": "dist/esm/bin.mjs" }, - "engines": { - "node": "20 || >=22" - }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/ts-json-schema-generator/node_modules/lru-cache": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.1.0.tgz", - "integrity": "sha512-QIXZUBJUx+2zHUdQujWejBkcD9+cs94tLn0+YL8UrCh+D5sCXZ4c7LaEH48pNwRY3MLDgqUFyhlCyjJPf1WP0A==", - "license": "ISC", - "engines": { - "node": "20 || >=22" - } - }, "node_modules/ts-json-schema-generator/node_modules/minimatch": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.1.tgz", - "integrity": "sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, "engines": { - "node": "20 || >=22" + "node": ">=16 || 14 >=14.17" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -6623,22 +6598,6 @@ "node": ">=16 || 14 >=14.17" } }, - "node_modules/ts-json-schema-generator/node_modules/path-scurry": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz", - "integrity": "sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==", - "license": "BlueOak-1.0.0", - "dependencies": { - "lru-cache": "^11.0.0", - "minipass": "^7.1.2" - }, - "engines": { - "node": "20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/ts-json-schema-generator/node_modules/typescript": { "version": "5.8.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", @@ -6987,7 +6946,8 @@ "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true }, "node_modules/write-file-atomic": { "version": "4.0.2", @@ -8284,6 +8244,12 @@ "fastq": "^1.6.0" } }, + "@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "optional": true + }, "@sinclair/typebox": { "version": "0.27.8", "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", @@ -9037,6 +9003,11 @@ "delayed-stream": "~1.0.0" } }, + "commander": { + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", + "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==" + }, "comment-json": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/comment-json/-/comment-json-4.2.3.tgz", @@ -9525,7 +9496,6 @@ "version": "5.1.1", "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", - "dev": true, "requires": { "cross-spawn": "^7.0.3", "get-stream": "^6.0.0", @@ -9690,7 +9660,8 @@ "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true }, "fsevents": { "version": "2.3.2", @@ -9702,7 +9673,8 @@ "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true }, "gensync": { "version": "1.0.0-beta.2", @@ -9724,13 +9696,13 @@ "get-stream": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", - "dev": true + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==" }, "glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -9795,6 +9767,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, "requires": { "function-bind": "^1.1.1" } @@ -9845,8 +9818,7 @@ "human-signals": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", - "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", - "dev": true + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==" }, "husky": { "version": "8.0.3", @@ -9901,6 +9873,7 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, "requires": { "once": "^1.3.0", "wrappy": "1" @@ -9909,12 +9882,8 @@ "inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "interpret": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", - "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==" + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true }, "is-arrayish": { "version": "0.2.1", @@ -9935,6 +9904,7 @@ "version": "2.11.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz", "integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==", + "dev": true, "requires": { "has": "^1.0.3" } @@ -9971,8 +9941,7 @@ "is-stream": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", - "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", - "dev": true + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==" }, "isarray": { "version": "0.0.1", @@ -10037,11 +10006,12 @@ } }, "jackspeak": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.1.1.tgz", - "integrity": "sha512-zptv57P3GpL+O0I7VdMJNBZCu+BPHVQUk55Ft8/QCJjTVxrnJHuVuX/0Bl2A6/+2oyR/ZMEuFKwmzqqZ/U5nPQ==", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", "requires": { - "@isaacs/cliui": "^8.0.2" + "@isaacs/cliui": "^8.0.2", + "@pkgjs/parseargs": "^0.11.0" } }, "jest": { @@ -10703,8 +10673,7 @@ "lru-cache": { "version": "10.4.3", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", - "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", - "dev": true + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==" }, "make-dir": { "version": "4.0.0", @@ -10733,8 +10702,7 @@ "merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" }, "merge2": { "version": "1.4.1", @@ -10766,8 +10734,7 @@ "mimic-fn": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==" }, "minimatch": { "version": "3.1.2", @@ -10855,7 +10822,6 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", - "dev": true, "requires": { "path-key": "^3.0.0" } @@ -10864,6 +10830,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, "requires": { "wrappy": "1" } @@ -10872,7 +10839,6 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "dev": true, "requires": { "mimic-fn": "^2.1.0" } @@ -10989,7 +10955,8 @@ "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==" + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true }, "path-key": { "version": "3.1.1", @@ -10999,13 +10966,13 @@ "path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true }, "path-scurry": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", - "dev": true, "requires": { "lru-cache": "^10.2.0", "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" @@ -11014,8 +10981,7 @@ "minipass": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", - "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", - "dev": true + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==" } } }, @@ -11167,14 +11133,6 @@ "picomatch": "^2.2.1" } }, - "rechoir": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", - "integrity": "sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==", - "requires": { - "resolve": "^1.1.6" - } - }, "repeat-string": { "version": "1.6.1", "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", @@ -11189,6 +11147,7 @@ "version": "1.22.1", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", + "dev": true, "requires": { "is-core-module": "^2.9.0", "path-parse": "^1.0.7", @@ -11322,20 +11281,18 @@ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" }, "shelljs": { - "version": "0.8.5", - "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz", - "integrity": "sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==", + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.10.0.tgz", + "integrity": "sha512-Jex+xw5Mg2qMZL3qnzXIfaxEtBaC4n7xifqaqtrZDdlheR70OGkydrPJWT0V1cA1k3nanC86x9FwAmQl6w3Klw==", "requires": { - "glob": "^7.0.0", - "interpret": "^1.0.0", - "rechoir": "^0.6.2" + "execa": "^5.1.1", + "fast-glob": "^3.3.2" } }, "signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" }, "sisteransi": { "version": "1.0.5", @@ -11490,8 +11447,7 @@ "strip-final-newline": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", - "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", - "dev": true + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==" }, "strip-json-comments": { "version": "3.1.1", @@ -11509,7 +11465,8 @@ "supports-preserve-symlinks-flag": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==" + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true }, "test-exclude": { "version": "6.0.0", @@ -11645,55 +11602,45 @@ } }, "ts-json-schema-generator": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/ts-json-schema-generator/-/ts-json-schema-generator-2.4.0.tgz", - "integrity": "sha512-HbmNsgs58CfdJq0gpteRTxPXG26zumezOs+SB9tgky6MpqiFgQwieCn2MW70+sxpHouZ/w9LW0V6L4ZQO4y1Ug==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/ts-json-schema-generator/-/ts-json-schema-generator-2.3.0.tgz", + "integrity": "sha512-t4lBQAwZc0sOJq9LJt3NgbznIcslVnm0JeEMFq8qIRklpMRY8jlYD0YmnRWbqBKANxkby91P1XanSSlSOFpUmg==", "requires": { "@types/json-schema": "^7.0.15", - "commander": "^13.1.0", - "glob": "^11.0.1", + "commander": "^12.0.0", + "glob": "^10.3.12", "json5": "^2.2.3", "normalize-path": "^3.0.0", - "safe-stable-stringify": "^2.5.0", - "tslib": "^2.8.1", - "typescript": "^5.8.2" + "safe-stable-stringify": "^2.4.3", + "tslib": "^2.6.2", + "typescript": "^5.4.5" }, "dependencies": { "brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", "requires": { "balanced-match": "^1.0.0" } }, - "commander": { - "version": "13.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-13.1.0.tgz", - "integrity": "sha512-/rFeCpNJQbhSZjGVwO9RFV3xPqbnERS8MmIQzCtD/zl6gpJuV/bMLuN92oG3F7d8oDEHHRrujSXNUr8fpjntKw==" - }, "glob": { - "version": "11.0.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.2.tgz", - "integrity": "sha512-YT7U7Vye+t5fZ/QMkBFrTJ7ZQxInIUjwyAjVj84CYXqgBdv30MFUPGnBR6sQaVq6Is15wYJUsnzTuWaGRBhBAQ==", + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", "requires": { "foreground-child": "^3.1.0", - "jackspeak": "^4.0.1", - "minimatch": "^10.0.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", "minipass": "^7.1.2", "package-json-from-dist": "^1.0.0", - "path-scurry": "^2.0.0" + "path-scurry": "^1.11.1" } }, - "lru-cache": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.1.0.tgz", - "integrity": "sha512-QIXZUBJUx+2zHUdQujWejBkcD9+cs94tLn0+YL8UrCh+D5sCXZ4c7LaEH48pNwRY3MLDgqUFyhlCyjJPf1WP0A==" - }, "minimatch": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.1.tgz", - "integrity": "sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "requires": { "brace-expansion": "^2.0.1" } @@ -11703,15 +11650,6 @@ "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==" }, - "path-scurry": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz", - "integrity": "sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==", - "requires": { - "lru-cache": "^11.0.0", - "minipass": "^7.1.2" - } - }, "typescript": { "version": "5.8.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", @@ -11941,7 +11879,8 @@ "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true }, "write-file-atomic": { "version": "4.0.2", diff --git a/package.json b/package.json index b2ca1c5..f3bd319 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.23.22", + "version": "0.23.23", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { @@ -66,10 +66,10 @@ "lodash": "4.17.21", "prettier": "3.0.0", "semver": "7.5.4", - "shelljs": "0.8.5", + "shelljs": "0.10.0", "slugify": "1.6.6", "socket.io-client": "4.7.5", - "ts-json-schema-generator": "2.4.0", + "ts-json-schema-generator": "2.3.0", "typescript": "5.1.6", "uuid": "9.0.0", "validator": "13.11.0", From 7449f618b1af14a86246bc887e3ea5d6a90989bb Mon Sep 17 00:00:00 2001 From: Aaron Goin Date: Fri, 13 Jun 2025 08:25:59 -0700 Subject: [PATCH 29/73] Improving safety of scrubKeys utility --- package-lock.json | 4 ++-- package.json | 2 +- templates/axios.js | 9 ++++++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7d66cef..d1a76da 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "polyapi", - "version": "0.23.23", + "version": "0.23.24", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "polyapi", - "version": "0.23.23", + "version": "0.23.24", "license": "MIT", "dependencies": { "@guanghechen/helper-string": "4.7.1", diff --git a/package.json b/package.json index f3bd319..ed47453 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.23.23", + "version": "0.23.24", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { diff --git a/templates/axios.js b/templates/axios.js index be6c9d8..def97c4 100644 --- a/templates/axios.js +++ b/templates/axios.js @@ -43,9 +43,12 @@ axios.interceptors.request.use( ); const scrubKeys = (err) => { - if (err.request) { - // Scrub the api key in the authorization header - err.request.headers['Authorization'] = `Bearer ********`; + if (err.request && typeof err.request.headers === 'object' && err.request.headers.Authorization) { + // Scrub any credentials in the authorization header + const [type, ...rest] = err.request.headers.Authorization.split(' '); + err.request.headers.Authorization = rest.length && type + ? `${type} ********` + : `********`; } throw err; }; From c03eed707a21dc1f4847ca8096b707850017a31c Mon Sep 17 00:00:00 2001 From: Dan Fellin Date: Mon, 16 Jun 2025 08:30:09 -0700 Subject: [PATCH 30/73] lets test the auto-update prebuilt functionality --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ed47453..bb6c71f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.23.24", + "version": "0.23.25", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { From eebcdbfa36e319969304ec47467277dc11762c2f Mon Sep 17 00:00:00 2001 From: Daniel-Estoll <115661842+Daniel-Estoll@users.noreply.github.com> Date: Mon, 16 Jun 2025 13:03:15 -0600 Subject: [PATCH 31/73] Changed command structure to fix windows glide bug (#15) * Changed command structure to fix windows glide bug * Added comment to explain strange syntax * Allowed directories to be specified in the command * Updated excludeCommand quotations and comment * Updated version * Added package-lock.json --- package-lock.json | 4 ++-- package.json | 2 +- src/deployables.ts | 37 ++++++++++++++++++++++--------------- 3 files changed, 25 insertions(+), 18 deletions(-) diff --git a/package-lock.json b/package-lock.json index d1a76da..e48cb08 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "polyapi", - "version": "0.23.24", + "version": "0.23.26", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "polyapi", - "version": "0.23.24", + "version": "0.23.26", "license": "MIT", "dependencies": { "@guanghechen/helper-string": "4.7.1", diff --git a/package.json b/package.json index bb6c71f..537f65d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.23.25", + "version": "0.23.26", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { diff --git a/src/deployables.ts b/src/deployables.ts index a4b72b5..419cfa1 100644 --- a/src/deployables.ts +++ b/src/deployables.ts @@ -170,26 +170,33 @@ export const getAllDeployableFilesWindows = ({ excludeDirs, }: PolyDeployConfig): string[] => { // To get the equivalent of grep in Windows we use a combination of `dir` and `findstr` - const includePattern = - includeFilesOrExtensions.length > 0 - ? includeFilesOrExtensions - .map((f) => (f.includes('.') ? f : `*.${f}`)) - .join(' ') - : '*'; - const excludePattern = excludeDirs.length > 0 ? excludeDirs.join('|') : ''; + const excludePattern = excludeDirs.length > 0 + ? excludeDirs + .map((f) => `\\${f}`) + .join(' ') : ''; const pattern = typeNames.length > 0 - ? typeNames.map((name) => `polyConfig: ${name}`).join('|') + ? typeNames.map((name) => `\\`).join(' ') : 'polyConfig'; + // Using two regular quotes or two smart quotes throws "The syntax of the command is incorrect". + // For some reason, starting with a regular quote and leaving the end without a quote works. const excludeCommand = excludePattern - ? ` | findstr /V /I "${excludePattern}"` + ? ` | findstr /V /I "${excludePattern}` : ''; - const searchCommand = ` | findstr /M /I /F:/ /C:"${pattern}"`; + const searchCommand = ` | findstr /M /I /F:/ ${pattern}`; let result: string[] = []; for (const dir of includeDirs) { - const dirCommand = `dir /S /P /B ${includePattern} ${dir}`; + const includePattern = + dir === '.' + ? includeFilesOrExtensions + .map((f) => (f.includes('.') ? f : `*.${f}`)) + .join(' ') + : includeFilesOrExtensions + .map((f) => (f.includes('.') ? f : `${dir}*.${f}`)) + .join(' '); + const dirCommand = `dir ${includePattern} /S /P /B`; const fullCommand = `${dirCommand}${excludeCommand}${searchCommand}`; try { const output = shell.exec(fullCommand).toString('utf8'); @@ -230,13 +237,13 @@ export const getAllDeployableFilesLinux = ({ export const getAllDeployableFiles = ( config: Partial = {}, ): string[] => { - config.typeNames = config.typeNames = DeployableTypeEntries.map((p) => p[0]); - config.includeDirs = config.includeDirs = ['.']; - config.includeFilesOrExtensions = config.includeFilesOrExtensions = [ + config.typeNames = config.typeNames || DeployableTypeEntries.map((p) => p[0]); + config.includeDirs = config.includeDirs || ['.']; + config.includeFilesOrExtensions = config.includeFilesOrExtensions || [ 'ts', 'js', ]; - config.excludeDirs = config.excludeDirs = [ + config.excludeDirs = config.excludeDirs || [ 'node_modules', 'dist', 'build', From 7bb92841990b31061acdc32ea1a74bd1490bf98a Mon Sep 17 00:00:00 2001 From: Daniel-Estoll <115661842+Daniel-Estoll@users.noreply.github.com> Date: Tue, 17 Jun 2025 14:28:31 -0600 Subject: [PATCH 32/73] Dirty deployables are now added to git after being updated (#16) * Dirty deployables are now added to git after being updated * changed slice to replace * Changed log to warn --- package-lock.json | 4 ++-- package.json | 2 +- src/commands/prepare.ts | 16 ++++++++++++++++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index e48cb08..f8322df 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "polyapi", - "version": "0.23.26", + "version": "0.23.27", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "polyapi", - "version": "0.23.26", + "version": "0.23.27", "license": "MIT", "dependencies": { "@guanghechen/helper-string": "4.7.1", diff --git a/package.json b/package.json index 537f65d..3dc7bad 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.23.26", + "version": "0.23.27", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { diff --git a/src/commands/prepare.ts b/src/commands/prepare.ts index 5226e3b..9fa1e60 100644 --- a/src/commands/prepare.ts +++ b/src/commands/prepare.ts @@ -160,6 +160,22 @@ export const prepareDeployables = async ( writeUpdatedDeployable(deployable, disableDocs), ), ); + const staged = shell.exec('git diff --name-only --cached') + .toString().split('\n').filter(Boolean); + const rootPath: string = shell.exec('git rev-parse --show-toplevel', {silent:true}) + .toString('utf8').replace('\n', ''); + for (const deployable of dirtyDeployables) { + try{ + const deployableName = deployable.file.replace(rootPath, ''); + if (staged.includes(deployableName)) { + shell.echo(`Staging ${deployableName}`); + shell.exec(`git add ${deployableName}`); + } + } + catch (error) { + console.warn(error); + } + } } console.log('Poly deployments are prepared.'); await saveDeployableRecords(parsedDeployables); From 049d630ac29eb20cc8c9e674a3264079c3232db1 Mon Sep 17 00:00:00 2001 From: Daniel-Estoll <115661842+Daniel-Estoll@users.noreply.github.com> Date: Wed, 18 Jun 2025 14:11:59 -0600 Subject: [PATCH 33/73] Re-fixed glide commit bug (#18) --- package-lock.json | 4 ++-- package.json | 2 +- src/commands/prepare.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index f8322df..33c6c0f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "polyapi", - "version": "0.23.27", + "version": "0.23.28", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "polyapi", - "version": "0.23.27", + "version": "0.23.28", "license": "MIT", "dependencies": { "@guanghechen/helper-string": "4.7.1", diff --git a/package.json b/package.json index 3dc7bad..41e7e38 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.23.27", + "version": "0.23.28", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { diff --git a/src/commands/prepare.ts b/src/commands/prepare.ts index 9fa1e60..f71e840 100644 --- a/src/commands/prepare.ts +++ b/src/commands/prepare.ts @@ -166,7 +166,7 @@ export const prepareDeployables = async ( .toString('utf8').replace('\n', ''); for (const deployable of dirtyDeployables) { try{ - const deployableName = deployable.file.replace(rootPath, ''); + const deployableName = deployable.file.replace(`${rootPath}/`, ''); if (staged.includes(deployableName)) { shell.echo(`Staging ${deployableName}`); shell.exec(`git add ${deployableName}`); From e176601f6304dd7f097ec620fc546c2a92c8def5 Mon Sep 17 00:00:00 2001 From: Aaron Goin Date: Wed, 18 Jun 2025 13:59:53 -0700 Subject: [PATCH 34/73] Adding support for tabi tables, and fixing small bug when generating empty object type (#13) * Adding support for tabi tables, and fixing small bug when generating empty object type * Fix update query * Fix type on update query * sime minor tweaks to tabi query types * lint and fixing deleteOne response * adding count query and fixing tests --- package-lock.json | 4 +- package.json | 2 +- src/commands/generate/index.ts | 29 +++ src/commands/generate/schemaTypes.ts | 16 +- src/commands/generate/table.ts | 193 ++++++++++++++++ src/commands/generate/types.ts | 1 - src/types/specifications.ts | 10 +- templates/index.d.ts.hbs | 2 + templates/index.js | 2 + templates/tabi/index.js | 97 +++++++++ templates/tabi/tables.js.hbs | 7 + templates/tabi/types.d.ts | 90 ++++++++ test/generateTables.spec.ts | 315 +++++++++++++++++++++++++++ test/generateTypes.spec.ts | 3 +- 14 files changed, 758 insertions(+), 13 deletions(-) create mode 100644 src/commands/generate/table.ts create mode 100644 templates/tabi/index.js create mode 100644 templates/tabi/tables.js.hbs create mode 100644 templates/tabi/types.d.ts create mode 100644 test/generateTables.spec.ts diff --git a/package-lock.json b/package-lock.json index 33c6c0f..ee29292 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "polyapi", - "version": "0.23.28", + "version": "0.24.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "polyapi", - "version": "0.23.28", + "version": "0.24.0", "license": "MIT", "dependencies": { "@guanghechen/helper-string": "4.7.1", diff --git a/package.json b/package.json index 41e7e38..13f05d7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.23.28", + "version": "0.24.0", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { diff --git a/src/commands/generate/index.ts b/src/commands/generate/index.ts index aad4865..5c9fca8 100644 --- a/src/commands/generate/index.ts +++ b/src/commands/generate/index.ts @@ -11,6 +11,7 @@ import { ServerFunctionSpecification, ServerVariableSpecification, Specification, + TableSpecification, WebhookHandleSpecification, } from '../../types'; import { getSpecs } from '../../api'; @@ -37,6 +38,7 @@ import { setGenerationErrors, } from './types'; import { generateSchemaTSDeclarationFiles } from './schemaTypes'; +import { generateTableTSDeclarationFiles } from './table'; // Register the eq helper for equality comparison handlebars.registerHelper('eq', (a, b) => a === b); @@ -62,6 +64,7 @@ const prepareDir = async (polyPath: string) => { fs.mkdirSync(`${libPath}/webhooks`); fs.mkdirSync(`${libPath}/server`); fs.mkdirSync(`${libPath}/vari`); + fs.mkdirSync(`${libPath}/tabi`); fs.mkdirSync(`${libPath}/schemas`); if (polyPath !== DEFAULT_POLY_PATH) { @@ -138,6 +141,9 @@ const generateJSFiles = async ( const serverVariables = specs.filter( (spec) => spec.type === 'serverVariable', ) as ServerVariableSpecification[]; + const tables = specs.filter( + (spec) => spec.type === 'table', + ) as TableSpecification[]; await generateIndexJSFile(libPath); await generatePolyCustomJSFile(libPath); @@ -164,6 +170,10 @@ const generateJSFiles = async ( generateServerVariableJSFiles(libPath, serverVariables), 'variables', ); + await tryAsync( + generateTableJSFiles(libPath, tables), + 'tables', + ); return customFnCodeGenerationErrors; }; @@ -323,6 +333,18 @@ const generateServerVariableJSFiles = async ( ); }; +const generateTableJSFiles = async ( + libPath: string, + specifications: TableSpecification[], +) => { + const tablesJSTemplate = handlebars.compile(loadTemplate('tabi/tables.js.hbs')); + fs.writeFileSync( + `${libPath}/tabi/tables.js`, + tablesJSTemplate({ specifications }), + ); + fs.copyFileSync(templateUrl('tabi/index.js'), `${libPath}/tabi/index.js`); +}; + const generateAuthFunctionJSFiles = async ( libPath: string, specifications: AuthFunctionSpecification[], @@ -607,6 +629,13 @@ export const generateSpecs = async ( ), 'schemas', ); + await tryAsync( + generateTableTSDeclarationFiles( + libPath, + filteredSpecs.filter((s) => s.type === 'table') as TableSpecification[], + ), + 'table types', + ); } generateContextDataFile(libPath, filteredSpecs); diff --git a/src/commands/generate/schemaTypes.ts b/src/commands/generate/schemaTypes.ts index ce77e56..2fd0522 100644 --- a/src/commands/generate/schemaTypes.ts +++ b/src/commands/generate/schemaTypes.ts @@ -56,13 +56,12 @@ export type JsonSchema = { $id?: string; $ref?: string; $schema?: string; - // eslint-disable-next-line @typescript-eslint/naming-convention - 'x-poly-ref'?: SchemaRef; deprecated?: boolean; nullable?: boolean; enum?: ConstValueT[]; const?: ConstValueT; definitions?: Record; + 'x-poly-ref'?: SchemaRef; [k: string]: unknown; }; @@ -72,7 +71,7 @@ export type SchemaSpec = Omit & { type SchemaTree = Record>; -const ws = memoize((depth = 1) => +export const ws = memoize((depth = 1) => depth < 0 ? '' : new Array(depth).fill(' ').join(''), ); const end = memoize((nested?: NestedT) => @@ -216,12 +215,13 @@ const printObjectSchema: PrintSchemaFn = ( schema.description, depth, schema.deprecated, - )}${ws(depth)}${printTypeName(schema.title, key, nested, optional)}{`; + )}${ws(depth)}${printTypeName(schema.title, key, nested, optional)}`; if ( schema.properties || schema.patternProperties || schema.additionalProperties ) { + result = `${result}{`; if (schema.properties) { Object.entries(schema.properties).forEach(([k, v]) => { result = `${result}${EOL}${printSchemaAsType( @@ -265,8 +265,12 @@ const printObjectSchema: PrintSchemaFn = ( } } result = `${result}${EOL}${ws(depth)}}${end(nested)}`; + } else if (nested) { + // Nested object type with no properties falls back to record type + result = `${result}Record${end(nested)}`; } else { - result = `${result}}${end(nested)}`; + // Non-nested object type uses empty interface {} + result = `${result}{}${end(nested)}`; } return result; }; @@ -500,7 +504,7 @@ const printConstSchema: PrintSchemaFn = ( }${end(nested)}`; }; -const printSchemaAsType: PrintSchemaFn = ( +export const printSchemaAsType: PrintSchemaFn = ( schema: JsonSchema, key, depth = 0, diff --git a/src/commands/generate/table.ts b/src/commands/generate/table.ts new file mode 100644 index 0000000..14ce910 --- /dev/null +++ b/src/commands/generate/table.ts @@ -0,0 +1,193 @@ +import fs from 'fs'; +import { EOL } from 'node:os'; +import { echoGenerationError, templateUrl } from '../../utils'; +import { TableSpecification } from '../../types'; +import { toPascalCase } from '@guanghechen/helper-string'; +import { set } from 'lodash'; +import { JsonSchema, printSchemaAsType, ws } from './schemaTypes'; +import { setGenerationErrors } from './types'; + +type TableTree = Record>; + +type TableRoot = { + path: string; + interfaceName: string; + namespaces: TableTree; + interfaces: Record; + hasTypes: boolean; +}; + +const buildTableTree = (specs: TableSpecification[]): TableRoot[] => { + const schemas: Record = { + default: { + path: 'default', + interfaceName: 'Tabi', + interfaces: {}, + namespaces: {}, + hasTypes: false, + }, + }; + for (const spec of specs) { + if (!spec.context) { + schemas.default.interfaces[spec.name] = spec; + schemas.default.namespaces[spec.name] = spec; + schemas.default.hasTypes = true; + continue; + } + const contextParts = spec.context.split('.'); + const last = contextParts.length - 1; + for (let i = 0; i <= last; i++) { + const name = contextParts[i]; + const interfaceName = i === last ? toPascalCase(name) : toPascalCase(contextParts[i]); + const path = contextParts.slice(0, i + 1).join('.'); + const parent = i ? contextParts.slice(0, i).join('.') : 'default'; + if (schemas[path]) continue; + schemas[path] = { + path, + interfaceName, + interfaces: {}, + namespaces: {}, + hasTypes: false, + }; + schemas[parent].interfaces[name] = interfaceName; + set(schemas[parent].namespaces, path, {}); + } + set(schemas[spec.context].namespaces, spec.contextName.split('.').map(v => toPascalCase(v)).join('.'), spec); + schemas[spec.context].interfaces[spec.name] = spec; + schemas[spec.context].hasTypes = true; + } + return Array.from(Object.values(schemas)); +}; + +const printTableInterface = (table: TableSpecification | string): string => { + if (typeof table === 'string') return `${table};`; + const _ws = ws(1); + const formattedName = table.contextName.split('.').map(v => toPascalCase(v)).join('.'); + return [ + '{', + `${_ws}count(query: ${formattedName}.CountQuery): Promise<${formattedName}.CountResult>;`, + `${_ws}selectMany(query: ${formattedName}.SelectManyQuery): Promise<${formattedName}.QueryResults>;`, + `${_ws}selectOne(query: ${formattedName}.SelectOneQuery): Promise<${formattedName}.QueryResult>;`, + `${_ws}insertMany(query: ${formattedName}.InsertManyQuery): Promise<${formattedName}.QueryResults>;`, + `${_ws}insertOne(query: ${formattedName}.InsertOneQuery): Promise<${formattedName}.QueryResult>;`, + `${_ws}upsertMany(query: ${formattedName}.InsertManyQuery): Promise<${formattedName}.QueryResults>;`, + `${_ws}upsertOne(query: ${formattedName}.InsertOneQuery): Promise<${formattedName}.QueryResult>;`, + `${_ws}updateMany(query: ${formattedName}.UpdateQuery): Promise<${formattedName}.QueryResults>;`, + `${_ws}updateOne(query: ${formattedName}.UpdateQuery): Promise<${formattedName}.QueryResult>;`, + `${_ws}deleteMany(query: ${formattedName}.DeleteQuery): Promise<${formattedName}.DeleteResults>;`, + `${_ws}deleteOne(query: ${formattedName}.DeleteQuery): Promise<${formattedName}.DeleteResult>;`, + '}', + ].join(`${EOL}${ws(2)}`); +}; + +const printTableNamespace = (schema: JsonSchema, name: string, depth = 1): string => { + return `${ws(depth)}namespace ${name} {${EOL}${ + printSchemaAsType(schema, 'Row', depth + 1) + }${EOL}${EOL}${ws(depth + 1)}${ + [ + 'type CountQuery = PolyCountQuery;', + 'type SelectManyQuery = PolySelectManyQuery;', + 'type SelectOneQuery = PolySelectOneQuery;', + 'type InsertManyQuery = PolyInsertManyQuery;', + 'type InsertOneQuery = PolyInsertOneQuery;', + 'type UpdateQuery = PolyUpdateQuery;', + 'type DeleteQuery = PolyDeleteQuery;', + 'type QueryResults = PolyQueryResults;', + 'type QueryResult = PolyQueryResult;', + 'type DeleteResults = PolyDeleteResults;', + 'type DeleteResult = PolyDeleteResult;', + 'type CountResult = PolyCountResult;', + ].join(`${EOL}${ws(depth + 1)}`) + }${EOL}${ws(depth)}}`; +}; + +const printTableTreeAsTypes = ( + table: TableTree, + name: string, + depth = 0, +): string => { + let result = `${ws(depth)}namespace ${name} {`; + for (const [key, child] of Object.entries(table)) { + if (!Object.keys(child).length) continue; + + let generated = ''; + if ('type' in child && child.type === 'table') { + try { + generated = printTableNamespace( + child.schema as JsonSchema, + (child.name || key) as string, + depth + 1, + ); + } catch (err) { + console.error(err); + echoGenerationError(child as TableSpecification); + setGenerationErrors(true); + } + } else { + generated = printTableTreeAsTypes(child as TableTree, key, depth + 1); + } + result = `${result}${EOL}${generated}`; + } + result = `${result}${EOL}${ws(depth)}}`; + return result; +}; + +const printTableRoot = (root: TableRoot): string => { + // print the interfaces + let result = 'declare namespace tabi {'; + // print the namespaces + if (root.hasTypes) { + for (const [key, table] of Object.entries(root.namespaces)) { + if (!Object.keys(table).length) continue; + const types = + 'type' in table && table.type === 'table' + ? printTableNamespace(table.schema as JsonSchema, key, 1) + : printTableTreeAsTypes(table as TableTree, key, 1); + result = `${result}${EOL}${types}`; + } + result = `${result}${EOL}`; + } + // print the interfaces + result = `${result}${EOL}${ws(1)}interface ${root.interfaceName} {${ + Object.entries(root.interfaces).map(([k, v]) => `${EOL}${ws(2)}${k}: ${printTableInterface(v)}`).join('') + }${EOL}${ws(1)}}`; + + // close the module + result = `${result}${EOL}}`; + return result; +}; + +const printTableSpecs = (specs: TableSpecification[]): Record => { + const tables = buildTableTree(specs); + // then print all the schema types as strings ready to be saved to disk + const fileMap = Object.fromEntries( + tables.map((table) => [`${table.path}.d.ts`, printTableRoot(table)]), + ); + fileMap['index.d.ts'] = Object.keys(fileMap) + .map((file) => `/// `) + .concat(['/// ']) + .join(EOL); + return fileMap; +}; + +export const generateTableTSDeclarationFiles = async ( + libPath: string, + specs: TableSpecification[], +) => { + const files = printTableSpecs(specs); + await Promise.all( + Object.entries(files).map( + ([file, contents]) => + new Promise((resolve, reject) => + fs.writeFile(`${libPath}/tabi/${file}`, contents, (err) => + err ? reject(err) : resolve(), + ), + ), + ), + ); + fs.copyFileSync(templateUrl('tabi/types.d.ts'), `${libPath}/tabi/types.d.ts`); +}; + +export const __test = { + printTableSpecs, +}; diff --git a/src/commands/generate/types.ts b/src/commands/generate/types.ts index 3e9aa17..42f81a6 100644 --- a/src/commands/generate/types.ts +++ b/src/commands/generate/types.ts @@ -81,7 +81,6 @@ const schemaToDeclarations = async ( unknownAny: options.unknownAny, customName(innerSchema, keyNameFromDefinition) { const ref = innerSchema['x-poly-ref'] as - // eslint-disable-next-line @typescript-eslint/naming-convention | (SchemaRef & { 'x-unresolved'?: true }) | undefined; diff --git a/src/types/specifications.ts b/src/types/specifications.ts index a483beb..5b3acff 100644 --- a/src/types/specifications.ts +++ b/src/types/specifications.ts @@ -13,6 +13,7 @@ export type SpecificationType = | 'serverFunction' | 'serverVariable' | 'snippet' + | 'table' | 'schema'; export interface ISpecification { @@ -154,6 +155,12 @@ export interface SchemaSpecification extends ISpecification { unresolvedPolySchemaRefs?: SchemaRef[]; } +export interface TableSpecification extends ISpecification { + type: 'table'; + schema: Record; + unresolvedPolySchemaRefs?: SchemaRef[]; +} + export type Specification = | ApiFunctionSpecification | CustomFunctionSpecification @@ -162,7 +169,8 @@ export type Specification = | WebhookHandleSpecification | ServerVariableSpecification | SnippetSpecification - | SchemaSpecification; + | SchemaSpecification + | TableSpecification; interface CreateWebhookHandleDtoForSpecificationInput extends CreateWebhookHandleDto { diff --git a/templates/index.d.ts.hbs b/templates/index.d.ts.hbs index 3816d76..4cd088b 100644 --- a/templates/index.d.ts.hbs +++ b/templates/index.d.ts.hbs @@ -3,6 +3,7 @@ {{/each}} /// /// +/// {{#each contexts}} {{#if firstLevel}} @@ -60,6 +61,7 @@ interface ErrorHandler { } export const errorHandler: ErrorHandler; export const vari: vari.Vari; +export const tabi: tabi.Tabi; /** * This type contain all schemas saved into poly. diff --git a/templates/index.js b/templates/index.js index 0c04213..2830db8 100644 --- a/templates/index.js +++ b/templates/index.js @@ -6,6 +6,7 @@ const webhooks = require('./webhooks'); const authFunctions = require('./auth'); const serverFunctions = require('./server'); const vari = require('./vari'); +const tabi = require('./tabi'); const polyCustom = require('./poly-custom'); const { createErrorHandler, sendLocalErrorEvent } = require('./error-handler'); const { CLIENT_ID, API_KEY, API_BASE_URL } = require('./constants'); @@ -72,5 +73,6 @@ module.exports = { ...poly, errorHandler: createErrorHandler(getApiKey, getSocket), vari: vari(CLIENT_ID, getSocket, getApiKey), + tabi: tabi(CLIENT_ID, polyCustom), polyCustom, }; diff --git a/templates/tabi/index.js b/templates/tabi/index.js new file mode 100644 index 0000000..4b94d03 --- /dev/null +++ b/templates/tabi/index.js @@ -0,0 +1,97 @@ +const { axios, scrubKeys } = require('../axios'); +const set = require('lodash/set'); +const { tables } = require('./tables'); + + +const executeQuery = (id, method, query, clientID, polyCustom) => + axios.post( + `/tables/${id}/${method}?clientId=${clientID}`, + query, + { + headers: { + 'x-poly-execution-id': polyCustom.executionId, + } + } + ) + .then(({ data }) => data) + .catch(scrubKeys); + +const firstResult = (rsp) => { + if (Array.isArray(rsp.results)) { + return rsp?.results.length ? rsp.results[0] : null; + } + // Else rsp is some kind of error + return rsp; +} + +const deleteOneResponse = (rsp) => { + if (typeof rsp.deleted === 'number') { + return { deleted: rsp.deleted > 0 }; + } + // Else rsp is some kind of error + return rsp; +} + +class Table { + constructor(id, clientID, polyCustom) { + this.id = id; + this.clientID = clientID; + this.polyCustom = polyCustom; + } + + count(query) { + return executeQuery(this.id, 'count', query, this.clientID, this.polyCustom); + } + + selectMany(query) { + query.limit = query.limit || 1000; + if (query.limit > 1000) throw Error(`Cannot select more than 1000 rows at a time.`); + return executeQuery(this.id, 'select', query, this.clientID, this.polyCustom); + } + + selectOne(query) { + query.limit = 1; + return executeQuery(this.id, 'select', query, this.clientID, this.polyCustom).then(firstResult); + } + + insertMany(query) { + if (query.data.length > 1000) throw Error(`Cannot insert more than 1000 rows at a time.`); + return executeQuery(this.id, 'insert', query, this.clientID, this.polyCustom); + } + + insertOne(query){ + query.data = [query.data]; + return executeQuery(this.id, 'insert', query, this.clientID, this.polyCustom).then(firstResult); + } + + upsertMany(query) { + if (query.data.length > 1000) throw Error(`Cannot upsert more than 1000 rows at a time.`); + return executeQuery(this.id, 'upsert', query, this.clientID, this.polyCustom); + } + + upsertOne(query) { + query.data = [query.data]; + return executeQuery(this.id, 'upsert', query, this.clientID, this.polyCustom).then(firstResult); + } + + updateMany(query) { + return executeQuery(this.id, 'update', query, this.clientID, this.polyCustom); + } + + updateOne(query) { + return executeQuery(this.id, 'update', query, this.clientID, this.polyCustom).then(firstResult); + } + + deleteMany(query) { + return executeQuery(this.id, 'delete', query, this.clientID, this.polyCustom); + } + + deleteOne(query) { + return executeQuery(this.id, 'delete', query, this.clientID, this.polyCustom).then(deleteOneResponse); + } +} + +module.exports = (clientID, polyCustom) => tables.reduce( + (acc, [path, id]) => set(acc, path, new Table(id, clientID, polyCustom)), + {} +); \ No newline at end of file diff --git a/templates/tabi/tables.js.hbs b/templates/tabi/tables.js.hbs new file mode 100644 index 0000000..dbc143c --- /dev/null +++ b/templates/tabi/tables.js.hbs @@ -0,0 +1,7 @@ +module.exports = { + tables: [ + {{#each specifications}} + ['{{#if context}}{{context}}.{{/if}}{{name}}', '{{id}}'], + {{/each}} + ], +}; \ No newline at end of file diff --git a/templates/tabi/types.d.ts b/templates/tabi/types.d.ts new file mode 100644 index 0000000..34f712f --- /dev/null +++ b/templates/tabi/types.d.ts @@ -0,0 +1,90 @@ + +// Utility to collapse the generics down to a raw object +type Clean> = T extends infer U ? { [K in keyof U]: U[K] } : never; + +// Utility to ensure at least one of the object's properties is defined +type Subset = { + [K in keyof T]: Required> & Partial> +}[keyof T]; + +type OptionalPolyColumns> = Omit & { + id?: string; + createdAt?: string; + updatedAt?: string; +} + +type QueryMode = 'default' | 'insensitive'; + +type ColumnFilter = Clean<{ + [K in Single]?: C; +} & { + [K in Many]?: C[]; +} & { + not?: C | ColumnFilter; +}> + +type Filter = C extends string + ? Clean & { mode?: QueryMode }> + : C extends number + ? ColumnFilter + : ColumnFilter + +type Where> = Clean<{ + [C in keyof T]?: T[C] | Filter; +} & { + AND?: Where | Where[]; + OR?: Where[]; + NOT?: Where | Where[]; +}>; + +type PolyCountQuery> = Clean<{ + where?: Where; +}>; + +type PolySelectOneQuery> = Clean<{ + where?: Where; + orderBy?: Record; +}>; + +type PolySelectManyQuery> = Clean<{ + where?: Where; + limit?: number; // 1000 is max limit for now + offset?: number; + orderBy?: Record; +}>; + +type PolyDeleteQuery> = Clean<{ + where?: Where; +}>; + +type PolyInsertOneQuery> = Clean<{ + data: OptionalPolyColumns; +}>; + +type PolyInsertManyQuery> = Clean<{ + data: OptionalPolyColumns[]; +}>; + +type PolyUpdateQuery> = Clean<{ + where?: Where; + data: Subset; +}>; + +type PolyQueryResults> = Clean<{ + results: T[]; + pagination: null; +}>; + +type PolyQueryResult> = Clean | null; + +type PolyDeleteResults = { + deleted: number; +} + +type PolyDeleteResult = { + deleted: boolean; +} + +type PolyCountResult = { + count: boolean; +} \ No newline at end of file diff --git a/test/generateTables.spec.ts b/test/generateTables.spec.ts new file mode 100644 index 0000000..3621d5f --- /dev/null +++ b/test/generateTables.spec.ts @@ -0,0 +1,315 @@ +import { EOL } from 'node:os'; +import { __test } from '../src/commands/generate/table'; +import { TableSpecification } from '../src/types'; + +const { + printTableSpecs +} = __test; + +// Utility to make creating multiline strings in more precise way than is possible with template literal strings +const multiline = (...lines: string[]) => lines.join(EOL); + + +describe('printTableSpecs', () => { + + test('single spec', () => { + const specs: TableSpecification[] = [ + { + 'id': 'ad5edb98-9eeb-4bb5-8122-32f9a6f6b512', + 'name': 'MyTable', + 'context': 'aaron.testing', + 'contextName': 'aaron.testing.MyTable', + 'type': 'table', + 'schema': { + 'type': 'object', + 'properties': { + 'object': { + 'type': 'string', + 'enum': [ + 'organization.project.api_key.deleted' + ] + }, + 'id': { + 'type': 'string' + }, + 'deleted': { + 'type': 'boolean' + } + }, + 'required': [ + 'object', + 'id', + 'deleted' + ], + 'additionalProperties': false, + '$schema': 'http://json-schema.org/draft-06/schema#', + }, + 'visibilityMetadata': { + 'visibility': 'ENVIRONMENT' + }, + 'unresolvedPolySchemaRefs': [] + } as TableSpecification + ]; + + const result = printTableSpecs(specs); + + expect(result['index.d.ts']).toEqual( + multiline( + '/// ', + '/// ', + '/// ', + '/// ', + ) + ); + expect(result['default.d.ts']).toEqual( + multiline( + 'declare namespace tabi {', + ' interface Tabi {', + ' aaron: Aaron;', + ' }', + '}', + ) + ); + + expect(result['aaron.d.ts']).toEqual( + multiline( + 'declare namespace tabi {', + ' interface Aaron {', + ' testing: Testing;', + ' }', + '}', + ) + ); + expect(result['aaron.testing.d.ts']).toEqual( + multiline( + 'declare namespace tabi {', + ' namespace Aaron {', + ' namespace Testing {', + ' namespace MyTable {', + ' type Row = {', + ' object: \'organization.project.api_key.deleted\';', + ' id: string;', + ' deleted: boolean;', + ' };', + '', + ' type CountQuery = PolyCountQuery;', + ' type SelectManyQuery = PolySelectManyQuery;', + ' type SelectOneQuery = PolySelectOneQuery;', + ' type InsertManyQuery = PolyInsertManyQuery;', + ' type InsertOneQuery = PolyInsertOneQuery;', + ' type UpdateQuery = PolyUpdateQuery;', + ' type DeleteQuery = PolyDeleteQuery;', + ' type QueryResults = PolyQueryResults;', + ' type QueryResult = PolyQueryResult;', + ' type DeleteResults = PolyDeleteResults;', + ' type DeleteResult = PolyDeleteResult;', + ' type CountResult = PolyCountResult;', + ' }', + ' }', + ' }', + '', + ' interface Testing {', + ' MyTable: {', + ' count(query: Aaron.Testing.MyTable.CountQuery): Promise;', + ' selectMany(query: Aaron.Testing.MyTable.SelectManyQuery): Promise;', + ' selectOne(query: Aaron.Testing.MyTable.SelectOneQuery): Promise;', + ' insertMany(query: Aaron.Testing.MyTable.InsertManyQuery): Promise;', + ' insertOne(query: Aaron.Testing.MyTable.InsertOneQuery): Promise;', + ' upsertMany(query: Aaron.Testing.MyTable.InsertManyQuery): Promise;', + ' upsertOne(query: Aaron.Testing.MyTable.InsertOneQuery): Promise;', + ' updateMany(query: Aaron.Testing.MyTable.UpdateQuery): Promise;', + ' updateOne(query: Aaron.Testing.MyTable.UpdateQuery): Promise;', + ' deleteMany(query: Aaron.Testing.MyTable.DeleteQuery): Promise;', + ' deleteOne(query: Aaron.Testing.MyTable.DeleteQuery): Promise;', + ' }', + ' }', + '}', + ) + ); + }); + + test('multiple spec', () => { + const specs: TableSpecification[] = [ + { + 'id': 'ad5edb98-9eeb-4bb5-8122-32f9a6f6b512', + 'name': 'MyTable', + 'context': 'aaron.testing', + 'contextName': 'aaron.testing.MyTable', + 'type': 'table', + 'schema': { + 'type': 'object', + 'properties': { + 'object': { + 'type': 'string', + 'enum': [ + 'organization.project.api_key.deleted' + ] + }, + 'id': { + 'type': 'string' + }, + 'deleted': { + 'type': 'boolean' + } + }, + 'required': [ + 'object', + 'id', + 'deleted' + ], + 'additionalProperties': false, + '$schema': 'http://json-schema.org/draft-06/schema#', + }, + 'visibilityMetadata': { + 'visibility': 'ENVIRONMENT' + }, + 'unresolvedPolySchemaRefs': [] + } as TableSpecification, + { + 'id': 'ad5edb98-9eeb-4bb5-8122-32f9a6f6b512', + 'name': 'OtherTable', + 'context': '', + 'contextName': 'OtherTable', + 'type': 'table', + 'schema': { + 'type': 'object', + 'properties': { + 'object': { + 'type': 'string', + 'enum': [ + 'organization.project.api_key.deleted' + ] + }, + 'id': { + 'type': 'string' + }, + 'deleted': { + 'type': 'boolean' + } + }, + 'required': [ + 'object', + 'id', + 'deleted' + ], + 'additionalProperties': false, + '$schema': 'http://json-schema.org/draft-06/schema#', + }, + 'visibilityMetadata': { + 'visibility': 'ENVIRONMENT' + }, + 'unresolvedPolySchemaRefs': [] + } as TableSpecification + ]; + + const result = printTableSpecs(specs); + + expect(result['index.d.ts']).toEqual( + multiline( + '/// ', + '/// ', + '/// ', + '/// ', + ) + ); + expect(result['default.d.ts']).toEqual( + multiline( + 'declare namespace tabi {', + ' namespace OtherTable {', + ' type Row = {', + ' object: \'organization.project.api_key.deleted\';', + ' id: string;', + ' deleted: boolean;', + ' };', + '', + ' type CountQuery = PolyCountQuery;', + ' type SelectManyQuery = PolySelectManyQuery;', + ' type SelectOneQuery = PolySelectOneQuery;', + ' type InsertManyQuery = PolyInsertManyQuery;', + ' type InsertOneQuery = PolyInsertOneQuery;', + ' type UpdateQuery = PolyUpdateQuery;', + ' type DeleteQuery = PolyDeleteQuery;', + ' type QueryResults = PolyQueryResults;', + ' type QueryResult = PolyQueryResult;', + ' type DeleteResults = PolyDeleteResults;', + ' type DeleteResult = PolyDeleteResult;', + ' type CountResult = PolyCountResult;', + ' }', + '', + ' interface Tabi {', + ' aaron: Aaron;', + ' OtherTable: {', + ' count(query: OtherTable.CountQuery): Promise;', + ' selectMany(query: OtherTable.SelectManyQuery): Promise;', + ' selectOne(query: OtherTable.SelectOneQuery): Promise;', + ' insertMany(query: OtherTable.InsertManyQuery): Promise;', + ' insertOne(query: OtherTable.InsertOneQuery): Promise;', + ' upsertMany(query: OtherTable.InsertManyQuery): Promise;', + ' upsertOne(query: OtherTable.InsertOneQuery): Promise;', + ' updateMany(query: OtherTable.UpdateQuery): Promise;', + ' updateOne(query: OtherTable.UpdateQuery): Promise;', + ' deleteMany(query: OtherTable.DeleteQuery): Promise;', + ' deleteOne(query: OtherTable.DeleteQuery): Promise;', + ' }', + ' }', + '}', + ) + ); + + expect(result['aaron.d.ts']).toEqual( + multiline( + 'declare namespace tabi {', + ' interface Aaron {', + ' testing: Testing;', + ' }', + '}', + ) + ); + expect(result['aaron.testing.d.ts']).toEqual( + multiline( + 'declare namespace tabi {', + ' namespace Aaron {', + ' namespace Testing {', + ' namespace MyTable {', + ' type Row = {', + ' object: \'organization.project.api_key.deleted\';', + ' id: string;', + ' deleted: boolean;', + ' };', + '', + ' type CountQuery = PolyCountQuery;', + ' type SelectManyQuery = PolySelectManyQuery;', + ' type SelectOneQuery = PolySelectOneQuery;', + ' type InsertManyQuery = PolyInsertManyQuery;', + ' type InsertOneQuery = PolyInsertOneQuery;', + ' type UpdateQuery = PolyUpdateQuery;', + ' type DeleteQuery = PolyDeleteQuery;', + ' type QueryResults = PolyQueryResults;', + ' type QueryResult = PolyQueryResult;', + ' type DeleteResults = PolyDeleteResults;', + ' type DeleteResult = PolyDeleteResult;', + ' type CountResult = PolyCountResult;', + ' }', + ' }', + ' }', + '', + ' interface Testing {', + ' MyTable: {', + ' count(query: Aaron.Testing.MyTable.CountQuery): Promise;', + ' selectMany(query: Aaron.Testing.MyTable.SelectManyQuery): Promise;', + ' selectOne(query: Aaron.Testing.MyTable.SelectOneQuery): Promise;', + ' insertMany(query: Aaron.Testing.MyTable.InsertManyQuery): Promise;', + ' insertOne(query: Aaron.Testing.MyTable.InsertOneQuery): Promise;', + ' upsertMany(query: Aaron.Testing.MyTable.InsertManyQuery): Promise;', + ' upsertOne(query: Aaron.Testing.MyTable.InsertOneQuery): Promise;', + ' updateMany(query: Aaron.Testing.MyTable.UpdateQuery): Promise;', + ' updateOne(query: Aaron.Testing.MyTable.UpdateQuery): Promise;', + ' deleteMany(query: Aaron.Testing.MyTable.DeleteQuery): Promise;', + ' deleteOne(query: Aaron.Testing.MyTable.DeleteQuery): Promise;', + ' }', + ' }', + '}', + ) + ); + }); +}); \ No newline at end of file diff --git a/test/generateTypes.spec.ts b/test/generateTypes.spec.ts index b016393..c9c5a01 100644 --- a/test/generateTypes.spec.ts +++ b/test/generateTypes.spec.ts @@ -1,9 +1,8 @@ import { EOL } from 'node:os'; -import { JsonSchema, SchemaSpec, __test } from '../src/commands/generate/schemaTypes'; +import { JsonSchema, SchemaSpec, printSchemaAsType, __test } from '../src/commands/generate/schemaTypes'; const { formatName, - printSchemaAsType, printComment, buildSchemaTree, printSchemaSpecs From d2164a9ec07ba5a3af226c0a45c1479c6070b64b Mon Sep 17 00:00:00 2001 From: Richard Date: Mon, 23 Jun 2025 12:40:51 +0200 Subject: [PATCH 35/73] 4324 p2 add new field cachepolylibrary false to customfunction table if its set to true do the behavior now behind faascachingenabled (#19) * adds support for cachePolyLibrary for server functions in glide and cache-poly-library flag * increment version --- index.d.ts | 5 ++++- package.json | 2 +- src/cli.ts | 8 ++++++++ src/commands/function.ts | 3 ++- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/index.d.ts b/index.d.ts index 64172ce..1c4536c 100644 --- a/index.d.ts +++ b/index.d.ts @@ -11,7 +11,10 @@ type PolyDeployable = {}> = { type PolyFunction = PolyDeployable<{ logsEnabled?: boolean; visibility?: Visibility }>; -export type PolyServerFunction = PolyFunction & { alwaysOn?: boolean }; +export type PolyServerFunction = PolyFunction & { + alwaysOn?: boolean; + cachePolyLibrary?: boolean; +}; export type PolyClientFunction = PolyFunction; diff --git a/package.json b/package.json index 13f05d7..8356e86 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.24.0", + "version": "0.24.1", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { diff --git a/src/cli.ts b/src/cli.ts index 2e6223e..75d9e16 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -236,6 +236,10 @@ void yargs .option('execution-api-key', { describe: 'Optional API key for server functions', type: 'string', + }) + .option('cache-poly-library', { + describe: 'Server function only - cache the poly library to improve function performance', + type: 'boolean', }), async ({ name, @@ -247,6 +251,7 @@ void yargs logs, generateContexts, executionApiKey, + cachePolyLibrary, }) => { const logsEnabled = logs === 'enabled' ? true : logs === 'disabled' ? false : undefined; @@ -266,6 +271,8 @@ void yargs ? 'Invalid value for `logs` option.' : executionApiKey && !uuidValidate(executionApiKey) ? 'Invalid value for `execution-api-key`. Must be a valid PolyAPI Key.' + : cachePolyLibrary && !server + ? 'Option `cache-poly-library` is only for server functions (--server).' : ''; if (err) { shell.echo(chalk.redBright('ERROR:'), err); @@ -286,6 +293,7 @@ void yargs logsEnabled, generateContexts, executionApiKey, + cachePolyLibrary, ); }, ); diff --git a/src/commands/function.ts b/src/commands/function.ts index c340a7d..65e0a54 100644 --- a/src/commands/function.ts +++ b/src/commands/function.ts @@ -1,4 +1,3 @@ - import fs from 'fs'; import chalk from 'chalk'; import shell from 'shelljs'; @@ -31,6 +30,7 @@ export const addOrUpdateCustomFunction = async ( logsEnabled: boolean | undefined, generateContexts: string | undefined, executionApiKey: string | null | undefined, + cachePolyLibrary: boolean | undefined, ) => { loadConfig(polyPath); @@ -96,6 +96,7 @@ export const addOrUpdateCustomFunction = async ( const other: Record = {}; if (generateContexts) { other.generateContexts = generateContexts.split(','); } if (logsEnabled !== undefined) other.logsEnabled = logsEnabled; + if (cachePolyLibrary !== undefined) other.cachePolyLibrary = cachePolyLibrary; customFunction = await createOrUpdateServerFunction( context, From 5be6c81bc0f1b8707fd83df21b31f7d8c8e5e44e Mon Sep 17 00:00:00 2001 From: Richard Date: Mon, 23 Jun 2025 12:41:42 +0200 Subject: [PATCH 36/73] P3) TS Client: Log PolyAPI Library version on function startup (#20) * welcome message for users with package version * show welcome message on first use --- package.json | 3 ++- src/cli.ts | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 8356e86..1ea673b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.24.1", + "version": "0.24.2", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { @@ -28,6 +28,7 @@ "prepublishOnly": "npm run lint && npm run build", "preversion": "npm run lint", "postversion": "git push && git push --tags", + "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js" }, "devDependencies": { diff --git a/src/cli.ts b/src/cli.ts index 75d9e16..ed550b4 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -8,12 +8,47 @@ import { loadConfig } from './config'; import { type RenameT } from './commands/model'; import { DEFAULT_POLY_PATH } from './constants'; import { isValidHttpUrl } from './utils'; +import fs from 'fs'; +import path from 'path'; if (process.env.NO_COLOR) { // Support NO_COLOR env variable https://no-color.org/ chalk.level = 0; } +const showWelcomeIfFirstTime = () => { + try { + const polyDir = DEFAULT_POLY_PATH; + const welcomeFile = path.join(polyDir, '.welcome-shown'); + + // If welcome has already been shown, return early + if (fs.existsSync(welcomeFile)) { + return; + } + + // Get version from package.json + const packagePath = path.join(__dirname, '..', 'package.json'); + const packageJson = JSON.parse(fs.readFileSync(packagePath, 'utf8')); + const version = packageJson.version; + + // Show welcome message + console.log(''); + console.log(chalk.green('✓ PolyAPI SDK installed successfully!')); + console.log(chalk.blue(`📦 Version: ${version}`)); + console.log(''); + console.log(chalk.yellow('Getting started:')); + console.log(' • Run ' + chalk.cyan('poly --help') + ' to see all available commands'); + console.log(' • Run ' + chalk.cyan('poly setup') + ' to configure your Poly connection'); + console.log(''); + + // Ensure .poly directory exists and mark welcome as shown + fs.mkdirSync(polyDir, { recursive: true }); + fs.writeFileSync(welcomeFile, new Date().toISOString()); + } catch (error) { + // Silently fail if there's an issue - don't break the CLI + } +}; + const checkPolyConfig = (polyPath: string) => { loadConfig(polyPath); @@ -24,6 +59,9 @@ const checkPolyConfig = (polyPath: string) => { return true; }; +// Show welcome message on first usage +showWelcomeIfFirstTime(); + void yargs .usage('$0 [args]') .command( From d166c4b22689657e5802894574524e9fd30dd44d Mon Sep 17 00:00:00 2001 From: Aaron Goin Date: Tue, 24 Jun 2025 13:55:05 -0700 Subject: [PATCH 37/73] Updating server function configs to support more properties, allowing for setting description via the config, and fixing bug where tabi tables could not be lowercase --- index.d.ts | 8 ++++++-- package.json | 2 +- src/commands/generate/table.ts | 4 ++-- src/dependencies.ts | 2 +- src/deployables.ts | 1 + src/transpiler.ts | 9 +++++++++ test/generateTables.spec.ts | 6 +++--- 7 files changed, 23 insertions(+), 9 deletions(-) diff --git a/index.d.ts b/index.d.ts index 1c4536c..4d689e0 100644 --- a/index.d.ts +++ b/index.d.ts @@ -6,14 +6,18 @@ type Visibility = 'PUBLIC' | 'TENANT' | 'ENVIRONMENT'; type PolyDeployable = {}> = { context: string; name: string; + description?: string; disableAi?: boolean; // Disable use of AI for filling in missing descriptions } & CustomConfig; -type PolyFunction = PolyDeployable<{ logsEnabled?: boolean; visibility?: Visibility }>; +type PolyFunction = PolyDeployable<{ visibility?: Visibility }>; export type PolyServerFunction = PolyFunction & { - alwaysOn?: boolean; + alwaysOn?: boolean; + logsEnabled?: boolean; + serverSideAsync?: boolean; cachePolyLibrary?: boolean; + generateContexts?: string[]; }; export type PolyClientFunction = PolyFunction; diff --git a/package.json b/package.json index 1ea673b..6981f9b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.24.2", + "version": "0.24.3", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { diff --git a/src/commands/generate/table.ts b/src/commands/generate/table.ts index 14ce910..dc90f5d 100644 --- a/src/commands/generate/table.ts +++ b/src/commands/generate/table.ts @@ -38,7 +38,7 @@ const buildTableTree = (specs: TableSpecification[]): TableRoot[] => { const last = contextParts.length - 1; for (let i = 0; i <= last; i++) { const name = contextParts[i]; - const interfaceName = i === last ? toPascalCase(name) : toPascalCase(contextParts[i]); + const interfaceName = toPascalCase(i === last ? name : contextParts[i]); const path = contextParts.slice(0, i + 1).join('.'); const parent = i ? contextParts.slice(0, i).join('.') : 'default'; if (schemas[path]) continue; @@ -81,7 +81,7 @@ const printTableInterface = (table: TableSpecification | string): string => { }; const printTableNamespace = (schema: JsonSchema, name: string, depth = 1): string => { - return `${ws(depth)}namespace ${name} {${EOL}${ + return `${ws(depth)}namespace ${toPascalCase(name)} {${EOL}${ printSchemaAsType(schema, 'Row', depth + 1) }${EOL}${EOL}${ws(depth + 1)}${ [ diff --git a/src/dependencies.ts b/src/dependencies.ts index 6f616b7..263fcf9 100644 --- a/src/dependencies.ts +++ b/src/dependencies.ts @@ -11,7 +11,7 @@ export const libraryMinVersionMap: Record = { 'ts-node': '5.0.0', typescript: '4.0.2', }; -const MIN_NODE_VERSION: VersionT = '18.20.5'; +const MIN_NODE_VERSION: VersionT = '20.19.3'; const DEFAULT_TS_CONFIG = { compilerOptions: { diff --git a/src/deployables.ts b/src/deployables.ts index 419cfa1..b6ffed5 100644 --- a/src/deployables.ts +++ b/src/deployables.ts @@ -43,6 +43,7 @@ export type ParsedDeployableConfig = { context: string; name: string; type: DeployableTypes; + description?: string; disableAi?: boolean; config: Record; }; diff --git a/src/transpiler.ts b/src/transpiler.ts index 0ece9ab..20c7299 100644 --- a/src/transpiler.ts +++ b/src/transpiler.ts @@ -367,6 +367,7 @@ const getFunctionDetails = ( const types = parseTSTypes(node, sourceFile); if ( jsDoc && + types.params.length === jsDoc.params.length && types.params.every( (p, i) => p.type === jsDoc.params[i].type && p.name === jsDoc.params[i].name, @@ -419,6 +420,14 @@ const parseDeployableFunction = ( ): DeployableRecord => { const [deployments, deploymentCommentRanges] = getDeployComments(sourceFile); const functionDetails = getFunctionDetails(sourceFile, polyConfig.name); + if (polyConfig.description) { + if (polyConfig.description !== functionDetails.types.description) { + functionDetails.types.description = polyConfig.description; + functionDetails.dirty = true; + } + } else { + polyConfig.description = functionDetails.types.description || ''; + } const dependencies = getDependencies(sourceFile.getFullText(), sourceFile.fileName, baseUrl); const typeSchemas = generateTypeSchemas(sourceFile.fileName, DeployableTypeEntries.map(d => d[0]), polyConfig.name); return { diff --git a/test/generateTables.spec.ts b/test/generateTables.spec.ts index 3621d5f..5e45dad 100644 --- a/test/generateTables.spec.ts +++ b/test/generateTables.spec.ts @@ -16,9 +16,9 @@ describe('printTableSpecs', () => { const specs: TableSpecification[] = [ { 'id': 'ad5edb98-9eeb-4bb5-8122-32f9a6f6b512', - 'name': 'MyTable', + 'name': 'myTable', 'context': 'aaron.testing', - 'contextName': 'aaron.testing.MyTable', + 'contextName': 'aaron.testing.myTable', 'type': 'table', 'schema': { 'type': 'object', @@ -109,7 +109,7 @@ describe('printTableSpecs', () => { ' }', '', ' interface Testing {', - ' MyTable: {', + ' myTable: {', ' count(query: Aaron.Testing.MyTable.CountQuery): Promise;', ' selectMany(query: Aaron.Testing.MyTable.SelectManyQuery): Promise;', ' selectOne(query: Aaron.Testing.MyTable.SelectOneQuery): Promise;', From 20bba634a5a8421f7c69ee54cb64987064fc2762 Mon Sep 17 00:00:00 2001 From: Daniel-Estoll <115661842+Daniel-Estoll@users.noreply.github.com> Date: Thu, 26 Jun 2025 11:34:12 -0600 Subject: [PATCH 38/73] 4504 p3 glide bug npx poly prepare does not find any deployables in windows (#21) * Changed command structure to fix windows glide bug * Added comment to explain strange syntax * Allowed directories to be specified in the command * Updated excludeCommand quotations and comment * Updated version * Added package-lock.json * Fixed config name TypeError * Revert "Fixed config name TypeError" This reverts commit 7b3208666c48679e0366a5d179d301d355be55e8. * Fixed windows find deployables command to ignore files without polyConfig --- package-lock.json | 4 ++-- package.json | 2 +- src/commands/prepare.ts | 11 ++++------- src/deployables.ts | 14 ++++++-------- 4 files changed, 13 insertions(+), 18 deletions(-) diff --git a/package-lock.json b/package-lock.json index ee29292..169f182 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "polyapi", - "version": "0.24.0", + "version": "0.24.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "polyapi", - "version": "0.24.0", + "version": "0.24.4", "license": "MIT", "dependencies": { "@guanghechen/helper-string": "4.7.1", diff --git a/package.json b/package.json index 6981f9b..3cc327b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.24.3", + "version": "0.24.4", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { diff --git a/src/commands/prepare.ts b/src/commands/prepare.ts index f71e840..0b5db55 100644 --- a/src/commands/prepare.ts +++ b/src/commands/prepare.ts @@ -160,16 +160,13 @@ export const prepareDeployables = async ( writeUpdatedDeployable(deployable, disableDocs), ), ); - const staged = shell.exec('git diff --name-only --cached') + const staged = shell.exec('git diff --name-only --cached', {silent:true}) .toString().split('\n').filter(Boolean); - const rootPath: string = shell.exec('git rev-parse --show-toplevel', {silent:true}) - .toString('utf8').replace('\n', ''); for (const deployable of dirtyDeployables) { try{ - const deployableName = deployable.file.replace(`${rootPath}/`, ''); - if (staged.includes(deployableName)) { - shell.echo(`Staging ${deployableName}`); - shell.exec(`git add ${deployableName}`); + if (staged.includes(deployable.file)) { + shell.echo(`Staging ${deployable.file}`); + shell.exec(`git add ${deployable.file}`); } } catch (error) { diff --git a/src/deployables.ts b/src/deployables.ts index b6ffed5..bbb3698 100644 --- a/src/deployables.ts +++ b/src/deployables.ts @@ -177,15 +177,13 @@ export const getAllDeployableFilesWindows = ({ .join(' ') : ''; const pattern = typeNames.length > 0 - ? typeNames.map((name) => `\\`).join(' ') - : 'polyConfig'; + ? typeNames.map((name) => `/C:"polyConfig: ${name}"`).join(' ') + : 'C/:"polyConfig"'; - // Using two regular quotes or two smart quotes throws "The syntax of the command is incorrect". - // For some reason, starting with a regular quote and leaving the end without a quote works. const excludeCommand = excludePattern - ? ` | findstr /V /I "${excludePattern}` + ? ` | findstr /V /I "${excludePattern}"` : ''; - const searchCommand = ` | findstr /M /I /F:/ ${pattern}`; + const searchCommand = ` | findstr /M /I /S /F:/ ${pattern} *.*`; let result: string[] = []; for (const dir of includeDirs) { @@ -197,10 +195,10 @@ export const getAllDeployableFilesWindows = ({ : includeFilesOrExtensions .map((f) => (f.includes('.') ? f : `${dir}*.${f}`)) .join(' '); - const dirCommand = `dir ${includePattern} /S /P /B`; + const dirCommand = `dir ${includePattern} /S /P /B > NUL`; const fullCommand = `${dirCommand}${excludeCommand}${searchCommand}`; try { - const output = shell.exec(fullCommand).toString('utf8'); + const output = shell.exec(fullCommand, {silent:true}).toString('utf8'); result = result.concat(output.split(/\r?\n/).filter(Boolean)); } catch {} } From 70e04b7334fe87b8a98b6f6d91978faec5ba4282 Mon Sep 17 00:00:00 2001 From: Aaron Goin Date: Thu, 26 Jun 2025 13:39:49 -0700 Subject: [PATCH 39/73] Making sure api function call errors aren't logged unless LOGS_ENABLED environment flag is truthy --- package-lock.json | 4 ++-- package.json | 2 +- templates/api-index.js | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 169f182..47fb428 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "polyapi", - "version": "0.24.4", + "version": "0.24.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "polyapi", - "version": "0.24.4", + "version": "0.24.5", "license": "MIT", "dependencies": { "@guanghechen/helper-string": "4.7.1", diff --git a/package.json b/package.json index 3cc327b..7fc468e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.24.4", + "version": "0.24.5", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { diff --git a/templates/api-index.js b/templates/api-index.js index 4e2bb25..22c3cf1 100644 --- a/templates/api-index.js +++ b/templates/api-index.js @@ -73,7 +73,7 @@ const executeApiFunction = (id, clientID, polyCustom, requestArgs) => { } ).then(({ headers, data }) => { polyHeaders = headers; - if (data && (data.status < 200 || data.status >= 300)) { + if (data && (data.status < 200 || data.status >= 300) && process.env.LOGS_ENABLED) { let responseData = data.data; try { responseData = JSON.stringify(data.data); @@ -95,7 +95,7 @@ const executeApiFunction = (id, clientID, polyCustom, requestArgs) => { httpsAgent, }) }).then(({ headers, data, status }) => { - if (status && (status < 200 || status >= 300)) { + if (status && (status < 200 || status >= 300) && process.env.LOGS_ENABLED) { console.error('Error direct executing api function with id:', id, 'Status code:', status, 'Request data:', requestArgs, 'Response data:', data.data); } const apiExecutionTimeMs = Date.now() - requestApiStartTime; @@ -122,7 +122,7 @@ const executeApiFunction = (id, clientID, polyCustom, requestArgs) => { } } ).then(({ headers, data }) => { - if (data && (data.status < 200 || data.status >= 300)) { + if (data && (data.status < 200 || data.status >= 300) && process.env.LOGS_ENABLED) { let responseData = data.data; try { responseData = JSON.stringify(data.data); From c618eccbab081587fcf9d413f184db623e7a3898 Mon Sep 17 00:00:00 2001 From: Aaron Goin Date: Thu, 26 Jun 2025 14:03:50 -0700 Subject: [PATCH 40/73] Remove the welcome message for now --- package-lock.json | 4 ++-- package.json | 2 +- src/cli.ts | 38 -------------------------------------- 3 files changed, 3 insertions(+), 41 deletions(-) diff --git a/package-lock.json b/package-lock.json index 47fb428..4ba1f20 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "polyapi", - "version": "0.24.5", + "version": "0.24.6", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "polyapi", - "version": "0.24.5", + "version": "0.24.6", "license": "MIT", "dependencies": { "@guanghechen/helper-string": "4.7.1", diff --git a/package.json b/package.json index 7fc468e..b867c79 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.24.5", + "version": "0.24.6", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { diff --git a/src/cli.ts b/src/cli.ts index ed550b4..75d9e16 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -8,47 +8,12 @@ import { loadConfig } from './config'; import { type RenameT } from './commands/model'; import { DEFAULT_POLY_PATH } from './constants'; import { isValidHttpUrl } from './utils'; -import fs from 'fs'; -import path from 'path'; if (process.env.NO_COLOR) { // Support NO_COLOR env variable https://no-color.org/ chalk.level = 0; } -const showWelcomeIfFirstTime = () => { - try { - const polyDir = DEFAULT_POLY_PATH; - const welcomeFile = path.join(polyDir, '.welcome-shown'); - - // If welcome has already been shown, return early - if (fs.existsSync(welcomeFile)) { - return; - } - - // Get version from package.json - const packagePath = path.join(__dirname, '..', 'package.json'); - const packageJson = JSON.parse(fs.readFileSync(packagePath, 'utf8')); - const version = packageJson.version; - - // Show welcome message - console.log(''); - console.log(chalk.green('✓ PolyAPI SDK installed successfully!')); - console.log(chalk.blue(`📦 Version: ${version}`)); - console.log(''); - console.log(chalk.yellow('Getting started:')); - console.log(' • Run ' + chalk.cyan('poly --help') + ' to see all available commands'); - console.log(' • Run ' + chalk.cyan('poly setup') + ' to configure your Poly connection'); - console.log(''); - - // Ensure .poly directory exists and mark welcome as shown - fs.mkdirSync(polyDir, { recursive: true }); - fs.writeFileSync(welcomeFile, new Date().toISOString()); - } catch (error) { - // Silently fail if there's an issue - don't break the CLI - } -}; - const checkPolyConfig = (polyPath: string) => { loadConfig(polyPath); @@ -59,9 +24,6 @@ const checkPolyConfig = (polyPath: string) => { return true; }; -// Show welcome message on first usage -showWelcomeIfFirstTime(); - void yargs .usage('$0 [args]') .command( From af440e041969550cc1f38d45795f77fd12f812bb Mon Sep 17 00:00:00 2001 From: Daniel-Estoll <115661842+Daniel-Estoll@users.noreply.github.com> Date: Mon, 30 Jun 2025 11:46:56 -0600 Subject: [PATCH 41/73] Windows glide duplicate deployables fix (#22) * Changed windows command for finding deployables to ensure that the same file is not found multiple times * Added replace to remove file paths in glide prepare * version * version --- package-lock.json | 4 ++-- package.json | 2 +- src/commands/prepare.ts | 11 +++++++---- src/deployables.ts | 4 ++-- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4ba1f20..75d4ba4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "polyapi", - "version": "0.24.6", + "version": "0.24.7", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "polyapi", - "version": "0.24.6", + "version": "0.24.7", "license": "MIT", "dependencies": { "@guanghechen/helper-string": "4.7.1", diff --git a/package.json b/package.json index b867c79..681c33b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.24.6", + "version": "0.24.7", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { diff --git a/src/commands/prepare.ts b/src/commands/prepare.ts index 0b5db55..dc9f286 100644 --- a/src/commands/prepare.ts +++ b/src/commands/prepare.ts @@ -162,13 +162,16 @@ export const prepareDeployables = async ( ); const staged = shell.exec('git diff --name-only --cached', {silent:true}) .toString().split('\n').filter(Boolean); + const rootPath: string = shell.exec('git rev-parse --show-toplevel', {silent:true}) + .toString('utf8').replace('\n', ''); for (const deployable of dirtyDeployables) { try{ - if (staged.includes(deployable.file)) { - shell.echo(`Staging ${deployable.file}`); - shell.exec(`git add ${deployable.file}`); + const deployableName = deployable.file.replace(`${rootPath}/`, ''); + if (staged.includes(deployableName)) { + shell.echo(`Staging ${deployableName}`); + shell.exec(`git add ${deployableName}`); } - } + } catch (error) { console.warn(error); } diff --git a/src/deployables.ts b/src/deployables.ts index bbb3698..1de572a 100644 --- a/src/deployables.ts +++ b/src/deployables.ts @@ -183,7 +183,7 @@ export const getAllDeployableFilesWindows = ({ const excludeCommand = excludePattern ? ` | findstr /V /I "${excludePattern}"` : ''; - const searchCommand = ` | findstr /M /I /S /F:/ ${pattern} *.*`; + const searchCommand = ` | findstr /M /I /F:/ ${pattern}`; let result: string[] = []; for (const dir of includeDirs) { @@ -195,7 +195,7 @@ export const getAllDeployableFilesWindows = ({ : includeFilesOrExtensions .map((f) => (f.includes('.') ? f : `${dir}*.${f}`)) .join(' '); - const dirCommand = `dir ${includePattern} /S /P /B > NUL`; + const dirCommand = `dir ${includePattern} /S /P /B `; const fullCommand = `${dirCommand}${excludeCommand}${searchCommand}`; try { const output = shell.exec(fullCommand, {silent:true}).toString('utf8'); From 01796d8ba970c248f5723df500782ce928889996 Mon Sep 17 00:00:00 2001 From: Aaron Goin Date: Mon, 30 Jun 2025 16:15:32 -0700 Subject: [PATCH 42/73] Removing the updateOne and deleteOne queries from Tabi for now since they don't really work! --- package-lock.json | 4 ++-- package.json | 2 +- src/commands/generate/table.ts | 6 +++--- templates/tabi/index.js | 26 +++++++++++++------------- templates/tabi/types.d.ts | 6 +++--- test/generateTables.spec.ts | 9 --------- 6 files changed, 22 insertions(+), 31 deletions(-) diff --git a/package-lock.json b/package-lock.json index 75d4ba4..29111cc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "polyapi", - "version": "0.24.7", + "version": "0.24.8", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "polyapi", - "version": "0.24.7", + "version": "0.24.8", "license": "MIT", "dependencies": { "@guanghechen/helper-string": "4.7.1", diff --git a/package.json b/package.json index 681c33b..b0ee3a3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.24.7", + "version": "0.24.8", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { diff --git a/src/commands/generate/table.ts b/src/commands/generate/table.ts index dc90f5d..b03cb6e 100644 --- a/src/commands/generate/table.ts +++ b/src/commands/generate/table.ts @@ -73,9 +73,9 @@ const printTableInterface = (table: TableSpecification | string): string => { `${_ws}upsertMany(query: ${formattedName}.InsertManyQuery): Promise<${formattedName}.QueryResults>;`, `${_ws}upsertOne(query: ${formattedName}.InsertOneQuery): Promise<${formattedName}.QueryResult>;`, `${_ws}updateMany(query: ${formattedName}.UpdateQuery): Promise<${formattedName}.QueryResults>;`, - `${_ws}updateOne(query: ${formattedName}.UpdateQuery): Promise<${formattedName}.QueryResult>;`, + // `${_ws}updateOne(query: ${formattedName}.UpdateQuery): Promise<${formattedName}.QueryResult>;`, `${_ws}deleteMany(query: ${formattedName}.DeleteQuery): Promise<${formattedName}.DeleteResults>;`, - `${_ws}deleteOne(query: ${formattedName}.DeleteQuery): Promise<${formattedName}.DeleteResult>;`, + // `${_ws}deleteOne(query: ${formattedName}.DeleteQuery): Promise<${formattedName}.DeleteResult>;`, '}', ].join(`${EOL}${ws(2)}`); }; @@ -95,7 +95,7 @@ const printTableNamespace = (schema: JsonSchema, name: string, depth = 1): strin 'type QueryResults = PolyQueryResults;', 'type QueryResult = PolyQueryResult;', 'type DeleteResults = PolyDeleteResults;', - 'type DeleteResult = PolyDeleteResult;', + // 'type DeleteResult = PolyDeleteResult;', 'type CountResult = PolyCountResult;', ].join(`${EOL}${ws(depth + 1)}`) }${EOL}${ws(depth)}}`; diff --git a/templates/tabi/index.js b/templates/tabi/index.js index 4b94d03..1936375 100644 --- a/templates/tabi/index.js +++ b/templates/tabi/index.js @@ -24,13 +24,13 @@ const firstResult = (rsp) => { return rsp; } -const deleteOneResponse = (rsp) => { - if (typeof rsp.deleted === 'number') { - return { deleted: rsp.deleted > 0 }; - } - // Else rsp is some kind of error - return rsp; -} +// const deleteOneResponse = (rsp) => { +// if (typeof rsp.deleted === 'number') { +// return { deleted: rsp.deleted > 0 }; +// } +// // Else rsp is some kind of error +// return rsp; +// } class Table { constructor(id, clientID, polyCustom) { @@ -78,17 +78,17 @@ class Table { return executeQuery(this.id, 'update', query, this.clientID, this.polyCustom); } - updateOne(query) { - return executeQuery(this.id, 'update', query, this.clientID, this.polyCustom).then(firstResult); - } + // updateOne(query) { + // return executeQuery(this.id, 'update', query, this.clientID, this.polyCustom).then(firstResult); + // } deleteMany(query) { return executeQuery(this.id, 'delete', query, this.clientID, this.polyCustom); } - deleteOne(query) { - return executeQuery(this.id, 'delete', query, this.clientID, this.polyCustom).then(deleteOneResponse); - } + // deleteOne(query) { + // return executeQuery(this.id, 'delete', query, this.clientID, this.polyCustom).then(deleteOneResponse); + // } } module.exports = (clientID, polyCustom) => tables.reduce( diff --git a/templates/tabi/types.d.ts b/templates/tabi/types.d.ts index 34f712f..c4a6391 100644 --- a/templates/tabi/types.d.ts +++ b/templates/tabi/types.d.ts @@ -81,9 +81,9 @@ type PolyDeleteResults = { deleted: number; } -type PolyDeleteResult = { - deleted: boolean; -} +// type PolyDeleteResult = { +// deleted: boolean; +// } type PolyCountResult = { count: boolean; diff --git a/test/generateTables.spec.ts b/test/generateTables.spec.ts index 5e45dad..0a29bf7 100644 --- a/test/generateTables.spec.ts +++ b/test/generateTables.spec.ts @@ -102,7 +102,6 @@ describe('printTableSpecs', () => { ' type QueryResults = PolyQueryResults;', ' type QueryResult = PolyQueryResult;', ' type DeleteResults = PolyDeleteResults;', - ' type DeleteResult = PolyDeleteResult;', ' type CountResult = PolyCountResult;', ' }', ' }', @@ -118,9 +117,7 @@ describe('printTableSpecs', () => { ' upsertMany(query: Aaron.Testing.MyTable.InsertManyQuery): Promise;', ' upsertOne(query: Aaron.Testing.MyTable.InsertOneQuery): Promise;', ' updateMany(query: Aaron.Testing.MyTable.UpdateQuery): Promise;', - ' updateOne(query: Aaron.Testing.MyTable.UpdateQuery): Promise;', ' deleteMany(query: Aaron.Testing.MyTable.DeleteQuery): Promise;', - ' deleteOne(query: Aaron.Testing.MyTable.DeleteQuery): Promise;', ' }', ' }', '}', @@ -232,7 +229,6 @@ describe('printTableSpecs', () => { ' type QueryResults = PolyQueryResults;', ' type QueryResult = PolyQueryResult;', ' type DeleteResults = PolyDeleteResults;', - ' type DeleteResult = PolyDeleteResult;', ' type CountResult = PolyCountResult;', ' }', '', @@ -247,9 +243,7 @@ describe('printTableSpecs', () => { ' upsertMany(query: OtherTable.InsertManyQuery): Promise;', ' upsertOne(query: OtherTable.InsertOneQuery): Promise;', ' updateMany(query: OtherTable.UpdateQuery): Promise;', - ' updateOne(query: OtherTable.UpdateQuery): Promise;', ' deleteMany(query: OtherTable.DeleteQuery): Promise;', - ' deleteOne(query: OtherTable.DeleteQuery): Promise;', ' }', ' }', '}', @@ -287,7 +281,6 @@ describe('printTableSpecs', () => { ' type QueryResults = PolyQueryResults;', ' type QueryResult = PolyQueryResult;', ' type DeleteResults = PolyDeleteResults;', - ' type DeleteResult = PolyDeleteResult;', ' type CountResult = PolyCountResult;', ' }', ' }', @@ -303,9 +296,7 @@ describe('printTableSpecs', () => { ' upsertMany(query: Aaron.Testing.MyTable.InsertManyQuery): Promise;', ' upsertOne(query: Aaron.Testing.MyTable.InsertOneQuery): Promise;', ' updateMany(query: Aaron.Testing.MyTable.UpdateQuery): Promise;', - ' updateOne(query: Aaron.Testing.MyTable.UpdateQuery): Promise;', ' deleteMany(query: Aaron.Testing.MyTable.DeleteQuery): Promise;', - ' deleteOne(query: Aaron.Testing.MyTable.DeleteQuery): Promise;', ' }', ' }', '}', From a31103f397fb767dc7da9798404363bfd9303892 Mon Sep 17 00:00:00 2001 From: Daniel-Estoll <115661842+Daniel-Estoll@users.noreply.github.com> Date: Wed, 23 Jul 2025 10:50:31 -0600 Subject: [PATCH 43/73] Warn on schema fallback (#25) * Added warning when falling back to unknown type * Bumped version * Moved warning to schemaTypes to ensure that warnings are not duplicated * Added falling back message --- package-lock.json | 4 ++-- package.json | 2 +- src/commands/generate/schemaTypes.ts | 8 ++++++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 29111cc..f991bbf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "polyapi", - "version": "0.24.8", + "version": "0.24.9", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "polyapi", - "version": "0.24.8", + "version": "0.24.9", "license": "MIT", "dependencies": { "@guanghechen/helper-string": "4.7.1", diff --git a/package.json b/package.json index b0ee3a3..d35e494 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.24.8", + "version": "0.24.9", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { diff --git a/src/commands/generate/schemaTypes.ts b/src/commands/generate/schemaTypes.ts index 2fd0522..eb78539 100644 --- a/src/commands/generate/schemaTypes.ts +++ b/src/commands/generate/schemaTypes.ts @@ -5,6 +5,8 @@ import { EOL } from 'node:os'; import { SchemaRef, SchemaSpecification } from '../../types'; import { echoGenerationError } from '../../utils'; import { setGenerationErrors } from './types'; +import shell from 'shelljs' +import chalk from 'chalk'; const unsafeCharacters = /(?:^\d)|[^0-9a-zA-Z_]/gi; const unescapedSingleQuote = /\b'\b/gi; @@ -678,6 +680,9 @@ const fillInUnresolvedSchemas = (specs: SchemaSpec[]): SchemaSpec[] => { visibility: 'ENVIRONMENT', }, }; + shell.echo( + chalk.yellow(`WARNING: Referenced Schema '${unresolved.path}' is unresolved. Falling back to 'unknown' type.`) + ); schemas.set(unresolved.path, fillerSpec); } } @@ -704,6 +709,9 @@ const fillInUnresolvedSchemas = (specs: SchemaSpec[]): SchemaSpec[] => { visibility: 'ENVIRONMENT', }, }; + shell.echo( + chalk.yellow(`WARNING: Referenced Schema '${contextName}' is unresolved, as context \`${context}\` was not generated. Falling back to 'unknown' type.`) + ); schemas.set(contextName, fillerSpec); } } From a20cd0cbb9bf91bda31009c415b56a7c961ea351 Mon Sep 17 00:00:00 2001 From: Daniel-Estoll <115661842+Daniel-Estoll@users.noreply.github.com> Date: Wed, 23 Jul 2025 11:27:18 -0600 Subject: [PATCH 44/73] added scrubbing to api function requestArgs (#27) * added scrubbing to api function requestArgs * Changed iteration to go through keys, added scrubbing to scrubKeys, changed * to 8 * closed some holes and fixed some edge cases * cleaning the scrubbing * bumped version * changed Record to Partial --- package.json | 2 +- templates/api-index.js | 27 ++++++++++++++++++++++++++- templates/axios.js | 8 ++++++-- templates/tabi/types.d.ts | 4 ++-- 4 files changed, 35 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index d35e494..2442abe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.24.9", + "version": "0.24.10", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { diff --git a/templates/api-index.js b/templates/api-index.js index 22c3cf1..f0c5440 100644 --- a/templates/api-index.js +++ b/templates/api-index.js @@ -49,6 +49,28 @@ const handleError = (err) => { }; } +const scrub = (data) => { + if (!data || typeof data !== 'object' ) return data; + const secrets = ["x_api_key", "x-api-key", "access_token", "access-token", "authorization", "api_key", "api-key", "apikey", "accesstoken", "token", "password", "key"]; + if (Array.isArray(data)) { + return data.map(item => scrub(item)) + } + else { + const temp = {}; + for (const key of Object.keys(data)) { + if (typeof data[key] === 'object') { + temp[key] = scrub(data[key]); + } else if (secrets.includes(key.toLowerCase())) { + temp[key] = "********"; + } else { + temp[key] = data[key]; + } + } + return temp + } +} + + const executeApiFunction = (id, clientID, polyCustom, requestArgs) => { const requestServerStartTime = Date.now(); @@ -78,7 +100,8 @@ const executeApiFunction = (id, clientID, polyCustom, requestArgs) => { try { responseData = JSON.stringify(data.data); } catch (err) {} - console.error('Error executing api function with id:', id, 'Status code:', data.status, 'Request data:', requestArgs, 'Response data:', responseData); + scrub(requestArgs) + console.error('Error executing api function with id:', id, 'Status code:', data.status, 'Request data:', scrubbedArgs, 'Response data:', responseData); } serverPreperationTimeMs = Number(polyHeaders['x-poly-execution-duration']); @@ -96,6 +119,7 @@ const executeApiFunction = (id, clientID, polyCustom, requestArgs) => { }) }).then(({ headers, data, status }) => { if (status && (status < 200 || status >= 300) && process.env.LOGS_ENABLED) { + scrub(requestArgs) console.error('Error direct executing api function with id:', id, 'Status code:', status, 'Request data:', requestArgs, 'Response data:', data.data); } const apiExecutionTimeMs = Date.now() - requestApiStartTime; @@ -127,6 +151,7 @@ const executeApiFunction = (id, clientID, polyCustom, requestArgs) => { try { responseData = JSON.stringify(data.data); } catch (err) {} + scrub(requestArgs) console.error('Error executing api function with id:', id, 'Status code:', data.status, 'Request data:', requestArgs, 'Response data:', responseData); } const serverExecutionTimeMs = Number(headers['x-poly-execution-duration']); diff --git a/templates/axios.js b/templates/axios.js index def97c4..d4dc378 100644 --- a/templates/axios.js +++ b/templates/axios.js @@ -5,6 +5,7 @@ const https = require('https'); const dotenv = require('dotenv'); const polyCustom = require('./poly-custom'); const { API_KEY, API_BASE_URL } = require('./constants'); +import { scrub } from './api-index.js' dotenv.config(); @@ -43,13 +44,16 @@ axios.interceptors.request.use( ); const scrubKeys = (err) => { - if (err.request && typeof err.request.headers === 'object' && err.request.headers.Authorization) { + if (!err.request || typeof err.request.headers !== 'object') throw err + const temp = scrub(err.request.headers) + if (err.request.headers.Authorization) { // Scrub any credentials in the authorization header const [type, ...rest] = err.request.headers.Authorization.split(' '); - err.request.headers.Authorization = rest.length && type + temp.Authorization = rest.length && type ? `${type} ********` : `********`; } + err.request.headers = temp throw err; }; diff --git a/templates/tabi/types.d.ts b/templates/tabi/types.d.ts index c4a6391..675b10e 100644 --- a/templates/tabi/types.d.ts +++ b/templates/tabi/types.d.ts @@ -43,14 +43,14 @@ type PolyCountQuery> = Clean<{ type PolySelectOneQuery> = Clean<{ where?: Where; - orderBy?: Record; + orderBy?: Partial>; }>; type PolySelectManyQuery> = Clean<{ where?: Where; limit?: number; // 1000 is max limit for now offset?: number; - orderBy?: Record; + orderBy?: Partial>; }>; type PolyDeleteQuery> = Clean<{ From 8849412fb76640d37ba7447214d4cf997d71e14d Mon Sep 17 00:00:00 2001 From: Daniel-Estoll <115661842+Daniel-Estoll@users.noreply.github.com> Date: Thu, 24 Jul 2025 09:55:06 -0600 Subject: [PATCH 45/73] Changed import path (#29) --- templates/axios.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/axios.js b/templates/axios.js index d4dc378..eece1f7 100644 --- a/templates/axios.js +++ b/templates/axios.js @@ -5,7 +5,7 @@ const https = require('https'); const dotenv = require('dotenv'); const polyCustom = require('./poly-custom'); const { API_KEY, API_BASE_URL } = require('./constants'); -import { scrub } from './api-index.js' +const { scrub } = require('../api/index.js') dotenv.config(); From d0e53d5772f7f0e2c0b243b62e272ad6444380a3 Mon Sep 17 00:00:00 2001 From: Daniel-Estoll <115661842+Daniel-Estoll@users.noreply.github.com> Date: Thu, 24 Jul 2025 10:09:13 -0600 Subject: [PATCH 46/73] Fix scrub import again (#30) * reversed imports * bumped version * added scrub to exports --- package.json | 2 +- templates/api-index.js | 23 +---------------------- templates/axios.js | 27 +++++++++++++++++++++++++-- 3 files changed, 27 insertions(+), 25 deletions(-) diff --git a/package.json b/package.json index 2442abe..396d5f1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.24.10", + "version": "0.24.11", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { diff --git a/templates/api-index.js b/templates/api-index.js index f0c5440..f67287d 100644 --- a/templates/api-index.js +++ b/templates/api-index.js @@ -1,4 +1,4 @@ -const { axios } = require('../axios'); +const { axios, scrub } = require('../axios'); const set = require('lodash/set'); const https = require('https'); const fs = require('fs'); @@ -49,27 +49,6 @@ const handleError = (err) => { }; } -const scrub = (data) => { - if (!data || typeof data !== 'object' ) return data; - const secrets = ["x_api_key", "x-api-key", "access_token", "access-token", "authorization", "api_key", "api-key", "apikey", "accesstoken", "token", "password", "key"]; - if (Array.isArray(data)) { - return data.map(item => scrub(item)) - } - else { - const temp = {}; - for (const key of Object.keys(data)) { - if (typeof data[key] === 'object') { - temp[key] = scrub(data[key]); - } else if (secrets.includes(key.toLowerCase())) { - temp[key] = "********"; - } else { - temp[key] = data[key]; - } - } - return temp - } -} - const executeApiFunction = (id, clientID, polyCustom, requestArgs) => { const requestServerStartTime = Date.now(); diff --git a/templates/axios.js b/templates/axios.js index eece1f7..55587b7 100644 --- a/templates/axios.js +++ b/templates/axios.js @@ -5,7 +5,6 @@ const https = require('https'); const dotenv = require('dotenv'); const polyCustom = require('./poly-custom'); const { API_KEY, API_BASE_URL } = require('./constants'); -const { scrub } = require('../api/index.js') dotenv.config(); @@ -43,6 +42,29 @@ axios.interceptors.request.use( } ); + +const scrub = (data) => { + if (!data || typeof data !== 'object' ) return data; + const secrets = ["x_api_key", "x-api-key", "access_token", "access-token", "authorization", "api_key", "api-key", "apikey", "accesstoken", "token", "password", "key"]; + if (Array.isArray(data)) { + return data.map(item => scrub(item)) + } + else { + const temp = {}; + for (const key of Object.keys(data)) { + if (typeof data[key] === 'object') { + temp[key] = scrub(data[key]); + } else if (secrets.includes(key.toLowerCase())) { + temp[key] = "********"; + } else { + temp[key] = data[key]; + } + } + return temp + } +} + + const scrubKeys = (err) => { if (!err.request || typeof err.request.headers !== 'object') throw err const temp = scrub(err.request.headers) @@ -59,5 +81,6 @@ const scrubKeys = (err) => { module.exports = { axios, - scrubKeys + scrubKeys, + scrub }; From 4a5d7f06751bd8e7c7d5c39f6838afdd32becdf7 Mon Sep 17 00:00:00 2001 From: Daniel-Estoll <115661842+Daniel-Estoll@users.noreply.github.com> Date: Thu, 24 Jul 2025 10:37:11 -0600 Subject: [PATCH 47/73] Changed warning message (#31) * Changed warning message * reworded message * removed the afro --- package.json | 2 +- src/commands/generate/schemaTypes.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 396d5f1..0e461be 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.24.11", + "version": "0.24.12", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { diff --git a/src/commands/generate/schemaTypes.ts b/src/commands/generate/schemaTypes.ts index eb78539..e13a178 100644 --- a/src/commands/generate/schemaTypes.ts +++ b/src/commands/generate/schemaTypes.ts @@ -681,7 +681,7 @@ const fillInUnresolvedSchemas = (specs: SchemaSpec[]): SchemaSpec[] => { }, }; shell.echo( - chalk.yellow(`WARNING: Referenced Schema '${unresolved.path}' is unresolved. Falling back to 'unknown' type.`) + chalk.yellow(`WARNING: Schema '${unresolved.path}' referenced from '${spec.contextName}' is unresolved. Falling back to 'unknown' type for '${unresolved.path}'.`) ); schemas.set(unresolved.path, fillerSpec); } @@ -710,7 +710,7 @@ const fillInUnresolvedSchemas = (specs: SchemaSpec[]): SchemaSpec[] => { }, }; shell.echo( - chalk.yellow(`WARNING: Referenced Schema '${contextName}' is unresolved, as context \`${context}\` was not generated. Falling back to 'unknown' type.`) + chalk.yellow(`WARNING: Schema '${contextName}' referenced from '${spec.contextName}' is unresolved. Falling back to 'unknown' type for '${contextName}'.`) ); schemas.set(contextName, fillerSpec); } From e50e556a02865cf97172998b2fdc3880b0acfdb4 Mon Sep 17 00:00:00 2001 From: Daniel-Estoll <115661842+Daniel-Estoll@users.noreply.github.com> Date: Fri, 25 Jul 2025 07:16:35 -0600 Subject: [PATCH 48/73] assigned scrub to a variable instead of just doing nothing with it (#33) * assigned scrub to a variable instead of just doing nothing with it * update --------- Co-authored-by: Dan Fellin --- package.json | 2 +- templates/api-index.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 0e461be..14c99aa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.24.12", + "version": "0.24.13", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { diff --git a/templates/api-index.js b/templates/api-index.js index f67287d..64428a5 100644 --- a/templates/api-index.js +++ b/templates/api-index.js @@ -98,7 +98,7 @@ const executeApiFunction = (id, clientID, polyCustom, requestArgs) => { }) }).then(({ headers, data, status }) => { if (status && (status < 200 || status >= 300) && process.env.LOGS_ENABLED) { - scrub(requestArgs) + requestArgs = scrub(requestArgs) console.error('Error direct executing api function with id:', id, 'Status code:', status, 'Request data:', requestArgs, 'Response data:', data.data); } const apiExecutionTimeMs = Date.now() - requestApiStartTime; @@ -130,7 +130,7 @@ const executeApiFunction = (id, clientID, polyCustom, requestArgs) => { try { responseData = JSON.stringify(data.data); } catch (err) {} - scrub(requestArgs) + requestArgs = scrub(requestArgs) console.error('Error executing api function with id:', id, 'Status code:', data.status, 'Request data:', requestArgs, 'Response data:', responseData); } const serverExecutionTimeMs = Number(headers['x-poly-execution-duration']); From ae87976216d33315a56faa43f065d0eceb68ebfb Mon Sep 17 00:00:00 2001 From: Dan Fellin Date: Fri, 25 Jul 2025 08:11:57 -0700 Subject: [PATCH 49/73] missed on scrub call to args --- package.json | 2 +- templates/api-index.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 14c99aa..cb0df21 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.24.13", + "version": "0.24.14", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { diff --git a/templates/api-index.js b/templates/api-index.js index 64428a5..57ccf56 100644 --- a/templates/api-index.js +++ b/templates/api-index.js @@ -78,8 +78,8 @@ const executeApiFunction = (id, clientID, polyCustom, requestArgs) => { let responseData = data.data; try { responseData = JSON.stringify(data.data); - } catch (err) {} - scrub(requestArgs) + } catch (err) { + requestArgs = scrub(requestArgs) console.error('Error executing api function with id:', id, 'Status code:', data.status, 'Request data:', scrubbedArgs, 'Response data:', responseData); } From bce46f8cf7f7b8f6aa5895cdfdcd2d3b9c760514 Mon Sep 17 00:00:00 2001 From: Dan Fellin Date: Fri, 25 Jul 2025 08:25:58 -0700 Subject: [PATCH 50/73] lets link to the OSS repo doh --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index cb0df21..235c6db 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,11 @@ { "name": "polyapi", - "version": "0.24.14", + "version": "0.24.15", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { "type": "git", - "url": "https://github.com/polyapi/poly-alpha", + "url": "https://github.com/polyapi/polyapi-typescript", "directory": "packages/client" }, "files": [ From 3dbbe577655804d0f9634fcd3c3681231713e4b9 Mon Sep 17 00:00:00 2001 From: Dan Fellin Date: Fri, 25 Jul 2025 10:17:38 -0700 Subject: [PATCH 51/73] fix --- package.json | 2 +- templates/api-index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 235c6db..7515753 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.24.15", + "version": "0.24.16", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { diff --git a/templates/api-index.js b/templates/api-index.js index 57ccf56..6296e01 100644 --- a/templates/api-index.js +++ b/templates/api-index.js @@ -78,7 +78,7 @@ const executeApiFunction = (id, clientID, polyCustom, requestArgs) => { let responseData = data.data; try { responseData = JSON.stringify(data.data); - } catch (err) { + } catch (err) {} requestArgs = scrub(requestArgs) console.error('Error executing api function with id:', id, 'Status code:', data.status, 'Request data:', scrubbedArgs, 'Response data:', responseData); } From e59a7e88ea6720a0b9eaca03ec0b3178538637cb Mon Sep 17 00:00:00 2001 From: Daniel-Estoll <115661842+Daniel-Estoll@users.noreply.github.com> Date: Mon, 28 Jul 2025 11:19:27 -0600 Subject: [PATCH 52/73] Commented out warnings (#34) * Commented out warnings * bumped version --- package.json | 2 +- src/commands/generate/schemaTypes.ts | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 7515753..7fba3c0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.24.16", + "version": "0.24.17", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { diff --git a/src/commands/generate/schemaTypes.ts b/src/commands/generate/schemaTypes.ts index e13a178..99ef2fc 100644 --- a/src/commands/generate/schemaTypes.ts +++ b/src/commands/generate/schemaTypes.ts @@ -680,9 +680,9 @@ const fillInUnresolvedSchemas = (specs: SchemaSpec[]): SchemaSpec[] => { visibility: 'ENVIRONMENT', }, }; - shell.echo( - chalk.yellow(`WARNING: Schema '${unresolved.path}' referenced from '${spec.contextName}' is unresolved. Falling back to 'unknown' type for '${unresolved.path}'.`) - ); + // shell.echo( + // chalk.yellow(`WARNING: Schema '${unresolved.path}' referenced from '${spec.contextName}' is unresolved. Falling back to 'unknown' type for '${unresolved.path}'.`) + // ); schemas.set(unresolved.path, fillerSpec); } } @@ -709,9 +709,9 @@ const fillInUnresolvedSchemas = (specs: SchemaSpec[]): SchemaSpec[] => { visibility: 'ENVIRONMENT', }, }; - shell.echo( - chalk.yellow(`WARNING: Schema '${contextName}' referenced from '${spec.contextName}' is unresolved. Falling back to 'unknown' type for '${contextName}'.`) - ); + // shell.echo( + // chalk.yellow(`WARNING: Schema '${contextName}' referenced from '${spec.contextName}' is unresolved. Falling back to 'unknown' type for '${contextName}'.`) + // ); schemas.set(contextName, fillerSpec); } } From 0398daac7b99c5198a77a8d64a539190e627dbcb Mon Sep 17 00:00:00 2001 From: Aaron Goin Date: Fri, 22 Aug 2025 15:22:40 -0700 Subject: [PATCH 53/73] bump form-data --- package-lock.json | 315 +++++++++++++++++++++++++++++++++++++++++++--- package.json | 7 +- 2 files changed, 304 insertions(+), 18 deletions(-) diff --git a/package-lock.json b/package-lock.json index 17d1b65..f5074c8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "polyapi", - "version": "0.24.17", + "version": "0.24.18", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "polyapi", - "version": "0.24.17", + "version": "0.24.18", "license": "MIT", "dependencies": { "@guanghechen/helper-string": "4.7.1", @@ -2585,6 +2585,19 @@ "dev": true, "license": "MIT" }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -3067,6 +3080,20 @@ "node": ">=12" } }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/eastasianwidth": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", @@ -3128,6 +3155,51 @@ "is-arrayish": "^0.2.1" } }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/escalade": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", @@ -3752,12 +3824,15 @@ } }, "node_modules/form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.4.tgz", + "integrity": "sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==", + "license": "MIT", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", "mime-types": "^2.1.12" }, "engines": { @@ -3785,10 +3860,13 @@ } }, "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/gensync": { "version": "1.0.0-beta.2", @@ -3808,6 +3886,30 @@ "node": "6.* || 8.* || >= 10.*" } }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/get-package-type": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", @@ -3818,6 +3920,19 @@ "node": ">=8.0.0" } }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/get-stream": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", @@ -3891,6 +4006,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", @@ -3952,6 +4079,45 @@ "node": ">=8" } }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/header-case": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/header-case/-/header-case-2.0.4.tgz", @@ -5220,6 +5386,15 @@ "tmpl": "1.0.5" } }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", @@ -8695,7 +8870,7 @@ "integrity": "sha512-iP4DebzoNlP/YN2dpwCgb8zoCmhtkajzS48JvwmkSkXvPI3DHc7m+XYL5tGnSlJtR6nImXZmdCuN5aP8dh1d8A==", "requires": { "follow-redirects": "^1.15.6", - "form-data": "^4.0.0", + "form-data": "^4.0.4", "proxy-from-env": "^1.1.0" } }, @@ -8857,6 +9032,15 @@ "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true }, + "call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "requires": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + } + }, "callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -9202,6 +9386,16 @@ "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz", "integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==" }, + "dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "requires": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + } + }, "eastasianwidth": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", @@ -9250,6 +9444,35 @@ "is-arrayish": "^0.2.1" } }, + "es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==" + }, + "es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==" + }, + "es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "requires": { + "es-errors": "^1.3.0" + } + }, + "es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "requires": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + } + }, "escalade": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", @@ -9648,12 +9871,14 @@ } }, "form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.4.tgz", + "integrity": "sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==", "requires": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", "mime-types": "^2.1.12" } }, @@ -9671,10 +9896,9 @@ "optional": true }, "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==" }, "gensync": { "version": "1.0.0-beta.2", @@ -9687,12 +9911,38 @@ "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" }, + "get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "requires": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + } + }, "get-package-type": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", "dev": true }, + "get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "requires": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + } + }, "get-stream": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", @@ -9740,6 +9990,11 @@ "slash": "^3.0.0" } }, + "gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==" + }, "graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", @@ -9782,6 +10037,27 @@ "resolved": "https://registry.npmjs.org/has-own-prop/-/has-own-prop-2.0.0.tgz", "integrity": "sha512-Pq0h+hvsVm6dDEa8x82GnLSYHOzNDt7f0ddFa3FqcQlgzEiptPqL+XrOJNavjOzSYiYWIrgeVYYgGlLmnxwilQ==" }, + "has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==" + }, + "has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "requires": { + "has-symbols": "^1.0.3" + } + }, + "hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "requires": { + "function-bind": "^1.1.2" + } + }, "header-case": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/header-case/-/header-case-2.0.4.tgz", @@ -10699,6 +10975,11 @@ "tmpl": "1.0.5" } }, + "math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==" + }, "merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", diff --git a/package.json b/package.json index 7fba3c0..51239d3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.24.17", + "version": "0.24.18", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { @@ -76,6 +76,11 @@ "validator": "13.11.0", "yargs": "17.7.1" }, + "overrides": { + "axios": { + "form-data": "^4.0.4" + } + }, "engines": { "node": ">=18.20.5" }, From 6789fe286a736e1f185dbda02b815279c5fc786b Mon Sep 17 00:00:00 2001 From: Aaron Goin Date: Fri, 29 Aug 2025 16:13:37 -0600 Subject: [PATCH 54/73] fixing glide deployment to also check remote destination to confirm if deployment already exists or if it really needs updated (#39) --- README_INTERNAL.md | 2 +- package-lock.json | 4 +- package.json | 2 +- src/api.ts | 70 +++++++++++++++++++++++++++---- src/commands/sync.ts | 93 ++++++++++++++++++++++++++++++------------ src/deployables.ts | 15 ++++--- src/types/functions.ts | 9 ++++ src/types/webhooks.ts | 31 +++++--------- 8 files changed, 160 insertions(+), 66 deletions(-) diff --git a/README_INTERNAL.md b/README_INTERNAL.md index ecde7f2..0698d30 100644 --- a/README_INTERNAL.md +++ b/README_INTERNAL.md @@ -41,7 +41,7 @@ Add the line "HELLO WORLD" to the end of `README.md` Then run this command to publish to your local Verdaccio instance: ```bash -./publish_local.sh +./scripts/publish_local.sh ``` ## Install Your Updated NPM Package Locally diff --git a/package-lock.json b/package-lock.json index f5074c8..8bcf6c6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "polyapi", - "version": "0.24.18", + "version": "0.24.19", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "polyapi", - "version": "0.24.18", + "version": "0.24.19", "license": "MIT", "dependencies": { "@guanghechen/helper-string": "4.7.1", diff --git a/package.json b/package.json index 51239d3..4312158 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.24.18", + "version": "0.24.19", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { diff --git a/src/api.ts b/src/api.ts index 4f96531..a495af2 100644 --- a/src/api.ts +++ b/src/api.ts @@ -123,21 +123,39 @@ export const createOrUpdateServerFunction = async ( ).data; }; +export const getServerFunctionById = async (id: string) => { + return ( + await axios.get>( + `${getApiBaseURL()}/functions/server/${id}`, + { + headers: { + 'Content-Type': 'application/json', + ...getApiHeaders(), + }, + }, + ) + ).data; +}; + export const getServerFunctionByName = async ( context: string, name: string, + detail = false ) => { - return ( - await axios.get>( - `${getApiBaseURL()}/functions/server`, + const basic = ( + await axios.get>( + `${getApiBaseURL()}/functions/server?search=${encodeURIComponent(`${context}${context && name ? '.' : ''}${name}`)}`, { headers: { 'Content-Type': 'application/json', ...getApiHeaders(), + 'x-poly-api-version': '2', }, }, ) - ).data.find((fn) => fn.name === name && fn.context === context); + ).data.results.find((fn) => fn.name === name && fn.context === context); + if (!detail || !basic) return basic; + return getServerFunctionById(basic.id); }; export const deleteServerFunction = async (id: string) => { @@ -178,21 +196,39 @@ export const createOrUpdateClientFunction = async ( ).data; }; +export const getClientFunctionById = async (id: string) => { + return ( + await axios.get>( + `${getApiBaseURL()}/functions/client/${id}`, + { + headers: { + 'Content-Type': 'application/json', + ...getApiHeaders(), + }, + }, + ) + ).data; +}; + export const getClientFunctionByName = async ( context: string, name: string, + detail = false, ) => { - return ( - await axios.get>( - `${getApiBaseURL()}/functions/client`, + const basic = ( + await axios.get>( + `${getApiBaseURL()}/functions/client?search=${encodeURIComponent(`${context}${context && name ? '.' : ''}${name}`)}`, { headers: { 'Content-Type': 'application/json', ...getApiHeaders(), + 'x-poly-api-version': '2', }, }, ) - ).data.find((fn) => fn.name === name && fn.context === context); + ).data.results.find((fn) => fn.name === name && fn.context === context); + if (!detail || !basic) return basic; + return getClientFunctionById(basic.id); }; export const deleteClientFunction = async (id: string) => { @@ -482,8 +518,22 @@ export const createOrUpdateWebhook = async ( ).data; }; -export const getWebhookByName = async (context: string, name: string) => { +export const getWebhookById = async (id: string) => { return ( + await axios.get>( + `${getApiBaseURL()}/webhooks/${id}`, + { + headers: { + 'Content-Type': 'application/json', + ...getApiHeaders(), + }, + }, + ) + ).data; +}; + +export const getWebhookByName = async (context: string, name: string, detail = false) => { + const basic = ( await axios.get>( `${getApiBaseURL()}/webhooks`, { @@ -496,6 +546,8 @@ export const getWebhookByName = async (context: string, name: string) => { ).data.find( (webhook) => webhook.name === name && webhook.context === context, ); + if (!detail || !basic) return basic; + return getWebhookById(basic.id); }; export const deleteWebhook = async (webhookId: string) => { diff --git a/src/commands/sync.ts b/src/commands/sync.ts index bf1a927..df3494f 100644 --- a/src/commands/sync.ts +++ b/src/commands/sync.ts @@ -11,6 +11,8 @@ import { getCacheDeploymentsRevision, removeDeployableRecords, prepareDeployableDirectory, + getDeployableFileRevision, + getRandomString, } from '../deployables'; import { createOrUpdateClientFunction, @@ -19,14 +21,18 @@ import { deleteClientFunction, deleteServerFunction, deleteWebhook, + getClientFunctionById, getClientFunctionByName, + getServerFunctionById, getServerFunctionByName, + getWebhookById, getWebhookByName, } from '../api'; +import { FunctionDetailsDto, WebhookHandleDto } from '../types'; const DEPLOY_ORDER: DeployableTypes[] = [ - 'server-function', 'client-function', + 'server-function', 'webhook', ]; @@ -105,6 +111,32 @@ const syncDeployableAndGetId = async (deployable, code) => { throw new Error(`Unsupported deployable type: '${deployable.type}'`); }; +const getDeployableFromServer = async ( + deployable: SyncDeployment, +): Promise => { + try { + switch(deployable.type) { + case 'server-function': { + return deployable.id + ? getServerFunctionById(deployable.id) as T + : getServerFunctionByName(deployable.context, deployable.name, true) as T; + } + case 'client-function': { + return deployable.id + ? getClientFunctionById(deployable.id) as T + : getClientFunctionByName(deployable.context, deployable.name, true) as T; + } + case 'webhook': { + return deployable.id + ? getWebhookById(deployable.id) as T + : getWebhookByName(deployable.context, deployable.name, true) as T; + } + } + } catch (err) { + return null; + } +} + const syncDeployable = async ( deployable: SyncDeployment, ): Promise => { @@ -149,33 +181,51 @@ export const syncDeployables = async ( const previousDeployment = deployable.deployments.find( (i) => i.instance === instance, ); + // Any deployable may be deployed to multiple instances/environments at the same time + // So we reduce the deployable record down to a single instance we want to deploy to + const syncDeployment: SyncDeployment = { + ...deployable, + ...previousDeployment, // flatten to grab name & context + type: deployable.type, // but make sure we use the latest type + description: deployable.description ?? deployable.types?.description, + instance, + }; + const deployed = await getDeployableFromServer(syncDeployment); const gitRevisionChanged = gitRevision !== deployable.gitRevision; - const fileRevisionChanged = - previousDeployment?.fileRevision !== deployable.fileRevision; + const serverFileRevision = !deployed + ? '' + : type === 'webhook' + // TODO: Actually calculate real revision on webhook + ? getRandomString(8) + : ((deployed as FunctionDetailsDto).hash || getDeployableFileRevision((deployed as FunctionDetailsDto).code)); + const fileRevisionChanged = serverFileRevision !== deployable.fileRevision; + // TODO: If deployed variabnt exists AND was deployed after timestamp on previousDeployment then sync it back to the repo let action = gitRevisionChanged ? 'REMOVED' - : !previousDeployment?.id + : !previousDeployment?.id && !deployed ? 'ADDED' : fileRevisionChanged ? 'UPDATED' - : 'OK'; + : 'SKIPPED'; - if (!dryRun && (gitRevisionChanged || fileRevisionChanged)) { + if (!dryRun && action !== 'SKIPPED') { // if user is changing type, ex. server -> client function or vice versa // then try to cleanup the old type first if (previousDeployment && deployable.type !== previousDeployment.type) { await removeDeployable(previousDeployment); } - // Any deployable may be deployed to multiple instances/environments at the same time - // So we reduce the deployable record down to a single instance we want to deploy to - const syncDeployment: SyncDeployment = { - ...deployable, - ...previousDeployment, // flatten to grab name & context - type: deployable.type, // but make sure we use the latest type - description: deployable.description ?? deployable.types?.description, - instance, - }; - if (gitRevision === deployable.gitRevision) { + if (gitRevisionChanged) { + // This deployable no longer exists so let's remove it + const found = await removeDeployable(syncDeployment); + if (!found) action = 'NOT FOUND'; + const removeIndex = allDeployables.findIndex( + (d) => + d.name === deployable.name && + d.context === deployable.context && + d.file === deployable.file, + ); + toRemove.push(...allDeployables.splice(removeIndex, 1)); + } else { const deployment = await syncDeployable(syncDeployment); if (previousDeployment) { previousDeployment.id = deployment.id; @@ -187,17 +237,6 @@ export const syncDeployables = async ( } else { deployable.deployments.unshift(deployment); } - } else { - // This deployable no longer exists so let's remove it - const found = await removeDeployable(syncDeployment); - if (!found) action = 'NOT FOUND'; - const removeIndex = allDeployables.findIndex( - (d) => - d.name === deployable.name && - d.context === deployable.context && - d.file === deployable.file, - ); - toRemove.push(...allDeployables.splice(removeIndex, 1)); } } diff --git a/src/deployables.ts b/src/deployables.ts index 1de572a..31c4ee2 100644 --- a/src/deployables.ts +++ b/src/deployables.ts @@ -150,7 +150,6 @@ const writeJsonFile = async ( path: string, contents: T, ): Promise => { - await open(path, 'w'); return writeFile(path, JSON.stringify(contents, undefined, 2), { encoding: 'utf8', flag: 'w', @@ -268,8 +267,14 @@ export const getDeployableFileRevision = (fileContents: string): string => fileContents.replace(/^(\/\/.*\n)+/, ''), ) .digest('hex') - // Trimming to 7 characters to align with git revision format and to keep this nice and short! - .substring(0, 7); + // Trimming to 8 characters to align with git revision format and to keep this nice and short! + .substring(0, 8); + +export const getRandomString = (length = 8) => { + return Array.from({ length }, () => + Math.floor(Math.random() * 16).toString(16), + ).join(''); +} export const getGitRevision = (branchOrTag = 'HEAD'): string => { try { @@ -281,9 +286,7 @@ export const getGitRevision = (branchOrTag = 'HEAD'): string => { return result; } catch (err) { console.warn('Failed to get git revision. Falling back to random hash.'); - return Array.from({ length: 8 }, () => - Math.floor(Math.random() * 16).toString(16), - ).join(''); + return getRandomString(8); } }; diff --git a/src/types/functions.ts b/src/types/functions.ts index 6831cae..e3e198d 100644 --- a/src/types/functions.ts +++ b/src/types/functions.ts @@ -59,6 +59,15 @@ export interface FunctionDetailsDto extends FunctionBasicDto { * If there are some missing poly schemas in `returnTypeSchema`, they will be listed here. */ unresolvedReturnTypePolySchemaRefs?: SchemaRef[]; + code: string; + language: string; + logsEnabled?: boolean; + serverSideAsync?: boolean; + minScale?: number | null; + maxScale?: number | null; + requirements?: string | null; + generateContexts?: string[] | null; + hash: string; } export interface EntrySource { diff --git a/src/types/webhooks.ts b/src/types/webhooks.ts index 80a9a61..b4f627a 100644 --- a/src/types/webhooks.ts +++ b/src/types/webhooks.ts @@ -71,43 +71,34 @@ export interface ExecuteWebhookHandleDescriptionGenerationDto { eventPayload: any; } -export interface WebhookHandleDto { +export interface WebhookHandleBasicDto { id: string; - context: string; name: string; + context: string; contextName: string; description: string; - url: string; - uri: string; visibility: Visibility; + subpath: string | null; + state: LifecycleState; + enabled: boolean; ownerUserId?: string | null; +} + +export interface WebhookHandleDto extends WebhookHandleBasicDto { + url: string; + uri: string; eventPayloadType: string; eventPayloadTypeSchema?: Record; responsePayload?: any; responseHeaders?: any; responseStatus: number | null; slug: string | null; - subpath: string | null; - method: string | null; + method: string; requirePolyApiKey: boolean; securityFunctions: WebhookSecurityFunction[]; - enabled: boolean; xmlParserOptions: WebhookHandleXmlParserOptions; } -export interface WebhookHandleBasicDto { - id: string; - name: string; - context: string; - contextName: string; - description: string; - visibility: Visibility; - subpath: string | null; - state: LifecycleState; - enabled: boolean; - ownerUserId?: string | null; -} - export interface WebhookHandleDescriptionGenerationDto { name: string; context: string; From 2bfef55b5d7c1412c062b270453c9be1117c0a06 Mon Sep 17 00:00:00 2001 From: Daniel-Estoll <115661842+Daniel-Estoll@users.noreply.github.com> Date: Tue, 2 Sep 2025 12:01:49 -0700 Subject: [PATCH 55/73] added visibility argument to function add command (#32) * added visibility argument to function add command * bumped version * Added visibility to sync * Updated properties and removed enum typecasting * bumped version * bumped version --- package.json | 2 +- src/api.ts | 5 +++++ src/cli.ts | 11 ++++++++++- src/commands/function.ts | 5 ++++- src/commands/sync.ts | 2 ++ 5 files changed, 22 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 4312158..5c17d92 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.24.19", + "version": "0.24.20", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { diff --git a/src/api.ts b/src/api.ts index a495af2..e7290d5 100644 --- a/src/api.ts +++ b/src/api.ts @@ -25,6 +25,7 @@ import { Specification, SpecificationInputDto, TosDto, + Visibility, WebhookHandleBasicDto, WebhookHandleDescriptionGenerationDto, WebhookHandleDto, @@ -95,6 +96,7 @@ export const createOrUpdateServerFunction = async ( name: string, description: string | null, code: string, + visibility: string, typeSchemas: Record, requirements: string[], other?: Record, @@ -108,6 +110,7 @@ export const createOrUpdateServerFunction = async ( name, description, code, + visibility, typeSchemas, requirements, executionApiKey, @@ -172,6 +175,7 @@ export const createOrUpdateClientFunction = async ( name: string, description: string | null, code: string, + visibility: string, typeSchemas: Record, other?: Record, ) => { @@ -183,6 +187,7 @@ export const createOrUpdateClientFunction = async ( name, description, code, + visibility, typeSchemas, ...other, }, diff --git a/src/cli.ts b/src/cli.ts index 75d9e16..43f78c0 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -240,6 +240,10 @@ void yargs .option('cache-poly-library', { describe: 'Server function only - cache the poly library to improve function performance', type: 'boolean', + }) + .option('visibility', { + describe: 'Specifies the visibility of a function. Options: PUBLIC, TENANT, ENVIRONMENT. Case insensitive', + type: 'string', }), async ({ name, @@ -252,9 +256,11 @@ void yargs generateContexts, executionApiKey, cachePolyLibrary, + visibility, }) => { const logsEnabled = logs === 'enabled' ? true : logs === 'disabled' ? false : undefined; + visibility = visibility ? visibility.toUpperCase() : "ENVIRONMENT"; const err = !name ? 'Missing function name.' : !file @@ -273,7 +279,9 @@ void yargs ? 'Invalid value for `execution-api-key`. Must be a valid PolyAPI Key.' : cachePolyLibrary && !server ? 'Option `cache-poly-library` is only for server functions (--server).' - : ''; + : !["PUBLIC", "TENANT", "ENVIRONMENT"].includes(visibility) + ? 'Option `visibility` must be either PUBLIC, TENANT, or ENVIRONMENT. Case insensitive.' + : ''; if (err) { shell.echo(chalk.redBright('ERROR:'), err); yargs.showHelp(); @@ -294,6 +302,7 @@ void yargs generateContexts, executionApiKey, cachePolyLibrary, + visibility, ); }, ); diff --git a/src/commands/function.ts b/src/commands/function.ts index 65e0a54..e54c4ea 100644 --- a/src/commands/function.ts +++ b/src/commands/function.ts @@ -4,6 +4,7 @@ import shell from 'shelljs'; import { CreateServerCustomFunctionResponseDto, FunctionDetailsDto, + Visibility, } from '../types'; import { createOrUpdateClientFunction, @@ -31,6 +32,7 @@ export const addOrUpdateCustomFunction = async ( generateContexts: string | undefined, executionApiKey: string | null | undefined, cachePolyLibrary: boolean | undefined, + visibility: string | undefined, ) => { loadConfig(polyPath); @@ -97,12 +99,12 @@ export const addOrUpdateCustomFunction = async ( if (generateContexts) { other.generateContexts = generateContexts.split(','); } if (logsEnabled !== undefined) other.logsEnabled = logsEnabled; if (cachePolyLibrary !== undefined) other.cachePolyLibrary = cachePolyLibrary; - customFunction = await createOrUpdateServerFunction( context, name, description, code, + visibility, typeSchemas, dependencies, other, @@ -138,6 +140,7 @@ export const addOrUpdateCustomFunction = async ( name, description, code, + visibility, typeSchemas, ); shell.echo(chalk.green('DONE')); diff --git a/src/commands/sync.ts b/src/commands/sync.ts index df3494f..d5fd025 100644 --- a/src/commands/sync.ts +++ b/src/commands/sync.ts @@ -82,6 +82,7 @@ const syncDeployableAndGetId = async (deployable, code) => { deployable.name, deployable.description, code, + deployable.config.visibility, deployable.typeSchemas, deployable.dependencies, deployable.config, @@ -94,6 +95,7 @@ const syncDeployableAndGetId = async (deployable, code) => { deployable.name, deployable.description, code, + deployable.config.visibility, deployable.typeSchemas, deployable.config, ) From 75f8f5eb0eb93158025a5a52c64155a2877cefb4 Mon Sep 17 00:00:00 2001 From: Dan Fellin Date: Fri, 5 Sep 2025 09:52:37 -0700 Subject: [PATCH 56/73] force image update --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fd379c0..fffef5f 100644 --- a/README.md +++ b/README.md @@ -75,4 +75,5 @@ const unregister = poly.myWebhookContext.paymentReceieved(event => { unregister(); ``` -Happy hacking! \ No newline at end of file +Happy hacking! +. \ No newline at end of file From 1c24fc5f0d9cc0b24672a590556879a4999a9fc5 Mon Sep 17 00:00:00 2001 From: Aaron Goin Date: Mon, 22 Sep 2025 08:37:32 -0600 Subject: [PATCH 57/73] Adding support for listening over websockets for gql subscription event (#42) --- package-lock.json | 4 +-- package.json | 2 +- src/commands/generate/index.ts | 21 ++++++++++++++ src/commands/generate/types.ts | 2 ++ src/types/specifications.ts | 8 ++++++ src/utils.ts | 4 ++- templates/graphql-subscriptions-index.js | 35 ++++++++++++++++++++++++ templates/graphql-subscriptions.js.hbs | 11 ++++++++ templates/index.d.ts.hbs | 1 + templates/index.js | 2 ++ 10 files changed, 86 insertions(+), 4 deletions(-) create mode 100644 templates/graphql-subscriptions-index.js create mode 100644 templates/graphql-subscriptions.js.hbs diff --git a/package-lock.json b/package-lock.json index 8584eaa..f98e993 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "polyapi", - "version": "0.24.20", + "version": "0.24.21", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "polyapi", - "version": "0.24.20", + "version": "0.24.21", "license": "MIT", "dependencies": { "@guanghechen/helper-string": "4.7.1", diff --git a/package.json b/package.json index 5c17d92..82b0a1a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.24.20", + "version": "0.24.21", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { diff --git a/src/commands/generate/index.ts b/src/commands/generate/index.ts index 5c9fca8..27a7a36 100644 --- a/src/commands/generate/index.ts +++ b/src/commands/generate/index.ts @@ -8,6 +8,7 @@ import { ApiFunctionSpecification, AuthFunctionSpecification, CustomFunctionSpecification, + GraphQLSubscriptionSpecification, ServerFunctionSpecification, ServerVariableSpecification, Specification, @@ -62,6 +63,7 @@ const prepareDir = async (polyPath: string) => { fs.mkdirSync(`${libPath}/client`); fs.mkdirSync(`${libPath}/auth`); fs.mkdirSync(`${libPath}/webhooks`); + fs.mkdirSync(`${libPath}/subscriptions`); fs.mkdirSync(`${libPath}/server`); fs.mkdirSync(`${libPath}/vari`); fs.mkdirSync(`${libPath}/tabi`); @@ -144,6 +146,9 @@ const generateJSFiles = async ( const tables = specs.filter( (spec) => spec.type === 'table', ) as TableSpecification[]; + const gqlSubscriptions = specs.filter( + (spec) => spec.type === 'graphqlSubscription', + ) as GraphQLSubscriptionSpecification[]; await generateIndexJSFile(libPath); await generatePolyCustomJSFile(libPath); @@ -158,6 +163,7 @@ const generateJSFiles = async ( 'custom functions', ); await tryAsync(generateWebhooksJSFiles(libPath, webhookHandles), 'webhooks'); + await tryAsync(generateGraphQLSubscriptionJSFiles(libPath, gqlSubscriptions), 'GraphQL subscriptions'); await tryAsync( generateAuthFunctionJSFiles(libPath, authFunctions), 'auth functions', @@ -284,6 +290,21 @@ const generateWebhooksJSFiles = async ( fs.copyFileSync(templateUrl('webhooks-index.js'), `${libPath}/webhooks/index.js`); }; +const generateGraphQLSubscriptionJSFiles = async ( + libPath: string, + specifications: GraphQLSubscriptionSpecification[], +) => { + const template = handlebars.compile(loadTemplate('graphql-subscriptions.js.hbs')); + fs.writeFileSync( + `${libPath}/subscriptions/subscriptions.js`, + template({ + specifications, + apiKey: getApiKey(), + }), + ); + fs.copyFileSync(templateUrl('graphql-subscriptions-index.js'), `${libPath}/subscriptions/index.js`); +} + const generateServerFunctionJSFiles = async ( libPath: string, specifications: ServerFunctionSpecification[], diff --git a/src/commands/generate/types.ts b/src/commands/generate/types.ts index 42f81a6..f207866 100644 --- a/src/commands/generate/types.ts +++ b/src/commands/generate/types.ts @@ -420,6 +420,8 @@ const getIDComment = (specification: Specification) => { return `* Auth provider ID: ${specification.id}`; case 'webhookHandle': return `* Webhook ID: ${specification.id}`; + case 'graphqlSubscription': + return `* GraphQL Subscription ID: ${specification.id}`; default: return null; } diff --git a/src/types/specifications.ts b/src/types/specifications.ts index 5b3acff..a903717 100644 --- a/src/types/specifications.ts +++ b/src/types/specifications.ts @@ -14,6 +14,7 @@ export type SpecificationType = | 'serverVariable' | 'snippet' | 'table' + | 'graphqlSubscription' | 'schema'; export interface ISpecification { @@ -126,6 +127,12 @@ export interface WebhookHandleSpecification extends ISpecification { function: FunctionSpecification; } +export interface GraphQLSubscriptionSpecification extends ISpecification { + type: 'graphqlSubscription'; + description: string; + function: FunctionSpecification; +} + export interface ServerVariableSpecification extends ISpecification { type: 'serverVariable'; variable: VariableSpecification; @@ -170,6 +177,7 @@ export type Specification = | ServerVariableSpecification | SnippetSpecification | SchemaSpecification + | GraphQLSubscriptionSpecification | TableSpecification; interface CreateWebhookHandleDtoForSpecificationInput diff --git a/src/utils.ts b/src/utils.ts index fb85dba..27368ce 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -54,15 +54,17 @@ export type GenerationError = { }; export const echoGenerationError = (specification: Specification) => { - const typeMap = { + const typeMap: Record = { apiFunction: 'API Function', customFunction: 'Custom Function', authFunction: 'Auth Function', webhookHandle: 'Webhook Handle', + graphqlSubscription: 'Webhook Handle', serverFunction: 'Server Function', serverVariable: 'Variable', schema: 'Schema', snippet: 'Snippet', + table: 'Table' }; const type = typeMap[specification.type]; diff --git a/templates/graphql-subscriptions-index.js b/templates/graphql-subscriptions-index.js new file mode 100644 index 0000000..deb3a63 --- /dev/null +++ b/templates/graphql-subscriptions-index.js @@ -0,0 +1,35 @@ +const set = require('lodash/set'); +const { subscriptions } = require('./subscriptions'); + +const registerGraphQLSubscriptionEventListener = (clientID, getSocket, getApiKey, subscriptionId, callback) => { + const socket = getSocket(); + socket.emit('registerSubscriptionHandler', { + clientID, + subscriptionId, + apiKey: getApiKey(), + }, registered => { + if (registered) { + socket.on( + `handleSubscriptionEvent:${subscriptionId}`, + async ({ event, params, executionId }) => { + await callback(event, params, { executionId }); + } + ); + } else { + console.log(`Could not register GraphQL subscription event handler for ${subscriptionId}`); + } + }); + + return () => { + socket.emit('unregisterSubscriptionHandler', { + clientID, + subscriptionId, + apiKey: getApiKey(), + }); + } +}; + +module.exports = (clientID, getSocket, getApiKey) => subscriptions.reduce( + (acc, [path, id]) => set(acc, path, (callback) => registerGraphQLSubscriptionEventListener(clientID, getSocket, getApiKey, id, callback)), + {} +); diff --git a/templates/graphql-subscriptions.js.hbs b/templates/graphql-subscriptions.js.hbs new file mode 100644 index 0000000..7353133 --- /dev/null +++ b/templates/graphql-subscriptions.js.hbs @@ -0,0 +1,11 @@ +module.exports = { + subscriptions: [ + {{#each specifications}} + {{#if context}} + ['{{context}}.{{name}}', '{{id}}'], + {{else}} + ['{{name}}', '{{id}}'], + {{/if}} + {{/each}} + ] +} diff --git a/templates/index.d.ts.hbs b/templates/index.d.ts.hbs index 4cd088b..9581d00 100644 --- a/templates/index.d.ts.hbs +++ b/templates/index.d.ts.hbs @@ -15,6 +15,7 @@ declare const poly: Poly; export default poly; export type UnregisterWebhookEventListener = () => void; +export type UnregisterGraphQLSubscriptionEventListener = () => void; export type AuthFunctionCallback = (token?: string, url?: string, error?: any) => any; export interface AuthFunctionResponse { diff --git a/templates/index.js b/templates/index.js index 2830db8..40def6b 100644 --- a/templates/index.js +++ b/templates/index.js @@ -3,6 +3,7 @@ const { io } = require('socket.io-client'); const apiFunctions = require('./api'); const clientFunctions = require('./client'); const webhooks = require('./webhooks'); +const subscriptions = require('./subscriptions'); const authFunctions = require('./auth'); const serverFunctions = require('./server'); const vari = require('./vari'); @@ -68,6 +69,7 @@ merge( serverFunctions(CLIENT_ID, polyCustom), authFunctions(CLIENT_ID, getSocket, getApiKey), webhooks(CLIENT_ID, getSocket, getApiKey), + subscriptions(CLIENT_ID, getSocket, getApiKey), ), module.exports = { ...poly, From 9c3c9cd49d4badc27ba61a6ecfb53f7cec895c7e Mon Sep 17 00:00:00 2001 From: Aaron Goin Date: Thu, 2 Oct 2025 11:21:55 -0700 Subject: [PATCH 58/73] bumping axios version --- package-lock.json | 20 ++++++++++---------- package.json | 9 ++------- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/package-lock.json b/package-lock.json index f98e993..aa67281 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "polyapi", - "version": "0.24.21", + "version": "0.24.22", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "polyapi", - "version": "0.24.21", + "version": "0.24.22", "license": "MIT", "dependencies": { "@guanghechen/helper-string": "4.7.1", @@ -14,7 +14,7 @@ "@typescript-eslint/eslint-plugin": "8.32.1", "@typescript-eslint/parser": "8.32.1", "adm-zip": "0.5.16", - "axios": "1.8.3", + "axios": "1.12.0", "chalk": "4.1.2", "comment-json": "4.2.3", "dotenv": "16.0.3", @@ -2352,13 +2352,13 @@ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "node_modules/axios": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.8.3.tgz", - "integrity": "sha512-iP4DebzoNlP/YN2dpwCgb8zoCmhtkajzS48JvwmkSkXvPI3DHc7m+XYL5tGnSlJtR6nImXZmdCuN5aP8dh1d8A==", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.12.0.tgz", + "integrity": "sha512-oXTDccv8PcfjZmPGlWsPSwtOJCZ/b6W5jAMCNcfwJbCzDckwG0jrYJFaWH1yvivfCXjVzV/SPDEhMB3Q+DSurg==", "license": "MIT", "dependencies": { "follow-redirects": "^1.15.6", - "form-data": "^4.0.0", + "form-data": "^4.0.4", "proxy-from-env": "^1.1.0" } }, @@ -8865,9 +8865,9 @@ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "axios": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.8.3.tgz", - "integrity": "sha512-iP4DebzoNlP/YN2dpwCgb8zoCmhtkajzS48JvwmkSkXvPI3DHc7m+XYL5tGnSlJtR6nImXZmdCuN5aP8dh1d8A==", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.12.0.tgz", + "integrity": "sha512-oXTDccv8PcfjZmPGlWsPSwtOJCZ/b6W5jAMCNcfwJbCzDckwG0jrYJFaWH1yvivfCXjVzV/SPDEhMB3Q+DSurg==", "requires": { "follow-redirects": "^1.15.6", "form-data": "^4.0.4", diff --git a/package.json b/package.json index 82b0a1a..b0e77d6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.24.21", + "version": "0.24.22", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { @@ -51,7 +51,7 @@ "@typescript-eslint/eslint-plugin": "8.32.1", "@typescript-eslint/parser": "8.32.1", "adm-zip": "0.5.16", - "axios": "1.8.3", + "axios": "1.12.0", "chalk": "4.1.2", "comment-json": "4.2.3", "dotenv": "16.0.3", @@ -76,11 +76,6 @@ "validator": "13.11.0", "yargs": "17.7.1" }, - "overrides": { - "axios": { - "form-data": "^4.0.4" - } - }, "engines": { "node": ">=18.20.5" }, From 179d18443b89030cfd3934374c0a702c3f475b00 Mon Sep 17 00:00:00 2001 From: Aaron Goin Date: Fri, 3 Oct 2025 16:35:47 -0700 Subject: [PATCH 59/73] tracking dependencies, also fixing some logging, and adding the updateOne and deleteOne queries to tabi tables --- package-lock.json | 4 +- package.json | 2 +- src/api.ts | 6 +- src/cli.ts | 9 +- src/commands/function.ts | 12 +- src/commands/generate/index.ts | 30 +-- src/commands/generate/schemaTypes.ts | 2 +- src/commands/generate/table.ts | 10 +- src/commands/prepare.ts | 9 +- src/commands/snippet.ts | 6 - src/deployables.ts | 4 +- src/transpiler.ts | 307 +++++++++++++++++++++------ src/utils.ts | 127 +++-------- templates/tabi/index.js | 30 +-- templates/tabi/types.d.ts | 6 +- 15 files changed, 332 insertions(+), 232 deletions(-) diff --git a/package-lock.json b/package-lock.json index aa67281..8c3b012 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "polyapi", - "version": "0.24.22", + "version": "0.24.23", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "polyapi", - "version": "0.24.22", + "version": "0.24.23", "license": "MIT", "dependencies": { "@guanghechen/helper-string": "4.7.1", diff --git a/package.json b/package.json index b0e77d6..116e9fe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.24.22", + "version": "0.24.23", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { diff --git a/src/api.ts b/src/api.ts index e7290d5..f51dab3 100644 --- a/src/api.ts +++ b/src/api.ts @@ -98,7 +98,8 @@ export const createOrUpdateServerFunction = async ( code: string, visibility: string, typeSchemas: Record, - requirements: string[], + externalDependencies: Record | undefined, + internalDependencies: Record> | undefined, other?: Record, executionApiKey?: string, ) => { @@ -112,7 +113,8 @@ export const createOrUpdateServerFunction = async ( code, visibility, typeSchemas, - requirements, + externalDependencies, + internalDependencies, executionApiKey, ...other, }, diff --git a/src/cli.ts b/src/cli.ts index 43f78c0..7fca459 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -71,10 +71,11 @@ void yargs demandOption: false, type: 'string', }, - functionIds: { - describe: 'Function IDs to generate', + ids: { + describe: 'Resource IDs to generate', demandOption: false, type: 'string', + alias: 'functionIds', }, customPath: { describe: 'Custom path to .poly directory (internal use only)', @@ -93,7 +94,7 @@ void yargs exitWhenNoConfig, contexts, names, - functionIds, + ids, customPath = DEFAULT_POLY_PATH, noTypes = false, }) => { @@ -113,7 +114,7 @@ void yargs polyPath: customPath, contexts: contexts?.split(','), names: names?.split(','), - functionIds: functionIds?.split(','), + ids: ids?.split(','), noTypes, }); }, diff --git a/src/commands/function.ts b/src/commands/function.ts index e54c4ea..de4768d 100644 --- a/src/commands/function.ts +++ b/src/commands/function.ts @@ -4,7 +4,6 @@ import shell from 'shelljs'; import { CreateServerCustomFunctionResponseDto, FunctionDetailsDto, - Visibility, } from '../types'; import { createOrUpdateClientFunction, @@ -86,8 +85,8 @@ export const addOrUpdateCustomFunction = async ( `${updating ? 'Updating' : 'Adding'} custom server side function...`, ); - const dependencies = getDependencies(code, file, tsConfigBaseUrl); - if (dependencies.length) { + const [externalDependencies, internalDependencies] = await getDependencies(code, file, tsConfigBaseUrl); + if (externalDependencies) { shell.echo( chalk.yellow( 'Please note that deploying your functions will take a few minutes because it makes use of libraries other than polyapi.', @@ -106,7 +105,8 @@ export const addOrUpdateCustomFunction = async ( code, visibility, typeSchemas, - dependencies, + externalDependencies, + internalDependencies, other, executionApiKey, ); @@ -149,7 +149,7 @@ export const addOrUpdateCustomFunction = async ( await generateSingleCustomFunction(polyPath, customFunction.id, updating); } catch (e) { - shell.echo(chalk.red('ERROR\n')); - shell.echo(`${e.response?.data?.message || e.message}`); + shell.echo(chalk.redBright('ERROR\n')); + shell.echo(chalk.red((e instanceof Error ? e.message : e.response?.data?.message) || 'Unexpected error.')); } }; diff --git a/src/commands/generate/index.ts b/src/commands/generate/index.ts index 27a7a36..9978449 100644 --- a/src/commands/generate/index.ts +++ b/src/commands/generate/index.ts @@ -18,10 +18,9 @@ import { import { getSpecs } from '../../api'; import { loadConfig, addOrUpdateConfig } from '../../config'; import { - generateContextDataFile, - getContextDataFileContent, + writeCachedSpecs, + getCachedSpecs, getPolyLibPath, - getSpecsFromContextData, showErrGettingSpecs, getStringPaths, loadTemplate, @@ -463,10 +462,10 @@ const generateSingleCustomFunction = async ( ); const libPath = getPolyLibPath(polyPath); - let contextData: Record = {}; + let prevSpecs: Specification[] = []; try { - contextData = getContextDataFileContent(libPath); + prevSpecs = getCachedSpecs(libPath); } catch (error) { shell.echo(chalk.red('ERROR')); shell.echo('Error while fetching local context data.'); @@ -475,8 +474,6 @@ const generateSingleCustomFunction = async ( return; } - const prevSpecs = getSpecsFromContextData(contextData); - let specs: Specification[] = []; try { @@ -502,6 +499,8 @@ const generateSingleCustomFunction = async ( await prepareDir(polyPath); + writeCachedSpecs(libPath, specs); + setGenerationErrors(false); await generateSpecs(libPath, specs, noTypes); @@ -553,13 +552,13 @@ const generate = async ({ polyPath, contexts, names, - functionIds, + ids, noTypes, }: { polyPath: string; contexts?: string[]; names?: string[]; - functionIds?: string[]; + ids?: string[]; noTypes: boolean; }) => { let specs: Specification[] = []; @@ -572,17 +571,20 @@ const generate = async ({ await prepareDir(polyPath); loadConfig(polyPath); - try { - specs = await getSpecs(contexts, names, functionIds, noTypes); + const libPath = getPolyLibPath(polyPath); - updateLocalConfig(polyPath, contexts, names, functionIds, noTypes); + try { + specs = await getSpecs(contexts, names, ids, noTypes); + writeCachedSpecs(libPath, specs); + updateLocalConfig(polyPath, contexts, names, ids, noTypes); } catch (error) { showErrGettingSpecs(error); return; } setGenerationErrors(false); - await generateSpecs(getPolyLibPath(polyPath), specs, noTypes); + await generateSpecs(libPath, specs, noTypes); + if (getGenerationErrors()) { shell.echo( @@ -659,8 +661,6 @@ export const generateSpecs = async ( ); } - generateContextDataFile(libPath, filteredSpecs); - if (missingNames.length) { setGenerationErrors(true); missingNames.map((s) => echoGenerationError(s)); diff --git a/src/commands/generate/schemaTypes.ts b/src/commands/generate/schemaTypes.ts index 99ef2fc..2d08090 100644 --- a/src/commands/generate/schemaTypes.ts +++ b/src/commands/generate/schemaTypes.ts @@ -558,7 +558,7 @@ const printSchemaTreeAsTypes = ( depth + 1, ); } catch (err) { - console.error(err); + shell.echo(chalk.red(err)); echoGenerationError(child as SchemaSpec); setGenerationErrors(true); } diff --git a/src/commands/generate/table.ts b/src/commands/generate/table.ts index b03cb6e..4cd1a07 100644 --- a/src/commands/generate/table.ts +++ b/src/commands/generate/table.ts @@ -1,4 +1,6 @@ import fs from 'fs'; +import chalk from 'chalk'; +import shell from 'shelljs'; import { EOL } from 'node:os'; import { echoGenerationError, templateUrl } from '../../utils'; import { TableSpecification } from '../../types'; @@ -73,9 +75,9 @@ const printTableInterface = (table: TableSpecification | string): string => { `${_ws}upsertMany(query: ${formattedName}.InsertManyQuery): Promise<${formattedName}.QueryResults>;`, `${_ws}upsertOne(query: ${formattedName}.InsertOneQuery): Promise<${formattedName}.QueryResult>;`, `${_ws}updateMany(query: ${formattedName}.UpdateQuery): Promise<${formattedName}.QueryResults>;`, - // `${_ws}updateOne(query: ${formattedName}.UpdateQuery): Promise<${formattedName}.QueryResult>;`, + `${_ws}updateOne(id: string, query: ${formattedName}.UpdateQuery): Promise<${formattedName}.QueryResult>;`, `${_ws}deleteMany(query: ${formattedName}.DeleteQuery): Promise<${formattedName}.DeleteResults>;`, - // `${_ws}deleteOne(query: ${formattedName}.DeleteQuery): Promise<${formattedName}.DeleteResult>;`, + `${_ws}deleteOne(id: string, query?: ${formattedName}.DeleteQuery): Promise<${formattedName}.DeleteResult>;`, '}', ].join(`${EOL}${ws(2)}`); }; @@ -95,7 +97,7 @@ const printTableNamespace = (schema: JsonSchema, name: string, depth = 1): strin 'type QueryResults = PolyQueryResults;', 'type QueryResult = PolyQueryResult;', 'type DeleteResults = PolyDeleteResults;', - // 'type DeleteResult = PolyDeleteResult;', + 'type DeleteResult = PolyDeleteResult;', 'type CountResult = PolyCountResult;', ].join(`${EOL}${ws(depth + 1)}`) }${EOL}${ws(depth)}}`; @@ -119,7 +121,7 @@ const printTableTreeAsTypes = ( depth + 1, ); } catch (err) { - console.error(err); + shell.echo(chalk.red(err)); echoGenerationError(child as TableSpecification); setGenerationErrors(true); } diff --git a/src/commands/prepare.ts b/src/commands/prepare.ts index dc9f286..8d9d744 100644 --- a/src/commands/prepare.ts +++ b/src/commands/prepare.ts @@ -1,4 +1,5 @@ import shell from 'shelljs'; +import chalk from 'chalk'; import { FunctionArgumentDto } from '../types'; import { getTSBaseUrl, parseDeployable } from '../transpiler'; import { @@ -95,12 +96,12 @@ const getAllDeployables = async ( ); const fullName = `${deployable.context}.${deployable.name}`; if (found.has(fullName)) { - console.error( + shell.echo(chalk.redBright( `Prepared ${deployable.type.replaceAll( '-', ' ', )} ${fullName}: DUPLICATE`, - ); + )); } else { found.set( fullName, @@ -115,8 +116,8 @@ const getAllDeployables = async ( ); } } catch (err) { - console.error(`ERROR parsing ${possible}`); - console.error(err); + shell.echo(chalk.redBright(`ERROR parsing ${possible}`)); + shell.echo(chalk.red(err)); } } return Array.from(found.values()); diff --git a/src/commands/snippet.ts b/src/commands/snippet.ts index 7e3e6a9..816bb4d 100644 --- a/src/commands/snippet.ts +++ b/src/commands/snippet.ts @@ -4,7 +4,6 @@ import chalk from 'chalk'; import shell from 'shelljs'; import { upsertSnippet } from '../api'; -import { upsertResourceInSpec } from '../utils'; const readFile = promisify(fs.readFile); @@ -56,11 +55,6 @@ export const addSnippet = async ( ); shell.echo(`Snippet ID: ${response.data.id}`); - upsertResourceInSpec(polyPath, { - updated: response.status === 200, - resourceId: response.data.id, - resourceName: 'snippet', - }); } catch (error) { const httpStatusCode = error.response?.status; diff --git a/src/deployables.ts b/src/deployables.ts index 31c4ee2..5b5fac2 100644 --- a/src/deployables.ts +++ b/src/deployables.ts @@ -78,7 +78,9 @@ export type DeployableRecord = ParsedDeployableConfig & { }; }; typeSchemas?: Record; - dependencies?: string[]; + dependencies?: string[]; // old version of external dependencies + externalDependencies?: Record, + internalDependencies?: Record>, description?: string; deployments: Deployment[]; deploymentCommentRanges?: Array<[startIndex: number, endIndex: number]>; diff --git a/src/transpiler.ts b/src/transpiler.ts index 20c7299..42b0a98 100644 --- a/src/transpiler.ts +++ b/src/transpiler.ts @@ -13,6 +13,10 @@ import { getDeployableFileRevision, ParsedDeployableConfig, } from './deployables'; +import { getCachedSpecs, getPolyLibPath, writeCachedSpecs } from './utils'; +import { DEFAULT_POLY_PATH } from './constants'; +import { Specification } from './types'; +import { getSpecs } from './api'; // NodeJS built-in libraries + polyapi // https://www.w3schools.com/nodejs/ref_modules.asp @@ -78,12 +82,22 @@ const loadTsSourceFile = (filePath: string): ts.SourceFile => { return sourceFile; }; -export const getDependencies = ( +let fetchedSpecs = false; + +export const getDependencies = async ( code: string, fileName: string, baseUrl: string | undefined, ) => { const importedLibraries = new Set(); + const internalReferences = new Set(); + let polyImportIdentifier: string | null = null; + let variImportIdentifier: string | null = null; + let tabiImportIdentifier: string | null = null; + let schemasImportIdentifier: string | null = null; + // Users can alias references to parts of the poly tree by assigning to a variable + // So this map holds those references + const aliasMap = new Map(); const compilerOptions = { module: ts.ModuleKind.CommonJS, @@ -92,6 +106,38 @@ export const getDependencies = ( baseUrl, }; + + // Helper to extract dotted path + const getPropertyPath = (expr: ts.PropertyAccessExpression): string => { + const parts: string[] = []; + let current: ts.Expression = expr; + while (ts.isPropertyAccessExpression(current)) { + parts.unshift(current.name.text); + current = current.expression; + } + if (ts.isIdentifier(current)) { + parts.unshift(current.text); + } + return parts.join('.'); + } + + const flattenTypeName = (name: ts.EntityName): string => { + const parts: string[] = []; + const recurse = (n: ts.EntityName): void => { + if (ts.isQualifiedName(n)) { + recurse(n.left); + parts.push(n.right.text); + } else { + parts.push(n.text); + } + } + recurse(name); + return parts.join('.'); + } + + const VariMethods = /\.(?:(?:get)|(?:update)|(?:onUpdate)|(?:inject))$/; + const TabiMethods = /\.(?:(?:count)|(?:selectMany)|(?:selectOne)|(?:insertMany)|(?:insertOne)|(?:upsertMany)|(?:upsertOne)|(?:updateMany)|(?:updateOne)|(?:deleteMany)|(?:deleteOne))$/; + const compilerHost = ts.createCompilerHost(compilerOptions); ts.transpileModule(code, { compilerOptions, @@ -100,9 +146,30 @@ export const getDependencies = ( (context) => { return (sourceFile) => { const visitor = (node: ts.Node): ts.Node => { + // Pull out external dependencies if (ts.isImportDeclaration(node)) { - const moduleName = (node.moduleSpecifier as ts.StringLiteral) - .text; + const moduleName = (node.moduleSpecifier as ts.StringLiteral).text; + + // Capture poly imports + if (moduleName === "polyapi" && node.importClause) { + // Get name of polyapi default import if defined + if (node.importClause.name) { + polyImportIdentifier = `${node.importClause.name.text}.`; + } + + // Look for any other named imports (like vari or tabi) + if (node.importClause.namedBindings && ts.isNamedImports(node.importClause.namedBindings)) { + for (const element of node.importClause.namedBindings.elements) { + const imported = element.propertyName ? element.propertyName.text : element.name.text; + const local = element.name.text; + + if (imported === "vari") variImportIdentifier = `${local}.`; + if (imported === "tabi") tabiImportIdentifier = `${local}.`; + if (imported === "schemas") schemasImportIdentifier = `${local}.`; + } + } + } + const resolvedModule = ts.resolveModuleName( moduleName, fileName, @@ -120,8 +187,78 @@ export const getDependencies = ( importedLibraries.add(moduleName); } } + return node; } - return node; + + + // Pull out internal dependencies + if (polyImportIdentifier || variImportIdentifier || tabiImportIdentifier) { + + // Track variable assignments (aliases) + if (ts.isVariableDeclaration(node) && node.initializer) { + if (ts.isPropertyAccessExpression(node.initializer)) { + const path = getPropertyPath(node.initializer); + + // Capture poly reference aliases + if (polyImportIdentifier && path.startsWith(polyImportIdentifier)) { + if (node.name && ts.isIdentifier(node.name)) { + aliasMap.set(node.name.text, path); + return node; // Don't recurse into assignment, just move on + } + } + + // Capture vari reference aliases + if (variImportIdentifier && path.startsWith(variImportIdentifier)) { + if (node.name && ts.isIdentifier(node.name)) { + aliasMap.set(node.name.text, path); + return node; // Don't recurse into assignment, just move on + } + } + + // Capture tabi reference aliases + if (tabiImportIdentifier && path.startsWith(tabiImportIdentifier)) { + if (node.name && ts.isIdentifier(node.name)) { + aliasMap.set(node.name.text, path); + return node; // Don't recurse into assignment, just move on + } + } + } + } else if (ts.isPropertyAccessExpression(node) && !ts.isPropertyAccessExpression(node.parent)) { + let path = getPropertyPath(node); + const root = path.split('.')[0]; + // If root is an alias, substitute + if (aliasMap.has(root)) { + const aliasBase = aliasMap.get(root)!; + path = aliasBase.split(".").concat(path.split('.').slice(1)).join('.'); + } + + // Capture poly references (all function types, webhooks, and subscriptions) + if (polyImportIdentifier && path.startsWith(polyImportIdentifier)) { + internalReferences.add(path.replace(polyImportIdentifier, '')); + } + + // Capture vari references + if (variImportIdentifier && path.startsWith(variImportIdentifier)) { + internalReferences.add(path.replace(VariMethods, '').replace(variImportIdentifier, '')); + } + + // Capture tabi references + if (tabiImportIdentifier && path.startsWith(tabiImportIdentifier)) { + internalReferences.add(path.replace(TabiMethods, '').replace(tabiImportIdentifier, '')); + } + } + } + + // Capture type references + if (schemasImportIdentifier && ts.isTypeReferenceNode(node)) { + const path = flattenTypeName(node.typeName); + if (path.startsWith(schemasImportIdentifier)) { + internalReferences.add(path.replace(schemasImportIdentifier, '')); + return node; + } + } + + return ts.visitEachChild(node, visitor, context); }; return ts.visitEachChild(sourceFile, visitor, context); }; @@ -130,11 +267,15 @@ export const getDependencies = ( }, }); - let dependencies = Array.from(importedLibraries).filter( + const dependencies = Array.from(importedLibraries).filter( (library) => !EXCLUDED_REQUIREMENTS.includes(library), ); + const externalDependencies = {}; + const internalDependencies = {}; + // Finalize any external dependencies if (dependencies.length) { + // Read dependency versions from package.json let packageJson: any = fs.readFileSync( path.join(process.cwd(), 'package.json'), 'utf-8', @@ -153,10 +294,10 @@ export const getDependencies = ( const packageJsonDevDependencies = packageJson.devDependencies || {}; for (const dependency of dependencies) { - if ( - packageJsonDependencies[dependency] || - packageJsonDevDependencies[dependency] - ) { + let dependencyName = dependency; + let version = packageJsonDependencies[dependencyName] || packageJsonDevDependencies[dependencyName]; + if (version) { + externalDependencies[dependency] = version; continue; } @@ -165,26 +306,58 @@ export const getDependencies = ( while (dependencyParts.length > 0) { dependencyParts.pop(); - const newDependencyPath = dependencyParts.join('/'); + dependencyName = dependencyParts.join('/'); + version = packageJsonDependencies[dependencyName] || packageJsonDevDependencies[dependencyName]; - if ( - packageJsonDependencies[newDependencyPath] || - packageJsonDevDependencies[newDependencyPath] - ) { - dependencies = dependencies.map((currentDependency) => { - if (currentDependency === dependency) { - return dependencyParts.join('/'); - } - - return currentDependency; - }); + if (version) { + externalDependencies[dependencyName] = version; break; } } + if (!dependencyName) { + externalDependencies[dependency] = 'latest'; + } + } + } + + // Finalize any internal dependencies + if (internalReferences.size) { + // Find each reference in the specs + // Group internal references by type in a map from contextName to id + const libPath = getPolyLibPath(DEFAULT_POLY_PATH); + let specs = getCachedSpecs(libPath); + const found: Specification[] = []; + let missing: string[] = []; + + const findReferencedSpecs = (toFind: string[] | Set) => { + for (const path of internalReferences) { + const spec = specs.find(s => s.contextName.toLowerCase() === path.toLowerCase()); + if (spec) { + found.push(spec); + internalDependencies[spec.type] = internalDependencies[spec.type] || []; + internalDependencies[spec.type].push({ path: spec.contextName, id: spec.id }); + } else { + missing.push(path); + } + } + } + findReferencedSpecs(internalReferences); + if (missing.length && !fetchedSpecs) { + // In case user generated the library with only a subset of the specs needed, grab them fresh from the api and try again + specs = await getSpecs(); + writeCachedSpecs(libPath, specs); + fetchedSpecs = true; + const toFind = missing; + missing = []; + findReferencedSpecs(toFind); + } + + if (missing.length) { + throw new Error(`Cannot resolve all poly resources referenced within function.\nMissing:\n${missing.map(n => `'${n}'`).join('\n')}`) } } - return dependencies; + return [dependencies.length ? externalDependencies : undefined, internalReferences.size ? internalDependencies : undefined]; }; export const parseDeployComment = (comment: string): Deployment => { @@ -411,13 +584,13 @@ const getFunctionDetails = ( return functionDetails; }; -const parseDeployableFunction = ( +const parseDeployableFunction = async ( sourceFile: ts.SourceFile, polyConfig: ParsedDeployableConfig, baseUrl: string, fileRevision: string, gitRevision: string, -): DeployableRecord => { +): Promise => { const [deployments, deploymentCommentRanges] = getDeployComments(sourceFile); const functionDetails = getFunctionDetails(sourceFile, polyConfig.name); if (polyConfig.description) { @@ -428,14 +601,15 @@ const parseDeployableFunction = ( } else { polyConfig.description = functionDetails.types.description || ''; } - const dependencies = getDependencies(sourceFile.getFullText(), sourceFile.fileName, baseUrl); + const [externalDependencies, internalDependencies] = await getDependencies(sourceFile.getFullText(), sourceFile.fileName, baseUrl); const typeSchemas = generateTypeSchemas(sourceFile.fileName, DeployableTypeEntries.map(d => d[0]), polyConfig.name); return { ...polyConfig, ...functionDetails, deployments, deploymentCommentRanges, - dependencies, + externalDependencies, + internalDependencies, typeSchemas, fileRevision, gitRevision, @@ -479,7 +653,7 @@ export const parseDeployable = async ( case 'server-function': case 'client-function': return [ - parseDeployableFunction( + await parseDeployableFunction( sourceFile, polyConfig, baseUrl, @@ -501,42 +675,41 @@ export const parseDeployable = async ( ]; } throw new Error('Invalid Poly deployment with unsupported type'); - } catch (err) { - console.error( - `Prepared ${polyConfig.type.replaceAll('-', ' ')} ${polyConfig.context}.${ - polyConfig.name + } catch (e) { + shell.echo(chalk.redBright( + `Prepared ${polyConfig.type.replaceAll('-', ' ')} ${polyConfig.context}.${polyConfig.name }: ERROR`, - ); - console.error(err); + )); + shell.echo(chalk.red((e instanceof Error ? e.message : e.response?.data?.message) || 'Unexpected error.')); } }; const dereferenceSchema = (obj: any, definitions: any, visited: Set = new Set()): any => { if (!obj || typeof obj !== 'object') return obj; - + if (Array.isArray(obj)) { return obj.map(item => dereferenceSchema(item, definitions, visited)); } - + const result: any = {}; - + for (const [key, value] of Object.entries(obj)) { if (key === '$ref' && typeof value === 'string') { const match = value.match(/^#\/definitions\/(.+)$/); if (match) { const defName = match[1]; - + // Prevent infinite recursion if (visited.has(defName)) { return { $ref: value }; } - + const definition = definitions[defName]; if (definition) { // Inspired by old flattenDefinitions logic: Check if this looks like a "real" type // vs a utility type by examining the definition structure const shouldInline = isInlineableDefinition(definition, defName); - + if (shouldInline) { // Inline the definition visited.add(defName); @@ -555,46 +728,46 @@ const dereferenceSchema = (obj: any, definitions: any, visited: Set = ne result[key] = dereferenceSchema(value, definitions, visited); } } - + return result; }; const isInlineableDefinition = (definition: any, defName: string): boolean => { const decodedDefName = decodeURIComponent(defName); - + // If it has "real" object properties, it's probably a real interface that should be inlined - if (definition.type === 'object' && definition.properties && - Object.keys(definition.properties).length > 0) { + if (definition.type === 'object' && definition.properties && + Object.keys(definition.properties).length > 0) { return true; } - + // If it has array items with concrete structure, inline it - if (definition.type === 'array' && definition.items && - typeof definition.items === 'object' && definition.items.type) { + if (definition.type === 'array' && definition.items && + typeof definition.items === 'object' && definition.items.type) { return true; } - + // If it's a simple type (string, number, boolean), inline it if (['string', 'number', 'boolean', 'integer'].includes(definition.type)) { return true; } - + // If it has enum values, it's a real type, inline it if (definition.enum && definition.enum.length > 0) { return true; } - + // If it's a union/intersection of concrete types, inline it if ((definition.anyOf || definition.allOf) && !decodedDefName.includes('<')) { return true; } - + // Keep as reference if it looks like a utility type (contains < > or other TypeScript operators) - if (decodedDefName.includes('<') || decodedDefName.includes('>') || - decodedDefName.includes('|') || decodedDefName.includes('&')) { + if (decodedDefName.includes('<') || decodedDefName.includes('>') || + decodedDefName.includes('|') || decodedDefName.includes('&')) { return false; } - + // If we can't determine, err on the side of inlining for "normal" looking names return !/[<>%|&]/.test(decodedDefName); }; @@ -624,7 +797,7 @@ const dereferenceRoot = (schema: any): any => { // Now recursively dereference based on intelligent heuristics const { definitions, $schema, ...rest } = rootSchema; const dereferencedRest = dereferenceSchema(rest, definitions); - + // Collect remaining references that weren't inlined const filteredDefinitions: any = {}; const findReferences = (obj: any, visited: Set = new Set()): void => { @@ -639,11 +812,11 @@ const dereferenceRoot = (schema: any): any => { if (match) { const encodedDefName = match[1]; const decodedDefName = decodeURIComponent(encodedDefName); - + // Try both encoded and decoded versions - const actualDefName = definitions[encodedDefName] ? encodedDefName : - definitions[decodedDefName] ? decodedDefName : null; - + const actualDefName = definitions[encodedDefName] ? encodedDefName : + definitions[decodedDefName] ? decodedDefName : null; + if (actualDefName && !visited.has(actualDefName)) { visited.add(actualDefName); filteredDefinitions[actualDefName] = definitions[actualDefName]; @@ -656,9 +829,9 @@ const dereferenceRoot = (schema: any): any => { } } }; - + findReferences(dereferencedRest); - + return { ...dereferencedRest, ...(Object.keys(filteredDefinitions).length > 0 && { definitions: filteredDefinitions }), @@ -676,17 +849,17 @@ export const extractTypesFromAST = (filePath: string, functionName: string): str if (!sourceFile) throw new Error(`Could not load file: ${filePath}`); const extractedTypes: Set = new Set(); - + const extractFromTypeNode = (typeNode: ts.TypeNode) => { if (ts.isTypeReferenceNode(typeNode)) { const typeName = typeNode.typeName.getText(sourceFile); - + // Skip primitive and built-in types const primitives = ['Promise', 'Array', 'Record', 'string', 'number', 'boolean', 'void', 'any', 'unknown', 'object', 'undefined', 'null']; if (!primitives.includes(typeName)) { extractedTypes.add(typeName); } - + // Extract type arguments from generics (like Promise -> extract T) if (typeNode.typeArguments) { for (const typeArg of typeNode.typeArguments) { @@ -709,7 +882,7 @@ export const extractTypesFromAST = (filePath: string, functionName: string): str extractFromTypeNode(param.type); } } - + // Extract types from return type if (node.type) { extractFromTypeNode(node.type); @@ -730,12 +903,12 @@ export const generateTypeSchemas = ( const tsconfigPath = path.resolve('tsconfig.json'); // Use provided function name or default to filename const actualFunctionName = functionName || path.basename(filePath, '.ts'); - + // FIXED: Use AST-based type extraction instead of string manipulation const extractedTypes = extractTypesFromAST(filePath, actualFunctionName); - + // Filter ignored types - const typeNames = extractedTypes.filter(typeName => + const typeNames = extractedTypes.filter(typeName => !ignoredTypeNames.includes(typeName) ); diff --git a/src/utils.ts b/src/utils.ts index 27368ce..104146f 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -13,7 +13,6 @@ import { SpecificationType, } from './types'; -import { getSpecs } from './api'; import { INSTANCE_URL_MAP } from './constants'; export const getPolyLibPath = (polyPath: string) => @@ -21,33 +20,39 @@ export const getPolyLibPath = (polyPath: string) => ? `${polyPath}/lib` : `${__dirname}/../../../${polyPath}/lib`; -export const getContextDataFileContent = (libPath: string) => { +export const getCachedSpecs = (libPath: string) => { try { const contents = fs.readFileSync(`${libPath}/specs.json`, 'utf-8'); - return JSON.parse(contents) as Record; + return JSON.parse(contents) as Specification[]; } catch (err) { - return {}; + return []; } }; -export const getSpecsFromContextData = (contextData) => { - const specs: Specification[] = []; - - const traverseAndGetSpec = (data) => { - for (const key of Object.keys(data)) { - if (typeof data[key].context === 'string') { - specs.push(data[key]); - } else { - traverseAndGetSpec(data[key]); - } - } - }; - - traverseAndGetSpec(contextData); +export const writeCachedSpecs = ( + libPath: string, + specs: Specification[], +) => { + fs.writeFileSync( + `${libPath}/specs.json`, + JSON.stringify( + specs.filter((spec) => { + if (spec.type === 'snippet') { + return spec.language === 'javascript'; + } + if (spec.type === 'customFunction') { + return spec.language === 'javascript'; + } - return specs; + return true; + }), + null, + 2, + ), + ); }; + export type GenerationError = { specification: Specification; stack: string; @@ -100,90 +105,6 @@ export const showErrGettingSpecs = (error: any) => { shell.exit(1); }; -export const generateContextDataFile = ( - libPath: string, - specs: Specification[], -) => { - fs.writeFileSync( - `${libPath}/specs.json`, - JSON.stringify( - specs.filter((spec) => { - if (spec.type === 'snippet') { - return spec.language === 'javascript'; - } - if (spec.type === 'customFunction') { - return spec.language === 'javascript'; - } - - return true; - }), - null, - 2, - ), - ); -}; - -export const upsertResourceInSpec = async ( - polyPath: string, - { - resourceId, - resourceName, - updated, - }: { - resourceId: string; - resourceName: string; - updated: boolean; - }, -) => { - shell.echo( - '-n', - updated - ? `Updating ${resourceName} in specs...` - : `Adding ${resourceName} to SDK...`, - ); - - let contextData: Record = {}; - - try { - contextData = getContextDataFileContent(getPolyLibPath(polyPath)); - } catch (error) { - shell.echo(chalk.red('ERROR')); - shell.echo('Error while fetching local context data.'); - shell.echo(chalk.red(error.message)); - shell.echo(chalk.red(error.stack)); - return; - } - - const prevSpecs = getSpecsFromContextData(contextData); - - let specs: Specification[] = []; - - try { - specs = await getSpecs([], [], [resourceId], false); - } catch (error) { - showErrGettingSpecs(error); - return; - } - - const [resource] = specs; - - if (prevSpecs.some((prevSpec) => prevSpec.id === resource.id)) { - specs = prevSpecs.map((prevSpec) => { - if (prevSpec.id === resource.id) { - return resource; - } - return prevSpec; - }); - } else { - prevSpecs.push(resource); - specs = prevSpecs; - } - - generateContextDataFile(getPolyLibPath(polyPath), specs); - - shell.echo(chalk.green('DONE')); -}; - export const getStringPaths = (data: Record | any[]) => { const paths = jp.paths(data, '$..*', 100); diff --git a/templates/tabi/index.js b/templates/tabi/index.js index 1936375..9369e35 100644 --- a/templates/tabi/index.js +++ b/templates/tabi/index.js @@ -24,13 +24,13 @@ const firstResult = (rsp) => { return rsp; } -// const deleteOneResponse = (rsp) => { -// if (typeof rsp.deleted === 'number') { -// return { deleted: rsp.deleted > 0 }; -// } -// // Else rsp is some kind of error -// return rsp; -// } +const deleteOneResponse = (rsp) => { + if (typeof rsp.deleted === 'number') { + return { deleted: rsp.deleted > 0 }; + } + // Else rsp is some kind of error + return rsp; +} class Table { constructor(id, clientID, polyCustom) { @@ -78,17 +78,21 @@ class Table { return executeQuery(this.id, 'update', query, this.clientID, this.polyCustom); } - // updateOne(query) { - // return executeQuery(this.id, 'update', query, this.clientID, this.polyCustom).then(firstResult); - // } + updateOne(id, query) { + if (!query.where) query.where = {}; + query.where.id = id; + return executeQuery(this.id, 'update', query, this.clientID, this.polyCustom).then(firstResult); + } deleteMany(query) { return executeQuery(this.id, 'delete', query, this.clientID, this.polyCustom); } - // deleteOne(query) { - // return executeQuery(this.id, 'delete', query, this.clientID, this.polyCustom).then(deleteOneResponse); - // } + deleteOne(id, query = {}) { + if (!query.where) query.where = {}; + query.where.id = id; + return executeQuery(this.id, 'delete', query, this.clientID, this.polyCustom).then(deleteOneResponse); + } } module.exports = (clientID, polyCustom) => tables.reduce( diff --git a/templates/tabi/types.d.ts b/templates/tabi/types.d.ts index 675b10e..1c4645a 100644 --- a/templates/tabi/types.d.ts +++ b/templates/tabi/types.d.ts @@ -81,9 +81,9 @@ type PolyDeleteResults = { deleted: number; } -// type PolyDeleteResult = { -// deleted: boolean; -// } +type PolyDeleteResult = { + deleted: boolean; +} type PolyCountResult = { count: boolean; From aaed9b9a28f3ba5d55b3cc0d01d9c918e9a0b78b Mon Sep 17 00:00:00 2001 From: Aaron Goin Date: Fri, 10 Oct 2025 11:55:02 -0700 Subject: [PATCH 60/73] Separate out public function internal dependencies from non-public ones --- package-lock.json | 4 ++-- package.json | 2 +- src/transpiler.ts | 14 ++++++++++++-- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8c3b012..319a908 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "polyapi", - "version": "0.24.23", + "version": "0.24.24", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "polyapi", - "version": "0.24.23", + "version": "0.24.24", "license": "MIT", "dependencies": { "@guanghechen/helper-string": "4.7.1", diff --git a/package.json b/package.json index 116e9fe..c2e8e94 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.24.23", + "version": "0.24.24", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { diff --git a/src/transpiler.ts b/src/transpiler.ts index 42b0a98..e5e4d42 100644 --- a/src/transpiler.ts +++ b/src/transpiler.ts @@ -334,8 +334,18 @@ export const getDependencies = async ( const spec = specs.find(s => s.contextName.toLowerCase() === path.toLowerCase()); if (spec) { found.push(spec); - internalDependencies[spec.type] = internalDependencies[spec.type] || []; - internalDependencies[spec.type].push({ path: spec.contextName, id: spec.id }); + let type: string = spec.type; + const dep = { path: spec.contextName, id: spec.id }; + if ( + spec.visibilityMetadata.visibility === 'PUBLIC' && + ['apiFunction', 'customFunction', 'serverFunction'].includes(type) + ) { + type = `public${type.substring(0, 1).toUpperCase()}${type.substring(1)}`; + dep['tenantName'] = spec.visibilityMetadata.foreignTenantName; + dep['environmentName'] = spec.visibilityMetadata.foreignEnvironmentName; + } + internalDependencies[type] = internalDependencies[type] || []; + internalDependencies[type].push(dep); } else { missing.push(path); } From e49ab20de92f9e18e4d7be8488c04c07d31fb275 Mon Sep 17 00:00:00 2001 From: Aaron Goin Date: Fri, 10 Oct 2025 13:43:17 -0700 Subject: [PATCH 61/73] fix dependency parsing for client functions, and making new feature work with glide deployments --- package-lock.json | 4 +-- package.json | 2 +- src/api.ts | 5 ++- src/commands/function.ts | 4 ++- src/commands/sync.ts | 77 ++++++++++++++++++++++------------------ 5 files changed, 52 insertions(+), 40 deletions(-) diff --git a/package-lock.json b/package-lock.json index 319a908..bb18c61 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "polyapi", - "version": "0.24.24", + "version": "0.25.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "polyapi", - "version": "0.24.24", + "version": "0.25.0", "license": "MIT", "dependencies": { "@guanghechen/helper-string": "4.7.1", diff --git a/package.json b/package.json index c2e8e94..ae63790 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.24.24", + "version": "0.25.0", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { diff --git a/src/api.ts b/src/api.ts index f51dab3..70aaf4d 100644 --- a/src/api.ts +++ b/src/api.ts @@ -25,7 +25,6 @@ import { Specification, SpecificationInputDto, TosDto, - Visibility, WebhookHandleBasicDto, WebhookHandleDescriptionGenerationDto, WebhookHandleDto, @@ -179,6 +178,8 @@ export const createOrUpdateClientFunction = async ( code: string, visibility: string, typeSchemas: Record, + externalDependencies: Record | undefined, + internalDependencies: Record> | undefined, other?: Record, ) => { return ( @@ -191,6 +192,8 @@ export const createOrUpdateClientFunction = async ( code, visibility, typeSchemas, + externalDependencies, + internalDependencies, ...other, }, { diff --git a/src/commands/function.ts b/src/commands/function.ts index de4768d..4b52cb7 100644 --- a/src/commands/function.ts +++ b/src/commands/function.ts @@ -78,6 +78,7 @@ export const addOrUpdateCustomFunction = async ( } const typeSchemas = generateTypeSchemas(file, DeployableTypeEntries.map(d => d[0]), name); + const [externalDependencies, internalDependencies] = await getDependencies(code, file, tsConfigBaseUrl); if (server) { shell.echo( @@ -85,7 +86,6 @@ export const addOrUpdateCustomFunction = async ( `${updating ? 'Updating' : 'Adding'} custom server side function...`, ); - const [externalDependencies, internalDependencies] = await getDependencies(code, file, tsConfigBaseUrl); if (externalDependencies) { shell.echo( chalk.yellow( @@ -142,6 +142,8 @@ export const addOrUpdateCustomFunction = async ( code, visibility, typeSchemas, + externalDependencies, + internalDependencies, ); shell.echo(chalk.green('DONE')); shell.echo(`Client Function ID: ${customFunction.id}`); diff --git a/src/commands/sync.ts b/src/commands/sync.ts index d5fd025..d4f6a5f 100644 --- a/src/commands/sync.ts +++ b/src/commands/sync.ts @@ -74,41 +74,48 @@ const removeDeployable = async ( }; const syncDeployableAndGetId = async (deployable, code) => { - switch (deployable.type) { - case 'server-function': - return ( - await createOrUpdateServerFunction( - deployable.context, - deployable.name, - deployable.description, - code, - deployable.config.visibility, - deployable.typeSchemas, - deployable.dependencies, - deployable.config, - ) - ).id; - case 'client-function': - return ( - await createOrUpdateClientFunction( - deployable.context, - deployable.name, - deployable.description, - code, - deployable.config.visibility, - deployable.typeSchemas, - deployable.config, - ) - ).id; - case 'webhook': - return ( - await createOrUpdateWebhook( - deployable.context, - deployable.name, - deployable.description, - deployable.config, - ) - ).id; + if (deployable.type === 'webhook') { + return ( + await createOrUpdateWebhook( + deployable.context, + deployable.name, + deployable.description, + deployable.config, + ) + ).id; + } + let { externalDependencies, dependencies } = deployable; + if (Array.isArray(dependencies) && !externalDependencies) { + externalDependencies = Object.fromEntries(dependencies.map(d => [d, "latest"])); + } + if (deployable.type === 'server-function') { + return ( + await createOrUpdateServerFunction( + deployable.context, + deployable.name, + deployable.description, + code, + deployable.config.visibility, + deployable.typeSchemas, + externalDependencies, + deployable.internalDependencies, + deployable.config, + ) + ).id; + } else if (deployable.type === 'client-function') { + return ( + await createOrUpdateClientFunction( + deployable.context, + deployable.name, + deployable.description, + code, + deployable.config.visibility, + deployable.typeSchemas, + externalDependencies, + deployable.internalDependencies, + deployable.config, + ) + ).id; } throw new Error(`Unsupported deployable type: '${deployable.type}'`); }; From 89edb1086478dbb5eb046a238e8f1297404063aa Mon Sep 17 00:00:00 2001 From: Aaron Goin Date: Fri, 10 Oct 2025 16:11:05 -0700 Subject: [PATCH 62/73] Fixing type error in the tabi count result type --- package-lock.json | 4 ++-- package.json | 2 +- templates/tabi/types.d.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index bb18c61..599a62c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "polyapi", - "version": "0.25.0", + "version": "0.25.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "polyapi", - "version": "0.25.0", + "version": "0.25.1", "license": "MIT", "dependencies": { "@guanghechen/helper-string": "4.7.1", diff --git a/package.json b/package.json index ae63790..733c333 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.25.0", + "version": "0.25.1", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { diff --git a/templates/tabi/types.d.ts b/templates/tabi/types.d.ts index 1c4645a..552ec07 100644 --- a/templates/tabi/types.d.ts +++ b/templates/tabi/types.d.ts @@ -86,5 +86,5 @@ type PolyDeleteResult = { } type PolyCountResult = { - count: boolean; + count: number; } \ No newline at end of file From 0a4e6e7758f37144a6786c6f107f8b532e943335 Mon Sep 17 00:00:00 2001 From: Aaron Goin Date: Mon, 13 Oct 2025 09:42:49 -0700 Subject: [PATCH 63/73] fix small potential bug trying to save specs.json when lib hasn't been generated --- package-lock.json | 4 ++-- package.json | 2 +- src/utils.ts | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 599a62c..cddd90c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "polyapi", - "version": "0.25.1", + "version": "0.25.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "polyapi", - "version": "0.25.1", + "version": "0.25.2", "license": "MIT", "dependencies": { "@guanghechen/helper-string": "4.7.1", diff --git a/package.json b/package.json index 733c333..5f0bcbf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.25.1", + "version": "0.25.2", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { diff --git a/src/utils.ts b/src/utils.ts index 104146f..1eb8f34 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -33,6 +33,7 @@ export const writeCachedSpecs = ( libPath: string, specs: Specification[], ) => { + fs.mkdirSync(libPath, { recursive: true }); fs.writeFileSync( `${libPath}/specs.json`, JSON.stringify( From f421ab24fd0636f6788a8e20af82840239573e29 Mon Sep 17 00:00:00 2001 From: Aaron Goin Date: Thu, 16 Oct 2025 07:27:10 -0700 Subject: [PATCH 64/73] keeping backwards compatibility for sfx requirements --- package-lock.json | 4 ++-- package.json | 2 +- src/api.ts | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index cddd90c..c51e17a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "polyapi", - "version": "0.25.2", + "version": "0.25.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "polyapi", - "version": "0.25.2", + "version": "0.25.3", "license": "MIT", "dependencies": { "@guanghechen/helper-string": "4.7.1", diff --git a/package.json b/package.json index 5f0bcbf..b660587 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.25.2", + "version": "0.25.3", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { diff --git a/src/api.ts b/src/api.ts index 70aaf4d..68a813e 100644 --- a/src/api.ts +++ b/src/api.ts @@ -112,6 +112,8 @@ export const createOrUpdateServerFunction = async ( code, visibility, typeSchemas, + // Keeping backwards compatability on requirements + requirements: Object.keys(externalDependencies), externalDependencies, internalDependencies, executionApiKey, From 70ecab770b781b53e1050b147a2fbd8053421209 Mon Sep 17 00:00:00 2001 From: Nahuel Rebollo Neira Date: Thu, 16 Oct 2025 15:28:27 -0300 Subject: [PATCH 65/73] =?UTF-8?q?R27=20=F0=9F=9A=80=20=20(#43)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * some cleanup and bringing over hidden files * bringing over the deploy workflow * adding CI/CD workflows * updating to use npm cache instead of yarn * Bringing in Richard's updates! * Some missed cleanup, missing dev dependencies, and fixed build. * hard pinned package versions (#2) * adding husky pre-commit hook for linting * # Feature (4156): P3) Bug with deploying a client function after it a… (#1) * # Feature (4156): P3) Bug with deploying a client function after it as deployed as a server function - Refactoring npm client - Verification added for checking existing function by name and context - color updated * Fixing bug where client was not resolving dependencies correctly * adding missing dependency for testing, and fixing issue where some names in the generated schemas were not being wrapped in quotes * Handling x-poly-refs contained with function arguments that are themselves function types (fixes webhook types and more) * improve logging of failed api function calls (#4) * improve logging of failed api function calls * Update templates/api-index.js.hbs Co-authored-by: Aaron Goin * onward --------- Co-authored-by: Aaron Goin * P2) (MS) npm client: add direct execute option and MTLS option (#3) * adds direct execute and mtls options support * reversed unintended change * fixed metric names + http agent to be created only once * version increment * lost my logging in code review, lets go agane (#6) * P3) VSCode Extension: Add a Refresh Button to Tree View #4107 (#5) * # Feature (4107): P3) VSCode Extension: Add a Refresh Button to Tree View - load config now can return value - Add or Update config function added * # Feature (4107): P3) VSCode Extension: Add a Refresh Button to Tree View - load config now can return value - Add or Update config function added - Version updated * 4372 update contexts info from terminal (#8) * # Feature (4107): P3) VSCode Extension: Add a Refresh Button to Tree View - load config now can return value - Add or Update config function added - if contexts is empty then it will not save in .config.env * schema generation improvements Supporting $refs defined inline within a schema. Fixing bug where allowing additional attributes on objects by default. Fixing bug where additional attributes generated name was wrapped in extra quotes. Fixing bug where schemas without contexts would fail to be generated. Improving schema generation to remove the extra interfaces which just cause noise for users. Removing yarn.lock since we only use NPM in this repo * Bumping to 0.23.19 to follow Richard's PR * # Feature (2790): P4) Ability to control npx poly generate via an extra view in VS code extension (can repurpose the configuration UI) (#11) - Local config updated - Version updated * try new action * Revert "try new action" This reverts commit 540feeb28e56940dd23716d789705d2f6b3d1c2a. * Bug fixes and improvements - Catching axios errors and scrubbing them of polyapi tokens and secrets - Fixing schema generation to remove extra, empty interfaces - Adding support for schemas with refs to inline definitions - Fixing bug where schemas with no contexts would not be generated - Fixing bug where schema public namespace was not Pascal cased * fixing generated webhooks and server functions * try a KISS version of auto deploy prebuilt (#12) * P1) Update typescript client to remove warnings (#7) * ts-json-schema-generator used instead of outdated package + eslint upgrade * eslint hardcode * eslintignore removed * eslint.config.js renamed to eslint.config.mjs to prevent errors * lock file updated * fix complex types * fix server function runtime * downgrade package to fix the wrong export of subpackage issue (#14) * Improving safety of scrubKeys utility * lets test the auto-update prebuilt functionality * Changed command structure to fix windows glide bug (#15) * Changed command structure to fix windows glide bug * Added comment to explain strange syntax * Allowed directories to be specified in the command * Updated excludeCommand quotations and comment * Updated version * Added package-lock.json * Dirty deployables are now added to git after being updated (#16) * Dirty deployables are now added to git after being updated * changed slice to replace * Changed log to warn * Re-fixed glide commit bug (#18) * Adding support for tabi tables, and fixing small bug when generating empty object type (#13) * Adding support for tabi tables, and fixing small bug when generating empty object type * Fix update query * Fix type on update query * sime minor tweaks to tabi query types * lint and fixing deleteOne response * adding count query and fixing tests * 4324 p2 add new field cachepolylibrary false to customfunction table if its set to true do the behavior now behind faascachingenabled (#19) * adds support for cachePolyLibrary for server functions in glide and cache-poly-library flag * increment version * P3) TS Client: Log PolyAPI Library version on function startup (#20) * welcome message for users with package version * show welcome message on first use * Updating server function configs to support more properties, allowing for setting description via the config, and fixing bug where tabi tables could not be lowercase * 4504 p3 glide bug npx poly prepare does not find any deployables in windows (#21) * Changed command structure to fix windows glide bug * Added comment to explain strange syntax * Allowed directories to be specified in the command * Updated excludeCommand quotations and comment * Updated version * Added package-lock.json * Fixed config name TypeError * Revert "Fixed config name TypeError" This reverts commit 7b3208666c48679e0366a5d179d301d355be55e8. * Fixed windows find deployables command to ignore files without polyConfig * Making sure api function call errors aren't logged unless LOGS_ENABLED environment flag is truthy * Remove the welcome message for now * Windows glide duplicate deployables fix (#22) * Changed windows command for finding deployables to ensure that the same file is not found multiple times * Added replace to remove file paths in glide prepare * version * version * Removing the updateOne and deleteOne queries from Tabi for now since they don't really work! * Warn on schema fallback (#25) * Added warning when falling back to unknown type * Bumped version * Moved warning to schemaTypes to ensure that warnings are not duplicated * Added falling back message * added scrubbing to api function requestArgs (#27) * added scrubbing to api function requestArgs * Changed iteration to go through keys, added scrubbing to scrubKeys, changed * to 8 * closed some holes and fixed some edge cases * cleaning the scrubbing * bumped version * changed Record to Partial * Changed import path (#29) * Fix scrub import again (#30) * reversed imports * bumped version * added scrub to exports * Changed warning message (#31) * Changed warning message * reworded message * removed the afro * assigned scrub to a variable instead of just doing nothing with it (#33) * assigned scrub to a variable instead of just doing nothing with it * update --------- Co-authored-by: Dan Fellin * missed on scrub call to args * lets link to the OSS repo doh * fix * Commented out warnings (#34) * Commented out warnings * bumped version * bump form-data * fixing glide deployment to also check remote destination to confirm if deployment already exists or if it really needs updated (#39) * added visibility argument to function add command (#32) * added visibility argument to function add command * bumped version * Added visibility to sync * Updated properties and removed enum typecasting * bumped version * bumped version * force image update * Adding support for listening over websockets for gql subscription event (#42) * bumping axios version * tracking dependencies, also fixing some logging, and adding the updateOne and deleteOne queries to tabi tables * Separate out public function internal dependencies from non-public ones * fix dependency parsing for client functions, and making new feature work with glide deployments * Fixing type error in the tabi count result type * fix small potential bug trying to save specs.json when lib hasn't been generated * keeping backwards compatibility for sfx requirements --------- Co-authored-by: Aaron Goin Co-authored-by: Richard Co-authored-by: SudiptaTJ Co-authored-by: Dan Fellin Co-authored-by: Dan Fellin Co-authored-by: Daniel-Estoll <115661842+Daniel-Estoll@users.noreply.github.com> --- README.md | 3 +- package-lock.json | 20 +- package.json | 4 +- src/api.ts | 12 +- src/cli.ts | 9 +- src/commands/function.ts | 13 +- src/commands/generate/index.ts | 51 ++-- src/commands/generate/schemaTypes.ts | 2 +- src/commands/generate/table.ts | 10 +- src/commands/generate/types.ts | 2 + src/commands/prepare.ts | 9 +- src/commands/snippet.ts | 6 - src/commands/sync.ts | 77 +++--- src/deployables.ts | 4 +- src/transpiler.ts | 317 ++++++++++++++++++----- src/types/specifications.ts | 8 + src/utils.ts | 132 ++-------- templates/graphql-subscriptions-index.js | 35 +++ templates/graphql-subscriptions.js.hbs | 11 + templates/index.d.ts.hbs | 1 + templates/index.js | 2 + templates/tabi/index.js | 30 ++- templates/tabi/types.d.ts | 8 +- 23 files changed, 488 insertions(+), 278 deletions(-) create mode 100644 templates/graphql-subscriptions-index.js create mode 100644 templates/graphql-subscriptions.js.hbs diff --git a/README.md b/README.md index fd379c0..fffef5f 100644 --- a/README.md +++ b/README.md @@ -75,4 +75,5 @@ const unregister = poly.myWebhookContext.paymentReceieved(event => { unregister(); ``` -Happy hacking! \ No newline at end of file +Happy hacking! +. \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 8584eaa..c51e17a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "polyapi", - "version": "0.24.20", + "version": "0.25.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "polyapi", - "version": "0.24.20", + "version": "0.25.3", "license": "MIT", "dependencies": { "@guanghechen/helper-string": "4.7.1", @@ -14,7 +14,7 @@ "@typescript-eslint/eslint-plugin": "8.32.1", "@typescript-eslint/parser": "8.32.1", "adm-zip": "0.5.16", - "axios": "1.8.3", + "axios": "1.12.0", "chalk": "4.1.2", "comment-json": "4.2.3", "dotenv": "16.0.3", @@ -2352,13 +2352,13 @@ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "node_modules/axios": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.8.3.tgz", - "integrity": "sha512-iP4DebzoNlP/YN2dpwCgb8zoCmhtkajzS48JvwmkSkXvPI3DHc7m+XYL5tGnSlJtR6nImXZmdCuN5aP8dh1d8A==", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.12.0.tgz", + "integrity": "sha512-oXTDccv8PcfjZmPGlWsPSwtOJCZ/b6W5jAMCNcfwJbCzDckwG0jrYJFaWH1yvivfCXjVzV/SPDEhMB3Q+DSurg==", "license": "MIT", "dependencies": { "follow-redirects": "^1.15.6", - "form-data": "^4.0.0", + "form-data": "^4.0.4", "proxy-from-env": "^1.1.0" } }, @@ -8865,9 +8865,9 @@ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "axios": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.8.3.tgz", - "integrity": "sha512-iP4DebzoNlP/YN2dpwCgb8zoCmhtkajzS48JvwmkSkXvPI3DHc7m+XYL5tGnSlJtR6nImXZmdCuN5aP8dh1d8A==", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.12.0.tgz", + "integrity": "sha512-oXTDccv8PcfjZmPGlWsPSwtOJCZ/b6W5jAMCNcfwJbCzDckwG0jrYJFaWH1yvivfCXjVzV/SPDEhMB3Q+DSurg==", "requires": { "follow-redirects": "^1.15.6", "form-data": "^4.0.4", diff --git a/package.json b/package.json index 5c17d92..35c0b1e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.24.20", + "version": "0.25.3", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { @@ -51,7 +51,7 @@ "@typescript-eslint/eslint-plugin": "8.32.1", "@typescript-eslint/parser": "8.32.1", "adm-zip": "0.5.16", - "axios": "1.8.3", + "axios": "1.12.0", "chalk": "4.1.2", "comment-json": "4.2.3", "dotenv": "16.0.3", diff --git a/src/api.ts b/src/api.ts index e7290d5..69fcdc3 100644 --- a/src/api.ts +++ b/src/api.ts @@ -98,7 +98,8 @@ export const createOrUpdateServerFunction = async ( code: string, visibility: string, typeSchemas: Record, - requirements: string[], + externalDependencies: Record | undefined, + internalDependencies: Record> | undefined, other?: Record, executionApiKey?: string, ) => { @@ -112,7 +113,10 @@ export const createOrUpdateServerFunction = async ( code, visibility, typeSchemas, - requirements, + // Keeping backwards compatability on requirements + requirements: Object.keys(externalDependencies), + externalDependencies, + internalDependencies, executionApiKey, ...other, }, @@ -177,6 +181,8 @@ export const createOrUpdateClientFunction = async ( code: string, visibility: string, typeSchemas: Record, + externalDependencies: Record | undefined, + internalDependencies: Record> | undefined, other?: Record, ) => { return ( @@ -189,6 +195,8 @@ export const createOrUpdateClientFunction = async ( code, visibility, typeSchemas, + externalDependencies, + internalDependencies, ...other, }, { diff --git a/src/cli.ts b/src/cli.ts index 43f78c0..7fca459 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -71,10 +71,11 @@ void yargs demandOption: false, type: 'string', }, - functionIds: { - describe: 'Function IDs to generate', + ids: { + describe: 'Resource IDs to generate', demandOption: false, type: 'string', + alias: 'functionIds', }, customPath: { describe: 'Custom path to .poly directory (internal use only)', @@ -93,7 +94,7 @@ void yargs exitWhenNoConfig, contexts, names, - functionIds, + ids, customPath = DEFAULT_POLY_PATH, noTypes = false, }) => { @@ -113,7 +114,7 @@ void yargs polyPath: customPath, contexts: contexts?.split(','), names: names?.split(','), - functionIds: functionIds?.split(','), + ids: ids?.split(','), noTypes, }); }, diff --git a/src/commands/function.ts b/src/commands/function.ts index e54c4ea..09dc620 100644 --- a/src/commands/function.ts +++ b/src/commands/function.ts @@ -79,6 +79,7 @@ export const addOrUpdateCustomFunction = async ( } const typeSchemas = generateTypeSchemas(file, DeployableTypeEntries.map(d => d[0]), name); + const [externalDependencies, internalDependencies] = await getDependencies(code, file, tsConfigBaseUrl); if (server) { shell.echo( @@ -86,8 +87,7 @@ export const addOrUpdateCustomFunction = async ( `${updating ? 'Updating' : 'Adding'} custom server side function...`, ); - const dependencies = getDependencies(code, file, tsConfigBaseUrl); - if (dependencies.length) { + if (externalDependencies) { shell.echo( chalk.yellow( 'Please note that deploying your functions will take a few minutes because it makes use of libraries other than polyapi.', @@ -106,7 +106,8 @@ export const addOrUpdateCustomFunction = async ( code, visibility, typeSchemas, - dependencies, + externalDependencies, + internalDependencies, other, executionApiKey, ); @@ -142,6 +143,8 @@ export const addOrUpdateCustomFunction = async ( code, visibility, typeSchemas, + externalDependencies, + internalDependencies, ); shell.echo(chalk.green('DONE')); shell.echo(`Client Function ID: ${customFunction.id}`); @@ -149,7 +152,7 @@ export const addOrUpdateCustomFunction = async ( await generateSingleCustomFunction(polyPath, customFunction.id, updating); } catch (e) { - shell.echo(chalk.red('ERROR\n')); - shell.echo(`${e.response?.data?.message || e.message}`); + shell.echo(chalk.redBright('ERROR\n')); + shell.echo(chalk.red((e instanceof Error ? e.message : e.response?.data?.message) || 'Unexpected error.')); } }; diff --git a/src/commands/generate/index.ts b/src/commands/generate/index.ts index 5c9fca8..9978449 100644 --- a/src/commands/generate/index.ts +++ b/src/commands/generate/index.ts @@ -8,6 +8,7 @@ import { ApiFunctionSpecification, AuthFunctionSpecification, CustomFunctionSpecification, + GraphQLSubscriptionSpecification, ServerFunctionSpecification, ServerVariableSpecification, Specification, @@ -17,10 +18,9 @@ import { import { getSpecs } from '../../api'; import { loadConfig, addOrUpdateConfig } from '../../config'; import { - generateContextDataFile, - getContextDataFileContent, + writeCachedSpecs, + getCachedSpecs, getPolyLibPath, - getSpecsFromContextData, showErrGettingSpecs, getStringPaths, loadTemplate, @@ -62,6 +62,7 @@ const prepareDir = async (polyPath: string) => { fs.mkdirSync(`${libPath}/client`); fs.mkdirSync(`${libPath}/auth`); fs.mkdirSync(`${libPath}/webhooks`); + fs.mkdirSync(`${libPath}/subscriptions`); fs.mkdirSync(`${libPath}/server`); fs.mkdirSync(`${libPath}/vari`); fs.mkdirSync(`${libPath}/tabi`); @@ -144,6 +145,9 @@ const generateJSFiles = async ( const tables = specs.filter( (spec) => spec.type === 'table', ) as TableSpecification[]; + const gqlSubscriptions = specs.filter( + (spec) => spec.type === 'graphqlSubscription', + ) as GraphQLSubscriptionSpecification[]; await generateIndexJSFile(libPath); await generatePolyCustomJSFile(libPath); @@ -158,6 +162,7 @@ const generateJSFiles = async ( 'custom functions', ); await tryAsync(generateWebhooksJSFiles(libPath, webhookHandles), 'webhooks'); + await tryAsync(generateGraphQLSubscriptionJSFiles(libPath, gqlSubscriptions), 'GraphQL subscriptions'); await tryAsync( generateAuthFunctionJSFiles(libPath, authFunctions), 'auth functions', @@ -284,6 +289,21 @@ const generateWebhooksJSFiles = async ( fs.copyFileSync(templateUrl('webhooks-index.js'), `${libPath}/webhooks/index.js`); }; +const generateGraphQLSubscriptionJSFiles = async ( + libPath: string, + specifications: GraphQLSubscriptionSpecification[], +) => { + const template = handlebars.compile(loadTemplate('graphql-subscriptions.js.hbs')); + fs.writeFileSync( + `${libPath}/subscriptions/subscriptions.js`, + template({ + specifications, + apiKey: getApiKey(), + }), + ); + fs.copyFileSync(templateUrl('graphql-subscriptions-index.js'), `${libPath}/subscriptions/index.js`); +} + const generateServerFunctionJSFiles = async ( libPath: string, specifications: ServerFunctionSpecification[], @@ -442,10 +462,10 @@ const generateSingleCustomFunction = async ( ); const libPath = getPolyLibPath(polyPath); - let contextData: Record = {}; + let prevSpecs: Specification[] = []; try { - contextData = getContextDataFileContent(libPath); + prevSpecs = getCachedSpecs(libPath); } catch (error) { shell.echo(chalk.red('ERROR')); shell.echo('Error while fetching local context data.'); @@ -454,8 +474,6 @@ const generateSingleCustomFunction = async ( return; } - const prevSpecs = getSpecsFromContextData(contextData); - let specs: Specification[] = []; try { @@ -481,6 +499,8 @@ const generateSingleCustomFunction = async ( await prepareDir(polyPath); + writeCachedSpecs(libPath, specs); + setGenerationErrors(false); await generateSpecs(libPath, specs, noTypes); @@ -532,13 +552,13 @@ const generate = async ({ polyPath, contexts, names, - functionIds, + ids, noTypes, }: { polyPath: string; contexts?: string[]; names?: string[]; - functionIds?: string[]; + ids?: string[]; noTypes: boolean; }) => { let specs: Specification[] = []; @@ -551,17 +571,20 @@ const generate = async ({ await prepareDir(polyPath); loadConfig(polyPath); - try { - specs = await getSpecs(contexts, names, functionIds, noTypes); + const libPath = getPolyLibPath(polyPath); - updateLocalConfig(polyPath, contexts, names, functionIds, noTypes); + try { + specs = await getSpecs(contexts, names, ids, noTypes); + writeCachedSpecs(libPath, specs); + updateLocalConfig(polyPath, contexts, names, ids, noTypes); } catch (error) { showErrGettingSpecs(error); return; } setGenerationErrors(false); - await generateSpecs(getPolyLibPath(polyPath), specs, noTypes); + await generateSpecs(libPath, specs, noTypes); + if (getGenerationErrors()) { shell.echo( @@ -638,8 +661,6 @@ export const generateSpecs = async ( ); } - generateContextDataFile(libPath, filteredSpecs); - if (missingNames.length) { setGenerationErrors(true); missingNames.map((s) => echoGenerationError(s)); diff --git a/src/commands/generate/schemaTypes.ts b/src/commands/generate/schemaTypes.ts index 99ef2fc..2d08090 100644 --- a/src/commands/generate/schemaTypes.ts +++ b/src/commands/generate/schemaTypes.ts @@ -558,7 +558,7 @@ const printSchemaTreeAsTypes = ( depth + 1, ); } catch (err) { - console.error(err); + shell.echo(chalk.red(err)); echoGenerationError(child as SchemaSpec); setGenerationErrors(true); } diff --git a/src/commands/generate/table.ts b/src/commands/generate/table.ts index b03cb6e..4cd1a07 100644 --- a/src/commands/generate/table.ts +++ b/src/commands/generate/table.ts @@ -1,4 +1,6 @@ import fs from 'fs'; +import chalk from 'chalk'; +import shell from 'shelljs'; import { EOL } from 'node:os'; import { echoGenerationError, templateUrl } from '../../utils'; import { TableSpecification } from '../../types'; @@ -73,9 +75,9 @@ const printTableInterface = (table: TableSpecification | string): string => { `${_ws}upsertMany(query: ${formattedName}.InsertManyQuery): Promise<${formattedName}.QueryResults>;`, `${_ws}upsertOne(query: ${formattedName}.InsertOneQuery): Promise<${formattedName}.QueryResult>;`, `${_ws}updateMany(query: ${formattedName}.UpdateQuery): Promise<${formattedName}.QueryResults>;`, - // `${_ws}updateOne(query: ${formattedName}.UpdateQuery): Promise<${formattedName}.QueryResult>;`, + `${_ws}updateOne(id: string, query: ${formattedName}.UpdateQuery): Promise<${formattedName}.QueryResult>;`, `${_ws}deleteMany(query: ${formattedName}.DeleteQuery): Promise<${formattedName}.DeleteResults>;`, - // `${_ws}deleteOne(query: ${formattedName}.DeleteQuery): Promise<${formattedName}.DeleteResult>;`, + `${_ws}deleteOne(id: string, query?: ${formattedName}.DeleteQuery): Promise<${formattedName}.DeleteResult>;`, '}', ].join(`${EOL}${ws(2)}`); }; @@ -95,7 +97,7 @@ const printTableNamespace = (schema: JsonSchema, name: string, depth = 1): strin 'type QueryResults = PolyQueryResults;', 'type QueryResult = PolyQueryResult;', 'type DeleteResults = PolyDeleteResults;', - // 'type DeleteResult = PolyDeleteResult;', + 'type DeleteResult = PolyDeleteResult;', 'type CountResult = PolyCountResult;', ].join(`${EOL}${ws(depth + 1)}`) }${EOL}${ws(depth)}}`; @@ -119,7 +121,7 @@ const printTableTreeAsTypes = ( depth + 1, ); } catch (err) { - console.error(err); + shell.echo(chalk.red(err)); echoGenerationError(child as TableSpecification); setGenerationErrors(true); } diff --git a/src/commands/generate/types.ts b/src/commands/generate/types.ts index 42f81a6..f207866 100644 --- a/src/commands/generate/types.ts +++ b/src/commands/generate/types.ts @@ -420,6 +420,8 @@ const getIDComment = (specification: Specification) => { return `* Auth provider ID: ${specification.id}`; case 'webhookHandle': return `* Webhook ID: ${specification.id}`; + case 'graphqlSubscription': + return `* GraphQL Subscription ID: ${specification.id}`; default: return null; } diff --git a/src/commands/prepare.ts b/src/commands/prepare.ts index dc9f286..8d9d744 100644 --- a/src/commands/prepare.ts +++ b/src/commands/prepare.ts @@ -1,4 +1,5 @@ import shell from 'shelljs'; +import chalk from 'chalk'; import { FunctionArgumentDto } from '../types'; import { getTSBaseUrl, parseDeployable } from '../transpiler'; import { @@ -95,12 +96,12 @@ const getAllDeployables = async ( ); const fullName = `${deployable.context}.${deployable.name}`; if (found.has(fullName)) { - console.error( + shell.echo(chalk.redBright( `Prepared ${deployable.type.replaceAll( '-', ' ', )} ${fullName}: DUPLICATE`, - ); + )); } else { found.set( fullName, @@ -115,8 +116,8 @@ const getAllDeployables = async ( ); } } catch (err) { - console.error(`ERROR parsing ${possible}`); - console.error(err); + shell.echo(chalk.redBright(`ERROR parsing ${possible}`)); + shell.echo(chalk.red(err)); } } return Array.from(found.values()); diff --git a/src/commands/snippet.ts b/src/commands/snippet.ts index 7e3e6a9..816bb4d 100644 --- a/src/commands/snippet.ts +++ b/src/commands/snippet.ts @@ -4,7 +4,6 @@ import chalk from 'chalk'; import shell from 'shelljs'; import { upsertSnippet } from '../api'; -import { upsertResourceInSpec } from '../utils'; const readFile = promisify(fs.readFile); @@ -56,11 +55,6 @@ export const addSnippet = async ( ); shell.echo(`Snippet ID: ${response.data.id}`); - upsertResourceInSpec(polyPath, { - updated: response.status === 200, - resourceId: response.data.id, - resourceName: 'snippet', - }); } catch (error) { const httpStatusCode = error.response?.status; diff --git a/src/commands/sync.ts b/src/commands/sync.ts index d5fd025..d4f6a5f 100644 --- a/src/commands/sync.ts +++ b/src/commands/sync.ts @@ -74,41 +74,48 @@ const removeDeployable = async ( }; const syncDeployableAndGetId = async (deployable, code) => { - switch (deployable.type) { - case 'server-function': - return ( - await createOrUpdateServerFunction( - deployable.context, - deployable.name, - deployable.description, - code, - deployable.config.visibility, - deployable.typeSchemas, - deployable.dependencies, - deployable.config, - ) - ).id; - case 'client-function': - return ( - await createOrUpdateClientFunction( - deployable.context, - deployable.name, - deployable.description, - code, - deployable.config.visibility, - deployable.typeSchemas, - deployable.config, - ) - ).id; - case 'webhook': - return ( - await createOrUpdateWebhook( - deployable.context, - deployable.name, - deployable.description, - deployable.config, - ) - ).id; + if (deployable.type === 'webhook') { + return ( + await createOrUpdateWebhook( + deployable.context, + deployable.name, + deployable.description, + deployable.config, + ) + ).id; + } + let { externalDependencies, dependencies } = deployable; + if (Array.isArray(dependencies) && !externalDependencies) { + externalDependencies = Object.fromEntries(dependencies.map(d => [d, "latest"])); + } + if (deployable.type === 'server-function') { + return ( + await createOrUpdateServerFunction( + deployable.context, + deployable.name, + deployable.description, + code, + deployable.config.visibility, + deployable.typeSchemas, + externalDependencies, + deployable.internalDependencies, + deployable.config, + ) + ).id; + } else if (deployable.type === 'client-function') { + return ( + await createOrUpdateClientFunction( + deployable.context, + deployable.name, + deployable.description, + code, + deployable.config.visibility, + deployable.typeSchemas, + externalDependencies, + deployable.internalDependencies, + deployable.config, + ) + ).id; } throw new Error(`Unsupported deployable type: '${deployable.type}'`); }; diff --git a/src/deployables.ts b/src/deployables.ts index 31c4ee2..5b5fac2 100644 --- a/src/deployables.ts +++ b/src/deployables.ts @@ -78,7 +78,9 @@ export type DeployableRecord = ParsedDeployableConfig & { }; }; typeSchemas?: Record; - dependencies?: string[]; + dependencies?: string[]; // old version of external dependencies + externalDependencies?: Record, + internalDependencies?: Record>, description?: string; deployments: Deployment[]; deploymentCommentRanges?: Array<[startIndex: number, endIndex: number]>; diff --git a/src/transpiler.ts b/src/transpiler.ts index 20c7299..e5e4d42 100644 --- a/src/transpiler.ts +++ b/src/transpiler.ts @@ -13,6 +13,10 @@ import { getDeployableFileRevision, ParsedDeployableConfig, } from './deployables'; +import { getCachedSpecs, getPolyLibPath, writeCachedSpecs } from './utils'; +import { DEFAULT_POLY_PATH } from './constants'; +import { Specification } from './types'; +import { getSpecs } from './api'; // NodeJS built-in libraries + polyapi // https://www.w3schools.com/nodejs/ref_modules.asp @@ -78,12 +82,22 @@ const loadTsSourceFile = (filePath: string): ts.SourceFile => { return sourceFile; }; -export const getDependencies = ( +let fetchedSpecs = false; + +export const getDependencies = async ( code: string, fileName: string, baseUrl: string | undefined, ) => { const importedLibraries = new Set(); + const internalReferences = new Set(); + let polyImportIdentifier: string | null = null; + let variImportIdentifier: string | null = null; + let tabiImportIdentifier: string | null = null; + let schemasImportIdentifier: string | null = null; + // Users can alias references to parts of the poly tree by assigning to a variable + // So this map holds those references + const aliasMap = new Map(); const compilerOptions = { module: ts.ModuleKind.CommonJS, @@ -92,6 +106,38 @@ export const getDependencies = ( baseUrl, }; + + // Helper to extract dotted path + const getPropertyPath = (expr: ts.PropertyAccessExpression): string => { + const parts: string[] = []; + let current: ts.Expression = expr; + while (ts.isPropertyAccessExpression(current)) { + parts.unshift(current.name.text); + current = current.expression; + } + if (ts.isIdentifier(current)) { + parts.unshift(current.text); + } + return parts.join('.'); + } + + const flattenTypeName = (name: ts.EntityName): string => { + const parts: string[] = []; + const recurse = (n: ts.EntityName): void => { + if (ts.isQualifiedName(n)) { + recurse(n.left); + parts.push(n.right.text); + } else { + parts.push(n.text); + } + } + recurse(name); + return parts.join('.'); + } + + const VariMethods = /\.(?:(?:get)|(?:update)|(?:onUpdate)|(?:inject))$/; + const TabiMethods = /\.(?:(?:count)|(?:selectMany)|(?:selectOne)|(?:insertMany)|(?:insertOne)|(?:upsertMany)|(?:upsertOne)|(?:updateMany)|(?:updateOne)|(?:deleteMany)|(?:deleteOne))$/; + const compilerHost = ts.createCompilerHost(compilerOptions); ts.transpileModule(code, { compilerOptions, @@ -100,9 +146,30 @@ export const getDependencies = ( (context) => { return (sourceFile) => { const visitor = (node: ts.Node): ts.Node => { + // Pull out external dependencies if (ts.isImportDeclaration(node)) { - const moduleName = (node.moduleSpecifier as ts.StringLiteral) - .text; + const moduleName = (node.moduleSpecifier as ts.StringLiteral).text; + + // Capture poly imports + if (moduleName === "polyapi" && node.importClause) { + // Get name of polyapi default import if defined + if (node.importClause.name) { + polyImportIdentifier = `${node.importClause.name.text}.`; + } + + // Look for any other named imports (like vari or tabi) + if (node.importClause.namedBindings && ts.isNamedImports(node.importClause.namedBindings)) { + for (const element of node.importClause.namedBindings.elements) { + const imported = element.propertyName ? element.propertyName.text : element.name.text; + const local = element.name.text; + + if (imported === "vari") variImportIdentifier = `${local}.`; + if (imported === "tabi") tabiImportIdentifier = `${local}.`; + if (imported === "schemas") schemasImportIdentifier = `${local}.`; + } + } + } + const resolvedModule = ts.resolveModuleName( moduleName, fileName, @@ -120,8 +187,78 @@ export const getDependencies = ( importedLibraries.add(moduleName); } } + return node; } - return node; + + + // Pull out internal dependencies + if (polyImportIdentifier || variImportIdentifier || tabiImportIdentifier) { + + // Track variable assignments (aliases) + if (ts.isVariableDeclaration(node) && node.initializer) { + if (ts.isPropertyAccessExpression(node.initializer)) { + const path = getPropertyPath(node.initializer); + + // Capture poly reference aliases + if (polyImportIdentifier && path.startsWith(polyImportIdentifier)) { + if (node.name && ts.isIdentifier(node.name)) { + aliasMap.set(node.name.text, path); + return node; // Don't recurse into assignment, just move on + } + } + + // Capture vari reference aliases + if (variImportIdentifier && path.startsWith(variImportIdentifier)) { + if (node.name && ts.isIdentifier(node.name)) { + aliasMap.set(node.name.text, path); + return node; // Don't recurse into assignment, just move on + } + } + + // Capture tabi reference aliases + if (tabiImportIdentifier && path.startsWith(tabiImportIdentifier)) { + if (node.name && ts.isIdentifier(node.name)) { + aliasMap.set(node.name.text, path); + return node; // Don't recurse into assignment, just move on + } + } + } + } else if (ts.isPropertyAccessExpression(node) && !ts.isPropertyAccessExpression(node.parent)) { + let path = getPropertyPath(node); + const root = path.split('.')[0]; + // If root is an alias, substitute + if (aliasMap.has(root)) { + const aliasBase = aliasMap.get(root)!; + path = aliasBase.split(".").concat(path.split('.').slice(1)).join('.'); + } + + // Capture poly references (all function types, webhooks, and subscriptions) + if (polyImportIdentifier && path.startsWith(polyImportIdentifier)) { + internalReferences.add(path.replace(polyImportIdentifier, '')); + } + + // Capture vari references + if (variImportIdentifier && path.startsWith(variImportIdentifier)) { + internalReferences.add(path.replace(VariMethods, '').replace(variImportIdentifier, '')); + } + + // Capture tabi references + if (tabiImportIdentifier && path.startsWith(tabiImportIdentifier)) { + internalReferences.add(path.replace(TabiMethods, '').replace(tabiImportIdentifier, '')); + } + } + } + + // Capture type references + if (schemasImportIdentifier && ts.isTypeReferenceNode(node)) { + const path = flattenTypeName(node.typeName); + if (path.startsWith(schemasImportIdentifier)) { + internalReferences.add(path.replace(schemasImportIdentifier, '')); + return node; + } + } + + return ts.visitEachChild(node, visitor, context); }; return ts.visitEachChild(sourceFile, visitor, context); }; @@ -130,11 +267,15 @@ export const getDependencies = ( }, }); - let dependencies = Array.from(importedLibraries).filter( + const dependencies = Array.from(importedLibraries).filter( (library) => !EXCLUDED_REQUIREMENTS.includes(library), ); + const externalDependencies = {}; + const internalDependencies = {}; + // Finalize any external dependencies if (dependencies.length) { + // Read dependency versions from package.json let packageJson: any = fs.readFileSync( path.join(process.cwd(), 'package.json'), 'utf-8', @@ -153,10 +294,10 @@ export const getDependencies = ( const packageJsonDevDependencies = packageJson.devDependencies || {}; for (const dependency of dependencies) { - if ( - packageJsonDependencies[dependency] || - packageJsonDevDependencies[dependency] - ) { + let dependencyName = dependency; + let version = packageJsonDependencies[dependencyName] || packageJsonDevDependencies[dependencyName]; + if (version) { + externalDependencies[dependency] = version; continue; } @@ -165,26 +306,68 @@ export const getDependencies = ( while (dependencyParts.length > 0) { dependencyParts.pop(); - const newDependencyPath = dependencyParts.join('/'); - - if ( - packageJsonDependencies[newDependencyPath] || - packageJsonDevDependencies[newDependencyPath] - ) { - dependencies = dependencies.map((currentDependency) => { - if (currentDependency === dependency) { - return dependencyParts.join('/'); - } + dependencyName = dependencyParts.join('/'); + version = packageJsonDependencies[dependencyName] || packageJsonDevDependencies[dependencyName]; - return currentDependency; - }); + if (version) { + externalDependencies[dependencyName] = version; break; } } + if (!dependencyName) { + externalDependencies[dependency] = 'latest'; + } + } + } + + // Finalize any internal dependencies + if (internalReferences.size) { + // Find each reference in the specs + // Group internal references by type in a map from contextName to id + const libPath = getPolyLibPath(DEFAULT_POLY_PATH); + let specs = getCachedSpecs(libPath); + const found: Specification[] = []; + let missing: string[] = []; + + const findReferencedSpecs = (toFind: string[] | Set) => { + for (const path of internalReferences) { + const spec = specs.find(s => s.contextName.toLowerCase() === path.toLowerCase()); + if (spec) { + found.push(spec); + let type: string = spec.type; + const dep = { path: spec.contextName, id: spec.id }; + if ( + spec.visibilityMetadata.visibility === 'PUBLIC' && + ['apiFunction', 'customFunction', 'serverFunction'].includes(type) + ) { + type = `public${type.substring(0, 1).toUpperCase()}${type.substring(1)}`; + dep['tenantName'] = spec.visibilityMetadata.foreignTenantName; + dep['environmentName'] = spec.visibilityMetadata.foreignEnvironmentName; + } + internalDependencies[type] = internalDependencies[type] || []; + internalDependencies[type].push(dep); + } else { + missing.push(path); + } + } + } + findReferencedSpecs(internalReferences); + if (missing.length && !fetchedSpecs) { + // In case user generated the library with only a subset of the specs needed, grab them fresh from the api and try again + specs = await getSpecs(); + writeCachedSpecs(libPath, specs); + fetchedSpecs = true; + const toFind = missing; + missing = []; + findReferencedSpecs(toFind); + } + + if (missing.length) { + throw new Error(`Cannot resolve all poly resources referenced within function.\nMissing:\n${missing.map(n => `'${n}'`).join('\n')}`) } } - return dependencies; + return [dependencies.length ? externalDependencies : undefined, internalReferences.size ? internalDependencies : undefined]; }; export const parseDeployComment = (comment: string): Deployment => { @@ -411,13 +594,13 @@ const getFunctionDetails = ( return functionDetails; }; -const parseDeployableFunction = ( +const parseDeployableFunction = async ( sourceFile: ts.SourceFile, polyConfig: ParsedDeployableConfig, baseUrl: string, fileRevision: string, gitRevision: string, -): DeployableRecord => { +): Promise => { const [deployments, deploymentCommentRanges] = getDeployComments(sourceFile); const functionDetails = getFunctionDetails(sourceFile, polyConfig.name); if (polyConfig.description) { @@ -428,14 +611,15 @@ const parseDeployableFunction = ( } else { polyConfig.description = functionDetails.types.description || ''; } - const dependencies = getDependencies(sourceFile.getFullText(), sourceFile.fileName, baseUrl); + const [externalDependencies, internalDependencies] = await getDependencies(sourceFile.getFullText(), sourceFile.fileName, baseUrl); const typeSchemas = generateTypeSchemas(sourceFile.fileName, DeployableTypeEntries.map(d => d[0]), polyConfig.name); return { ...polyConfig, ...functionDetails, deployments, deploymentCommentRanges, - dependencies, + externalDependencies, + internalDependencies, typeSchemas, fileRevision, gitRevision, @@ -479,7 +663,7 @@ export const parseDeployable = async ( case 'server-function': case 'client-function': return [ - parseDeployableFunction( + await parseDeployableFunction( sourceFile, polyConfig, baseUrl, @@ -501,42 +685,41 @@ export const parseDeployable = async ( ]; } throw new Error('Invalid Poly deployment with unsupported type'); - } catch (err) { - console.error( - `Prepared ${polyConfig.type.replaceAll('-', ' ')} ${polyConfig.context}.${ - polyConfig.name + } catch (e) { + shell.echo(chalk.redBright( + `Prepared ${polyConfig.type.replaceAll('-', ' ')} ${polyConfig.context}.${polyConfig.name }: ERROR`, - ); - console.error(err); + )); + shell.echo(chalk.red((e instanceof Error ? e.message : e.response?.data?.message) || 'Unexpected error.')); } }; const dereferenceSchema = (obj: any, definitions: any, visited: Set = new Set()): any => { if (!obj || typeof obj !== 'object') return obj; - + if (Array.isArray(obj)) { return obj.map(item => dereferenceSchema(item, definitions, visited)); } - + const result: any = {}; - + for (const [key, value] of Object.entries(obj)) { if (key === '$ref' && typeof value === 'string') { const match = value.match(/^#\/definitions\/(.+)$/); if (match) { const defName = match[1]; - + // Prevent infinite recursion if (visited.has(defName)) { return { $ref: value }; } - + const definition = definitions[defName]; if (definition) { // Inspired by old flattenDefinitions logic: Check if this looks like a "real" type // vs a utility type by examining the definition structure const shouldInline = isInlineableDefinition(definition, defName); - + if (shouldInline) { // Inline the definition visited.add(defName); @@ -555,46 +738,46 @@ const dereferenceSchema = (obj: any, definitions: any, visited: Set = ne result[key] = dereferenceSchema(value, definitions, visited); } } - + return result; }; const isInlineableDefinition = (definition: any, defName: string): boolean => { const decodedDefName = decodeURIComponent(defName); - + // If it has "real" object properties, it's probably a real interface that should be inlined - if (definition.type === 'object' && definition.properties && - Object.keys(definition.properties).length > 0) { + if (definition.type === 'object' && definition.properties && + Object.keys(definition.properties).length > 0) { return true; } - + // If it has array items with concrete structure, inline it - if (definition.type === 'array' && definition.items && - typeof definition.items === 'object' && definition.items.type) { + if (definition.type === 'array' && definition.items && + typeof definition.items === 'object' && definition.items.type) { return true; } - + // If it's a simple type (string, number, boolean), inline it if (['string', 'number', 'boolean', 'integer'].includes(definition.type)) { return true; } - + // If it has enum values, it's a real type, inline it if (definition.enum && definition.enum.length > 0) { return true; } - + // If it's a union/intersection of concrete types, inline it if ((definition.anyOf || definition.allOf) && !decodedDefName.includes('<')) { return true; } - + // Keep as reference if it looks like a utility type (contains < > or other TypeScript operators) - if (decodedDefName.includes('<') || decodedDefName.includes('>') || - decodedDefName.includes('|') || decodedDefName.includes('&')) { + if (decodedDefName.includes('<') || decodedDefName.includes('>') || + decodedDefName.includes('|') || decodedDefName.includes('&')) { return false; } - + // If we can't determine, err on the side of inlining for "normal" looking names return !/[<>%|&]/.test(decodedDefName); }; @@ -624,7 +807,7 @@ const dereferenceRoot = (schema: any): any => { // Now recursively dereference based on intelligent heuristics const { definitions, $schema, ...rest } = rootSchema; const dereferencedRest = dereferenceSchema(rest, definitions); - + // Collect remaining references that weren't inlined const filteredDefinitions: any = {}; const findReferences = (obj: any, visited: Set = new Set()): void => { @@ -639,11 +822,11 @@ const dereferenceRoot = (schema: any): any => { if (match) { const encodedDefName = match[1]; const decodedDefName = decodeURIComponent(encodedDefName); - + // Try both encoded and decoded versions - const actualDefName = definitions[encodedDefName] ? encodedDefName : - definitions[decodedDefName] ? decodedDefName : null; - + const actualDefName = definitions[encodedDefName] ? encodedDefName : + definitions[decodedDefName] ? decodedDefName : null; + if (actualDefName && !visited.has(actualDefName)) { visited.add(actualDefName); filteredDefinitions[actualDefName] = definitions[actualDefName]; @@ -656,9 +839,9 @@ const dereferenceRoot = (schema: any): any => { } } }; - + findReferences(dereferencedRest); - + return { ...dereferencedRest, ...(Object.keys(filteredDefinitions).length > 0 && { definitions: filteredDefinitions }), @@ -676,17 +859,17 @@ export const extractTypesFromAST = (filePath: string, functionName: string): str if (!sourceFile) throw new Error(`Could not load file: ${filePath}`); const extractedTypes: Set = new Set(); - + const extractFromTypeNode = (typeNode: ts.TypeNode) => { if (ts.isTypeReferenceNode(typeNode)) { const typeName = typeNode.typeName.getText(sourceFile); - + // Skip primitive and built-in types const primitives = ['Promise', 'Array', 'Record', 'string', 'number', 'boolean', 'void', 'any', 'unknown', 'object', 'undefined', 'null']; if (!primitives.includes(typeName)) { extractedTypes.add(typeName); } - + // Extract type arguments from generics (like Promise -> extract T) if (typeNode.typeArguments) { for (const typeArg of typeNode.typeArguments) { @@ -709,7 +892,7 @@ export const extractTypesFromAST = (filePath: string, functionName: string): str extractFromTypeNode(param.type); } } - + // Extract types from return type if (node.type) { extractFromTypeNode(node.type); @@ -730,12 +913,12 @@ export const generateTypeSchemas = ( const tsconfigPath = path.resolve('tsconfig.json'); // Use provided function name or default to filename const actualFunctionName = functionName || path.basename(filePath, '.ts'); - + // FIXED: Use AST-based type extraction instead of string manipulation const extractedTypes = extractTypesFromAST(filePath, actualFunctionName); - + // Filter ignored types - const typeNames = extractedTypes.filter(typeName => + const typeNames = extractedTypes.filter(typeName => !ignoredTypeNames.includes(typeName) ); diff --git a/src/types/specifications.ts b/src/types/specifications.ts index 5b3acff..a903717 100644 --- a/src/types/specifications.ts +++ b/src/types/specifications.ts @@ -14,6 +14,7 @@ export type SpecificationType = | 'serverVariable' | 'snippet' | 'table' + | 'graphqlSubscription' | 'schema'; export interface ISpecification { @@ -126,6 +127,12 @@ export interface WebhookHandleSpecification extends ISpecification { function: FunctionSpecification; } +export interface GraphQLSubscriptionSpecification extends ISpecification { + type: 'graphqlSubscription'; + description: string; + function: FunctionSpecification; +} + export interface ServerVariableSpecification extends ISpecification { type: 'serverVariable'; variable: VariableSpecification; @@ -170,6 +177,7 @@ export type Specification = | ServerVariableSpecification | SnippetSpecification | SchemaSpecification + | GraphQLSubscriptionSpecification | TableSpecification; interface CreateWebhookHandleDtoForSpecificationInput diff --git a/src/utils.ts b/src/utils.ts index fb85dba..1eb8f34 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -13,7 +13,6 @@ import { SpecificationType, } from './types'; -import { getSpecs } from './api'; import { INSTANCE_URL_MAP } from './constants'; export const getPolyLibPath = (polyPath: string) => @@ -21,48 +20,57 @@ export const getPolyLibPath = (polyPath: string) => ? `${polyPath}/lib` : `${__dirname}/../../../${polyPath}/lib`; -export const getContextDataFileContent = (libPath: string) => { +export const getCachedSpecs = (libPath: string) => { try { const contents = fs.readFileSync(`${libPath}/specs.json`, 'utf-8'); - return JSON.parse(contents) as Record; + return JSON.parse(contents) as Specification[]; } catch (err) { - return {}; + return []; } }; -export const getSpecsFromContextData = (contextData) => { - const specs: Specification[] = []; - - const traverseAndGetSpec = (data) => { - for (const key of Object.keys(data)) { - if (typeof data[key].context === 'string') { - specs.push(data[key]); - } else { - traverseAndGetSpec(data[key]); - } - } - }; - - traverseAndGetSpec(contextData); +export const writeCachedSpecs = ( + libPath: string, + specs: Specification[], +) => { + fs.mkdirSync(libPath, { recursive: true }); + fs.writeFileSync( + `${libPath}/specs.json`, + JSON.stringify( + specs.filter((spec) => { + if (spec.type === 'snippet') { + return spec.language === 'javascript'; + } + if (spec.type === 'customFunction') { + return spec.language === 'javascript'; + } - return specs; + return true; + }), + null, + 2, + ), + ); }; + export type GenerationError = { specification: Specification; stack: string; }; export const echoGenerationError = (specification: Specification) => { - const typeMap = { + const typeMap: Record = { apiFunction: 'API Function', customFunction: 'Custom Function', authFunction: 'Auth Function', webhookHandle: 'Webhook Handle', + graphqlSubscription: 'Webhook Handle', serverFunction: 'Server Function', serverVariable: 'Variable', schema: 'Schema', snippet: 'Snippet', + table: 'Table' }; const type = typeMap[specification.type]; @@ -98,90 +106,6 @@ export const showErrGettingSpecs = (error: any) => { shell.exit(1); }; -export const generateContextDataFile = ( - libPath: string, - specs: Specification[], -) => { - fs.writeFileSync( - `${libPath}/specs.json`, - JSON.stringify( - specs.filter((spec) => { - if (spec.type === 'snippet') { - return spec.language === 'javascript'; - } - if (spec.type === 'customFunction') { - return spec.language === 'javascript'; - } - - return true; - }), - null, - 2, - ), - ); -}; - -export const upsertResourceInSpec = async ( - polyPath: string, - { - resourceId, - resourceName, - updated, - }: { - resourceId: string; - resourceName: string; - updated: boolean; - }, -) => { - shell.echo( - '-n', - updated - ? `Updating ${resourceName} in specs...` - : `Adding ${resourceName} to SDK...`, - ); - - let contextData: Record = {}; - - try { - contextData = getContextDataFileContent(getPolyLibPath(polyPath)); - } catch (error) { - shell.echo(chalk.red('ERROR')); - shell.echo('Error while fetching local context data.'); - shell.echo(chalk.red(error.message)); - shell.echo(chalk.red(error.stack)); - return; - } - - const prevSpecs = getSpecsFromContextData(contextData); - - let specs: Specification[] = []; - - try { - specs = await getSpecs([], [], [resourceId], false); - } catch (error) { - showErrGettingSpecs(error); - return; - } - - const [resource] = specs; - - if (prevSpecs.some((prevSpec) => prevSpec.id === resource.id)) { - specs = prevSpecs.map((prevSpec) => { - if (prevSpec.id === resource.id) { - return resource; - } - return prevSpec; - }); - } else { - prevSpecs.push(resource); - specs = prevSpecs; - } - - generateContextDataFile(getPolyLibPath(polyPath), specs); - - shell.echo(chalk.green('DONE')); -}; - export const getStringPaths = (data: Record | any[]) => { const paths = jp.paths(data, '$..*', 100); diff --git a/templates/graphql-subscriptions-index.js b/templates/graphql-subscriptions-index.js new file mode 100644 index 0000000..deb3a63 --- /dev/null +++ b/templates/graphql-subscriptions-index.js @@ -0,0 +1,35 @@ +const set = require('lodash/set'); +const { subscriptions } = require('./subscriptions'); + +const registerGraphQLSubscriptionEventListener = (clientID, getSocket, getApiKey, subscriptionId, callback) => { + const socket = getSocket(); + socket.emit('registerSubscriptionHandler', { + clientID, + subscriptionId, + apiKey: getApiKey(), + }, registered => { + if (registered) { + socket.on( + `handleSubscriptionEvent:${subscriptionId}`, + async ({ event, params, executionId }) => { + await callback(event, params, { executionId }); + } + ); + } else { + console.log(`Could not register GraphQL subscription event handler for ${subscriptionId}`); + } + }); + + return () => { + socket.emit('unregisterSubscriptionHandler', { + clientID, + subscriptionId, + apiKey: getApiKey(), + }); + } +}; + +module.exports = (clientID, getSocket, getApiKey) => subscriptions.reduce( + (acc, [path, id]) => set(acc, path, (callback) => registerGraphQLSubscriptionEventListener(clientID, getSocket, getApiKey, id, callback)), + {} +); diff --git a/templates/graphql-subscriptions.js.hbs b/templates/graphql-subscriptions.js.hbs new file mode 100644 index 0000000..7353133 --- /dev/null +++ b/templates/graphql-subscriptions.js.hbs @@ -0,0 +1,11 @@ +module.exports = { + subscriptions: [ + {{#each specifications}} + {{#if context}} + ['{{context}}.{{name}}', '{{id}}'], + {{else}} + ['{{name}}', '{{id}}'], + {{/if}} + {{/each}} + ] +} diff --git a/templates/index.d.ts.hbs b/templates/index.d.ts.hbs index 4cd088b..9581d00 100644 --- a/templates/index.d.ts.hbs +++ b/templates/index.d.ts.hbs @@ -15,6 +15,7 @@ declare const poly: Poly; export default poly; export type UnregisterWebhookEventListener = () => void; +export type UnregisterGraphQLSubscriptionEventListener = () => void; export type AuthFunctionCallback = (token?: string, url?: string, error?: any) => any; export interface AuthFunctionResponse { diff --git a/templates/index.js b/templates/index.js index 2830db8..40def6b 100644 --- a/templates/index.js +++ b/templates/index.js @@ -3,6 +3,7 @@ const { io } = require('socket.io-client'); const apiFunctions = require('./api'); const clientFunctions = require('./client'); const webhooks = require('./webhooks'); +const subscriptions = require('./subscriptions'); const authFunctions = require('./auth'); const serverFunctions = require('./server'); const vari = require('./vari'); @@ -68,6 +69,7 @@ merge( serverFunctions(CLIENT_ID, polyCustom), authFunctions(CLIENT_ID, getSocket, getApiKey), webhooks(CLIENT_ID, getSocket, getApiKey), + subscriptions(CLIENT_ID, getSocket, getApiKey), ), module.exports = { ...poly, diff --git a/templates/tabi/index.js b/templates/tabi/index.js index 1936375..9369e35 100644 --- a/templates/tabi/index.js +++ b/templates/tabi/index.js @@ -24,13 +24,13 @@ const firstResult = (rsp) => { return rsp; } -// const deleteOneResponse = (rsp) => { -// if (typeof rsp.deleted === 'number') { -// return { deleted: rsp.deleted > 0 }; -// } -// // Else rsp is some kind of error -// return rsp; -// } +const deleteOneResponse = (rsp) => { + if (typeof rsp.deleted === 'number') { + return { deleted: rsp.deleted > 0 }; + } + // Else rsp is some kind of error + return rsp; +} class Table { constructor(id, clientID, polyCustom) { @@ -78,17 +78,21 @@ class Table { return executeQuery(this.id, 'update', query, this.clientID, this.polyCustom); } - // updateOne(query) { - // return executeQuery(this.id, 'update', query, this.clientID, this.polyCustom).then(firstResult); - // } + updateOne(id, query) { + if (!query.where) query.where = {}; + query.where.id = id; + return executeQuery(this.id, 'update', query, this.clientID, this.polyCustom).then(firstResult); + } deleteMany(query) { return executeQuery(this.id, 'delete', query, this.clientID, this.polyCustom); } - // deleteOne(query) { - // return executeQuery(this.id, 'delete', query, this.clientID, this.polyCustom).then(deleteOneResponse); - // } + deleteOne(id, query = {}) { + if (!query.where) query.where = {}; + query.where.id = id; + return executeQuery(this.id, 'delete', query, this.clientID, this.polyCustom).then(deleteOneResponse); + } } module.exports = (clientID, polyCustom) => tables.reduce( diff --git a/templates/tabi/types.d.ts b/templates/tabi/types.d.ts index 675b10e..552ec07 100644 --- a/templates/tabi/types.d.ts +++ b/templates/tabi/types.d.ts @@ -81,10 +81,10 @@ type PolyDeleteResults = { deleted: number; } -// type PolyDeleteResult = { -// deleted: boolean; -// } +type PolyDeleteResult = { + deleted: boolean; +} type PolyCountResult = { - count: boolean; + count: number; } \ No newline at end of file From 79055151f9b65ace00a7ff22a0c39fa5751bad7d Mon Sep 17 00:00:00 2001 From: Aaron Goin Date: Fri, 17 Oct 2025 11:10:23 -0700 Subject: [PATCH 66/73] Fixed transpiler to handle case where package.json file does not exist. --- package-lock.json | 4 ++-- package.json | 2 +- src/transpiler.ts | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index c51e17a..6f59bb7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "polyapi", - "version": "0.25.3", + "version": "0.25.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "polyapi", - "version": "0.25.3", + "version": "0.25.4", "license": "MIT", "dependencies": { "@guanghechen/helper-string": "4.7.1", diff --git a/package.json b/package.json index 35c0b1e..7031473 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.25.3", + "version": "0.25.4", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { diff --git a/src/transpiler.ts b/src/transpiler.ts index e5e4d42..0dcc9dc 100644 --- a/src/transpiler.ts +++ b/src/transpiler.ts @@ -275,13 +275,13 @@ export const getDependencies = async ( // Finalize any external dependencies if (dependencies.length) { - // Read dependency versions from package.json - let packageJson: any = fs.readFileSync( - path.join(process.cwd(), 'package.json'), - 'utf-8', - ); - + let packageJson: any = {}; try { + // Read dependency versions from package.json + packageJson = fs.readFileSync( + path.join(process.cwd(), 'package.json'), + 'utf-8', + ); packageJson = JSON.parse(packageJson); } catch (error) { shell.echo( From 6c0e2f5389669779000a5c162df6c870066603ba Mon Sep 17 00:00:00 2001 From: Aaron Goin Date: Fri, 17 Oct 2025 12:56:35 -0700 Subject: [PATCH 67/73] Turning on strict null checks to prevent bugs like the one I'm fixing with function requirements! --- package-lock.json | 4 ++-- package.json | 2 +- src/api.ts | 14 ++++++------- src/commands/function.ts | 4 ++-- src/commands/generate/index.ts | 11 +++++----- src/commands/model/validate.ts | 4 ++-- src/commands/prepare.ts | 20 +++++++++--------- src/transpiler.ts | 37 ++++++++++++++++++---------------- src/utils.ts | 4 +++- tsconfig.json | 3 ++- 10 files changed, 56 insertions(+), 47 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6f59bb7..708183d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "polyapi", - "version": "0.25.4", + "version": "0.25.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "polyapi", - "version": "0.25.4", + "version": "0.25.5", "license": "MIT", "dependencies": { "@guanghechen/helper-string": "4.7.1", diff --git a/package.json b/package.json index 7031473..358d05c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.25.4", + "version": "0.25.5", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { diff --git a/src/api.ts b/src/api.ts index 69fcdc3..b0b2cde 100644 --- a/src/api.ts +++ b/src/api.ts @@ -51,7 +51,7 @@ const getApiBaseURL = () => { if (isDevEnv) { return process.env.POLY_API_BASE_URL; } else { - return process.env.POLY_API_BASE_URL.replace(/^http:/, 'https://'); + return process.env.POLY_API_BASE_URL!.replace(/^http:/, 'https://'); } }; @@ -96,12 +96,12 @@ export const createOrUpdateServerFunction = async ( name: string, description: string | null, code: string, - visibility: string, + visibility: string | undefined, typeSchemas: Record, - externalDependencies: Record | undefined, - internalDependencies: Record> | undefined, + externalDependencies?: Record | undefined, + internalDependencies?: Record> | undefined, other?: Record, - executionApiKey?: string, + executionApiKey?: string | null, ) => { return ( await axios.post>( @@ -114,7 +114,7 @@ export const createOrUpdateServerFunction = async ( visibility, typeSchemas, // Keeping backwards compatability on requirements - requirements: Object.keys(externalDependencies), + requirements: externalDependencies ? Object.keys(externalDependencies) : null, externalDependencies, internalDependencies, executionApiKey, @@ -179,7 +179,7 @@ export const createOrUpdateClientFunction = async ( name: string, description: string | null, code: string, - visibility: string, + visibility: string | undefined, typeSchemas: Record, externalDependencies: Record | undefined, internalDependencies: Record> | undefined, diff --git a/src/commands/function.ts b/src/commands/function.ts index 09dc620..39d10c3 100644 --- a/src/commands/function.ts +++ b/src/commands/function.ts @@ -50,7 +50,7 @@ export const addOrUpdateCustomFunction = async ( try { let customFunction: FunctionDetailsDto; - const specs = await getSpecs([context], [name]); + const specs = await getSpecs(context ? [context] : undefined, [name]); const functionSpec = specs.find( (spec) => spec.name === name && spec.context === context, ); @@ -150,7 +150,7 @@ export const addOrUpdateCustomFunction = async ( shell.echo(`Client Function ID: ${customFunction.id}`); } - await generateSingleCustomFunction(polyPath, customFunction.id, updating); + await generateSingleCustomFunction(polyPath, customFunction!.id, updating); } catch (e) { shell.echo(chalk.redBright('ERROR\n')); shell.echo(chalk.red((e instanceof Error ? e.message : e.response?.data?.message) || 'Unexpected error.')); diff --git a/src/commands/generate/index.ts b/src/commands/generate/index.ts index 9978449..8be6cfc 100644 --- a/src/commands/generate/index.ts +++ b/src/commands/generate/index.ts @@ -252,7 +252,7 @@ const generateCustomFunctionJSFiles = async ( customFunctionJSTemplate(spec), ).catch((error) => { codeGenerationErrors[spec.id] = { - stack: (error as Error).stack, + stack: (error as Error).stack || '', specification: spec, }; }), @@ -328,7 +328,7 @@ const generateServerVariableJSFiles = async ( const contextPaths = getContextPaths(contextData); const template = handlebars.compile(loadTemplate('vari/index.js.hbs')); - const arrPaths = []; + const arrPaths: Array<{ context: string; paths: string[] }> = []; for (const specification of specifications) { if ( @@ -412,7 +412,7 @@ const generateAuthFunctionJSFiles = async ( }), ).catch((error) => { codeGenerationErrors[spec.id] = { - stack: (error as Error).stack, + stack: (error as Error).stack || '', specification: spec, }; }), @@ -483,7 +483,7 @@ const generateSingleCustomFunction = async ( return; } - const [customFunction] = specs; + const [customFunction] = specs as [Specification]; if (prevSpecs.some((prevSpec) => prevSpec.id === customFunction.id)) { specs = prevSpecs.map((prevSpec) => { @@ -610,6 +610,7 @@ const tryAsync = async ( ), ); } + return undefined as R; }; export const generateSpecs = async ( @@ -624,7 +625,7 @@ export const generateSpecs = async ( acc[s.name.trim() ? 1 : 0].push(s); return acc; }, - [[], []], + [[], []] as [Specification[], Specification[]], ); const jsFilesCodeGenerationErrors = await generateJSFiles(libPath, specs); diff --git a/src/commands/model/validate.ts b/src/commands/model/validate.ts index 299645e..f921d99 100644 --- a/src/commands/model/validate.ts +++ b/src/commands/model/validate.ts @@ -18,10 +18,10 @@ const getDuplicatedIdentifier = ( apiFunctions: { name: string; context: string }[], ): string | null => { for (let i = 0; i < apiFunctions.length; i++) { - const firstApiFunction = apiFunctions[i]; + const firstApiFunction = apiFunctions[i]!; for (let c = 0; c < apiFunctions.length; c++) { - const secondApiFunction = apiFunctions[c]; + const secondApiFunction = apiFunctions[c]!; if ( firstApiFunction.name && diff --git a/src/commands/prepare.ts b/src/commands/prepare.ts index 8d9d744..97afe53 100644 --- a/src/commands/prepare.ts +++ b/src/commands/prepare.ts @@ -33,22 +33,22 @@ const fillInMissingFunctionDetails = async ( code: string, ): Promise => { const isMissingDescriptions = - !deployable.types.description || - !deployable.types.returns.description || - deployable.types.params.some((p) => !p.description); + !deployable.types!.description || + !deployable.types!.returns.description || + deployable.types!.params.some((p) => !p.description); if (isMissingDescriptions) { try { const aiGenerated = await getFunctionDescription( deployable.type, - deployable.types.description, - deployable.types.params.map((p) => ({ ...p, key: p.name })), + deployable.types!.description, + deployable.types!.params.map((p) => ({ ...p, key: p.name })), code, ); - if (!deployable.types.description && aiGenerated.description) { - deployable.types.description = aiGenerated.description; + if (!deployable.types!.description && aiGenerated.description) { + deployable.types!.description = aiGenerated.description; deployable.dirty = true; } - deployable.types.params = deployable.types.params.map((p) => { + deployable.types!.params = deployable.types!.params.map((p) => { if (p.description) return p; const aiArg = aiGenerated.arguments.find((a) => a.name === p.name); if (!aiArg || !aiArg.description) return p; @@ -89,11 +89,13 @@ const getAllDeployables = async ( const found = new Map(); for (const possible of possibleDeployables) { try { - const [deployable, code] = await parseDeployable( + const result = await parseDeployable( possible, baseUrl, gitRevision, ); + if (!result) throw new Error("Failed to parse a deployable record"); + const [deployable, code] = result; const fullName = `${deployable.context}.${deployable.name}`; if (found.has(fullName)) { shell.echo(chalk.redBright( diff --git a/src/transpiler.ts b/src/transpiler.ts index 0dcc9dc..0b81b66 100644 --- a/src/transpiler.ts +++ b/src/transpiler.ts @@ -87,7 +87,7 @@ let fetchedSpecs = false; export const getDependencies = async ( code: string, fileName: string, - baseUrl: string | undefined, + baseUrl: string | undefined ) => { const importedLibraries = new Set(); const internalReferences = new Set(); @@ -225,7 +225,7 @@ export const getDependencies = async ( } } else if (ts.isPropertyAccessExpression(node) && !ts.isPropertyAccessExpression(node.parent)) { let path = getPropertyPath(node); - const root = path.split('.')[0]; + const root = path.split('.')[0]!; // If root is an alias, substitute if (aliasMap.has(root)) { const aliasBase = aliasMap.get(root)!; @@ -370,7 +370,7 @@ export const getDependencies = async ( return [dependencies.length ? externalDependencies : undefined, internalReferences.size ? internalDependencies : undefined]; }; -export const parseDeployComment = (comment: string): Deployment => { +export const parseDeployComment = (comment: string): Deployment | null => { // Poly deployed @ 2024-08-29T22:46:46.791Z - test.weeklyReport - https://develop-k8s.polyapi.io/canopy/polyui/collections/server-functions/f0630f95-eac8-4c7d-9d23-639d39034bb6 - e3b0c44 const match = comment.match( /^\s*(?:\/\/\s*)*Poly deployed @ (\S+) - (\S+)\.([^.]+) - (https?:\/\/[^/]+)\/\S+\/(\S+)s\/(\S+) - (\S+)$/, @@ -385,10 +385,10 @@ export const parseDeployComment = (comment: string): Deployment => { deployed, fileRevision, // Local development puts canopy on a different port than the poly-server - instance: instance.endsWith('localhost:3000') + instance: instance?.endsWith('localhost:3000') ? instance.replace(':3000', ':8000') : instance, - }; + } as Deployment; }; type Ranges = Array<[start: number, end: number]>; @@ -424,10 +424,10 @@ const getPolyConfig = (types: string[], sourceFile: ts.SourceFile): any => { const visit = (node: ts.Node) => { if (ts.isVariableStatement(node)) { const declaration = node.declarationList.declarations[0]; - const name = declaration.name.getText(sourceFile); - const type = declaration.type?.getText(sourceFile); - if (name === 'polyConfig' && type && types.includes(type)) { - const initializer = node.declarationList.declarations[0].initializer; + const name = declaration?.name.getText(sourceFile); + const type = declaration?.type?.getText(sourceFile); + if (declaration && name === 'polyConfig' && type && types.includes(type)) { + const initializer = declaration.initializer; if (initializer && ts.isObjectLiteralExpression(initializer)) { // eval() is generally considered harmful // but since we're running entirely client side on user-provided code @@ -462,7 +462,7 @@ const parseJSDoc = (node: ts.FunctionDeclaration): any => { description: '', }, }; - const firstJsDoc = jsDoc[0]; + const firstJsDoc = jsDoc[0]!; jsDocTags.description = firstJsDoc.comment ? ts.getTextOfJSDocComment(firstJsDoc.comment) : ''; @@ -535,7 +535,10 @@ const parseTSTypes = ( const getFunctionDetails = ( sourceFile: ts.SourceFile, functionName: string, -) => { +): Pick< + DeployableRecord, + 'types' | 'docStartIndex' | 'docEndIndex' | 'dirty' +> => { let functionDetails: null | Pick< DeployableRecord, 'types' | 'docStartIndex' | 'docEndIndex' | 'dirty' @@ -604,12 +607,12 @@ const parseDeployableFunction = async ( const [deployments, deploymentCommentRanges] = getDeployComments(sourceFile); const functionDetails = getFunctionDetails(sourceFile, polyConfig.name); if (polyConfig.description) { - if (polyConfig.description !== functionDetails.types.description) { - functionDetails.types.description = polyConfig.description; + if (polyConfig.description !== functionDetails.types?.description) { + functionDetails.types!.description = polyConfig.description; functionDetails.dirty = true; } } else { - polyConfig.description = functionDetails.types.description || ''; + polyConfig.description = functionDetails.types?.description || ''; } const [externalDependencies, internalDependencies] = await getDependencies(sourceFile.getFullText(), sourceFile.fileName, baseUrl); const typeSchemas = generateTypeSchemas(sourceFile.fileName, DeployableTypeEntries.map(d => d[0]), polyConfig.name); @@ -648,7 +651,7 @@ export const parseDeployable = async ( filePath: string, baseUrl: string, gitRevision: string, -): Promise<[DeployableRecord, string]> => { +): Promise<[DeployableRecord, string] | undefined> => { const sourceFile = await loadTsSourceFile(filePath); const polyConfig = getPolyConfig( @@ -707,7 +710,7 @@ const dereferenceSchema = (obj: any, definitions: any, visited: Set = ne if (key === '$ref' && typeof value === 'string') { const match = value.match(/^#\/definitions\/(.+)$/); if (match) { - const defName = match[1]; + const defName = match[1]!; // Prevent infinite recursion if (visited.has(defName)) { @@ -820,7 +823,7 @@ const dereferenceRoot = (schema: any): any => { if (key === '$ref' && typeof value === 'string') { const match = value.match(/^#\/definitions\/(.+)$/); if (match) { - const encodedDefName = match[1]; + const encodedDefName = match[1]!; const decodedDefName = decodeURIComponent(encodedDefName); // Try both encoded and decoded versions diff --git a/src/utils.ts b/src/utils.ts index 1eb8f34..77a2c12 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -113,7 +113,9 @@ export const getStringPaths = (data: Record | any[]) => { for (let i = 0; i < paths.length; i++) { let stringPath = ''; - for (const part of paths[i]) { + const parts = paths[i]; + if (!parts) continue; + for (const part of parts) { const isString = typeof part === 'string'; const delimiter = stringPath.length > 0 && isString ? '.' : ''; if (isString) { diff --git a/tsconfig.json b/tsconfig.json index 2c25806..3876c9d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,11 +13,12 @@ "sourceMap": true, "incremental": true, "skipLibCheck": true, - "strictNullChecks": false, + "strictNullChecks": true, "noImplicitAny": false, "strictBindCallApply": false, "forceConsistentCasingInFileNames": false, "noFallthroughCasesInSwitch": false, + "noUncheckedIndexedAccess": true, "outDir": "build", }, "include": ["src/**/*"], From 41d9b89725997d9aa271aa8d6654078dac60c06e Mon Sep 17 00:00:00 2001 From: Aaron Goin Date: Fri, 17 Oct 2025 13:19:56 -0700 Subject: [PATCH 68/73] Revert "Turning on strict null checks to prevent bugs like the one I'm fixing with function requirements!" This reverts commit 6c0e2f5389669779000a5c162df6c870066603ba. --- package-lock.json | 4 ++-- package.json | 2 +- src/api.ts | 14 ++++++------- src/commands/function.ts | 4 ++-- src/commands/generate/index.ts | 11 +++++----- src/commands/model/validate.ts | 4 ++-- src/commands/prepare.ts | 20 +++++++++--------- src/transpiler.ts | 37 ++++++++++++++++------------------ src/utils.ts | 4 +--- tsconfig.json | 3 +-- 10 files changed, 47 insertions(+), 56 deletions(-) diff --git a/package-lock.json b/package-lock.json index 708183d..6f59bb7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "polyapi", - "version": "0.25.5", + "version": "0.25.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "polyapi", - "version": "0.25.5", + "version": "0.25.4", "license": "MIT", "dependencies": { "@guanghechen/helper-string": "4.7.1", diff --git a/package.json b/package.json index 358d05c..7031473 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.25.5", + "version": "0.25.4", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { diff --git a/src/api.ts b/src/api.ts index b0b2cde..69fcdc3 100644 --- a/src/api.ts +++ b/src/api.ts @@ -51,7 +51,7 @@ const getApiBaseURL = () => { if (isDevEnv) { return process.env.POLY_API_BASE_URL; } else { - return process.env.POLY_API_BASE_URL!.replace(/^http:/, 'https://'); + return process.env.POLY_API_BASE_URL.replace(/^http:/, 'https://'); } }; @@ -96,12 +96,12 @@ export const createOrUpdateServerFunction = async ( name: string, description: string | null, code: string, - visibility: string | undefined, + visibility: string, typeSchemas: Record, - externalDependencies?: Record | undefined, - internalDependencies?: Record> | undefined, + externalDependencies: Record | undefined, + internalDependencies: Record> | undefined, other?: Record, - executionApiKey?: string | null, + executionApiKey?: string, ) => { return ( await axios.post>( @@ -114,7 +114,7 @@ export const createOrUpdateServerFunction = async ( visibility, typeSchemas, // Keeping backwards compatability on requirements - requirements: externalDependencies ? Object.keys(externalDependencies) : null, + requirements: Object.keys(externalDependencies), externalDependencies, internalDependencies, executionApiKey, @@ -179,7 +179,7 @@ export const createOrUpdateClientFunction = async ( name: string, description: string | null, code: string, - visibility: string | undefined, + visibility: string, typeSchemas: Record, externalDependencies: Record | undefined, internalDependencies: Record> | undefined, diff --git a/src/commands/function.ts b/src/commands/function.ts index 39d10c3..09dc620 100644 --- a/src/commands/function.ts +++ b/src/commands/function.ts @@ -50,7 +50,7 @@ export const addOrUpdateCustomFunction = async ( try { let customFunction: FunctionDetailsDto; - const specs = await getSpecs(context ? [context] : undefined, [name]); + const specs = await getSpecs([context], [name]); const functionSpec = specs.find( (spec) => spec.name === name && spec.context === context, ); @@ -150,7 +150,7 @@ export const addOrUpdateCustomFunction = async ( shell.echo(`Client Function ID: ${customFunction.id}`); } - await generateSingleCustomFunction(polyPath, customFunction!.id, updating); + await generateSingleCustomFunction(polyPath, customFunction.id, updating); } catch (e) { shell.echo(chalk.redBright('ERROR\n')); shell.echo(chalk.red((e instanceof Error ? e.message : e.response?.data?.message) || 'Unexpected error.')); diff --git a/src/commands/generate/index.ts b/src/commands/generate/index.ts index 8be6cfc..9978449 100644 --- a/src/commands/generate/index.ts +++ b/src/commands/generate/index.ts @@ -252,7 +252,7 @@ const generateCustomFunctionJSFiles = async ( customFunctionJSTemplate(spec), ).catch((error) => { codeGenerationErrors[spec.id] = { - stack: (error as Error).stack || '', + stack: (error as Error).stack, specification: spec, }; }), @@ -328,7 +328,7 @@ const generateServerVariableJSFiles = async ( const contextPaths = getContextPaths(contextData); const template = handlebars.compile(loadTemplate('vari/index.js.hbs')); - const arrPaths: Array<{ context: string; paths: string[] }> = []; + const arrPaths = []; for (const specification of specifications) { if ( @@ -412,7 +412,7 @@ const generateAuthFunctionJSFiles = async ( }), ).catch((error) => { codeGenerationErrors[spec.id] = { - stack: (error as Error).stack || '', + stack: (error as Error).stack, specification: spec, }; }), @@ -483,7 +483,7 @@ const generateSingleCustomFunction = async ( return; } - const [customFunction] = specs as [Specification]; + const [customFunction] = specs; if (prevSpecs.some((prevSpec) => prevSpec.id === customFunction.id)) { specs = prevSpecs.map((prevSpec) => { @@ -610,7 +610,6 @@ const tryAsync = async ( ), ); } - return undefined as R; }; export const generateSpecs = async ( @@ -625,7 +624,7 @@ export const generateSpecs = async ( acc[s.name.trim() ? 1 : 0].push(s); return acc; }, - [[], []] as [Specification[], Specification[]], + [[], []], ); const jsFilesCodeGenerationErrors = await generateJSFiles(libPath, specs); diff --git a/src/commands/model/validate.ts b/src/commands/model/validate.ts index f921d99..299645e 100644 --- a/src/commands/model/validate.ts +++ b/src/commands/model/validate.ts @@ -18,10 +18,10 @@ const getDuplicatedIdentifier = ( apiFunctions: { name: string; context: string }[], ): string | null => { for (let i = 0; i < apiFunctions.length; i++) { - const firstApiFunction = apiFunctions[i]!; + const firstApiFunction = apiFunctions[i]; for (let c = 0; c < apiFunctions.length; c++) { - const secondApiFunction = apiFunctions[c]!; + const secondApiFunction = apiFunctions[c]; if ( firstApiFunction.name && diff --git a/src/commands/prepare.ts b/src/commands/prepare.ts index 97afe53..8d9d744 100644 --- a/src/commands/prepare.ts +++ b/src/commands/prepare.ts @@ -33,22 +33,22 @@ const fillInMissingFunctionDetails = async ( code: string, ): Promise => { const isMissingDescriptions = - !deployable.types!.description || - !deployable.types!.returns.description || - deployable.types!.params.some((p) => !p.description); + !deployable.types.description || + !deployable.types.returns.description || + deployable.types.params.some((p) => !p.description); if (isMissingDescriptions) { try { const aiGenerated = await getFunctionDescription( deployable.type, - deployable.types!.description, - deployable.types!.params.map((p) => ({ ...p, key: p.name })), + deployable.types.description, + deployable.types.params.map((p) => ({ ...p, key: p.name })), code, ); - if (!deployable.types!.description && aiGenerated.description) { - deployable.types!.description = aiGenerated.description; + if (!deployable.types.description && aiGenerated.description) { + deployable.types.description = aiGenerated.description; deployable.dirty = true; } - deployable.types!.params = deployable.types!.params.map((p) => { + deployable.types.params = deployable.types.params.map((p) => { if (p.description) return p; const aiArg = aiGenerated.arguments.find((a) => a.name === p.name); if (!aiArg || !aiArg.description) return p; @@ -89,13 +89,11 @@ const getAllDeployables = async ( const found = new Map(); for (const possible of possibleDeployables) { try { - const result = await parseDeployable( + const [deployable, code] = await parseDeployable( possible, baseUrl, gitRevision, ); - if (!result) throw new Error("Failed to parse a deployable record"); - const [deployable, code] = result; const fullName = `${deployable.context}.${deployable.name}`; if (found.has(fullName)) { shell.echo(chalk.redBright( diff --git a/src/transpiler.ts b/src/transpiler.ts index 0b81b66..0dcc9dc 100644 --- a/src/transpiler.ts +++ b/src/transpiler.ts @@ -87,7 +87,7 @@ let fetchedSpecs = false; export const getDependencies = async ( code: string, fileName: string, - baseUrl: string | undefined + baseUrl: string | undefined, ) => { const importedLibraries = new Set(); const internalReferences = new Set(); @@ -225,7 +225,7 @@ export const getDependencies = async ( } } else if (ts.isPropertyAccessExpression(node) && !ts.isPropertyAccessExpression(node.parent)) { let path = getPropertyPath(node); - const root = path.split('.')[0]!; + const root = path.split('.')[0]; // If root is an alias, substitute if (aliasMap.has(root)) { const aliasBase = aliasMap.get(root)!; @@ -370,7 +370,7 @@ export const getDependencies = async ( return [dependencies.length ? externalDependencies : undefined, internalReferences.size ? internalDependencies : undefined]; }; -export const parseDeployComment = (comment: string): Deployment | null => { +export const parseDeployComment = (comment: string): Deployment => { // Poly deployed @ 2024-08-29T22:46:46.791Z - test.weeklyReport - https://develop-k8s.polyapi.io/canopy/polyui/collections/server-functions/f0630f95-eac8-4c7d-9d23-639d39034bb6 - e3b0c44 const match = comment.match( /^\s*(?:\/\/\s*)*Poly deployed @ (\S+) - (\S+)\.([^.]+) - (https?:\/\/[^/]+)\/\S+\/(\S+)s\/(\S+) - (\S+)$/, @@ -385,10 +385,10 @@ export const parseDeployComment = (comment: string): Deployment | null => { deployed, fileRevision, // Local development puts canopy on a different port than the poly-server - instance: instance?.endsWith('localhost:3000') + instance: instance.endsWith('localhost:3000') ? instance.replace(':3000', ':8000') : instance, - } as Deployment; + }; }; type Ranges = Array<[start: number, end: number]>; @@ -424,10 +424,10 @@ const getPolyConfig = (types: string[], sourceFile: ts.SourceFile): any => { const visit = (node: ts.Node) => { if (ts.isVariableStatement(node)) { const declaration = node.declarationList.declarations[0]; - const name = declaration?.name.getText(sourceFile); - const type = declaration?.type?.getText(sourceFile); - if (declaration && name === 'polyConfig' && type && types.includes(type)) { - const initializer = declaration.initializer; + const name = declaration.name.getText(sourceFile); + const type = declaration.type?.getText(sourceFile); + if (name === 'polyConfig' && type && types.includes(type)) { + const initializer = node.declarationList.declarations[0].initializer; if (initializer && ts.isObjectLiteralExpression(initializer)) { // eval() is generally considered harmful // but since we're running entirely client side on user-provided code @@ -462,7 +462,7 @@ const parseJSDoc = (node: ts.FunctionDeclaration): any => { description: '', }, }; - const firstJsDoc = jsDoc[0]!; + const firstJsDoc = jsDoc[0]; jsDocTags.description = firstJsDoc.comment ? ts.getTextOfJSDocComment(firstJsDoc.comment) : ''; @@ -535,10 +535,7 @@ const parseTSTypes = ( const getFunctionDetails = ( sourceFile: ts.SourceFile, functionName: string, -): Pick< - DeployableRecord, - 'types' | 'docStartIndex' | 'docEndIndex' | 'dirty' -> => { +) => { let functionDetails: null | Pick< DeployableRecord, 'types' | 'docStartIndex' | 'docEndIndex' | 'dirty' @@ -607,12 +604,12 @@ const parseDeployableFunction = async ( const [deployments, deploymentCommentRanges] = getDeployComments(sourceFile); const functionDetails = getFunctionDetails(sourceFile, polyConfig.name); if (polyConfig.description) { - if (polyConfig.description !== functionDetails.types?.description) { - functionDetails.types!.description = polyConfig.description; + if (polyConfig.description !== functionDetails.types.description) { + functionDetails.types.description = polyConfig.description; functionDetails.dirty = true; } } else { - polyConfig.description = functionDetails.types?.description || ''; + polyConfig.description = functionDetails.types.description || ''; } const [externalDependencies, internalDependencies] = await getDependencies(sourceFile.getFullText(), sourceFile.fileName, baseUrl); const typeSchemas = generateTypeSchemas(sourceFile.fileName, DeployableTypeEntries.map(d => d[0]), polyConfig.name); @@ -651,7 +648,7 @@ export const parseDeployable = async ( filePath: string, baseUrl: string, gitRevision: string, -): Promise<[DeployableRecord, string] | undefined> => { +): Promise<[DeployableRecord, string]> => { const sourceFile = await loadTsSourceFile(filePath); const polyConfig = getPolyConfig( @@ -710,7 +707,7 @@ const dereferenceSchema = (obj: any, definitions: any, visited: Set = ne if (key === '$ref' && typeof value === 'string') { const match = value.match(/^#\/definitions\/(.+)$/); if (match) { - const defName = match[1]!; + const defName = match[1]; // Prevent infinite recursion if (visited.has(defName)) { @@ -823,7 +820,7 @@ const dereferenceRoot = (schema: any): any => { if (key === '$ref' && typeof value === 'string') { const match = value.match(/^#\/definitions\/(.+)$/); if (match) { - const encodedDefName = match[1]!; + const encodedDefName = match[1]; const decodedDefName = decodeURIComponent(encodedDefName); // Try both encoded and decoded versions diff --git a/src/utils.ts b/src/utils.ts index 77a2c12..1eb8f34 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -113,9 +113,7 @@ export const getStringPaths = (data: Record | any[]) => { for (let i = 0; i < paths.length; i++) { let stringPath = ''; - const parts = paths[i]; - if (!parts) continue; - for (const part of parts) { + for (const part of paths[i]) { const isString = typeof part === 'string'; const delimiter = stringPath.length > 0 && isString ? '.' : ''; if (isString) { diff --git a/tsconfig.json b/tsconfig.json index 3876c9d..2c25806 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,12 +13,11 @@ "sourceMap": true, "incremental": true, "skipLibCheck": true, - "strictNullChecks": true, + "strictNullChecks": false, "noImplicitAny": false, "strictBindCallApply": false, "forceConsistentCasingInFileNames": false, "noFallthroughCasesInSwitch": false, - "noUncheckedIndexedAccess": true, "outDir": "build", }, "include": ["src/**/*"], From c72309eba8b1aa3a105e902a5edcec9564bb7b8b Mon Sep 17 00:00:00 2001 From: Aaron Goin Date: Fri, 17 Oct 2025 13:21:02 -0700 Subject: [PATCH 69/73] Slimmed down changes for hotfixing --- package-lock.json | 4 ++-- package.json | 2 +- src/api.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6f59bb7..708183d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "polyapi", - "version": "0.25.4", + "version": "0.25.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "polyapi", - "version": "0.25.4", + "version": "0.25.5", "license": "MIT", "dependencies": { "@guanghechen/helper-string": "4.7.1", diff --git a/package.json b/package.json index 7031473..358d05c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.25.4", + "version": "0.25.5", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { diff --git a/src/api.ts b/src/api.ts index 69fcdc3..4632dda 100644 --- a/src/api.ts +++ b/src/api.ts @@ -114,7 +114,7 @@ export const createOrUpdateServerFunction = async ( visibility, typeSchemas, // Keeping backwards compatability on requirements - requirements: Object.keys(externalDependencies), + requirements: externalDependencies ? Object.keys(externalDependencies) : null, externalDependencies, internalDependencies, executionApiKey, From f3386100fe4018a5e2791dfc06e2324a6097178f Mon Sep 17 00:00:00 2001 From: Aaron Goin Date: Tue, 28 Oct 2025 07:07:50 -0700 Subject: [PATCH 70/73] Generating SDK into temp directory and then swapping it in more atomically for the lib directory --- src/commands/generate/index.ts | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/src/commands/generate/index.ts b/src/commands/generate/index.ts index 9978449..7d701fc 100644 --- a/src/commands/generate/index.ts +++ b/src/commands/generate/index.ts @@ -53,8 +53,9 @@ const getApiBaseUrl = () => const getApiKey = () => process.env.POLY_API_KEY; -const prepareDir = async (polyPath: string) => { - const libPath = getPolyLibPath(polyPath); +const prepareDir = async (polyPath: string, temp = false) => { + let libPath = getPolyLibPath(polyPath); + if (temp) libPath = libPath.replace('/lib', '/temp'); fs.rmSync(libPath, { recursive: true, force: true }); fs.mkdirSync(libPath, { recursive: true }); @@ -461,7 +462,7 @@ const generateSingleCustomFunction = async ( updated ? 'Regenerating TypeScript SDK...' : 'Generating TypeScript SDK...', ); - const libPath = getPolyLibPath(polyPath); + let libPath = getPolyLibPath(polyPath); let prevSpecs: Specification[] = []; try { @@ -497,13 +498,18 @@ const generateSingleCustomFunction = async ( specs = prevSpecs; } - await prepareDir(polyPath); + await prepareDir(polyPath, true); + libPath = getPolyLibPath(polyPath); + const tempPath = libPath.replace('/lib', '/temp'); - writeCachedSpecs(libPath, specs); + writeCachedSpecs(tempPath, specs); setGenerationErrors(false); - await generateSpecs(libPath, specs, noTypes); + await generateSpecs(tempPath, specs, noTypes); + // Now remove old lib and rename temp directory to force a switchover in typescript + fs.rmSync(libPath, { recursive: true, force: true }); + fs.renameSync(tempPath, libPath); if (getGenerationErrors()) { shell.echo( @@ -568,14 +574,15 @@ const generate = async ({ : 'Generating Poly TypeScript SDK...'; shell.echo('-n', generateMsg); - await prepareDir(polyPath); + await prepareDir(polyPath, true); loadConfig(polyPath); const libPath = getPolyLibPath(polyPath); + const tempPath = libPath.replace('/lib', '/temp'); try { specs = await getSpecs(contexts, names, ids, noTypes); - writeCachedSpecs(libPath, specs); + writeCachedSpecs(tempPath, specs); updateLocalConfig(polyPath, contexts, names, ids, noTypes); } catch (error) { showErrGettingSpecs(error); @@ -583,8 +590,10 @@ const generate = async ({ } setGenerationErrors(false); - await generateSpecs(libPath, specs, noTypes); - + await generateSpecs(tempPath, specs, noTypes); + // Now remove old lib and rename temp directory to force a switchover in typescript + fs.rmSync(libPath, { recursive: true, force: true }); + fs.renameSync(tempPath, libPath); if (getGenerationErrors()) { shell.echo( From 46367cc929f5e606f62ea7588749a673d60ee1d2 Mon Sep 17 00:00:00 2001 From: Aaron Goin Date: Tue, 28 Oct 2025 07:15:35 -0700 Subject: [PATCH 71/73] Bump version to deploy sdk generate fix! --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 708183d..2249a9e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "polyapi", - "version": "0.25.5", + "version": "0.25.6", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "polyapi", - "version": "0.25.5", + "version": "0.25.6", "license": "MIT", "dependencies": { "@guanghechen/helper-string": "4.7.1", diff --git a/package.json b/package.json index 358d05c..543a2a6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.25.5", + "version": "0.25.6", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { From c43ea1e233fd11d3cc7934cbe6adcbf8552973ff Mon Sep 17 00:00:00 2001 From: Aaron Goin Date: Tue, 28 Oct 2025 08:29:21 -0700 Subject: [PATCH 72/73] More robust internal dependency parsing --- package-lock.json | 4 +- package.json | 2 +- src/transpiler.ts | 119 ++++++++++++++++++++++++++++++++++------------ 3 files changed, 91 insertions(+), 34 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2249a9e..b1ccffa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "polyapi", - "version": "0.25.6", + "version": "0.25.7", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "polyapi", - "version": "0.25.6", + "version": "0.25.7", "license": "MIT", "dependencies": { "@guanghechen/helper-string": "4.7.1", diff --git a/package.json b/package.json index 543a2a6..d875448 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "polyapi", - "version": "0.25.6", + "version": "0.25.7", "description": "Poly is a CLI tool to help create and manage your Poly definitions.", "license": "MIT", "repository": { diff --git a/src/transpiler.ts b/src/transpiler.ts index 0dcc9dc..5a3641b 100644 --- a/src/transpiler.ts +++ b/src/transpiler.ts @@ -95,6 +95,8 @@ export const getDependencies = async ( let variImportIdentifier: string | null = null; let tabiImportIdentifier: string | null = null; let schemasImportIdentifier: string | null = null; + const otherImportIdentifiers: string[] = []; + let lookForInternalDependencies = false; // Users can alias references to parts of the poly tree by assigning to a variable // So this map holds those references const aliasMap = new Map(); @@ -121,6 +123,17 @@ export const getDependencies = async ( return parts.join('.'); } + const unwrapExpression = (expr: ts.Expression): ts.Expression => { + while ( + ts.isParenthesizedExpression(expr) || + ts.isAsExpression(expr) || + ts.isTypeAssertionExpression(expr) + ) { + expr = expr.expression; + } + return expr; + } + const flattenTypeName = (name: ts.EntityName): string => { const parts: string[] = []; const recurse = (n: ts.EntityName): void => { @@ -155,17 +168,28 @@ export const getDependencies = async ( // Get name of polyapi default import if defined if (node.importClause.name) { polyImportIdentifier = `${node.importClause.name.text}.`; + lookForInternalDependencies = true; } - // Look for any other named imports (like vari or tabi) + // Look for any other named imports (like vari, tabi, schemas, and other top-level namespaces (like OOB, etc)) if (node.importClause.namedBindings && ts.isNamedImports(node.importClause.namedBindings)) { for (const element of node.importClause.namedBindings.elements) { const imported = element.propertyName ? element.propertyName.text : element.name.text; const local = element.name.text; - if (imported === "vari") variImportIdentifier = `${local}.`; - if (imported === "tabi") tabiImportIdentifier = `${local}.`; - if (imported === "schemas") schemasImportIdentifier = `${local}.`; + if (imported === "vari") { + variImportIdentifier = `${local}.`; + lookForInternalDependencies = true; + } else if (imported === "tabi") { + tabiImportIdentifier = `${local}.`; + lookForInternalDependencies = true; + } else if (imported === "schemas") { + schemasImportIdentifier = `${local}.`; + lookForInternalDependencies = true; + } else if (local !== 'polyCustom') { + otherImportIdentifiers.push(`${local}.`); + lookForInternalDependencies = true; + } } } } @@ -192,38 +216,69 @@ export const getDependencies = async ( // Pull out internal dependencies - if (polyImportIdentifier || variImportIdentifier || tabiImportIdentifier) { - - // Track variable assignments (aliases) + if (lookForInternalDependencies) { + // Track assignments of poly imports to follow aliases if (ts.isVariableDeclaration(node) && node.initializer) { - if (ts.isPropertyAccessExpression(node.initializer)) { - const path = getPropertyPath(node.initializer); - - // Capture poly reference aliases - if (polyImportIdentifier && path.startsWith(polyImportIdentifier)) { + const initializer = unwrapExpression(node.initializer); + // Simple variable assignments (aliases) + if (ts.isIdentifier(node.name) && ts.isPropertyAccessExpression(initializer)) { + const path = getPropertyPath(initializer); + + if ( + // Capture poly reference aliases + (polyImportIdentifier && path.startsWith(polyImportIdentifier)) || + // Capture vari reference aliases + (variImportIdentifier && path.startsWith(variImportIdentifier)) || + // Capture tabi reference aliases + (tabiImportIdentifier && path.startsWith(tabiImportIdentifier)) || + // Capture other top-level namespace reference aliases + (otherImportIdentifiers.length && otherImportIdentifiers.some(other => path.startsWith(other))) + ) { if (node.name && ts.isIdentifier(node.name)) { aliasMap.set(node.name.text, path); return node; // Don't recurse into assignment, just move on } } - - // Capture vari reference aliases - if (variImportIdentifier && path.startsWith(variImportIdentifier)) { - if (node.name && ts.isIdentifier(node.name)) { - aliasMap.set(node.name.text, path); - return node; // Don't recurse into assignment, just move on - } + } + // Destructuring assignments (aliases) + else if (ts.isObjectBindingPattern(node.name)) { + let basePath: string | undefined; + if (ts.isPropertyAccessExpression(initializer)) { + basePath = getPropertyPath(initializer); + } else if (ts.isIdentifier(initializer)) { + basePath = initializer.text; } - - // Capture tabi reference aliases - if (tabiImportIdentifier && path.startsWith(tabiImportIdentifier)) { - if (node.name && ts.isIdentifier(node.name)) { - aliasMap.set(node.name.text, path); - return node; // Don't recurse into assignment, just move on + if (!basePath) return node; + + for (const element of node.name.elements) { + if (!ts.isBindingElement(element)) continue; + + // Handle `propertyName: alias` and shorthand `{ prop }` + const propName = element.propertyName + ? element.propertyName.getText() + : element.name.getText(); + const localName = element.name.getText(); + let path = `${basePath}.${propName}`; + const root = path.split('.')[0]; + // Check for alias to handle case where we're destructuring something from an aliased import + if (aliasMap.has(root)) { + const aliasBase = aliasMap.get(root); + path = aliasBase.split(".").concat(path.split('.').slice(1)).join('.'); + } + if ( + (polyImportIdentifier && path.startsWith(polyImportIdentifier)) || + (variImportIdentifier && path.startsWith(variImportIdentifier)) || + (tabiImportIdentifier && path.startsWith(tabiImportIdentifier)) || + (otherImportIdentifiers.length && otherImportIdentifiers.some(other => path.startsWith(other))) + ) { + aliasMap.set(localName, path); } } + return node; } - } else if (ts.isPropertyAccessExpression(node) && !ts.isPropertyAccessExpression(node.parent)) { + } + // Look for use of imported poly dep! + else if (ts.isPropertyAccessExpression(node) && !ts.isPropertyAccessExpression(node.parent)) { let path = getPropertyPath(node); const root = path.split('.')[0]; // If root is an alias, substitute @@ -231,21 +286,23 @@ export const getDependencies = async ( const aliasBase = aliasMap.get(root)!; path = aliasBase.split(".").concat(path.split('.').slice(1)).join('.'); } - // Capture poly references (all function types, webhooks, and subscriptions) if (polyImportIdentifier && path.startsWith(polyImportIdentifier)) { internalReferences.add(path.replace(polyImportIdentifier, '')); } - // Capture vari references - if (variImportIdentifier && path.startsWith(variImportIdentifier)) { + else if (variImportIdentifier && path.startsWith(variImportIdentifier)) { internalReferences.add(path.replace(VariMethods, '').replace(variImportIdentifier, '')); } - // Capture tabi references - if (tabiImportIdentifier && path.startsWith(tabiImportIdentifier)) { + else if (tabiImportIdentifier && path.startsWith(tabiImportIdentifier)) { internalReferences.add(path.replace(TabiMethods, '').replace(tabiImportIdentifier, '')); } + // Capture other top-level namespace references + else if (otherImportIdentifiers.length) { + const match = otherImportIdentifiers.find(other => path.startsWith(other)); + if (match) internalReferences.add(path); + } } } From 3abbb555e02a34a93ed85b872162f24d857cc384 Mon Sep 17 00:00:00 2001 From: Aaron Goin Date: Tue, 28 Oct 2025 08:43:51 -0700 Subject: [PATCH 73/73] comments --- src/transpiler.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/transpiler.ts b/src/transpiler.ts index 5a3641b..cdca109 100644 --- a/src/transpiler.ts +++ b/src/transpiler.ts @@ -220,7 +220,7 @@ export const getDependencies = async ( // Track assignments of poly imports to follow aliases if (ts.isVariableDeclaration(node) && node.initializer) { const initializer = unwrapExpression(node.initializer); - // Simple variable assignments (aliases) + // Simple variable assignments (aliases), ex. `const OOB = polyapi.OOB;` if (ts.isIdentifier(node.name) && ts.isPropertyAccessExpression(initializer)) { const path = getPropertyPath(initializer); @@ -240,7 +240,7 @@ export const getDependencies = async ( } } } - // Destructuring assignments (aliases) + // Destructuring assignments (aliases), ex. `const { OOB } = polyapi;` else if (ts.isObjectBindingPattern(node.name)) { let basePath: string | undefined; if (ts.isPropertyAccessExpression(initializer)) {