@stigg/typescript-mcp 0.1.0-alpha.9 → 0.1.0-beta.1
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/code-tool-paths.cjs +8 -0
- package/code-tool-paths.cjs.map +1 -0
- package/code-tool-paths.d.cts +2 -0
- package/code-tool-paths.d.cts.map +1 -0
- package/code-tool-types.d.mts.map +1 -1
- package/code-tool-types.d.ts.map +1 -1
- package/code-tool-worker.d.mts +5 -0
- package/code-tool-worker.d.mts.map +1 -0
- package/code-tool-worker.d.ts +5 -0
- package/code-tool-worker.d.ts.map +1 -0
- package/code-tool-worker.js +357 -0
- package/code-tool-worker.js.map +1 -0
- package/code-tool-worker.mjs +319 -0
- package/code-tool-worker.mjs.map +1 -0
- package/code-tool.d.mts +8 -2
- package/code-tool.d.mts.map +1 -1
- package/code-tool.d.ts +8 -2
- package/code-tool.d.ts.map +1 -1
- package/code-tool.js +266 -37
- package/code-tool.js.map +1 -1
- package/code-tool.mjs +233 -37
- package/code-tool.mjs.map +1 -1
- package/docs-search-tool.d.mts +3 -1
- package/docs-search-tool.d.mts.map +1 -1
- package/docs-search-tool.d.ts +3 -1
- package/docs-search-tool.d.ts.map +1 -1
- package/docs-search-tool.js +53 -4
- package/docs-search-tool.js.map +1 -1
- package/docs-search-tool.mjs +52 -4
- package/docs-search-tool.mjs.map +1 -1
- package/http.d.mts +2 -4
- package/http.d.mts.map +1 -1
- package/http.d.ts +2 -4
- package/http.d.ts.map +1 -1
- package/http.js +123 -40
- package/http.js.map +1 -1
- package/http.mjs +123 -40
- package/http.mjs.map +1 -1
- package/index.js +13 -12
- package/index.js.map +1 -1
- package/index.mjs +13 -12
- package/index.mjs.map +1 -1
- package/instructions.d.mts +5 -0
- package/instructions.d.mts.map +1 -0
- package/instructions.d.ts +5 -0
- package/instructions.d.ts.map +1 -0
- package/instructions.js +61 -0
- package/instructions.js.map +1 -0
- package/instructions.mjs +55 -0
- package/instructions.mjs.map +1 -0
- package/local-docs-search.d.mts +28 -0
- package/local-docs-search.d.mts.map +1 -0
- package/local-docs-search.d.ts +28 -0
- package/local-docs-search.d.ts.map +1 -0
- package/local-docs-search.js +4774 -0
- package/local-docs-search.js.map +1 -0
- package/local-docs-search.mjs +4734 -0
- package/local-docs-search.mjs.map +1 -0
- package/logger.d.mts +7 -0
- package/logger.d.mts.map +1 -0
- package/logger.d.ts +7 -0
- package/logger.d.ts.map +1 -0
- package/logger.js +29 -0
- package/logger.js.map +1 -0
- package/logger.mjs +22 -0
- package/logger.mjs.map +1 -0
- package/methods.d.mts.map +1 -1
- package/methods.d.ts.map +1 -1
- package/methods.js +235 -43
- package/methods.js.map +1 -1
- package/methods.mjs +235 -43
- package/methods.mjs.map +1 -1
- package/options.d.mts +7 -0
- package/options.d.mts.map +1 -1
- package/options.d.ts +7 -0
- package/options.d.ts.map +1 -1
- package/options.js +42 -0
- package/options.js.map +1 -1
- package/options.mjs +42 -0
- package/options.mjs.map +1 -1
- package/package.json +58 -7
- package/server.d.mts +10 -1
- package/server.d.mts.map +1 -1
- package/server.d.ts +10 -1
- package/server.d.ts.map +1 -1
- package/server.js +72 -47
- package/server.js.map +1 -1
- package/server.mjs +72 -47
- package/server.mjs.map +1 -1
- package/src/code-tool-paths.cts +5 -0
- package/src/code-tool-types.ts +1 -0
- package/src/code-tool-worker.ts +370 -0
- package/src/code-tool.ts +302 -47
- package/src/docs-search-tool.ts +81 -11
- package/src/http.ts +131 -42
- package/src/index.ts +15 -13
- package/src/instructions.ts +83 -0
- package/src/local-docs-search.ts +5667 -0
- package/src/logger.ts +28 -0
- package/src/methods.ts +235 -43
- package/src/options.ts +56 -0
- package/src/server.ts +85 -58
- package/src/stdio.ts +6 -2
- package/src/types.ts +3 -0
- package/src/util.ts +2 -2
- package/stdio.d.mts.map +1 -1
- package/stdio.d.ts.map +1 -1
- package/stdio.js +6 -2
- package/stdio.js.map +1 -1
- package/stdio.mjs +6 -2
- package/stdio.mjs.map +1 -1
- package/types.d.mts +6 -0
- package/types.d.mts.map +1 -1
- package/types.d.ts +6 -0
- package/types.d.ts.map +1 -1
- package/types.js.map +1 -1
- package/types.mjs.map +1 -1
- package/util.js +2 -2
- package/util.js.map +1 -1
- package/util.mjs +2 -2
- package/util.mjs.map +1 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.getWorkerPath = getWorkerPath;
|
|
5
|
+
function getWorkerPath() {
|
|
6
|
+
return require.resolve('./code-tool-worker.mjs');
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=code-tool-paths.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-tool-paths.cjs","sourceRoot":"","sources":["src/code-tool-paths.cts"],"names":[],"mappings":";AAAA,sFAAsF;;AAEtF,sCAEC;AAFD,SAAgB,aAAa;IAC3B,OAAO,OAAO,CAAC,OAAO,CAAC,wBAAwB,CAAC,CAAC;AACnD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-tool-paths.d.cts","sourceRoot":"","sources":["src/code-tool-paths.cts"],"names":[],"mappings":"AAEA,wBAAgB,aAAa,IAAI,MAAM,CAEtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-tool-types.d.mts","sourceRoot":"","sources":["src/code-tool-types.ts"],"names":[],"mappings":"OAEO,EAAE,aAAa,EAAE,MAAM,mBAAmB;AAEjD,MAAM,MAAM,WAAW,GAAG;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,aAAa,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B,CAAC;
|
|
1
|
+
{"version":3,"file":"code-tool-types.d.mts","sourceRoot":"","sources":["src/code-tool-types.ts"],"names":[],"mappings":"OAEO,EAAE,aAAa,EAAE,MAAM,mBAAmB;AAEjD,MAAM,MAAM,WAAW,GAAG;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,aAAa,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC"}
|
package/code-tool-types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-tool-types.d.ts","sourceRoot":"","sources":["src/code-tool-types.ts"],"names":[],"mappings":"OAEO,EAAE,aAAa,EAAE,MAAM,mBAAmB;AAEjD,MAAM,MAAM,WAAW,GAAG;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,aAAa,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B,CAAC;
|
|
1
|
+
{"version":3,"file":"code-tool-types.d.ts","sourceRoot":"","sources":["src/code-tool-types.ts"],"names":[],"mappings":"OAEO,EAAE,aAAa,EAAE,MAAM,mBAAmB;AAEjD,MAAM,MAAM,WAAW,GAAG;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,aAAa,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-tool-worker.d.mts","sourceRoot":"","sources":["src/code-tool-worker.ts"],"names":[],"mappings":";iBAuS0B,OAAO,KAAG,OAAO,CAAC,QAAQ,CAAC;;AA0ErD,wBAAyB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-tool-worker.d.ts","sourceRoot":"","sources":["src/code-tool-worker.ts"],"names":[],"mappings":";iBAuS0B,OAAO,KAAG,OAAO,CAAC,QAAQ,CAAC;;AA0ErD,wBAAyB"}
|
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
+
};
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
41
|
+
const node_util_1 = __importDefault(require("node:util"));
|
|
42
|
+
const fuse_js_1 = __importDefault(require("fuse.js"));
|
|
43
|
+
const typescript_1 = __importDefault(require("typescript"));
|
|
44
|
+
const typescript_2 = require("@stigg/typescript");
|
|
45
|
+
async function tseval(code) {
|
|
46
|
+
return Promise.resolve(`${'data:application/typescript;charset=utf-8;base64,' + Buffer.from(code).toString('base64')}`).then(s => __importStar(require(s)));
|
|
47
|
+
}
|
|
48
|
+
function getRunFunctionSource(code) {
|
|
49
|
+
const sourceFile = typescript_1.default.createSourceFile('code.ts', code, typescript_1.default.ScriptTarget.Latest, true);
|
|
50
|
+
const printer = typescript_1.default.createPrinter();
|
|
51
|
+
for (const statement of sourceFile.statements) {
|
|
52
|
+
// Check for top-level function declarations
|
|
53
|
+
if (typescript_1.default.isFunctionDeclaration(statement)) {
|
|
54
|
+
if (statement.name?.text === 'run') {
|
|
55
|
+
return {
|
|
56
|
+
type: 'declaration',
|
|
57
|
+
client: statement.parameters[0]?.name.getText(),
|
|
58
|
+
code: printer.printNode(typescript_1.default.EmitHint.Unspecified, statement.body, sourceFile),
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
// Check for variable declarations: const run = () => {} or const run = function() {}
|
|
63
|
+
if (typescript_1.default.isVariableStatement(statement)) {
|
|
64
|
+
for (const declaration of statement.declarationList.declarations) {
|
|
65
|
+
if (typescript_1.default.isIdentifier(declaration.name) &&
|
|
66
|
+
declaration.name.text === 'run' &&
|
|
67
|
+
// Check if it's initialized with a function
|
|
68
|
+
declaration.initializer &&
|
|
69
|
+
(typescript_1.default.isFunctionExpression(declaration.initializer) || typescript_1.default.isArrowFunction(declaration.initializer))) {
|
|
70
|
+
return {
|
|
71
|
+
type: 'expression',
|
|
72
|
+
client: declaration.initializer.parameters[0]?.name.getText(),
|
|
73
|
+
code: printer.printNode(typescript_1.default.EmitHint.Unspecified, declaration.initializer, sourceFile),
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
function getTSDiagnostics(code) {
|
|
82
|
+
const functionSource = getRunFunctionSource(code);
|
|
83
|
+
const codeWithImport = [
|
|
84
|
+
'import { Stigg } from "@stigg/typescript";',
|
|
85
|
+
functionSource.type === 'declaration' ?
|
|
86
|
+
`async function run(${functionSource.client}: Stigg)`
|
|
87
|
+
: `const run: (${functionSource.client}: Stigg) => Promise<unknown> =`,
|
|
88
|
+
functionSource.code,
|
|
89
|
+
].join('\n');
|
|
90
|
+
const sourcePath = node_path_1.default.resolve('code.ts');
|
|
91
|
+
const ast = typescript_1.default.createSourceFile(sourcePath, codeWithImport, typescript_1.default.ScriptTarget.Latest, true);
|
|
92
|
+
const options = typescript_1.default.getDefaultCompilerOptions();
|
|
93
|
+
options.target = typescript_1.default.ScriptTarget.Latest;
|
|
94
|
+
options.module = typescript_1.default.ModuleKind.NodeNext;
|
|
95
|
+
options.moduleResolution = typescript_1.default.ModuleResolutionKind.NodeNext;
|
|
96
|
+
const host = typescript_1.default.createCompilerHost(options, true);
|
|
97
|
+
const newHost = {
|
|
98
|
+
...host,
|
|
99
|
+
getSourceFile: (...args) => {
|
|
100
|
+
if (node_path_1.default.resolve(args[0]) === sourcePath) {
|
|
101
|
+
return ast;
|
|
102
|
+
}
|
|
103
|
+
return host.getSourceFile(...args);
|
|
104
|
+
},
|
|
105
|
+
readFile: (...args) => {
|
|
106
|
+
if (node_path_1.default.resolve(args[0]) === sourcePath) {
|
|
107
|
+
return codeWithImport;
|
|
108
|
+
}
|
|
109
|
+
return host.readFile(...args);
|
|
110
|
+
},
|
|
111
|
+
fileExists: (...args) => {
|
|
112
|
+
if (node_path_1.default.resolve(args[0]) === sourcePath) {
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
115
|
+
return host.fileExists(...args);
|
|
116
|
+
},
|
|
117
|
+
};
|
|
118
|
+
const program = typescript_1.default.createProgram({
|
|
119
|
+
options,
|
|
120
|
+
rootNames: [sourcePath],
|
|
121
|
+
host: newHost,
|
|
122
|
+
});
|
|
123
|
+
const diagnostics = typescript_1.default.getPreEmitDiagnostics(program, ast);
|
|
124
|
+
return diagnostics.map((d) => {
|
|
125
|
+
const message = typescript_1.default.flattenDiagnosticMessageText(d.messageText, '\n');
|
|
126
|
+
if (!d.file || !d.start)
|
|
127
|
+
return `- ${message}`;
|
|
128
|
+
const { line: lineNumber } = typescript_1.default.getLineAndCharacterOfPosition(d.file, d.start);
|
|
129
|
+
const line = codeWithImport.split('\n').at(lineNumber)?.trim();
|
|
130
|
+
return line ? `- ${message}\n ${line}` : `- ${message}`;
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
const fuse = new fuse_js_1.default([
|
|
134
|
+
'client.v1.customers.archive',
|
|
135
|
+
'client.v1.customers.checkEntitlement',
|
|
136
|
+
'client.v1.customers.import',
|
|
137
|
+
'client.v1.customers.list',
|
|
138
|
+
'client.v1.customers.listResources',
|
|
139
|
+
'client.v1.customers.provision',
|
|
140
|
+
'client.v1.customers.retrieve',
|
|
141
|
+
'client.v1.customers.retrieveEntitlements',
|
|
142
|
+
'client.v1.customers.unarchive',
|
|
143
|
+
'client.v1.customers.update',
|
|
144
|
+
'client.v1.customers.paymentMethod.attach',
|
|
145
|
+
'client.v1.customers.paymentMethod.detach',
|
|
146
|
+
'client.v1.customers.promotionalEntitlements.create',
|
|
147
|
+
'client.v1.customers.promotionalEntitlements.list',
|
|
148
|
+
'client.v1.customers.promotionalEntitlements.revoke',
|
|
149
|
+
'client.v1.customers.integrations.link',
|
|
150
|
+
'client.v1.customers.integrations.list',
|
|
151
|
+
'client.v1.customers.integrations.retrieve',
|
|
152
|
+
'client.v1.customers.integrations.unlink',
|
|
153
|
+
'client.v1.customers.integrations.update',
|
|
154
|
+
'client.v1.subscriptions.cancel',
|
|
155
|
+
'client.v1.subscriptions.delegate',
|
|
156
|
+
'client.v1.subscriptions.import',
|
|
157
|
+
'client.v1.subscriptions.list',
|
|
158
|
+
'client.v1.subscriptions.migrate',
|
|
159
|
+
'client.v1.subscriptions.preview',
|
|
160
|
+
'client.v1.subscriptions.provision',
|
|
161
|
+
'client.v1.subscriptions.retrieve',
|
|
162
|
+
'client.v1.subscriptions.transfer',
|
|
163
|
+
'client.v1.subscriptions.update',
|
|
164
|
+
'client.v1.subscriptions.futureUpdate.cancelPendingPayment',
|
|
165
|
+
'client.v1.subscriptions.futureUpdate.cancelSchedule',
|
|
166
|
+
'client.v1.subscriptions.usage.chargeUsage',
|
|
167
|
+
'client.v1.subscriptions.usage.sync',
|
|
168
|
+
'client.v1.subscriptions.invoice.markAsPaid',
|
|
169
|
+
'client.v1.coupons.archiveCoupon',
|
|
170
|
+
'client.v1.coupons.create',
|
|
171
|
+
'client.v1.coupons.list',
|
|
172
|
+
'client.v1.coupons.retrieve',
|
|
173
|
+
'client.v1.coupons.updateCoupon',
|
|
174
|
+
'client.v1.events.report',
|
|
175
|
+
'client.v1.events.credits.getAutoRecharge',
|
|
176
|
+
'client.v1.events.credits.getUsage',
|
|
177
|
+
'client.v1.events.credits.listLedger',
|
|
178
|
+
'client.v1.events.credits.grants.create',
|
|
179
|
+
'client.v1.events.credits.grants.list',
|
|
180
|
+
'client.v1.events.credits.grants.void',
|
|
181
|
+
'client.v1.events.credits.customCurrencies.archive',
|
|
182
|
+
'client.v1.events.credits.customCurrencies.create',
|
|
183
|
+
'client.v1.events.credits.customCurrencies.list',
|
|
184
|
+
'client.v1.events.credits.customCurrencies.listAssociatedEntities',
|
|
185
|
+
'client.v1.events.credits.customCurrencies.unarchive',
|
|
186
|
+
'client.v1.events.credits.customCurrencies.update',
|
|
187
|
+
'client.v1.features.archiveFeature',
|
|
188
|
+
'client.v1.features.createFeature',
|
|
189
|
+
'client.v1.features.listFeatures',
|
|
190
|
+
'client.v1.features.retrieveFeature',
|
|
191
|
+
'client.v1.features.unarchiveFeature',
|
|
192
|
+
'client.v1.features.updateFeature',
|
|
193
|
+
'client.v1.addons.archive',
|
|
194
|
+
'client.v1.addons.create',
|
|
195
|
+
'client.v1.addons.createDraft',
|
|
196
|
+
'client.v1.addons.list',
|
|
197
|
+
'client.v1.addons.publish',
|
|
198
|
+
'client.v1.addons.removeDraft',
|
|
199
|
+
'client.v1.addons.retrieve',
|
|
200
|
+
'client.v1.addons.update',
|
|
201
|
+
'client.v1.addons.entitlements.create',
|
|
202
|
+
'client.v1.addons.entitlements.delete',
|
|
203
|
+
'client.v1.addons.entitlements.list',
|
|
204
|
+
'client.v1.addons.entitlements.update',
|
|
205
|
+
'client.v1.plans.archive',
|
|
206
|
+
'client.v1.plans.create',
|
|
207
|
+
'client.v1.plans.createDraft',
|
|
208
|
+
'client.v1.plans.list',
|
|
209
|
+
'client.v1.plans.publish',
|
|
210
|
+
'client.v1.plans.removeDraft',
|
|
211
|
+
'client.v1.plans.retrieve',
|
|
212
|
+
'client.v1.plans.update',
|
|
213
|
+
'client.v1.plans.entitlements.create',
|
|
214
|
+
'client.v1.plans.entitlements.delete',
|
|
215
|
+
'client.v1.plans.entitlements.list',
|
|
216
|
+
'client.v1.plans.entitlements.update',
|
|
217
|
+
'client.v1.usage.history',
|
|
218
|
+
'client.v1.usage.report',
|
|
219
|
+
'client.v1.products.archiveProduct',
|
|
220
|
+
'client.v1.products.createProduct',
|
|
221
|
+
'client.v1.products.duplicateProduct',
|
|
222
|
+
'client.v1.products.listProducts',
|
|
223
|
+
'client.v1.products.unarchiveProduct',
|
|
224
|
+
'client.v1.products.updateProduct',
|
|
225
|
+
], { threshold: 1, shouldSort: true });
|
|
226
|
+
function getMethodSuggestions(fullyQualifiedMethodName) {
|
|
227
|
+
return fuse
|
|
228
|
+
.search(fullyQualifiedMethodName)
|
|
229
|
+
.map(({ item }) => item)
|
|
230
|
+
.slice(0, 5);
|
|
231
|
+
}
|
|
232
|
+
const proxyToObj = new WeakMap();
|
|
233
|
+
const objToProxy = new WeakMap();
|
|
234
|
+
function makeSdkProxy(obj, { path, isBelievedBad = false }) {
|
|
235
|
+
let proxy = objToProxy.get(obj);
|
|
236
|
+
if (!proxy) {
|
|
237
|
+
proxy = new Proxy(obj, {
|
|
238
|
+
get(target, prop, receiver) {
|
|
239
|
+
const propPath = [...path, String(prop)];
|
|
240
|
+
const value = Reflect.get(target, prop, receiver);
|
|
241
|
+
if (isBelievedBad || (!(prop in target) && value === undefined)) {
|
|
242
|
+
// If we're accessing a path that doesn't exist, it will probably eventually error.
|
|
243
|
+
// Let's proxy it and mark it bad so that we can control the error message.
|
|
244
|
+
// We proxy an empty class so that an invocation or construction attempt is possible.
|
|
245
|
+
return makeSdkProxy(class {
|
|
246
|
+
}, { path: propPath, isBelievedBad: true });
|
|
247
|
+
}
|
|
248
|
+
if (value !== null && (typeof value === 'object' || typeof value === 'function')) {
|
|
249
|
+
return makeSdkProxy(value, { path: propPath, isBelievedBad });
|
|
250
|
+
}
|
|
251
|
+
return value;
|
|
252
|
+
},
|
|
253
|
+
apply(target, thisArg, args) {
|
|
254
|
+
if (isBelievedBad || typeof target !== 'function') {
|
|
255
|
+
const fullyQualifiedMethodName = path.join('.');
|
|
256
|
+
const suggestions = getMethodSuggestions(fullyQualifiedMethodName);
|
|
257
|
+
throw new Error(`${fullyQualifiedMethodName} is not a function. Did you mean: ${suggestions.join(', ')}`);
|
|
258
|
+
}
|
|
259
|
+
return Reflect.apply(target, proxyToObj.get(thisArg) ?? thisArg, args);
|
|
260
|
+
},
|
|
261
|
+
construct(target, args, newTarget) {
|
|
262
|
+
if (isBelievedBad || typeof target !== 'function') {
|
|
263
|
+
const fullyQualifiedMethodName = path.join('.');
|
|
264
|
+
const suggestions = getMethodSuggestions(fullyQualifiedMethodName);
|
|
265
|
+
throw new Error(`${fullyQualifiedMethodName} is not a constructor. Did you mean: ${suggestions.join(', ')}`);
|
|
266
|
+
}
|
|
267
|
+
return Reflect.construct(target, args, newTarget);
|
|
268
|
+
},
|
|
269
|
+
});
|
|
270
|
+
objToProxy.set(obj, proxy);
|
|
271
|
+
proxyToObj.set(proxy, obj);
|
|
272
|
+
}
|
|
273
|
+
return proxy;
|
|
274
|
+
}
|
|
275
|
+
function parseError(code, error) {
|
|
276
|
+
if (!(error instanceof Error))
|
|
277
|
+
return;
|
|
278
|
+
const cause = error.cause instanceof Error ? `: ${error.cause.message}` : '';
|
|
279
|
+
const message = error.name ? `${error.name}: ${error.message}${cause}` : `${error.message}${cause}`;
|
|
280
|
+
try {
|
|
281
|
+
// Deno uses V8; the first "<anonymous>:LINE:COLUMN" is the top of stack.
|
|
282
|
+
const lineNumber = error.stack?.match(/<anonymous>:([0-9]+):[0-9]+/)?.[1];
|
|
283
|
+
// -1 for the zero-based indexing
|
|
284
|
+
const line = lineNumber &&
|
|
285
|
+
code
|
|
286
|
+
.split('\n')
|
|
287
|
+
.at(parseInt(lineNumber, 10) - 1)
|
|
288
|
+
?.trim();
|
|
289
|
+
return line ? `${message}\n at line ${lineNumber}\n ${line}` : message;
|
|
290
|
+
}
|
|
291
|
+
catch {
|
|
292
|
+
return message;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
const fetch = async (req) => {
|
|
296
|
+
const { opts, code } = (await req.json());
|
|
297
|
+
const runFunctionSource = code ? getRunFunctionSource(code) : null;
|
|
298
|
+
if (!runFunctionSource) {
|
|
299
|
+
const message = code ?
|
|
300
|
+
'The code is missing a top-level `run` function.'
|
|
301
|
+
: 'The code argument is missing. Provide one containing a top-level `run` function.';
|
|
302
|
+
return Response.json({
|
|
303
|
+
is_error: true,
|
|
304
|
+
result: `${message} Write code within this template:\n\n\`\`\`\nasync function run(client) {\n // Fill this out\n}\n\`\`\``,
|
|
305
|
+
log_lines: [],
|
|
306
|
+
err_lines: [],
|
|
307
|
+
}, { status: 400, statusText: 'Code execution error' });
|
|
308
|
+
}
|
|
309
|
+
const diagnostics = getTSDiagnostics(code);
|
|
310
|
+
if (diagnostics.length > 0) {
|
|
311
|
+
return Response.json({
|
|
312
|
+
is_error: true,
|
|
313
|
+
result: `The code contains TypeScript diagnostics:\n${diagnostics.join('\n')}`,
|
|
314
|
+
log_lines: [],
|
|
315
|
+
err_lines: [],
|
|
316
|
+
}, { status: 400, statusText: 'Code execution error' });
|
|
317
|
+
}
|
|
318
|
+
const client = new typescript_2.Stigg({
|
|
319
|
+
...opts,
|
|
320
|
+
});
|
|
321
|
+
const log_lines = [];
|
|
322
|
+
const err_lines = [];
|
|
323
|
+
const originalConsole = globalThis.console;
|
|
324
|
+
globalThis.console = {
|
|
325
|
+
...originalConsole,
|
|
326
|
+
log: (...args) => {
|
|
327
|
+
log_lines.push(node_util_1.default.format(...args));
|
|
328
|
+
},
|
|
329
|
+
error: (...args) => {
|
|
330
|
+
err_lines.push(node_util_1.default.format(...args));
|
|
331
|
+
},
|
|
332
|
+
};
|
|
333
|
+
try {
|
|
334
|
+
let run_ = async (client) => { };
|
|
335
|
+
run_ = (await tseval(`${code}\nexport default run;`)).default;
|
|
336
|
+
const result = await run_(makeSdkProxy(client, { path: ['client'] }));
|
|
337
|
+
return Response.json({
|
|
338
|
+
is_error: false,
|
|
339
|
+
result,
|
|
340
|
+
log_lines,
|
|
341
|
+
err_lines,
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
catch (e) {
|
|
345
|
+
return Response.json({
|
|
346
|
+
is_error: true,
|
|
347
|
+
result: parseError(code, e),
|
|
348
|
+
log_lines,
|
|
349
|
+
err_lines,
|
|
350
|
+
}, { status: 400, statusText: 'Code execution error' });
|
|
351
|
+
}
|
|
352
|
+
finally {
|
|
353
|
+
globalThis.console = originalConsole;
|
|
354
|
+
}
|
|
355
|
+
};
|
|
356
|
+
exports.default = { fetch };
|
|
357
|
+
//# sourceMappingURL=code-tool-worker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-tool-worker.js","sourceRoot":"","sources":["src/code-tool-worker.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtF,0DAA6B;AAC7B,0DAA6B;AAC7B,sDAA2B;AAC3B,4DAA4B;AAE5B,kDAAyD;AAEzD,KAAK,UAAU,MAAM,CAAC,IAAY;IAChC,0BAAc,mDAAmD,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,wCAAE;AAC5G,CAAC;AAED,SAAS,oBAAoB,CAAC,IAAY;IAKxC,MAAM,UAAU,GAAG,oBAAE,CAAC,gBAAgB,CAAC,SAAS,EAAE,IAAI,EAAE,oBAAE,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACtF,MAAM,OAAO,GAAG,oBAAE,CAAC,aAAa,EAAE,CAAC;IAEnC,KAAK,MAAM,SAAS,IAAI,UAAU,CAAC,UAAU,EAAE,CAAC;QAC9C,4CAA4C;QAC5C,IAAI,oBAAE,CAAC,qBAAqB,CAAC,SAAS,CAAC,EAAE,CAAC;YACxC,IAAI,SAAS,CAAC,IAAI,EAAE,IAAI,KAAK,KAAK,EAAE,CAAC;gBACnC,OAAO;oBACL,IAAI,EAAE,aAAa;oBAC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