@acomo/cli 1.0.13 → 1.0.15
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/dist/index.js +13 -15
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -12166,6 +12166,14 @@ function clearConfig() {
|
|
|
12166
12166
|
}
|
|
12167
12167
|
|
|
12168
12168
|
// src/lib/api-client.ts
|
|
12169
|
+
var FETCH_TIMEOUT_MS = 3e4;
|
|
12170
|
+
function fetchWithTimeout(input, init) {
|
|
12171
|
+
const controller = new AbortController();
|
|
12172
|
+
const timer = setTimeout(() => controller.abort(), FETCH_TIMEOUT_MS);
|
|
12173
|
+
return fetch(input, { ...init, signal: controller.signal }).finally(
|
|
12174
|
+
() => clearTimeout(timer)
|
|
12175
|
+
);
|
|
12176
|
+
}
|
|
12169
12177
|
var REQUIRED_KEYS = [
|
|
12170
12178
|
{ key: "baseUrl", envKey: ENV_KEYS.baseUrl },
|
|
12171
12179
|
{ key: "tenantId", envKey: ENV_KEYS.tenantId },
|
|
@@ -12186,7 +12194,8 @@ function createConfiguration() {
|
|
|
12186
12194
|
const params = {
|
|
12187
12195
|
basePath: config.baseUrl,
|
|
12188
12196
|
accessToken: config.accessToken,
|
|
12189
|
-
apiKey: config.tenantId
|
|
12197
|
+
apiKey: config.tenantId,
|
|
12198
|
+
fetchApi: fetchWithTimeout
|
|
12190
12199
|
};
|
|
12191
12200
|
return new Configuration(params);
|
|
12192
12201
|
}
|
|
@@ -12199,7 +12208,9 @@ function extractApiClasses() {
|
|
|
12199
12208
|
}
|
|
12200
12209
|
return apiClasses;
|
|
12201
12210
|
}
|
|
12211
|
+
var cachedRegistry = null;
|
|
12202
12212
|
function buildOperationRegistry(config) {
|
|
12213
|
+
if (cachedRegistry) return cachedRegistry;
|
|
12203
12214
|
const registry = /* @__PURE__ */ new Map();
|
|
12204
12215
|
const apiClasses = extractApiClasses();
|
|
12205
12216
|
for (const [className, ApiClass] of Object.entries(apiClasses)) {
|
|
@@ -12212,6 +12223,7 @@ function buildOperationRegistry(config) {
|
|
|
12212
12223
|
registry.set(method, { instance, method });
|
|
12213
12224
|
}
|
|
12214
12225
|
}
|
|
12226
|
+
cachedRegistry = registry;
|
|
12215
12227
|
return registry;
|
|
12216
12228
|
}
|
|
12217
12229
|
|
|
@@ -13642,20 +13654,6 @@ async function resolveParams(positional) {
|
|
|
13642
13654
|
throw new Error(`\u7121\u52B9\u306A JSON \u3067\u3059: ${positional}`);
|
|
13643
13655
|
}
|
|
13644
13656
|
}
|
|
13645
|
-
if (!process.stdin.isTTY) {
|
|
13646
|
-
const chunks = [];
|
|
13647
|
-
for await (const chunk of process.stdin) {
|
|
13648
|
-
chunks.push(chunk);
|
|
13649
|
-
}
|
|
13650
|
-
const text = Buffer.concat(chunks).toString().trim();
|
|
13651
|
-
if (text) {
|
|
13652
|
-
try {
|
|
13653
|
-
return JSON.parse(text);
|
|
13654
|
-
} catch (error) {
|
|
13655
|
-
throw new Error(`\u7121\u52B9\u306A JSON \u3067\u3059 (stdin): ${text}`);
|
|
13656
|
-
}
|
|
13657
|
-
}
|
|
13658
|
-
}
|
|
13659
13657
|
return void 0;
|
|
13660
13658
|
}
|
|
13661
13659
|
function placeholderForType(type) {
|