@proteinjs/conversation 1.0.7 → 1.0.9
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/.eslintrc.js +1 -1
- package/.prettierignore +4 -0
- package/CHANGELOG.md +11 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +28 -40
- package/dist/src/CodegenConversation.d.ts +11 -11
- package/dist/src/CodegenConversation.js +180 -294
- package/dist/src/Conversation.d.ts +49 -52
- package/dist/src/Conversation.js +288 -478
- package/dist/src/ConversationModule.d.ts +6 -6
- package/dist/src/ConversationModule.js +3 -3
- package/dist/src/Function.d.ts +4 -4
- package/dist/src/Function.js +3 -3
- package/dist/src/OpenAi.d.ts +10 -42
- package/dist/src/OpenAi.js +305 -495
- package/dist/src/Paragraph.d.ts +4 -4
- package/dist/src/Paragraph.js +17 -17
- package/dist/src/Sentence.d.ts +4 -4
- package/dist/src/Sentence.js +21 -21
- package/dist/src/code_template/Code.d.ts +15 -15
- package/dist/src/code_template/Code.js +73 -167
- package/dist/src/code_template/CodeTemplate.d.ts +11 -11
- package/dist/src/code_template/CodeTemplate.js +80 -169
- package/dist/src/code_template/CodeTemplateModule.d.ts +6 -6
- package/dist/src/code_template/CodeTemplateModule.js +26 -28
- package/dist/src/code_template/Repo.d.ts +38 -34
- package/dist/src/code_template/Repo.js +195 -291
- package/dist/src/fs/conversation_fs/ConversationFsModerator.d.ts +12 -12
- package/dist/src/fs/conversation_fs/ConversationFsModerator.js +108 -110
- package/dist/src/fs/conversation_fs/ConversationFsModule.d.ts +11 -11
- package/dist/src/fs/conversation_fs/ConversationFsModule.js +97 -204
- package/dist/src/fs/conversation_fs/FsFunctions.d.ts +62 -58
- package/dist/src/fs/conversation_fs/FsFunctions.js +252 -414
- package/dist/src/fs/git/GitModule.d.ts +8 -8
- package/dist/src/fs/git/GitModule.js +74 -163
- package/dist/src/fs/keyword_to_files_index/KeywordToFilesIndexFunctions.d.ts +18 -16
- package/dist/src/fs/keyword_to_files_index/KeywordToFilesIndexFunctions.js +58 -158
- package/dist/src/fs/keyword_to_files_index/KeywordToFilesIndexModule.d.ts +26 -27
- package/dist/src/fs/keyword_to_files_index/KeywordToFilesIndexModule.js +131 -234
- package/dist/src/fs/package/PackageFunctions.d.ts +60 -54
- package/dist/src/fs/package/PackageFunctions.js +213 -366
- package/dist/src/fs/package/PackageModule.d.ts +24 -24
- package/dist/src/fs/package/PackageModule.js +170 -292
- package/dist/src/history/MessageHistory.d.ts +12 -12
- package/dist/src/history/MessageHistory.js +46 -52
- package/dist/src/history/MessageModerator.d.ts +2 -2
- package/dist/src/history/MessageModerator.js +3 -3
- package/dist/src/template/ConversationTemplate.d.ts +8 -8
- package/dist/src/template/ConversationTemplate.js +3 -3
- package/dist/src/template/ConversationTemplateFunctions.d.ts +35 -33
- package/dist/src/template/ConversationTemplateFunctions.js +75 -176
- package/dist/src/template/ConversationTemplateModule.d.ts +48 -51
- package/dist/src/template/ConversationTemplateModule.js +116 -211
- package/dist/src/template/createApp/CreateAppTemplate.d.ts +1 -1
- package/dist/src/template/createApp/CreateAppTemplate.js +59 -151
- package/dist/src/template/createCode/CreateCodeConversationTemplate.d.ts +1 -1
- package/dist/src/template/createCode/CreateCodeConversationTemplate.js +67 -183
- package/dist/src/template/createPackage/CreatePackageConversationTemplate.d.ts +1 -1
- package/dist/src/template/createPackage/CreatePackageConversationTemplate.js +77 -174
- package/dist/src/template/createPackage/tsconfig.json +11 -11
- package/dist/test/createKeywordFilesIndex.test.d.ts +1 -1
- package/dist/test/createKeywordFilesIndex.test.js +41 -132
- package/dist/test/openai/openai.generateList.test.d.ts +1 -1
- package/dist/test/openai/openai.generateList.test.js +47 -136
- package/dist/test/openai/openai.parseCodeFromMarkdown.test.d.ts +1 -1
- package/dist/test/openai/openai.parseCodeFromMarkdown.test.js +12 -13
- package/dist/test/repo/repo.test.d.ts +1 -1
- package/dist/test/repo/repo.test.js +38 -127
- package/package.json +5 -6
- package/LICENSE +0 -21
|
@@ -1,419 +1,266 @@
|
|
|
1
|
-
|
|
2
|
-
var __awaiter =
|
|
3
|
-
|
|
4
|
-
function (thisArg, _arguments, P, generator) {
|
|
5
|
-
function adopt(value) {
|
|
6
|
-
return value instanceof P
|
|
7
|
-
? value
|
|
8
|
-
: new P(function (resolve) {
|
|
9
|
-
resolve(value);
|
|
10
|
-
});
|
|
11
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
12
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
13
|
-
|
|
14
|
-
try {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
reject(e);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
function rejected(value) {
|
|
21
|
-
try {
|
|
22
|
-
step(generator['throw'](value));
|
|
23
|
-
} catch (e) {
|
|
24
|
-
reject(e);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
function step(result) {
|
|
28
|
-
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
29
|
-
}
|
|
30
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
31
9
|
});
|
|
32
|
-
|
|
33
|
-
var __generator =
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
label: 0,
|
|
38
|
-
sent: function () {
|
|
39
|
-
if (t[0] & 1) throw t[1];
|
|
40
|
-
return t[1];
|
|
41
|
-
},
|
|
42
|
-
trys: [],
|
|
43
|
-
ops: [],
|
|
44
|
-
},
|
|
45
|
-
f,
|
|
46
|
-
y,
|
|
47
|
-
t,
|
|
48
|
-
g;
|
|
49
|
-
return (
|
|
50
|
-
(g = { next: verb(0), throw: verb(1), return: verb(2) }),
|
|
51
|
-
typeof Symbol === 'function' &&
|
|
52
|
-
(g[Symbol.iterator] = function () {
|
|
53
|
-
return this;
|
|
54
|
-
}),
|
|
55
|
-
g
|
|
56
|
-
);
|
|
57
|
-
function verb(n) {
|
|
58
|
-
return function (v) {
|
|
59
|
-
return step([n, v]);
|
|
60
|
-
};
|
|
61
|
-
}
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
62
15
|
function step(op) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
(
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
_.label++;
|
|
84
|
-
y = op[1];
|
|
85
|
-
op = [0];
|
|
86
|
-
continue;
|
|
87
|
-
case 7:
|
|
88
|
-
op = _.ops.pop();
|
|
89
|
-
_.trys.pop();
|
|
90
|
-
continue;
|
|
91
|
-
default:
|
|
92
|
-
if (!((t = _.trys), (t = t.length > 0 && t[t.length - 1])) && (op[0] === 6 || op[0] === 2)) {
|
|
93
|
-
_ = 0;
|
|
94
|
-
continue;
|
|
95
|
-
}
|
|
96
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
97
|
-
_.label = op[1];
|
|
98
|
-
break;
|
|
99
|
-
}
|
|
100
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
101
|
-
_.label = t[1];
|
|
102
|
-
t = op;
|
|
103
|
-
break;
|
|
104
|
-
}
|
|
105
|
-
if (t && _.label < t[2]) {
|
|
106
|
-
_.label = t[2];
|
|
107
|
-
_.ops.push(op);
|
|
108
|
-
break;
|
|
109
|
-
}
|
|
110
|
-
if (t[2]) _.ops.pop();
|
|
111
|
-
_.trys.pop();
|
|
112
|
-
continue;
|
|
113
|
-
}
|
|
114
|
-
op = body.call(thisArg, _);
|
|
115
|
-
} catch (e) {
|
|
116
|
-
op = [6, e];
|
|
117
|
-
y = 0;
|
|
118
|
-
} finally {
|
|
119
|
-
f = t = 0;
|
|
120
|
-
}
|
|
121
|
-
if (op[0] & 5) throw op[1];
|
|
122
|
-
return { value: op[0] ? op[1] : void 0, done: true };
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
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;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
123
36
|
}
|
|
124
|
-
|
|
125
|
-
Object.defineProperty(exports,
|
|
126
|
-
exports.packageFunctions =
|
|
127
|
-
|
|
128
|
-
exports.uninstallPackagesFunctionName =
|
|
129
|
-
exports.npmInstallFunction =
|
|
130
|
-
exports.npmInstallFunctionName =
|
|
131
|
-
exports.generateTypescriptDeclarationsFunction =
|
|
132
|
-
exports.generateTypescriptDeclarationsFunctionName =
|
|
133
|
-
exports.searchLibrariesFunction =
|
|
134
|
-
exports.searchLibrariesFunctionName =
|
|
135
|
-
exports.searchPackagesFunction =
|
|
136
|
-
exports.searchPackagesFunctionName =
|
|
137
|
-
exports.runPackageScriptFunctionName =
|
|
138
|
-
exports.installPackagesFunction =
|
|
139
|
-
exports.installPackagesFunctionName =
|
|
140
|
-
void 0;
|
|
141
|
-
var util_node_1 = require('@proteinjs/util-node');
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.packageFunctions = exports.uninstallPackagesFunction = exports.uninstallPackagesFunctionName = exports.npmInstallFunction = exports.npmInstallFunctionName = exports.generateTypescriptDeclarationsFunction = exports.generateTypescriptDeclarationsFunctionName = exports.searchLibrariesFunction = exports.searchLibrariesFunctionName = exports.searchPackagesFunction = exports.searchPackagesFunctionName = exports.runPackageScriptFunctionName = exports.installPackagesFunction = exports.installPackagesFunctionName = void 0;
|
|
40
|
+
var util_node_1 = require("@proteinjs/util-node");
|
|
142
41
|
exports.installPackagesFunctionName = 'installPackages';
|
|
143
42
|
exports.installPackagesFunction = {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
type: 'object',
|
|
149
|
-
properties: {
|
|
150
|
-
packages: {
|
|
151
|
-
type: 'array',
|
|
152
|
-
description: 'Packages to install',
|
|
153
|
-
items: {
|
|
43
|
+
definition: {
|
|
44
|
+
name: exports.installPackagesFunctionName,
|
|
45
|
+
description: 'Get the content of files',
|
|
46
|
+
parameters: {
|
|
154
47
|
type: 'object',
|
|
155
48
|
properties: {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
49
|
+
packages: {
|
|
50
|
+
type: 'array',
|
|
51
|
+
description: 'Packages to install',
|
|
52
|
+
items: {
|
|
53
|
+
type: 'object',
|
|
54
|
+
properties: {
|
|
55
|
+
name: {
|
|
56
|
+
type: 'string',
|
|
57
|
+
description: 'Name of package',
|
|
58
|
+
},
|
|
59
|
+
version: {
|
|
60
|
+
type: 'string',
|
|
61
|
+
description: 'Version of package',
|
|
62
|
+
},
|
|
63
|
+
exactVersion: {
|
|
64
|
+
type: 'boolean',
|
|
65
|
+
description: 'If true, freeze the version so subsequent installs do not bump minor versions',
|
|
66
|
+
},
|
|
67
|
+
development: {
|
|
68
|
+
type: 'boolean',
|
|
69
|
+
description: 'If true, install as a dev dependency',
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
required: ['name'],
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
cwdPath: {
|
|
76
|
+
type: 'string',
|
|
77
|
+
description: 'The directory to install packages in',
|
|
78
|
+
},
|
|
172
79
|
},
|
|
173
|
-
required: ['
|
|
174
|
-
},
|
|
80
|
+
required: ['packages', 'cwdPath'],
|
|
175
81
|
},
|
|
176
|
-
cwdPath: {
|
|
177
|
-
type: 'string',
|
|
178
|
-
description: 'The directory to install packages in',
|
|
179
|
-
},
|
|
180
|
-
},
|
|
181
|
-
required: ['packages', 'cwdPath'],
|
|
182
82
|
},
|
|
183
|
-
|
|
184
|
-
call: function (params) {
|
|
185
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
186
|
-
return __generator(this, function (_a) {
|
|
83
|
+
call: function (params) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
187
84
|
switch (_a.label) {
|
|
188
|
-
|
|
189
|
-
return [
|
|
190
|
-
case 1:
|
|
191
|
-
return [2 /*return*/, _a.sent()];
|
|
85
|
+
case 0: return [4 /*yield*/, util_node_1.PackageUtil.installPackages(params.packages, params.cwdPath)];
|
|
86
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
192
87
|
}
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
},
|
|
196
|
-
instructions: ['To install a package, use the '.concat(exports.installPackagesFunctionName, ' function')],
|
|
88
|
+
}); }); },
|
|
89
|
+
instructions: ["To install a package, use the ".concat(exports.installPackagesFunctionName, " function")],
|
|
197
90
|
};
|
|
198
91
|
exports.runPackageScriptFunctionName = 'runPackageScript';
|
|
199
92
|
var runPackageScriptFunction = {
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
93
|
+
definition: {
|
|
94
|
+
name: exports.runPackageScriptFunctionName,
|
|
95
|
+
description: 'Run `npm run x`, where `x` is an existing script in a package.json',
|
|
96
|
+
parameters: {
|
|
97
|
+
type: 'object',
|
|
98
|
+
properties: {
|
|
99
|
+
name: {
|
|
100
|
+
type: 'string',
|
|
101
|
+
description: 'Name of the script',
|
|
102
|
+
},
|
|
103
|
+
cwdPath: {
|
|
104
|
+
type: 'string',
|
|
105
|
+
description: 'If omitted, defaults to process.cwd',
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
required: ['name'],
|
|
213
109
|
},
|
|
214
|
-
},
|
|
215
|
-
required: ['name'],
|
|
216
110
|
},
|
|
217
|
-
|
|
218
|
-
call: function (params) {
|
|
219
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
220
|
-
return __generator(this, function (_a) {
|
|
111
|
+
call: function (params) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
221
112
|
switch (_a.label) {
|
|
222
|
-
|
|
223
|
-
return [
|
|
224
|
-
case 1:
|
|
225
|
-
return [2 /*return*/, _a.sent()];
|
|
113
|
+
case 0: return [4 /*yield*/, util_node_1.PackageUtil.runPackageScript(params.name, params.cwdPath)];
|
|
114
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
226
115
|
}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
'To run a npm script (such as start, test, or watch), use the '.concat(
|
|
232
|
-
exports.runPackageScriptFunctionName,
|
|
233
|
-
' function'
|
|
234
|
-
),
|
|
235
|
-
],
|
|
116
|
+
}); }); },
|
|
117
|
+
instructions: [
|
|
118
|
+
"To run a npm script (such as start, test, or watch), use the ".concat(exports.runPackageScriptFunctionName, " function"),
|
|
119
|
+
],
|
|
236
120
|
};
|
|
237
121
|
exports.searchPackagesFunctionName = 'searchPackages';
|
|
238
122
|
function searchPackagesFunction(packageModule) {
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
123
|
+
var _this = this;
|
|
124
|
+
return {
|
|
125
|
+
definition: {
|
|
126
|
+
name: exports.searchPackagesFunctionName,
|
|
127
|
+
description: 'Get package.json file paths for package names that include the keyword',
|
|
128
|
+
parameters: {
|
|
129
|
+
type: 'object',
|
|
130
|
+
properties: {
|
|
131
|
+
keyword: {
|
|
132
|
+
type: 'string',
|
|
133
|
+
description: 'Keyword to match package names',
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
required: ['keyword'],
|
|
137
|
+
},
|
|
251
138
|
},
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
return [4 /*yield*/, packageModule.searchPackages(params.keyword)];
|
|
261
|
-
case 1:
|
|
262
|
-
return [2 /*return*/, _a.sent()];
|
|
263
|
-
}
|
|
264
|
-
});
|
|
265
|
-
});
|
|
266
|
-
},
|
|
267
|
-
instructions: [
|
|
268
|
-
'To search for packages in the local repo, use the '.concat(exports.searchPackagesFunctionName, ' function'),
|
|
269
|
-
],
|
|
270
|
-
};
|
|
139
|
+
call: function (params) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
140
|
+
switch (_a.label) {
|
|
141
|
+
case 0: return [4 /*yield*/, packageModule.searchPackages(params.keyword)];
|
|
142
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
143
|
+
}
|
|
144
|
+
}); }); },
|
|
145
|
+
instructions: ["To search for packages in the local repo, use the ".concat(exports.searchPackagesFunctionName, " function")],
|
|
146
|
+
};
|
|
271
147
|
}
|
|
272
148
|
exports.searchPackagesFunction = searchPackagesFunction;
|
|
273
149
|
exports.searchLibrariesFunctionName = 'searchLibraries';
|
|
274
150
|
function searchLibrariesFunction(packageModule) {
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
151
|
+
var _this = this;
|
|
152
|
+
return {
|
|
153
|
+
definition: {
|
|
154
|
+
name: exports.searchLibrariesFunctionName,
|
|
155
|
+
description: 'Return libraries that match the keyword',
|
|
156
|
+
parameters: {
|
|
157
|
+
type: 'object',
|
|
158
|
+
properties: {
|
|
159
|
+
keyword: {
|
|
160
|
+
type: 'string',
|
|
161
|
+
description: 'Keyword to match file names',
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
required: ['keyword'],
|
|
165
|
+
},
|
|
287
166
|
},
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
return [4 /*yield*/, packageModule.searchLibraries(params.keyword)];
|
|
297
|
-
case 1:
|
|
298
|
-
return [2 /*return*/, _a.sent()];
|
|
299
|
-
}
|
|
300
|
-
});
|
|
301
|
-
});
|
|
302
|
-
},
|
|
303
|
-
instructions: [
|
|
304
|
-
'To search for libraries in the local repo, use the '.concat(exports.searchLibrariesFunctionName, ' function'),
|
|
305
|
-
],
|
|
306
|
-
};
|
|
167
|
+
call: function (params) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
168
|
+
switch (_a.label) {
|
|
169
|
+
case 0: return [4 /*yield*/, packageModule.searchLibraries(params.keyword)];
|
|
170
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
171
|
+
}
|
|
172
|
+
}); }); },
|
|
173
|
+
instructions: ["To search for libraries in the local repo, use the ".concat(exports.searchLibrariesFunctionName, " function")],
|
|
174
|
+
};
|
|
307
175
|
}
|
|
308
176
|
exports.searchLibrariesFunction = searchLibrariesFunction;
|
|
309
177
|
exports.generateTypescriptDeclarationsFunctionName = 'generateTypescriptDesclarations';
|
|
310
178
|
exports.generateTypescriptDeclarationsFunction = {
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
179
|
+
definition: {
|
|
180
|
+
name: exports.generateTypescriptDeclarationsFunctionName,
|
|
181
|
+
description: 'Return the typescript declarations for the files',
|
|
182
|
+
parameters: {
|
|
183
|
+
type: 'object',
|
|
184
|
+
properties: {
|
|
185
|
+
tsFilePaths: {
|
|
186
|
+
type: 'array',
|
|
187
|
+
description: 'File paths to generate declarations for',
|
|
188
|
+
items: {
|
|
189
|
+
type: 'string',
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
required: ['tsFilePaths'],
|
|
323
194
|
},
|
|
324
|
-
},
|
|
325
|
-
required: ['tsFilePaths'],
|
|
326
195
|
},
|
|
327
|
-
|
|
328
|
-
call: function (params) {
|
|
329
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
330
|
-
return __generator(this, function (_a) {
|
|
196
|
+
call: function (params) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
331
197
|
return [2 /*return*/, util_node_1.PackageUtil.generateTypescriptDeclarations(params)];
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
'To generate typescript declarations for a local file, use the '.concat(
|
|
337
|
-
exports.generateTypescriptDeclarationsFunctionName,
|
|
338
|
-
' function'
|
|
339
|
-
),
|
|
340
|
-
],
|
|
198
|
+
}); }); },
|
|
199
|
+
instructions: [
|
|
200
|
+
"To generate typescript declarations for a local file, use the ".concat(exports.generateTypescriptDeclarationsFunctionName, " function"),
|
|
201
|
+
],
|
|
341
202
|
};
|
|
342
203
|
exports.npmInstallFunctionName = 'npmInstall';
|
|
343
204
|
exports.npmInstallFunction = {
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
205
|
+
definition: {
|
|
206
|
+
name: exports.npmInstallFunctionName,
|
|
207
|
+
description: 'Run `npm install` in the specified directory',
|
|
208
|
+
parameters: {
|
|
209
|
+
type: 'object',
|
|
210
|
+
properties: {
|
|
211
|
+
cwdPath: {
|
|
212
|
+
type: 'string',
|
|
213
|
+
description: 'Directory to execute the command from',
|
|
214
|
+
},
|
|
215
|
+
},
|
|
216
|
+
required: ['cwdPath'],
|
|
353
217
|
},
|
|
354
|
-
},
|
|
355
|
-
required: ['cwdPath'],
|
|
356
218
|
},
|
|
357
|
-
|
|
358
|
-
call: function (params) {
|
|
359
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
360
|
-
return __generator(this, function (_a) {
|
|
219
|
+
call: function (params) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
361
220
|
switch (_a.label) {
|
|
362
|
-
|
|
363
|
-
return [
|
|
364
|
-
case 1:
|
|
365
|
-
return [2 /*return*/, _a.sent()];
|
|
221
|
+
case 0: return [4 /*yield*/, util_node_1.PackageUtil.npmInstall(params.cwdPath)];
|
|
222
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
366
223
|
}
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
},
|
|
370
|
-
instructions: [
|
|
371
|
-
'To run npm install in a specific directory, use the '.concat(exports.npmInstallFunctionName, ' function'),
|
|
372
|
-
],
|
|
224
|
+
}); }); },
|
|
225
|
+
instructions: ["To run npm install in a specific directory, use the ".concat(exports.npmInstallFunctionName, " function")],
|
|
373
226
|
};
|
|
374
227
|
exports.uninstallPackagesFunctionName = 'uninstallPackages';
|
|
375
228
|
exports.uninstallPackagesFunction = {
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
229
|
+
definition: {
|
|
230
|
+
name: exports.uninstallPackagesFunctionName,
|
|
231
|
+
description: 'Uninstall packages',
|
|
232
|
+
parameters: {
|
|
233
|
+
type: 'object',
|
|
234
|
+
properties: {
|
|
235
|
+
packageNames: {
|
|
236
|
+
type: 'array',
|
|
237
|
+
description: 'Packages to uninstall',
|
|
238
|
+
items: {
|
|
239
|
+
type: 'string',
|
|
240
|
+
description: 'Name of package',
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
cwdPath: {
|
|
244
|
+
type: 'string',
|
|
245
|
+
description: 'The directory to uninstall packages from',
|
|
246
|
+
},
|
|
247
|
+
},
|
|
248
|
+
required: ['packageNames', 'cwdPath'],
|
|
393
249
|
},
|
|
394
|
-
},
|
|
395
|
-
required: ['packageNames', 'cwdPath'],
|
|
396
250
|
},
|
|
397
|
-
|
|
398
|
-
call: function (params) {
|
|
399
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
400
|
-
return __generator(this, function (_a) {
|
|
251
|
+
call: function (params) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
401
252
|
switch (_a.label) {
|
|
402
|
-
|
|
403
|
-
return [
|
|
404
|
-
case 1:
|
|
405
|
-
return [2 /*return*/, _a.sent()];
|
|
253
|
+
case 0: return [4 /*yield*/, util_node_1.PackageUtil.uninstallPackages(params.packageNames, params.cwdPath)];
|
|
254
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
406
255
|
}
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
},
|
|
410
|
-
instructions: ['To uninstall a package, use the '.concat(exports.uninstallPackagesFunctionName, ' function')],
|
|
256
|
+
}); }); },
|
|
257
|
+
instructions: ["To uninstall a package, use the ".concat(exports.uninstallPackagesFunctionName, " function")],
|
|
411
258
|
};
|
|
412
259
|
exports.packageFunctions = [
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
260
|
+
exports.installPackagesFunction,
|
|
261
|
+
runPackageScriptFunction,
|
|
262
|
+
exports.generateTypescriptDeclarationsFunction,
|
|
263
|
+
exports.npmInstallFunction,
|
|
264
|
+
exports.uninstallPackagesFunction,
|
|
418
265
|
];
|
|
419
|
-
//# sourceMappingURL=PackageFunctions.js.map
|
|
266
|
+
//# sourceMappingURL=PackageFunctions.js.map
|