polyapi 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +55 -0
- package/build/api.d.ts +4 -0
- package/build/api.d.ts.map +1 -0
- package/build/api.js +27 -0
- package/build/api.js.map +1 -0
- package/build/cli.d.ts +3 -0
- package/build/cli.d.ts.map +1 -0
- package/build/cli.js +33 -0
- package/build/cli.js.map +1 -0
- package/build/commands/generate.d.ts +3 -0
- package/build/commands/generate.d.ts.map +1 -0
- package/build/commands/generate.js +145 -0
- package/build/commands/generate.js.map +1 -0
- package/build/commands/setup.d.ts +3 -0
- package/build/commands/setup.d.ts.map +1 -0
- package/build/commands/setup.js +39 -0
- package/build/commands/setup.js.map +1 -0
- package/build/config.d.ts +3 -0
- package/build/config.d.ts.map +1 -0
- package/build/config.js +25 -0
- package/build/config.js.map +1 -0
- package/build/constants.d.ts +3 -0
- package/build/constants.d.ts.map +1 -0
- package/build/constants.js +6 -0
- package/build/constants.js.map +1 -0
- package/build/templates/index.d.ts.hbs +25 -0
- package/build/templates/index.js.hbs +84 -0
- package/build/templates/{{context}}.d.ts.hbs +19 -0
- package/build/tsconfig.tsbuildinfo +1 -0
- package/index.d.ts +2 -0
- package/index.js +3 -0
- package/package.json +58 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Darko Vukovic
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
## Usage
|
|
2
|
+
Make sure you have set your npm registry in .npmrc file.
|
|
3
|
+
|
|
4
|
+
Install the package with `npm install polyapi`.
|
|
5
|
+
|
|
6
|
+
Run `npx poly generate` to setup your Poly connection (only for the first time) and generate Poly functions.
|
|
7
|
+
Whenever you update your Poly functions, run `npx poly generate` again to update your local functions.
|
|
8
|
+
|
|
9
|
+
### Using Poly functions
|
|
10
|
+
After that you can use your Poly client in your code:
|
|
11
|
+
```
|
|
12
|
+
import poly from 'polyapi';
|
|
13
|
+
|
|
14
|
+
const response = await poly.myContext.myFunction('param1', 'param2');
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### Using error handler
|
|
18
|
+
Poly functions can throw errors. You can catch them with try/catch or you can register an error handler for function path:
|
|
19
|
+
```
|
|
20
|
+
import poly, {errorHandler} from 'polyapi';
|
|
21
|
+
|
|
22
|
+
errorHandler.on('myContext.myFunction', (error) => {
|
|
23
|
+
// handle error
|
|
24
|
+
});
|
|
25
|
+
```
|
|
26
|
+
or you can register an error handler for all functions in context:
|
|
27
|
+
```
|
|
28
|
+
errorHandler.on('myContext', (error) => {
|
|
29
|
+
// handle error
|
|
30
|
+
});
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
To remove error handler for function path:
|
|
34
|
+
```
|
|
35
|
+
errorHandler.off('myContext.myFunction');
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Using Webhook handlers
|
|
39
|
+
Similar to error handlers, you can register handlers for Webhooks:
|
|
40
|
+
```
|
|
41
|
+
import poly from 'polyapi';
|
|
42
|
+
|
|
43
|
+
poly.myWebhookContext.paymentReceieved(event => {
|
|
44
|
+
// handle event
|
|
45
|
+
});
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Webhook handlers have their context and function alias. To remove a handler call the returned function:
|
|
49
|
+
```
|
|
50
|
+
const unregister = poly.myWebhookContext.paymentReceieved(event => {
|
|
51
|
+
// handle event
|
|
52
|
+
});
|
|
53
|
+
...
|
|
54
|
+
unregister();
|
|
55
|
+
```
|
package/build/api.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAE7D,eAAO,MAAM,gBAAgB,8BAS5B,CAAC;AAEF,eAAO,MAAM,iBAAiB,mCAS7B,CAAC"}
|
package/build/api.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getWebhookHandles = exports.getPolyFunctions = void 0;
|
|
7
|
+
const axios_1 = __importDefault(require("axios"));
|
|
8
|
+
const constants_1 = require("./constants");
|
|
9
|
+
const getPolyFunctions = async () => {
|
|
10
|
+
return (await axios_1.default.get(`${process.env.POLY_API_BASE_URL}/function`, {
|
|
11
|
+
headers: {
|
|
12
|
+
'Content-Type': 'application/json',
|
|
13
|
+
[constants_1.POLY_HEADER_API_KEY]: process.env.POLY_API_KEY || '',
|
|
14
|
+
},
|
|
15
|
+
})).data;
|
|
16
|
+
};
|
|
17
|
+
exports.getPolyFunctions = getPolyFunctions;
|
|
18
|
+
const getWebhookHandles = async () => {
|
|
19
|
+
return (await axios_1.default.get(`${process.env.POLY_API_BASE_URL}/webhook`, {
|
|
20
|
+
headers: {
|
|
21
|
+
'Content-Type': 'application/json',
|
|
22
|
+
[constants_1.POLY_HEADER_API_KEY]: process.env.POLY_API_KEY || '',
|
|
23
|
+
},
|
|
24
|
+
})).data;
|
|
25
|
+
};
|
|
26
|
+
exports.getWebhookHandles = getWebhookHandles;
|
|
27
|
+
//# sourceMappingURL=api.js.map
|
package/build/api.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,2CAAkD;AAG3C,MAAM,gBAAgB,GAAG,KAAK,IAAI,EAAE;IACzC,OAAO,CACL,MAAM,eAAK,CAAC,GAAG,CAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,WAAW,EAAE;QAC1E,OAAO,EAAE;YACP,cAAc,EAAE,kBAAkB;YAClC,CAAC,+BAAmB,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,EAAE;SACtD;KACF,CAAC,CACH,CAAC,IAAI,CAAC;AACT,CAAC,CAAC;AATW,QAAA,gBAAgB,oBAS3B;AAEK,MAAM,iBAAiB,GAAG,KAAK,IAAI,EAAE;IAC1C,OAAO,CACL,MAAM,eAAK,CAAC,GAAG,CAAqB,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,UAAU,EAAE;QAC9E,OAAO,EAAE;YACP,cAAc,EAAE,kBAAkB;YAClC,CAAC,+BAAmB,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,EAAE;SACtD;KACF,CAAC,CACH,CAAC,IAAI,CAAC;AACT,CAAC,CAAC;AATW,QAAA,iBAAiB,qBAS5B"}
|
package/build/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|
package/build/cli.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const yargs_1 = __importDefault(require("yargs"));
|
|
8
|
+
const shelljs_1 = __importDefault(require("shelljs"));
|
|
9
|
+
const setup_1 = __importDefault(require("./commands/setup"));
|
|
10
|
+
const generate_1 = __importDefault(require("./commands/generate"));
|
|
11
|
+
const config_1 = require("./config");
|
|
12
|
+
const checkPolyConfig = () => {
|
|
13
|
+
(0, config_1.loadConfig)();
|
|
14
|
+
if (!process.env.POLY_API_KEY) {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
return true;
|
|
18
|
+
};
|
|
19
|
+
yargs_1.default
|
|
20
|
+
.usage('$0 <cmd> [args]')
|
|
21
|
+
.command('setup', 'Setups your Poly connection', setup_1.default)
|
|
22
|
+
.command('generate', 'Generates client types for Poly service', async ({ argv: { exitWhenNoConfig } }) => {
|
|
23
|
+
if (!checkPolyConfig()) {
|
|
24
|
+
if (exitWhenNoConfig) {
|
|
25
|
+
shelljs_1.default.echo('Poly is not configured. Please run `poly generate` manually.');
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
await (0, setup_1.default)();
|
|
29
|
+
}
|
|
30
|
+
await (0, generate_1.default)();
|
|
31
|
+
})
|
|
32
|
+
.help(true).argv;
|
|
33
|
+
//# sourceMappingURL=cli.js.map
|
package/build/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;;AACA,kDAA0B;AAC1B,sDAA4B;AAC5B,6DAAqC;AACrC,mEAA2C;AAC3C,qCAAsC;AAEtC,MAAM,eAAe,GAAG,GAAG,EAAE;IAC3B,IAAA,mBAAU,GAAE,CAAC;IAEb,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE;QAC7B,OAAO,KAAK,CAAC;KACd;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAGF,eAAK;KACF,KAAK,CAAC,iBAAiB,CAAC;KACxB,OAAO,CAAC,OAAO,EAAE,6BAA6B,EAAE,eAAK,CAAC;KACtD,OAAO,CACN,UAAU,EACV,yCAAyC,EACzC,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,gBAAgB,EAAE,EAAiB,EAAE,EAAE;IACtD,IAAI,CAAC,eAAe,EAAE,EAAE;QACtB,IAAI,gBAAgB,EAAE;YACpB,iBAAK,CAAC,IAAI,CAAC,8DAA8D,CAAC,CAAC;YAC3E,OAAO;SACR;QAED,MAAM,IAAA,eAAK,GAAE,CAAC;KACf;IAED,MAAM,IAAA,kBAAQ,GAAE,CAAC;AACnB,CAAC,CACF;KACA,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/commands/generate.ts"],"names":[],"mappings":"AAuKA,QAAA,MAAM,QAAQ,qBAab,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __asyncValues = (this && this.__asyncValues) || function (o) {
|
|
3
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
4
|
+
var m = o[Symbol.asyncIterator], i;
|
|
5
|
+
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);
|
|
6
|
+
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); }); }; }
|
|
7
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
8
|
+
};
|
|
9
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
10
|
+
var t = {};
|
|
11
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
12
|
+
t[p] = s[p];
|
|
13
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
14
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
15
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
16
|
+
t[p[i]] = s[p[i]];
|
|
17
|
+
}
|
|
18
|
+
return t;
|
|
19
|
+
};
|
|
20
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
21
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
const fs_1 = __importDefault(require("fs"));
|
|
25
|
+
const handlebars_1 = __importDefault(require("handlebars"));
|
|
26
|
+
const set_1 = __importDefault(require("lodash/set"));
|
|
27
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
28
|
+
const shelljs_1 = __importDefault(require("shelljs"));
|
|
29
|
+
const helper_string_1 = require("@guanghechen/helper-string");
|
|
30
|
+
const api_1 = require("../api");
|
|
31
|
+
const constants_1 = require("../constants");
|
|
32
|
+
const config_1 = require("../config");
|
|
33
|
+
const POLY_LIB_PATH = `${__dirname}/../../../${constants_1.POLY_USER_FOLDER_NAME}/lib`;
|
|
34
|
+
const prepareDir = () => {
|
|
35
|
+
fs_1.default.rmSync(POLY_LIB_PATH, { recursive: true, force: true });
|
|
36
|
+
fs_1.default.mkdirSync(POLY_LIB_PATH, { recursive: true });
|
|
37
|
+
};
|
|
38
|
+
const loadTemplate = async (fileName) => fs_1.default.readFileSync(`${__dirname}/../templates/${fileName}`, 'utf8');
|
|
39
|
+
const generateJSFiles = async (functions, webhookHandles) => {
|
|
40
|
+
const template = handlebars_1.default.compile(await loadTemplate('index.js.hbs'));
|
|
41
|
+
fs_1.default.writeFileSync(`${POLY_LIB_PATH}/index.js`, template({
|
|
42
|
+
functions,
|
|
43
|
+
webhookHandles,
|
|
44
|
+
apiBaseUrl: process.env.POLY_API_BASE_URL,
|
|
45
|
+
apiKey: process.env.POLY_API_KEY,
|
|
46
|
+
}));
|
|
47
|
+
};
|
|
48
|
+
const generateTSDeclarationFilesForContext = async (parentContextPath, contextName, contextData, contextFilesCollector = []) => {
|
|
49
|
+
var _a, e_1, _b, _c;
|
|
50
|
+
const contextPath = `${parentContextPath ? `${parentContextPath}.` : ''}${contextName}`;
|
|
51
|
+
const contextDataKeys = Object.keys(contextData);
|
|
52
|
+
const contextDataFunctions = contextDataKeys
|
|
53
|
+
.filter((key) => contextData[key].type === 'function')
|
|
54
|
+
.map((key) => contextData[key]);
|
|
55
|
+
const contextDataWebhookHandles = contextDataKeys
|
|
56
|
+
.filter((key) => contextData[key].type === 'webhookHandle')
|
|
57
|
+
.map((key) => contextData[key]);
|
|
58
|
+
const contextDataSubContexts = contextDataKeys
|
|
59
|
+
.filter((key) => !contextData[key].type)
|
|
60
|
+
.map((key) => ({
|
|
61
|
+
name: key,
|
|
62
|
+
interfaceName: (0, helper_string_1.toPascalCase)(`${contextPath}.${key}`),
|
|
63
|
+
}));
|
|
64
|
+
const contextFiles = await generateTSContextDeclarationFile(contextPath, contextDataFunctions, contextDataWebhookHandles, contextDataSubContexts);
|
|
65
|
+
contextFilesCollector = [...contextFilesCollector, contextFiles];
|
|
66
|
+
try {
|
|
67
|
+
for (var _d = true, contextDataSubContexts_1 = __asyncValues(contextDataSubContexts), contextDataSubContexts_1_1; contextDataSubContexts_1_1 = await contextDataSubContexts_1.next(), _a = contextDataSubContexts_1_1.done, !_a;) {
|
|
68
|
+
_c = contextDataSubContexts_1_1.value;
|
|
69
|
+
_d = false;
|
|
70
|
+
try {
|
|
71
|
+
const subContext = _c;
|
|
72
|
+
contextFilesCollector = await generateTSDeclarationFilesForContext(contextPath, subContext.name, contextData[subContext.name], contextFilesCollector);
|
|
73
|
+
}
|
|
74
|
+
finally {
|
|
75
|
+
_d = true;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
80
|
+
finally {
|
|
81
|
+
try {
|
|
82
|
+
if (!_d && !_a && (_b = contextDataSubContexts_1.return)) await _b.call(contextDataSubContexts_1);
|
|
83
|
+
}
|
|
84
|
+
finally { if (e_1) throw e_1.error; }
|
|
85
|
+
}
|
|
86
|
+
return contextFilesCollector;
|
|
87
|
+
};
|
|
88
|
+
const generateTSDeclarationFiles = async (functions, webhookHandles) => {
|
|
89
|
+
const contextData = getContextData(functions, webhookHandles);
|
|
90
|
+
const { default: defaultContext } = contextData, otherContexts = __rest(contextData, ["default"]);
|
|
91
|
+
const contextFiles = await generateTSDeclarationFilesForContext(null, '', Object.assign(Object.assign({}, otherContexts), defaultContext));
|
|
92
|
+
await generateTSIndexDeclarationFile(contextFiles);
|
|
93
|
+
};
|
|
94
|
+
const generateTSIndexDeclarationFile = async (contextFiles) => {
|
|
95
|
+
const template = handlebars_1.default.compile(await loadTemplate('index.d.ts.hbs'));
|
|
96
|
+
fs_1.default.writeFileSync(`${POLY_LIB_PATH}/index.d.ts`, template({
|
|
97
|
+
contextFiles,
|
|
98
|
+
}));
|
|
99
|
+
};
|
|
100
|
+
const generateTSContextDeclarationFile = async (context, functions, webhookHandles, subContexts) => {
|
|
101
|
+
const template = handlebars_1.default.compile(await loadTemplate('{{context}}.d.ts.hbs'));
|
|
102
|
+
const fileName = `${context === '' ? 'default' : context}.d.ts`;
|
|
103
|
+
const returnTypeDefinitions = functions.reduce((result, func) => {
|
|
104
|
+
return `${result}${func.returnType}\n`;
|
|
105
|
+
}, '');
|
|
106
|
+
const webhookHandlesEventTypeDefinitions = webhookHandles.reduce((result, handle) => {
|
|
107
|
+
return `${result}${handle.eventType}\n`;
|
|
108
|
+
}, '');
|
|
109
|
+
const toFunctionData = (func) => (Object.assign(Object.assign({}, func), { arguments: func.arguments.map((arg) => (Object.assign(Object.assign({}, arg), { name: (0, helper_string_1.toCamelCase)(arg.name) }))), returnType: func.returnType ? `Promise<${(0, helper_string_1.toPascalCase)(`${context}.${func.name}`)}Type['content']>` : 'Promise<any>' }));
|
|
110
|
+
const toWebhookHandleData = (handle) => (Object.assign(Object.assign({}, handle), { eventType: handle.eventType ? `${(0, helper_string_1.toPascalCase)(`${context}.${handle.alias}`)}EventType['content']` : 'any' }));
|
|
111
|
+
fs_1.default.writeFileSync(`${POLY_LIB_PATH}/${fileName}`, template({
|
|
112
|
+
interfaceName: context === '' ? 'Poly' : (0, helper_string_1.toPascalCase)(context),
|
|
113
|
+
context,
|
|
114
|
+
functions: functions.map(toFunctionData),
|
|
115
|
+
webhookHandles: webhookHandles.map(toWebhookHandleData),
|
|
116
|
+
subContexts,
|
|
117
|
+
returnTypeDefinitions,
|
|
118
|
+
webhookHandlesEventTypeDefinitions,
|
|
119
|
+
}));
|
|
120
|
+
return fileName;
|
|
121
|
+
};
|
|
122
|
+
const getContextData = (functions, webhookHandles) => {
|
|
123
|
+
const contextData = {};
|
|
124
|
+
functions.forEach((func) => {
|
|
125
|
+
const contextFunctionName = `${func.context || 'default'}.${func.name}`;
|
|
126
|
+
(0, set_1.default)(contextData, contextFunctionName, Object.assign(Object.assign({}, func), { type: 'function', name: func.name.split('.').pop() }));
|
|
127
|
+
});
|
|
128
|
+
webhookHandles.forEach((handle) => {
|
|
129
|
+
const contextFunctionName = `${handle.context || 'default'}.${handle.alias}`;
|
|
130
|
+
(0, set_1.default)(contextData, contextFunctionName, Object.assign(Object.assign({}, handle), { type: 'webhookHandle', alias: handle.alias.split('.').pop() }));
|
|
131
|
+
});
|
|
132
|
+
return contextData;
|
|
133
|
+
};
|
|
134
|
+
const generate = async () => {
|
|
135
|
+
shelljs_1.default.echo('-n', chalk_1.default.rgb(255, 255, 255)(`Generating Poly functions...`));
|
|
136
|
+
prepareDir();
|
|
137
|
+
(0, config_1.loadConfig)();
|
|
138
|
+
const functions = await (0, api_1.getPolyFunctions)();
|
|
139
|
+
const webhookHandles = await (0, api_1.getWebhookHandles)();
|
|
140
|
+
await generateJSFiles(functions, webhookHandles);
|
|
141
|
+
await generateTSDeclarationFiles(functions, webhookHandles);
|
|
142
|
+
shelljs_1.default.echo(chalk_1.default.green('DONE'));
|
|
143
|
+
};
|
|
144
|
+
exports.default = generate;
|
|
145
|
+
//# sourceMappingURL=generate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../src/commands/generate.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAAoB;AACpB,4DAAoC;AACpC,qDAA6B;AAC7B,kDAA0B;AAC1B,sDAA4B;AAC5B,8DAAuE;AAGvE,gCAA6D;AAC7D,4CAAqD;AACrD,sCAAuC;AAEvC,MAAM,aAAa,GAAG,GAAG,SAAS,aAAa,iCAAqB,MAAM,CAAC;AAO3E,MAAM,UAAU,GAAG,GAAG,EAAE;IACtB,YAAE,CAAC,MAAM,CAAC,aAAa,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3D,YAAE,CAAC,SAAS,CAAC,aAAa,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AACnD,CAAC,CAA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IACH,cAAc,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;QAChC,MAAM,mBAAmB,GAAG,GAAG,MAAM,CAAC,OAAO,IAAI,SAAS,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;QAC7E,IAAA,aAAG,EAAC,WAAW,EAAE,mBAAmB,kCAC/B,MAAM,KACT,IAAI,EAAE,eAAe,EACrB,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,IACpC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC;AAEF,MAAM,QAAQ,GAAG,KAAK,IAAI,EAAE;IAC1B,iBAAK,CAAC,IAAI,CAAC,IAAI,EAAE,eAAK,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,8BAA8B,CAAC,CAAC,CAAC;IAE3E,UAAU,EAAE,CAAC;IACb,IAAA,mBAAU,GAAE,CAAC;IAEb,MAAM,SAAS,GAAG,MAAM,IAAA,sBAAgB,GAAE,CAAC;IAC3C,MAAM,cAAc,GAAG,MAAM,IAAA,uBAAiB,GAAE,CAAC;IAEjD,MAAM,eAAe,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;IACjD,MAAM,0BAA0B,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;IAE5D,iBAAK,CAAC,IAAI,CAAC,eAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;AAClC,CAAC,CAAC;AAEF,kBAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/commands/setup.ts"],"names":[],"mappings":"AAMA,QAAA,MAAM,KAAK,qBA6BV,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const shelljs_1 = __importDefault(require("shelljs"));
|
|
7
|
+
const inquirer_1 = __importDefault(require("inquirer"));
|
|
8
|
+
const config_1 = require("../config");
|
|
9
|
+
const URL_REGEX = /https?:\/\/(?:w{1,3}\.)?[^\s.]+(?:\.[a-z]+)*(?::\d+)?(?![^<]*(?:<\/\w+>|\/?>))/;
|
|
10
|
+
const setup = async () => {
|
|
11
|
+
await shelljs_1.default.echo('Please setup your connection to Poly service.');
|
|
12
|
+
const { polyApiBaseUrl, polyApiKey } = await inquirer_1.default.prompt([
|
|
13
|
+
{
|
|
14
|
+
type: 'input',
|
|
15
|
+
name: 'polyApiBaseUrl',
|
|
16
|
+
message: 'Poly API Base URL:',
|
|
17
|
+
default: process.env.POLY_API_BASE_URL || 'https://api.poly.io',
|
|
18
|
+
filter: (value) => value.trim(),
|
|
19
|
+
validate: (url) => {
|
|
20
|
+
if (!URL_REGEX.test(url)) {
|
|
21
|
+
return 'Given URL is not valid. Please enter valid URL.';
|
|
22
|
+
}
|
|
23
|
+
return true;
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
type: 'input',
|
|
28
|
+
name: 'polyApiKey',
|
|
29
|
+
message: 'Poly API Key:',
|
|
30
|
+
filter: (value) => value.trim(),
|
|
31
|
+
},
|
|
32
|
+
]);
|
|
33
|
+
(0, config_1.saveConfig)({
|
|
34
|
+
POLY_API_BASE_URL: polyApiBaseUrl,
|
|
35
|
+
POLY_API_KEY: polyApiKey,
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
exports.default = setup;
|
|
39
|
+
//# sourceMappingURL=setup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.js","sourceRoot":"","sources":["../../src/commands/setup.ts"],"names":[],"mappings":";;;;;AA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
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.saveConfig = exports.loadConfig = void 0;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const dotenv_1 = __importDefault(require("dotenv"));
|
|
9
|
+
const constants_1 = require("./constants");
|
|
10
|
+
const POLY_USER_FOLDER_PATH = `${__dirname}/../../${constants_1.POLY_USER_FOLDER_NAME}`;
|
|
11
|
+
const POLY_CONFIG_FILE_PATH = `${POLY_USER_FOLDER_PATH}/.config.env`;
|
|
12
|
+
const loadConfig = () => {
|
|
13
|
+
if (fs_1.default.existsSync(POLY_CONFIG_FILE_PATH)) {
|
|
14
|
+
dotenv_1.default.config({ path: POLY_CONFIG_FILE_PATH });
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
exports.loadConfig = loadConfig;
|
|
18
|
+
const saveConfig = (config) => {
|
|
19
|
+
fs_1.default.mkdirSync(POLY_USER_FOLDER_PATH, { recursive: true });
|
|
20
|
+
fs_1.default.writeFileSync(POLY_CONFIG_FILE_PATH, Object.entries(config)
|
|
21
|
+
.map(([key, value]) => `${key}=${value}`)
|
|
22
|
+
.join('\n'));
|
|
23
|
+
};
|
|
24
|
+
exports.saveConfig = saveConfig;
|
|
25
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,oDAA4B;AAC5B,2CAAoD;AAEpD,MAAM,qBAAqB,GAAG,GAAG,SAAS,UAAU,iCAAqB,EAAE,CAAC;AAC5E,MAAM,qBAAqB,GAAG,GAAG,qBAAqB,cAAc,CAAC;AAE9D,MAAM,UAAU,GAAG,GAAG,EAAE;IAC7B,IAAI,YAAE,CAAC,UAAU,CAAC,qBAAqB,CAAC,EAAE;QACxC,gBAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,qBAAqB,EAAE,CAAC,CAAC;KAChD;AACH,CAAC,CAAC;AAJW,QAAA,UAAU,cAIrB;AAEK,MAAM,UAAU,GAAG,CAAC,MAA8B,EAAE,EAAE;IAC3D,YAAE,CAAC,SAAS,CAAC,qBAAqB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACzD,YAAE,CAAC,aAAa,CACd,qBAAqB,EACrB,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC;SACnB,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,IAAI,KAAK,EAAE,CAAC;SACxC,IAAI,CAAC,IAAI,CAAC,CACd,CAAC;AACJ,CAAC,CAAC;AARW,QAAA,UAAU,cAQrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,iBAAiB,CAAC;AAClD,eAAO,MAAM,qBAAqB,UAAU,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.POLY_USER_FOLDER_NAME = exports.POLY_HEADER_API_KEY = void 0;
|
|
4
|
+
exports.POLY_HEADER_API_KEY = 'X-PolyApiKey';
|
|
5
|
+
exports.POLY_USER_FOLDER_NAME = `.poly`;
|
|
6
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,mBAAmB,GAAG,cAAc,CAAC;AACrC,QAAA,qBAAqB,GAAG,OAAO,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{{#each contextFiles}}
|
|
2
|
+
/// <reference path="./{{this}}" />
|
|
3
|
+
{{/each}}
|
|
4
|
+
|
|
5
|
+
export = poly;
|
|
6
|
+
export as namespace poly;
|
|
7
|
+
|
|
8
|
+
declare const poly: poly.Poly;
|
|
9
|
+
|
|
10
|
+
declare namespace poly {
|
|
11
|
+
interface Poly {}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface ErrorEvent {
|
|
15
|
+
message: string;
|
|
16
|
+
data?: unknown;
|
|
17
|
+
status?: number;
|
|
18
|
+
statusText?: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
interface ErrorHandler {
|
|
22
|
+
on: (path: string, handler: (error: ErrorEvent) => void) => void;
|
|
23
|
+
off: (path: string) => void;
|
|
24
|
+
}
|
|
25
|
+
export const errorHandler: ErrorHandler;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
const axios = require('axios');
|
|
2
|
+
const set = require('lodash/set');
|
|
3
|
+
const { io } = require("socket.io-client");
|
|
4
|
+
const { v4: uuidv4 } = require('uuid');
|
|
5
|
+
|
|
6
|
+
const clientID = uuidv4();
|
|
7
|
+
let socket = null;
|
|
8
|
+
const getSocket = () => {
|
|
9
|
+
if (!socket) {
|
|
10
|
+
socket = io('{{apiBaseUrl}}/events');
|
|
11
|
+
}
|
|
12
|
+
return socket;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const functions = [
|
|
16
|
+
{{#each functions}}
|
|
17
|
+
{{#if context}}
|
|
18
|
+
['{{context}}.{{name}}', '{{id}}'],
|
|
19
|
+
{{else}}
|
|
20
|
+
['{{name}}', '{{id}}'],
|
|
21
|
+
{{/if}}
|
|
22
|
+
{{/each}}
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
const webhookHandles = [
|
|
26
|
+
{{#each webhookHandles}}
|
|
27
|
+
{{#if context}}
|
|
28
|
+
['{{context}}.{{alias}}', '{{id}}'],
|
|
29
|
+
{{else}}
|
|
30
|
+
['{{alias}}', '{{id}}'],
|
|
31
|
+
{{/if}}
|
|
32
|
+
{{/each}}
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
const errorHandler = {
|
|
36
|
+
on: (path, callback) => {
|
|
37
|
+
const socket = getSocket();
|
|
38
|
+
socket.emit('registerErrorHandler', {
|
|
39
|
+
clientID,
|
|
40
|
+
path,
|
|
41
|
+
apiKey: '{{apiKey}}'
|
|
42
|
+
});
|
|
43
|
+
socket.on(`handleError:${path}`, callback);
|
|
44
|
+
},
|
|
45
|
+
off: (path) => {
|
|
46
|
+
const socket = getSocket();
|
|
47
|
+
socket.emit('unregisterErrorHandler', {
|
|
48
|
+
clientID,
|
|
49
|
+
path,
|
|
50
|
+
apiKey: '{{apiKey}}'
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const registerWebhookEventListener = (webhookHandleID, callback) => {
|
|
56
|
+
const socket = getSocket();
|
|
57
|
+
socket.emit('registerWebhookEventHandler', {
|
|
58
|
+
clientID,
|
|
59
|
+
webhookHandleID,
|
|
60
|
+
apiKey: '{{apiKey}}'
|
|
61
|
+
});
|
|
62
|
+
socket.on(`handleWebhookEvent:${webhookHandleID}`, callback);
|
|
63
|
+
|
|
64
|
+
return () => {
|
|
65
|
+
socket.emit('unregisterWebhookEventHandler', {
|
|
66
|
+
clientID,
|
|
67
|
+
webhookHandleID,
|
|
68
|
+
apiKey: '{{apiKey}}'
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
module.exports = {
|
|
74
|
+
...functions.reduce(
|
|
75
|
+
(acc, [name, id]) => set(acc, name, (...args) => axios.post(`{{apiBaseUrl}}/function/execute/${id}`, { clientID, args }).then(({ data }) => data)),
|
|
76
|
+
{}
|
|
77
|
+
),
|
|
78
|
+
...webhookHandles.reduce(
|
|
79
|
+
(acc, [alias, id]) => set(acc, alias, (callback) => registerWebhookEventListener(id, callback)),
|
|
80
|
+
{}
|
|
81
|
+
),
|
|
82
|
+
|
|
83
|
+
errorHandler
|
|
84
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import poly = require("./index");
|
|
2
|
+
|
|
3
|
+
type UnregisterWebhookEventListenerType = () => void;
|
|
4
|
+
|
|
5
|
+
{{returnTypeDefinitions}}
|
|
6
|
+
{{webhookHandlesEventTypeDefinitions}}
|
|
7
|
+
declare module "./index" {
|
|
8
|
+
interface {{interfaceName}} {
|
|
9
|
+
{{#each subContexts}}
|
|
10
|
+
{{name}}: {{interfaceName}};
|
|
11
|
+
{{/each}}
|
|
12
|
+
{{#each functions}}
|
|
13
|
+
{{name}}: ({{#each arguments}}{{name}}: {{type}}{{#unless @last}}, {{/unless}}{{/each}}) => {{{returnType}}};
|
|
14
|
+
{{/each}}
|
|
15
|
+
{{#each webhookHandles}}
|
|
16
|
+
{{alias}}: (callback: (event: {{{eventType}}}) => any) => UnregisterWebhookEventListenerType;
|
|
17
|
+
{{/each}}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"program":{"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.dom.iterable.d.ts","../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../node_modules/typescript/lib/lib.scripthost.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/typescript/lib/lib.es2019.intl.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.date.d.ts","../node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.es2020.number.d.ts","../node_modules/typescript/lib/lib.esnext.intl.d.ts","../node_modules/typescript/lib/lib.es2017.full.d.ts","../node_modules/axios/index.d.ts","../src/constants.ts","../../common/build/src/dto/function.dto.d.ts","../../common/build/src/dto/teach.dto.d.ts","../../common/build/src/dto/teach-details.dto.d.ts","../../common/build/src/dto/teach-response.dto.d.ts","../../common/build/src/dto/execute-function.dto.d.ts","../../common/build/src/dto/update-function.dto.d.ts","../../common/build/src/dto/post-question.dto.d.ts","../../common/build/src/dto/post-question-response.dto.d.ts","../../common/build/src/dto/error-handler.dto.d.ts","../../common/build/src/dto/webhook-handle.dto.d.ts","../../common/build/src/dto/webhook-event-handler.dto.d.ts","../../common/build/src/dto/register-webhook-handle.dto.d.ts","../../common/build/src/dto/index.d.ts","../../common/build/src/poly-function.d.ts","../../common/build/src/chat.d.ts","../../common/build/src/event.d.ts","../../common/build/src/index.d.ts","../src/api.ts","../../../node_modules/@types/yargs-parser/index.d.ts","../../../node_modules/@types/yargs/index.d.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/assert/strict.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/dns/promises.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/dom-events.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/readline/promises.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/stream/promises.d.ts","../../../node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/@types/node/stream/web.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/test.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/timers/promises.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/globals.global.d.ts","../../../node_modules/@types/node/index.d.ts","../node_modules/dotenv/lib/main.d.ts","../src/config.ts","../src/commands/setup.ts","../node_modules/handlebars/types/index.d.ts","../node_modules/@types/lodash/common/common.d.ts","../node_modules/@types/lodash/common/array.d.ts","../node_modules/@types/lodash/common/collection.d.ts","../node_modules/@types/lodash/common/date.d.ts","../node_modules/@types/lodash/common/function.d.ts","../node_modules/@types/lodash/common/lang.d.ts","../node_modules/@types/lodash/common/math.d.ts","../node_modules/@types/lodash/common/number.d.ts","../node_modules/@types/lodash/common/object.d.ts","../node_modules/@types/lodash/common/seq.d.ts","../node_modules/@types/lodash/common/string.d.ts","../node_modules/@types/lodash/common/util.d.ts","../node_modules/@types/lodash/index.d.ts","../node_modules/@types/lodash/set.d.ts","../node_modules/chalk/index.d.ts","../node_modules/@guanghechen/helper-string/lib/types/index.d.ts","../src/commands/generate.ts","../src/cli.ts","../../../node_modules/@babel/types/lib/index.d.ts","../../../node_modules/@types/babel__generator/index.d.ts","../../../node_modules/@babel/parser/typings/babel-parser.d.ts","../../../node_modules/@types/babel__template/index.d.ts","../../../node_modules/@types/babel__traverse/index.d.ts","../../../node_modules/@types/babel__core/index.d.ts","../../../node_modules/@types/connect/index.d.ts","../../../node_modules/@types/body-parser/index.d.ts","../../../node_modules/@types/cookie/index.d.ts","../../../node_modules/@types/cookiejar/index.d.ts","../../../node_modules/@types/cors/index.d.ts","../../../node_modules/@types/eslint/helpers.d.ts","../../../node_modules/@types/estree/index.d.ts","../../../node_modules/@types/json-schema/index.d.ts","../../../node_modules/@types/eslint/index.d.ts","../../../node_modules/@types/eslint-scope/index.d.ts","../../../node_modules/@types/range-parser/index.d.ts","../../../node_modules/@types/qs/index.d.ts","../../../node_modules/@types/express-serve-static-core/index.d.ts","../../../node_modules/@types/mime/Mime.d.ts","../../../node_modules/@types/mime/index.d.ts","../../../node_modules/@types/serve-static/index.d.ts","../../../node_modules/@types/express/index.d.ts","../../../node_modules/@types/graceful-fs/index.d.ts","../../../node_modules/@types/istanbul-lib-coverage/index.d.ts","../../../node_modules/@types/istanbul-lib-report/index.d.ts","../../../node_modules/@types/istanbul-reports/index.d.ts","../../../node_modules/@jest/expect-utils/build/index.d.ts","../../../node_modules/chalk/index.d.ts","../../../node_modules/@sinclair/typebox/typebox.d.ts","../../../node_modules/@jest/schemas/build/index.d.ts","../../../node_modules/pretty-format/build/index.d.ts","../../../node_modules/jest-diff/build/index.d.ts","../../../node_modules/jest-matcher-utils/build/index.d.ts","../../../node_modules/expect/build/index.d.ts","../../../node_modules/@types/jest/index.d.ts","../../../node_modules/@types/jsonpath/index.d.ts","../../../node_modules/@types/mustache/index.d.ts","../../../node_modules/@types/parse-json/index.d.ts","../../../node_modules/@types/prettier/index.d.ts","../../../node_modules/@types/semver/classes/semver.d.ts","../../../node_modules/@types/semver/functions/parse.d.ts","../../../node_modules/@types/semver/functions/valid.d.ts","../../../node_modules/@types/semver/functions/clean.d.ts","../../../node_modules/@types/semver/functions/inc.d.ts","../../../node_modules/@types/semver/functions/diff.d.ts","../../../node_modules/@types/semver/functions/major.d.ts","../../../node_modules/@types/semver/functions/minor.d.ts","../../../node_modules/@types/semver/functions/patch.d.ts","../../../node_modules/@types/semver/functions/prerelease.d.ts","../../../node_modules/@types/semver/functions/compare.d.ts","../../../node_modules/@types/semver/functions/rcompare.d.ts","../../../node_modules/@types/semver/functions/compare-loose.d.ts","../../../node_modules/@types/semver/functions/compare-build.d.ts","../../../node_modules/@types/semver/functions/sort.d.ts","../../../node_modules/@types/semver/functions/rsort.d.ts","../../../node_modules/@types/semver/functions/gt.d.ts","../../../node_modules/@types/semver/functions/lt.d.ts","../../../node_modules/@types/semver/functions/eq.d.ts","../../../node_modules/@types/semver/functions/neq.d.ts","../../../node_modules/@types/semver/functions/gte.d.ts","../../../node_modules/@types/semver/functions/lte.d.ts","../../../node_modules/@types/semver/functions/cmp.d.ts","../../../node_modules/@types/semver/functions/coerce.d.ts","../../../node_modules/@types/semver/classes/comparator.d.ts","../../../node_modules/@types/semver/classes/range.d.ts","../../../node_modules/@types/semver/functions/satisfies.d.ts","../../../node_modules/@types/semver/ranges/max-satisfying.d.ts","../../../node_modules/@types/semver/ranges/min-satisfying.d.ts","../../../node_modules/@types/semver/ranges/to-comparators.d.ts","../../../node_modules/@types/semver/ranges/min-version.d.ts","../../../node_modules/@types/semver/ranges/valid.d.ts","../../../node_modules/@types/semver/ranges/outside.d.ts","../../../node_modules/@types/semver/ranges/gtr.d.ts","../../../node_modules/@types/semver/ranges/ltr.d.ts","../../../node_modules/@types/semver/ranges/intersects.d.ts","../../../node_modules/@types/semver/ranges/simplify.d.ts","../../../node_modules/@types/semver/ranges/subset.d.ts","../../../node_modules/@types/semver/internals/identifiers.d.ts","../../../node_modules/@types/semver/index.d.ts","../../../node_modules/@types/stack-utils/index.d.ts","../../../node_modules/buffer/index.d.ts","../../../node_modules/@types/superagent/index.d.ts","../../../node_modules/@types/supertest/index.d.ts","../../../node_modules/@types/urijs/dom-monkeypatch.d.ts","../../../node_modules/@types/urijs/index.d.ts","../../../node_modules/@types/validator/lib/isBoolean.d.ts","../../../node_modules/@types/validator/lib/isEmail.d.ts","../../../node_modules/@types/validator/lib/isFQDN.d.ts","../../../node_modules/@types/validator/lib/isIBAN.d.ts","../../../node_modules/@types/validator/lib/isISO31661Alpha2.d.ts","../../../node_modules/@types/validator/lib/isISO4217.d.ts","../../../node_modules/@types/validator/lib/isURL.d.ts","../../../node_modules/@types/validator/lib/isTaxID.d.ts","../../../node_modules/@types/validator/index.d.ts"],"fileInfos":[{"version":"8730f4bf322026ff5229336391a18bcaa1f94d4f82416c8b2f3954e2ccaae2ba","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","4b421cbfb3a38a27c279dec1e9112c3d1da296f77a1a85ddadf7e7a425d45d18","1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9",{"version":"3aafcb693fe5b5c3bd277bd4c3a617b53db474fe498fc5df067c5603b1eebde7","affectsGlobalScope":true},{"version":"f3d4da15233e593eacb3965cde7960f3fddf5878528d882bcedd5cbaba0193c7","affectsGlobalScope":true},{"version":"7fac8cb5fc820bc2a59ae11ef1c5b38d3832c6d0dfaec5acdb5569137d09a481","affectsGlobalScope":true},{"version":"097a57355ded99c68e6df1b738990448e0bf170e606707df5a7c0481ff2427cd","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"8cc8c5a3bac513368b0157f3d8b31cfdcfe78b56d3724f30f80ed9715e404af8","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"5f406584aef28a331c36523df688ca3650288d14f39c5d2e555c95f0d2ff8f6f","affectsGlobalScope":true},{"version":"22f230e544b35349cfb3bd9110b6ef37b41c6d6c43c3314a31bd0d9652fcec72","affectsGlobalScope":true},{"version":"7ea0b55f6b315cf9ac2ad622b0a7813315bb6e97bf4bb3fbf8f8affbca7dc695","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"eb26de841c52236d8222f87e9e6a235332e0788af8c87a71e9e210314300410a","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"81cac4cbc92c0c839c70f8ffb94eb61e2d32dc1c3cf6d95844ca099463cf37ea","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"5e5e095c4470c8bab227dbbc61374878ecead104c74ab9960d3adcccfee23205","affectsGlobalScope":true},{"version":"09aa50414b80c023553090e2f53827f007a301bc34b0495bfb2c3c08ab9ad1eb","affectsGlobalScope":true},{"version":"d7f680a43f8cd12a6b6122c07c54ba40952b0c8aa140dcfcf32eb9e6cb028596","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"2768ef564cfc0689a1b76106c421a2909bdff0acbe87da010785adab80efdd5c","affectsGlobalScope":true},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true},{"version":"52d1bb7ab7a3306fd0375c8bff560feed26ed676a5b0457fa8027b563aecb9a4","affectsGlobalScope":true},"d2f31f19e1ba6ed59be9259d660a239d9a3fcbbc8e038c6b2009bde34b175fed","17affcd8cc646e7f05e4b96d325b893d22542dd2c2c63ead572ca1bea346ebc9",{"version":"b72fcc91fef6d70201b323748308b3ec288a19a1efeaa618f4d92c5c57dabd4e","signature":"3aec5eefbf0ed1ba71047caeb052a6c1c66af0d5d6ad0d8f3d589a81c7833857"},"f32481cdf5239f881e41e9d8d0207d7bba0c9f0d89b57a801a0bcc79d803c235","6e687fea7f406a16b543c909fe5d497a1b4eb38656feb09cbfe235e255758fef","8b6d5bb3b11e8b8560404f8b936e0356a08e250cb838dca510880c67df2dbb28","d0333068ebde49fe08d6259dc593704d1e45b8517326876a42291f4d2ece19ea","0c5a9ae78715f76cc756dd3c7bbe23b0cd6766e3a154875a4319d44620e81a90","0a1ac9dbce2a51b41448c26fc268001cd770e3ad1a3ea73aa22f45b8f348723f","e79c7dcb98d2d0efd60ca7f5d31dc661035117993751b9ca04ba0e52d9b26c59","ef7f3d63a04ec4792b0c9442e6b076f9380c1c8f9727a5fcd08d38ffa30fd9c1","7eea5ac97c83b3e3836cff0592fd299845ab1be6b3cf910efd3337c4fa3f535a","c844a9693b31db0bd26bb35ca7d4b1483830fda67e490b4c52442a36ae0c4dfe","a6123a6220561eb8b65d00f450407e8bc9fc1267c6ba5ec57832cf0df6fad0ea","3e0b347ef53370f68b89b7a05ae7ef71562936d04904a7f05ab0f547edb9e5d6","bed8cafc540c29d94e30de15e155f0469b95357502745be248bce9e10b9cf521","354356301b39b5653da8b8d836f2edfdec7dbc289f0d2bb1e7e33185e81f6738","219227e47acde27f9ec85a36e97b2c4bd5c32a328387ff5c6d69b45f54e87ca9","1641908fa1c2dda900f120f9cb010c1244ba1c179e9af75ac4524bde54e5d304","0f90be2e2be5b5c658affac5bfb630bdbdfeccfde0674e7b7ef0fc933d5ad660",{"version":"c0650bcf9b42179e4a73f8cc5b9a8522460fc0686ef0550486ba1e243e249e32","signature":"1608513227eeb872aac00e3a3418461b130d6c2af52a03d7658e84c6b0f29ab4"},"70e9a18da08294f75bf23e46c7d69e67634c0765d355887b9b41f0d959e1426e","ae84439d1ae42b30ced3df38c4285f35b805be40dfc95b0647d0e59c70b11f97","7e771891adaa85b690266bc37bd6eb43bc57eecc4b54693ead36467e7369952a","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"ca72190df0eb9b09d4b600821c8c7b6c9747b75a1c700c4d57dc0bb72abc074c","affectsGlobalScope":true},"21a167fec8f933752fb8157f06d28fab6817af3ad9b0bdb1908a10762391eab9",{"version":"bb65c6267c5d6676be61acbf6604cf0a4555ac4b505df58ac15c831fcbff4e3e","affectsGlobalScope":true},"374ca798f244e464346f14301dc2a8b4b111af1a83b49fffef5906c338a1f922","5a94487653355b56018122d92392beb2e5f4a6c63ba5cef83bbe1c99775ef713",{"version":"d5135ad93b33adcce80b18f8065087934cdc1730d63db58562edcf017e1aad9b","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","dab86d9604fe40854ef3c0a6f9e8948873dc3509213418e5e457f410fd11200f","bb9c4ffa5e6290c6980b63c815cdd1625876dadb2efaf77edbe82984be93e55e","489532ff54b714f0e0939947a1c560e516d3ae93d51d639ab02e907a0e950114","f30bb836526d930a74593f7b0f5c1c46d10856415a8f69e5e2fc3db80371e362","14b5aa23c5d0ae1907bc696ac7b6915d88f7d85799cc0dc2dcf98fbce2c5a67c","5c439dafdc09abe4d6c260a96b822fa0ba5be7203c71a63ab1f1423cd9e838ea",{"version":"6b526a5ec4a401ca7c26cfe6a48e641d8f30af76673bad3b06a1b4504594a960","affectsGlobalScope":true},{"version":"816ad2e607a96de5bcac7d437f843f5afd8957f1fa5eefa6bba8e4ed7ca8fd84","affectsGlobalScope":true},"cec36af22f514322f870e81d30675c78df82ae8bf4863f5fd4e4424c040c678d","d903fafe96674bc0b2ac38a5be4a8fc07b14c2548d1cdb165a80ea24c44c0c54","5eec82ac21f84d83586c59a16b9b8502d34505d1393393556682fe7e7fde9ef2","04eb6578a588d6a46f50299b55f30e3a04ef27d0c5a46c57d8fcc211cd530faa","8d3c583a07e0c37e876908c2d5da575019f689df8d9fa4c081d99119d53dba22","2c828a5405191d006115ab34e191b8474bc6c86ffdc401d1a9864b1b6e088a58",{"version":"e8b18c6385ff784228a6f369694fcf1a6b475355ba89090a88de13587a9391d5","affectsGlobalScope":true},"d076fede3cb042e7b13fc29442aaa03a57806bc51e2b26a67a01fbc66a7c0c12","7c013aa892414a7fdcfd861ae524a668eaa3ede8c7c0acafaf611948122c8d93","b0973c3cbcdc59b37bf477731d468696ecaf442593ec51bab497a613a580fe30",{"version":"4989e92ba5b69b182d2caaea6295af52b7dc73a4f7a2e336a676722884e7139d","affectsGlobalScope":true},{"version":"b3624aed92dab6da8484280d3cb3e2f4130ec3f4ef3f8201c95144ae9e898bb6","affectsGlobalScope":true},"5153a2fd150e46ce57bb3f8db1318d33f6ad3261ed70ceeff92281c0608c74a3","210d54cd652ec0fec8c8916e4af59bb341065576ecda039842f9ffb2e908507c","36b03690b628eab08703d63f04eaa89c5df202e5f1edf3989f13ad389cd2c091","0effadd232a20498b11308058e334d3339cc5bf8c4c858393e38d9d4c0013dcf","25846d43937c672bab7e8195f3d881f93495df712ee901860effc109918938cc","fd93cee2621ff42dabe57b7be402783fd1aa69ece755bcba1e0290547ae60513","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff","69ee23dd0d215b09907ad30d23f88b7790c93329d1faf31d7835552a10cf7cbf","44b8b584a338b190a59f4f6929d072431950c7bd92ec2694821c11bce180c8a5","23b89798789dffbd437c0c423f5d02d11f9736aea73d6abf16db4f812ff36eda","223c37f62ce09a3d99e77498acdee7b2705a4ae14552fbdb4093600cd9164f3f",{"version":"970a90f76d4d219ad60819d61f5994514087ba94c985647a3474a5a3d12714ed","affectsGlobalScope":true},"e10177274a35a9d07c825615340b2fcde2f610f53f3fb40269fd196b4288dda6","4c8525f256873c7ba3135338c647eaf0ca7115a1a2805ae2d0056629461186ce","3c13ef48634e7b5012fcf7e8fce7496352c2d779a7201389ca96a2a81ee4314d","5d0a25ec910fa36595f85a67ac992d7a53dd4064a1ba6aea1c9f14ab73a023f2",{"version":"f0900cd5d00fe1263ff41201fb8073dbeb984397e4af3b8002a5c207a30bdc33","affectsGlobalScope":true},{"version":"4c50342e1b65d3bee2ed4ab18f84842d5724ad11083bd666d8705dc7a6079d80","affectsGlobalScope":true},"06d7c42d256f0ce6afe1b2b6cfbc97ab391f29dadb00dd0ae8e8f23f5bc916c3","ec4bd1b200670fb567920db572d6701ed42a9641d09c4ff6869768c8f81b404c","e59a892d87e72733e2a9ca21611b9beb52977be2696c7ba4b216cbbb9a48f5aa",{"version":"da26af7362f53d122283bc69fed862b9a9fe27e01bc6a69d1d682e0e5a4df3e6","affectsGlobalScope":true},"8a300fa9b698845a1f9c41ecbe2c5966634582a8e2020d51abcace9b55aa959e",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"8dbe725f8d237e70310977afcfa011629804d101ebaa0266cafda6b61ad72236","cfdd927a5eae7a7e623b9745722ef3f2b7a2997fddc5d32b7e3dcaeeb15ff4a3",{"version":"5b957b6314ee66e1944532c56feef51d4fb22dcb0d43cdec554f4f16624ec6c7","signature":"220575330bb27b2f8592008189217edf284789d47e08d04746eece744ee92d32"},{"version":"8cf1f9d29c85bfb98cb1bcbae37751a2c51afb6a17a7a0190c02e1111db8cb97","signature":"8c7de83338120e3156c26cd6a0c8691be5a32636158f9ffbe79d292ac8bd2e15"},{"version":"f3a68054f682f21cec1eb6bc37d3c4c7f73b7723c7256f8a1ccc75873024aaa6","affectsGlobalScope":true},"675e702f2032766a91eeadee64f51014c64688525da99dccd8178f0c599f13a8","458111fc89d11d2151277c822dfdc1a28fa5b6b2493cf942e37d4cd0a6ee5f22","d70c026dd2eeaa974f430ea229230a1897fdb897dc74659deebe2afd4feeb08f","187119ff4f9553676a884e296089e131e8cc01691c546273b1d0089c3533ce42","febf0b2de54781102b00f61653b21377390a048fbf5262718c91860d11ff34a6","98f9d826db9cd99d27a01a59ee5f22863df00ccf1aaf43e1d7db80ebf716f7c3","0aaef8cded245bf5036a7a40b65622dd6c4da71f7a35343112edbe112b348a1e","00baffbe8a2f2e4875367479489b5d43b5fc1429ecb4a4cc98cfc3009095f52a","dcd91d3b697cb650b95db5471189b99815af5db2a1cd28760f91e0b12ede8ed5","3c92b6dfd43cc1c2485d9eba5ff0b74a19bb8725b692773ef1d66dac48cda4bd","3cf0d343c2276842a5b617f22ba82af6322c7cfe8bb52238ffc0c491a3c21019","df996e25faa505f85aeb294d15ebe61b399cf1d1e49959cdfaf2cc0815c203f9",{"version":"f2eff8704452659641164876c1ef0df4174659ce7311b0665798ea3f556fa9ad","affectsGlobalScope":true},"05dd03486750d327568269b9f84aa51f15a066bcdc2ccefd8b592fb06fa3a371","0d14fa22c41fdc7277e6f71473b20ebc07f40f00e38875142335d5b63cdfc9d2","a52dc1b10e4b840f4a4939b9e6b4e1aa1363fcded03f7173f0d45b1035be413d",{"version":"f08f8c6297aa08d74068d4f4edf8eff0d74ac1835cfc24de495a77df795babd5","signature":"e4191137e757421654676b4ce2173085c6d0780fefd15e330c7359fc66b8dc97"},{"version":"b79391ad212eab9d1d01934f89a5a99b3f741e60726c90c6445ba13f2f162a25","signature":"43e818adf60173644896298637f47b01d5819b17eda46eaa32d0c7d64724d012"},"f4617bbd5403ec5b058db53b242dcb1421952e2652bd5c80abf6a1c4ea5656d6","cc957354aa3c94c9961ebf46282cfde1e81d107fc5785a61f62c67f1dd3ac2eb","230d323ef7f2ffadfc0ceae494492c4d2faa2b4eaec07a4b71424d084b97ebb8","93de1c6dab503f053efe8d304cb522bb3a89feab8c98f307a674a4fae04773e9","dae3d1adc67ac3dbd1cd471889301339ec439837b5df565982345be20c8fca9a","b6ddf3a46ccfa4441d8be84d2e9bf3087573c48804196faedbd4a25b60631beb","6d829824ead8999f87b6df21200df3c6150391b894b4e80662caa462bd48d073","afc559c1b93df37c25aef6b3dfa2d64325b0e112e887ee18bf7e6f4ec383fc90","117ffeecf6c55e25b6446f449ad079029b5e7317399b0a693858faaaea5ca73e","8d48b8f8a377ade8dd1f000625bc276eea067f2529cc9cafdf082d17142107d6","efdced704bd09db6984a2a26e3573bc43cdc2379bdef3bcff6cff77efe8ba82b",{"version":"64d4b35c5456adf258d2cf56c341e203a073253f229ef3208fc0d5020253b241","affectsGlobalScope":true},"946bd1737d9412395a8f24414c70f18660b84a75a12b0b448e6eb1a2161d06dd","f3e604694b624fa3f83f6684185452992088f5efb2cf136b62474aa106d6f1b6","4e75a89a181f3b091173e4c0828dec3fb1c24087d3bb4f37b4a31e0619e8336f","e050a0afcdbb269720a900c85076d18e0c1ab73e580202a2bf6964978181222a","16d51f964ec125ad2024cf03f0af444b3bc3ec3614d9345cc54d09bab45c9a4c","ba601641fac98c229ccd4a303f747de376d761babb33229bb7153bed9356c9cc",{"version":"c5dd1fef4cd4aaffc78786047bed5ae6fc1200d19a1946cbc4e2d3ed4d62c8fa","affectsGlobalScope":true},"5b9ecf7da4d71cf3832dbb8336150fa924631811f488ad4690c2dfec2b4fb1d7","951c85f75aac041dddbedfedf565886a7b494e29ec1532e2a9b4a6180560b50e","f47887b61c6cf2f48746980390d6cb5b8013518951d912cfb37fe748071942be","43cdd474c5aa3340da4816bb8f1ae7f3b1bcf9e70d997afc36a0f2c432378c84","bf88ef4208a770ca39a844b182b3695df536326ea566893fdc5b8418702a331e","8b06ac3faeacb8484d84ddb44571d8f410697f98d7bfa86c0fda60373a9f5215","7eb06594824ada538b1d8b48c3925a83e7db792f47a081a62cf3e5c4e23cf0ee","f5638f7c2f12a9a1a57b5c41b3c1ea7db3876c003bab68e6a57afd6bcc169af0","6c1e688f95fcaf53b1e41c0fdadf2c1cfc96fa924eaf7f9fdb60f96deb0a4986","0d14fa22c41fdc7277e6f71473b20ebc07f40f00e38875142335d5b63cdfc9d2","db25694be959314fd1e868d72e567746db1db9e2001fae545d12d2a8c1bba1b8","43883cf3635bb1846cbdc6c363787b76227677388c74f7313e3f0edb380840fa","2d47012580f859dae201d2eef898a416bdae719dffc087dfd06aefe3de2f9c8d","3e70a7e67c2cb16f8cd49097360c0309fe9d1e3210ff9222e9dac1f8df9d4fb6","ab68d2a3e3e8767c3fba8f80de099a1cfc18c0de79e42cb02ae66e22dfe14a66","2cec1a31729b9b01e9294c33fc9425d336eff067282809761ad2e74425d6d2a5",{"version":"0c3b45b6a42c0074fadd59c5d370592ca48c89a706d903452565ca89b1b2c164","affectsGlobalScope":true},"b8bc64f2a9515e7ba8b523260cf3b0a418eabfc556e5bee6fabd36b73f4789c2","a74476691118f376a4d42c9721f76c5c896e41393df98c7789589f618ad1dbd5","2b8264b2fefd7367e0f20e2c04eed5d3038831fe00f5efbc110ff0131aab899b","bc88e4049153bc4dddb4503ed7e624eb141edfa9064b3659d6c86e900fe9e621","2b93035328f7778d200252681c1d86285d501ed424825a18f81e4c3028aa51d9","2ac9c8332c5f8510b8bdd571f8271e0f39b0577714d5e95c1e79a12b2616f069","42c21aa963e7b86fa00801d96e88b36803188018d5ad91db2a9101bccd40b3ff","d31eb848cdebb4c55b4893b335a7c0cca95ad66dee13cbb7d0893810c0a9c301","77c1d91a129ba60b8c405f9f539e42df834afb174fe0785f89d92a2c7c16b77a","7a9e0a564fee396cacf706523b5aeed96e04c6b871a8bebefad78499fbffc5bc","906c751ef5822ec0dadcea2f0e9db64a33fb4ee926cc9f7efa38afe5d5371b2a","5387c049e9702f2d2d7ece1a74836a14b47fbebe9bbeb19f94c580a37c855351","c68391fb9efad5d99ff332c65b1606248c4e4a9f1dd9a087204242b56c7126d6","e9cf02252d3a0ced987d24845dcb1f11c1be5541f17e5daa44c6de2d18138d0c","e8b02b879754d85f48489294f99147aeccc352c760d95a6fe2b6e49cd400b2fe","9f6908ab3d8a86c68b86e38578afc7095114e66b2fc36a2a96e9252aac3998e0","0eedb2344442b143ddcd788f87096961cd8572b64f10b4afc3356aa0460171c6","71405cc70f183d029cc5018375f6c35117ffdaf11846c35ebf85ee3956b1b2a6","c68baff4d8ba346130e9753cefe2e487a16731bf17e05fdacc81e8c9a26aae9d","2cd15528d8bb5d0453aa339b4b52e0696e8b07e790c153831c642c3dea5ac8af","479d622e66283ffa9883fbc33e441f7fc928b2277ff30aacbec7b7761b4e9579","ade307876dc5ca267ca308d09e737b611505e015c535863f22420a11fffc1c54","f8cdefa3e0dee639eccbe9794b46f90291e5fd3989fcba60d2f08fde56179fb9","86c5a62f99aac7053976e317dbe9acb2eaf903aaf3d2e5bb1cafe5c2df7b37a8","2b300954ce01a8343866f737656e13243e86e5baef51bd0631b21dcef1f6e954","a2d409a9ffd872d6b9d78ead00baa116bbc73cfa959fce9a2f29d3227876b2a1","b288936f560cd71f4a6002953290de9ff8dfbfbf37f5a9391be5c83322324898","61178a781ef82e0ff54f9430397e71e8f365fc1e3725e0e5346f2de7b0d50dfa","6a6ccb37feb3aad32d9be026a3337db195979cd5727a616fc0f557e974101a54","c649ea79205c029a02272ef55b7ab14ada0903db26144d2205021f24727ac7a3","38e2b02897c6357bbcff729ef84c736727b45cc152abe95a7567caccdfad2a1d","d6610ea7e0b1a7686dba062a1e5544dd7d34140f4545305b7c6afaebfb348341","3dee35db743bdba2c8d19aece7ac049bde6fa587e195d86547c882784e6ba34c","b15e55c5fa977c2f25ca0b1db52cfa2d1fd4bf0baf90a8b90d4a7678ca462ff1","f41d30972724714763a2698ae949fbc463afb203b5fa7c4ad7e4de0871129a17","843dd7b6a7c6269fd43827303f5cbe65c1fecabc30b4670a50d5a15d57daeeb9","f06d8b8567ee9fd799bf7f806efe93b67683ef24f4dea5b23ef12edff4434d9d","6017384f697ff38bc3ef6a546df5b230c3c31329db84cbfe686c83bec011e2b2","e1a5b30d9248549ca0c0bb1d653bafae20c64c4aa5928cc4cd3017b55c2177b0","a593632d5878f17295bd53e1c77f27bf4c15212822f764a2bfc1702f4b413fa0","a868a534ba1c2ca9060b8a13b0ffbbbf78b4be7b0ff80d8c75b02773f7192c29","da7545aba8f54a50fde23e2ede00158dc8112560d934cee58098dfb03aae9b9d","34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","6aee496bf0ecfbf6731aa8cca32f4b6e92cdc0a444911a7d88410408a45ecc5d","b0d10e46cfe3f6c476b69af02eaa38e4ccc7430221ce3109ae84bb9fb8282298","4967529644e391115ca5592184d4b63980569adf60ee685f968fd59ab1557188","29c5862cadd1c5e069453c60e8b240870431396921a50afc57bfdf5bdc614e47","76232dbb982272b182a76ad8745a9b02724dc9896e2328ce360e2c56c64c9778",{"version":"159733de19927f949b83112a45b7c52ebc0bbad1605a668d5c19ba65e0ee9128","affectsGlobalScope":true},{"version":"c16dbaa3868bacd3383a553f462f20fa8fa671dfa1e92ac464a5c7ffcfcc37c9","affectsGlobalScope":true},"ecb3f7a39c52816137f9a87278225ce7f522c6e493c46bb2fff2c2cc2ba0e2d4","31d26ca7224d3ef8d3d5e1e95aefba1c841dcb94edcdf9aaa23c7de437f0e4a2","c5b3da7e2ecd5968f723282aba49d8d1a2e178d0afe48998dad93f81e2724091","3e4ba3ecd2f4b94e22c38ff57b944e43591cac6fd4d83e3f58157f04524d8da6","4b8e57cbc17c20af9d4824447c89f0749f3aa1ec7267e4b982c95b1e2a01fab7","37d6dd79947b8c3f5eb759bd092d7c9b844d3655e547d16c3f2138d8d637674e","c96700cd147d5926d56ec9b45a66d6c8a86def5e94806157fa17c68831a6337f","f6688a02946a3f7490aa9e26d76d1c97a388e42e77388cbab010b69982c86e9e","526b135a7fe91b400b5b642aeb9ede972fa8271ea61481a0fb99a283aa24fbae"],"options":{"allowSyntheticDefaultImports":true,"declaration":true,"declarationMap":true,"emitDecoratorMetadata":true,"esModuleInterop":true,"experimentalDecorators":true,"module":1,"noFallthroughCasesInSwitch":false,"noImplicitAny":false,"outDir":"./","removeComments":true,"skipLibCheck":true,"sourceMap":true,"strictBindCallApply":false,"strictNullChecks":false,"target":4},"fileIdsList":[[115,145],[115],[115,174],[115,145,146,147,148,149],[115,145,147],[88,115,122,151],[88,115,122],[115,157,159],[115,156,157,158],[85,88,115,122,161,162],[115,152,162,163,166],[86,115,122],[115,169],[115,170],[115,176,179],[115,165],[115,164],[69,115],[72,115],[73,78,106,115],[74,85,86,93,103,114,115],[74,75,85,93,115],[76,115],[77,78,86,94,115],[78,103,111,115],[79,81,85,93,115],[80,115],[81,82,115],[85,115],[83,85,115],[85,86,87,103,114,115],[85,86,87,100,103,106,115],[115,119],[81,88,93,103,114,115],[85,86,88,89,93,103,111,114,115],[88,90,103,111,114,115],[69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121],[85,91,115],[92,114,115],[81,85,93,103,115],[94,115],[95,115],[72,96,115],[97,113,115,119],[98,115],[99,115],[85,100,101,115],[100,102,115,117],[73,85,103,104,105,106,115],[73,103,105,115],[103,104,115],[106,115],[107,115],[85,109,110,115],[109,110,115],[78,93,103,111,115],[112,115],[93,113,115],[73,88,99,114,115],[78,115],[103,115,116],[115,117],[115,118],[73,78,85,87,96,103,114,115,117,119],[103,115,120],[115,185,224],[115,185,209,224],[115,224],[115,185],[115,185,210,224],[115,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223],[115,210,224],[88,115,122,165],[73,86,88,103,115,122,154],[115,227],[115,229],[115,231,232,233,234,235,236,237,238],[115,239],[67,115],[115,172,178],[115,176],[115,141,177],[115,175],[115,127,129,130,131,132,133,134,135,136,137,138,139],[115,127,128,130,131,132,133,134,135,136,137,138,139],[115,128,129,130,131,132,133,134,135,136,137,138,139],[115,127,128,129,131,132,133,134,135,136,137,138,139],[115,127,128,129,130,132,133,134,135,136,137,138,139],[115,127,128,129,130,131,133,134,135,136,137,138,139],[115,127,128,129,130,131,132,134,135,136,137,138,139],[115,127,128,129,130,131,132,133,135,136,137,138,139],[115,127,128,129,130,131,132,133,134,136,137,138,139],[115,127,128,129,130,131,132,133,134,135,137,138,139],[115,127,128,129,130,131,132,133,134,135,136,138,139],[115,127,128,129,130,131,132,133,134,135,136,137,139],[115,127,128,129,130,131,132,133,134,135,136,137,138],[115,139],[115,122],[47,48,65,115],[68,115,124,125,143],[48,65,66,86,115,124,126,140,141,142],[115,124],[48,86,115,123],[65,115],[49,50,51,52,53,54,55,56,57,58,59,60,115],[61,62,63,64,115],[65]],"referencedMap":[[147,1],[145,2],[172,2],[175,3],[174,2],[150,4],[146,1],[148,5],[149,1],[152,6],[151,7],[153,2],[154,2],[155,7],[160,8],[156,2],[159,9],[157,2],[163,10],[167,11],[168,12],[169,2],[170,13],[171,14],[180,15],[158,2],[181,2],[164,16],[165,17],[182,2],[69,18],[70,18],[72,19],[73,20],[74,21],[75,22],[76,23],[77,24],[78,25],[79,26],[80,27],[81,28],[82,28],[84,29],[83,30],[85,29],[86,31],[87,32],[71,33],[121,2],[88,34],[89,35],[90,36],[122,37],[91,38],[92,39],[93,40],[94,41],[95,42],[96,43],[97,44],[98,45],[99,46],[100,47],[101,47],[102,48],[103,49],[105,50],[104,51],[106,52],[107,53],[108,2],[109,54],[110,55],[111,56],[112,57],[113,58],[114,59],[115,60],[116,61],[117,62],[118,63],[119,64],[120,65],[183,2],[184,2],[162,2],[161,2],[209,66],[210,67],[185,68],[188,68],[207,66],[208,66],[198,66],[197,69],[195,66],[190,66],[203,66],[201,66],[205,66],[189,66],[202,66],[206,66],[191,66],[192,66],[204,66],[186,66],[193,66],[194,66],[196,66],[200,66],[211,70],[199,66],[187,66],[224,71],[223,2],[218,70],[220,72],[219,70],[212,70],[213,70],[215,70],[217,70],[221,72],[222,72],[214,72],[216,72],[166,73],[225,2],[227,74],[228,75],[229,2],[230,76],[239,77],[231,78],[232,2],[233,2],[234,2],[235,2],[236,2],[238,2],[237,2],[67,2],[68,79],[226,2],[173,2],[179,80],[177,81],[178,82],[176,83],[142,2],[128,84],[129,85],[127,86],[130,87],[131,88],[132,89],[133,90],[134,91],[135,92],[136,93],[137,94],[138,95],[139,96],[140,97],[47,2],[141,2],[123,98],[126,2],[8,2],[9,2],[13,2],[12,2],[2,2],[14,2],[15,2],[16,2],[17,2],[18,2],[19,2],[20,2],[21,2],[3,2],[4,2],[46,2],[25,2],[22,2],[23,2],[24,2],[26,2],[27,2],[28,2],[5,2],[29,2],[30,2],[31,2],[32,2],[6,2],[36,2],[33,2],[34,2],[35,2],[37,2],[7,2],[38,2],[43,2],[44,2],[39,2],[40,2],[41,2],[42,2],[1,2],[45,2],[11,2],[10,2],[66,99],[144,100],[143,101],[125,102],[124,103],[48,2],[63,2],[57,2],[53,2],[49,104],[61,105],[56,104],[55,2],[60,2],[51,2],[52,2],[50,104],[54,2],[59,2],[58,2],[64,2],[65,106],[62,2]],"exportedModulesMap":[[147,1],[145,2],[172,2],[175,3],[174,2],[150,4],[146,1],[148,5],[149,1],[152,6],[151,7],[153,2],[154,2],[155,7],[160,8],[156,2],[159,9],[157,2],[163,10],[167,11],[168,12],[169,2],[170,13],[171,14],[180,15],[158,2],[181,2],[164,16],[165,17],[182,2],[69,18],[70,18],[72,19],[73,20],[74,21],[75,22],[76,23],[77,24],[78,25],[79,26],[80,27],[81,28],[82,28],[84,29],[83,30],[85,29],[86,31],[87,32],[71,33],[121,2],[88,34],[89,35],[90,36],[122,37],[91,38],[92,39],[93,40],[94,41],[95,42],[96,43],[97,44],[98,45],[99,46],[100,47],[101,47],[102,48],[103,49],[105,50],[104,51],[106,52],[107,53],[108,2],[109,54],[110,55],[111,56],[112,57],[113,58],[114,59],[115,60],[116,61],[117,62],[118,63],[119,64],[120,65],[183,2],[184,2],[162,2],[161,2],[209,66],[210,67],[185,68],[188,68],[207,66],[208,66],[198,66],[197,69],[195,66],[190,66],[203,66],[201,66],[205,66],[189,66],[202,66],[206,66],[191,66],[192,66],[204,66],[186,66],[193,66],[194,66],[196,66],[200,66],[211,70],[199,66],[187,66],[224,71],[223,2],[218,70],[220,72],[219,70],[212,70],[213,70],[215,70],[217,70],[221,72],[222,72],[214,72],[216,72],[166,73],[225,2],[227,74],[228,75],[229,2],[230,76],[239,77],[231,78],[232,2],[233,2],[234,2],[235,2],[236,2],[238,2],[237,2],[67,2],[68,79],[226,2],[173,2],[179,80],[177,81],[178,82],[176,83],[142,2],[128,84],[129,85],[127,86],[130,87],[131,88],[132,89],[133,90],[134,91],[135,92],[136,93],[137,94],[138,95],[139,96],[140,97],[47,2],[141,2],[123,98],[126,2],[8,2],[9,2],[13,2],[12,2],[2,2],[14,2],[15,2],[16,2],[17,2],[18,2],[19,2],[20,2],[21,2],[3,2],[4,2],[46,2],[25,2],[22,2],[23,2],[24,2],[26,2],[27,2],[28,2],[5,2],[29,2],[30,2],[31,2],[32,2],[6,2],[36,2],[33,2],[34,2],[35,2],[37,2],[7,2],[38,2],[43,2],[44,2],[39,2],[40,2],[41,2],[42,2],[1,2],[45,2],[11,2],[10,2],[66,107],[63,2],[57,2],[53,2],[49,104],[61,105],[56,104],[55,2],[60,2],[51,2],[52,2],[50,104],[54,2],[59,2],[58,2],[64,2],[65,106],[62,2]],"semanticDiagnosticsPerFile":[147,145,172,175,174,150,146,148,149,152,151,153,154,155,160,156,159,157,163,167,168,169,170,171,180,158,181,164,165,182,69,70,72,73,74,75,76,77,78,79,80,81,82,84,83,85,86,87,71,121,88,89,90,122,91,92,93,94,95,96,97,98,99,100,101,102,103,105,104,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,183,184,162,161,209,210,185,188,207,208,198,197,195,190,203,201,205,189,202,206,191,192,204,186,193,194,196,200,211,199,187,224,223,218,220,219,212,213,215,217,221,222,214,216,166,225,227,228,229,230,239,231,232,233,234,235,236,238,237,67,68,226,173,179,177,178,176,142,128,129,127,130,131,132,133,134,135,136,137,138,139,140,47,141,123,126,8,9,13,12,2,14,15,16,17,18,19,20,21,3,4,46,25,22,23,24,26,27,28,5,29,30,31,32,6,36,33,34,35,37,7,38,43,44,39,40,41,42,1,45,11,10,66,144,143,125,124,48,63,57,53,49,61,56,55,60,51,52,50,54,59,58,64,65,62]},"version":"4.9.5"}
|
package/index.d.ts
ADDED
package/index.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "polyapi",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Poly is a CLI tool to help you create and manage your Poly definitions.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/polyapi/poly-alpha",
|
|
9
|
+
"directory": "packages/client"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"build/**/*",
|
|
13
|
+
"index.js",
|
|
14
|
+
"index.d.ts"
|
|
15
|
+
],
|
|
16
|
+
"main": "index.js",
|
|
17
|
+
"bin": {
|
|
18
|
+
"poly": "build/cli.js"
|
|
19
|
+
},
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsc -b",
|
|
22
|
+
"prebuild": "rimraf build",
|
|
23
|
+
"postbuild": "npm run copy-templates",
|
|
24
|
+
"copy-templates": "copyfiles \"templates/*.hbs\" build",
|
|
25
|
+
"format": "prettier --write \"src/**/*.ts\"",
|
|
26
|
+
"lint": "tslint -p tsconfig.json",
|
|
27
|
+
"prepare": "npm run build",
|
|
28
|
+
"prepublishOnly": "npm run lint",
|
|
29
|
+
"preversion": "npm run lint",
|
|
30
|
+
"version": "npm run format && git add -A src",
|
|
31
|
+
"postversion": "git push && git push --tags"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@types/lodash": "^4.14.191",
|
|
35
|
+
"copyfiles": "^2.4.1",
|
|
36
|
+
"prettier": "^2.8.4",
|
|
37
|
+
"rimraf": "^4.1.2",
|
|
38
|
+
"tslint": "^6.1.3",
|
|
39
|
+
"tslint-config-prettier": "^1.18.0",
|
|
40
|
+
"typescript": "^4.9.5"
|
|
41
|
+
},
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"@guanghechen/helper-string": "^4.3.0",
|
|
44
|
+
"axios": "^1.3.3",
|
|
45
|
+
"chalk": "^4.1.2",
|
|
46
|
+
"dotenv": "^16.0.3",
|
|
47
|
+
"handlebars": "^4.7.7",
|
|
48
|
+
"inquirer": "^8.2.5",
|
|
49
|
+
"lodash": "^4.17.21",
|
|
50
|
+
"shelljs": "^0.8.5",
|
|
51
|
+
"socket.io-client": "^4.6.1",
|
|
52
|
+
"uuid": "^9.0.0",
|
|
53
|
+
"yargs": "^17.7.0"
|
|
54
|
+
},
|
|
55
|
+
"engines": {
|
|
56
|
+
"node": ">=18.0.0"
|
|
57
|
+
}
|
|
58
|
+
}
|