@kweaver-ai/kweaver-sdk 0.5.1 → 0.5.2
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/README.md +6 -1
- package/README.zh.md +5 -0
- package/dist/api/agent-chat.d.ts +1 -1
- package/dist/api/agent-chat.js +4 -4
- package/dist/api/agent-list.d.ts +35 -0
- package/dist/api/agent-list.js +86 -12
- package/dist/api/bkn-backend.d.ts +60 -0
- package/dist/api/bkn-backend.js +103 -10
- package/dist/api/conversations.d.ts +6 -3
- package/dist/api/conversations.js +26 -27
- package/dist/api/dataflow.js +1 -10
- package/dist/api/datasources.js +1 -10
- package/dist/api/dataviews.js +1 -10
- package/dist/api/headers.d.ts +9 -0
- package/dist/api/headers.js +25 -0
- package/dist/api/knowledge-networks.d.ts +41 -0
- package/dist/api/knowledge-networks.js +69 -22
- package/dist/api/ontology-query.d.ts +14 -1
- package/dist/api/ontology-query.js +63 -49
- package/dist/api/semantic-search.js +2 -12
- package/dist/api/skills.d.ts +141 -0
- package/dist/api/skills.js +216 -0
- package/dist/api/vega.d.ts +63 -0
- package/dist/api/vega.js +130 -10
- package/dist/auth/oauth.d.ts +5 -1
- package/dist/auth/oauth.js +293 -94
- package/dist/cli.js +28 -4
- package/dist/client.d.ts +3 -0
- package/dist/client.js +4 -0
- package/dist/commands/agent.d.ts +33 -1
- package/dist/commands/agent.js +721 -49
- package/dist/commands/auth.js +156 -33
- package/dist/commands/bkn-ops.d.ts +77 -0
- package/dist/commands/bkn-ops.js +1056 -0
- package/dist/commands/bkn-query.d.ts +14 -0
- package/dist/commands/bkn-query.js +370 -0
- package/dist/commands/bkn-schema.d.ts +135 -0
- package/dist/commands/bkn-schema.js +1461 -0
- package/dist/commands/bkn-utils.d.ts +36 -0
- package/dist/commands/bkn-utils.js +102 -0
- package/dist/commands/bkn.d.ts +7 -113
- package/dist/commands/bkn.js +175 -2429
- package/dist/commands/dataview.d.ts +7 -0
- package/dist/commands/dataview.js +38 -2
- package/dist/commands/ds.d.ts +1 -0
- package/dist/commands/ds.js +8 -1
- package/dist/commands/import-csv.d.ts +2 -0
- package/dist/commands/import-csv.js +3 -2
- package/dist/commands/skill.d.ts +26 -0
- package/dist/commands/skill.js +524 -0
- package/dist/commands/vega.js +371 -14
- package/dist/config/jwt.d.ts +6 -0
- package/dist/config/jwt.js +21 -0
- package/dist/config/store.d.ts +37 -5
- package/dist/config/store.js +363 -30
- package/dist/index.d.ts +6 -1
- package/dist/index.js +5 -1
- package/dist/resources/bkn.d.ts +4 -0
- package/dist/resources/bkn.js +4 -0
- package/dist/resources/conversations.d.ts +5 -2
- package/dist/resources/conversations.js +17 -3
- package/dist/resources/skills.d.ts +47 -0
- package/dist/resources/skills.js +47 -0
- package/dist/resources/vega.d.ts +11 -0
- package/dist/resources/vega.js +37 -1
- package/package.json +1 -1
package/dist/commands/auth.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { autoSelectBusinessDomain, clearPlatformSession, deletePlatform, getConfigDir, getCurrentPlatform, getPlatformAlias, hasPlatform, listPlatforms, loadClientConfig, loadTokenConfig, resolvePlatformIdentifier, setCurrentPlatform, setPlatformAlias, } from "../config/store.js";
|
|
1
|
+
import { autoSelectBusinessDomain, clearPlatformSession, deletePlatform, deleteUser, getActiveUser, getConfigDir, getCurrentPlatform, getPlatformAlias, hasPlatform, listPlatforms, listUserProfiles, loadClientConfig, loadTokenConfig, resolvePlatformIdentifier, resolveUserId, setActiveUser, setCurrentPlatform, setPlatformAlias, } from "../config/store.js";
|
|
2
|
+
import { decodeJwtPayload } from "../config/jwt.js";
|
|
2
3
|
import { buildCopyCommand, formatHttpError, normalizeBaseUrl, oauth2Login, playwrightLogin, refreshTokenLogin, } from "../auth/oauth.js";
|
|
3
4
|
export async function runAuthCommand(args) {
|
|
4
5
|
const target = args[0];
|
|
@@ -9,10 +10,12 @@ kweaver auth <url> Login (shorthand; same options as login)
|
|
|
9
10
|
kweaver auth whoami [url|alias] Show current user identity (from id_token)
|
|
10
11
|
kweaver auth export [url|alias] [--json] Export credentials; run printed command on a headless host
|
|
11
12
|
kweaver auth status [url|alias] Show current auth status
|
|
12
|
-
kweaver auth list List
|
|
13
|
+
kweaver auth list List all platforms and users (tree view)
|
|
13
14
|
kweaver auth use <url|alias> Switch active platform
|
|
14
|
-
kweaver auth
|
|
15
|
-
kweaver auth
|
|
15
|
+
kweaver auth users [url|alias] List all user profiles (with usernames) for a platform
|
|
16
|
+
kweaver auth switch [url|alias] --user <id|username> Switch active user for a platform
|
|
17
|
+
kweaver auth logout [url|alias] [--user <id>] Logout (clear local token)
|
|
18
|
+
kweaver auth delete <url|alias> [--user <id>] Delete saved credentials
|
|
16
19
|
|
|
17
20
|
Login options:
|
|
18
21
|
--alias <name> Save platform with a short alias (use with use / status / logout)
|
|
@@ -23,6 +26,10 @@ Login options:
|
|
|
23
26
|
--refresh-token <t> Use on a machine without a browser: exchange refresh token for access token.
|
|
24
27
|
Requires --client-id and --client-secret.
|
|
25
28
|
Get these from the callback page after browser login or \`auth export\`.
|
|
29
|
+
--port <n> Local callback port (default: 9010). Use when 9010 is occupied.
|
|
30
|
+
--redirect-uri <uri> Full OAuth2 redirect URI override. Localhost URIs start a local server;
|
|
31
|
+
non-localhost URIs use a manual paste-the-callback-URL flow.
|
|
32
|
+
Overrides --port. Example: http://127.0.0.1:8080/callback
|
|
26
33
|
-u, --username Username (with -p triggers Playwright headless login)
|
|
27
34
|
-p, --password Password
|
|
28
35
|
--playwright Force Playwright browser login even without -u/-p
|
|
@@ -47,7 +54,13 @@ Login options:
|
|
|
47
54
|
if (target === "export") {
|
|
48
55
|
return runAuthExportCommand(rest);
|
|
49
56
|
}
|
|
50
|
-
|
|
57
|
+
if (target === "users") {
|
|
58
|
+
return runAuthUsersCommand(rest);
|
|
59
|
+
}
|
|
60
|
+
if (target === "switch") {
|
|
61
|
+
return runAuthSwitchCommand(rest);
|
|
62
|
+
}
|
|
63
|
+
const LOGIN_SUBCOMMANDS = new Set(["status", "list", "use", "delete", "logout", "export", "whoami", "users", "switch"]);
|
|
51
64
|
if (target && !LOGIN_SUBCOMMANDS.has(target)) {
|
|
52
65
|
try {
|
|
53
66
|
const normalizedTarget = normalizeBaseUrl(target);
|
|
@@ -58,7 +71,14 @@ Login options:
|
|
|
58
71
|
const clientId = readOption(args, "--client-id");
|
|
59
72
|
const clientSecret = readOption(args, "--client-secret");
|
|
60
73
|
const refreshToken = readOption(args, "--refresh-token");
|
|
74
|
+
const customRedirectUri = readOption(args, "--redirect-uri");
|
|
75
|
+
const customPortStr = readOption(args, "--port");
|
|
76
|
+
const customPort = customPortStr ? parseInt(customPortStr, 10) : undefined;
|
|
61
77
|
const tlsInsecure = args.includes("--insecure") || args.includes("-k");
|
|
78
|
+
if (customPort !== undefined && (Number.isNaN(customPort) || customPort < 1 || customPort > 65535)) {
|
|
79
|
+
console.error("Invalid --port value. Expected a number between 1 and 65535.");
|
|
80
|
+
return 1;
|
|
81
|
+
}
|
|
62
82
|
let token;
|
|
63
83
|
if (refreshToken) {
|
|
64
84
|
if (!clientId || !clientSecret) {
|
|
@@ -72,17 +92,20 @@ Login options:
|
|
|
72
92
|
});
|
|
73
93
|
}
|
|
74
94
|
else if (username && password) {
|
|
75
|
-
// Headless Playwright login with credentials
|
|
76
95
|
console.log("Logging in (headless)...");
|
|
77
|
-
token = await playwrightLogin(normalizedTarget, {
|
|
96
|
+
token = await playwrightLogin(normalizedTarget, {
|
|
97
|
+
username, password, tlsInsecure,
|
|
98
|
+
port: customPort, redirectUri: customRedirectUri ?? undefined,
|
|
99
|
+
});
|
|
78
100
|
}
|
|
79
101
|
else if (usePlaywright) {
|
|
80
|
-
// Explicit Playwright fallback
|
|
81
102
|
console.log("Opening browser for login (Playwright)...");
|
|
82
|
-
token = await playwrightLogin(normalizedTarget, {
|
|
103
|
+
token = await playwrightLogin(normalizedTarget, {
|
|
104
|
+
tlsInsecure,
|
|
105
|
+
port: customPort, redirectUri: customRedirectUri ?? undefined,
|
|
106
|
+
});
|
|
83
107
|
}
|
|
84
108
|
else {
|
|
85
|
-
// Default: OAuth2 authorization code flow (supports refresh_token)
|
|
86
109
|
if (clientId) {
|
|
87
110
|
console.log(`Opening browser for OAuth2 login (client: ${clientId})...`);
|
|
88
111
|
}
|
|
@@ -93,6 +116,7 @@ Login options:
|
|
|
93
116
|
clientId: clientId ?? undefined,
|
|
94
117
|
clientSecret: clientSecret ?? undefined,
|
|
95
118
|
tlsInsecure,
|
|
119
|
+
port: customPort, redirectUri: customRedirectUri ?? undefined,
|
|
96
120
|
});
|
|
97
121
|
}
|
|
98
122
|
if (alias) {
|
|
@@ -109,6 +133,11 @@ Login options:
|
|
|
109
133
|
}
|
|
110
134
|
}
|
|
111
135
|
console.log(`Current platform: ${normalizedTarget}`);
|
|
136
|
+
const activeUser = getActiveUser(normalizedTarget);
|
|
137
|
+
if (activeUser) {
|
|
138
|
+
const userLabel = token.displayName ? `${token.displayName} (${activeUser})` : activeUser;
|
|
139
|
+
console.log(`User: ${userLabel}`);
|
|
140
|
+
}
|
|
112
141
|
console.log(`Access token saved: yes`);
|
|
113
142
|
if (token.refreshToken) {
|
|
114
143
|
console.log(`Refresh token: yes (auto-refresh enabled)`);
|
|
@@ -148,8 +177,14 @@ Login options:
|
|
|
148
177
|
`Config directory: ${getConfigDir()}`,
|
|
149
178
|
`Platform: ${token.baseUrl}`,
|
|
150
179
|
`Current platform: ${token.baseUrl === currentPlatform ? "yes" : "no"}`,
|
|
151
|
-
`Token present: yes`,
|
|
152
180
|
];
|
|
181
|
+
const statusActiveUser = getActiveUser(platform);
|
|
182
|
+
if (statusActiveUser) {
|
|
183
|
+
const statusDisplayName = token.displayName;
|
|
184
|
+
const userLabel = statusDisplayName ? `${statusDisplayName} (${statusActiveUser})` : statusActiveUser;
|
|
185
|
+
lines.push(`User: ${userLabel}`);
|
|
186
|
+
}
|
|
187
|
+
lines.push(`Token present: yes`);
|
|
153
188
|
lines.push(`Refresh token: ${token.refreshToken ? "yes (auto-refresh enabled)" : "no"}`);
|
|
154
189
|
if (token.tlsInsecure) {
|
|
155
190
|
lines.push(`TLS: certificate verification disabled (saved; dev only)`);
|
|
@@ -183,8 +218,18 @@ Login options:
|
|
|
183
218
|
console.log(`Config directory: ${getConfigDir()}`);
|
|
184
219
|
for (const platform of platforms) {
|
|
185
220
|
const marker = platform.baseUrl === currentPlatform ? "*" : "-";
|
|
186
|
-
const aliasPart = platform.alias ? `
|
|
187
|
-
console.log(`${marker} ${platform.baseUrl}${aliasPart}
|
|
221
|
+
const aliasPart = platform.alias ? ` (${platform.alias})` : "";
|
|
222
|
+
console.log(`${marker} ${platform.baseUrl}${aliasPart}`);
|
|
223
|
+
const profiles = listUserProfiles(platform.baseUrl);
|
|
224
|
+
const activeUser = getActiveUser(platform.baseUrl);
|
|
225
|
+
for (let i = 0; i < profiles.length; i++) {
|
|
226
|
+
const p = profiles[i];
|
|
227
|
+
const isLast = i === profiles.length - 1;
|
|
228
|
+
const branch = isLast ? "└──" : "├──";
|
|
229
|
+
const activeMarker = p.userId === activeUser ? " *" : "";
|
|
230
|
+
const label = p.username ? `${p.username} (${p.userId})` : p.userId;
|
|
231
|
+
console.log(` ${branch} ${label}${activeMarker}`);
|
|
232
|
+
}
|
|
188
233
|
}
|
|
189
234
|
return 0;
|
|
190
235
|
}
|
|
@@ -204,16 +249,24 @@ Login options:
|
|
|
204
249
|
return 0;
|
|
205
250
|
}
|
|
206
251
|
if (target === "delete") {
|
|
207
|
-
const
|
|
252
|
+
const deleteUserArg = readOption(args, "--user");
|
|
253
|
+
const positionalArgs = args.slice(1).filter((a) => a !== "--user" && a !== deleteUserArg);
|
|
254
|
+
const resolvedTarget = positionalArgs[0] ? resolvePlatformIdentifier(positionalArgs[0]) : "";
|
|
208
255
|
const deleteTarget = resolvedTarget && /^https?:\/\//.test(resolvedTarget) ? normalizeBaseUrl(resolvedTarget) : resolvedTarget;
|
|
209
256
|
if (!deleteTarget) {
|
|
210
|
-
console.error("Usage: kweaver auth delete <platform-url|alias>");
|
|
257
|
+
console.error("Usage: kweaver auth delete <platform-url|alias> [--user <userId|username>]");
|
|
211
258
|
return 1;
|
|
212
259
|
}
|
|
213
260
|
if (!hasPlatform(deleteTarget)) {
|
|
214
261
|
console.error(`No saved token for ${deleteTarget}.`);
|
|
215
262
|
return 1;
|
|
216
263
|
}
|
|
264
|
+
if (deleteUserArg) {
|
|
265
|
+
const deleteUserId = resolveUserId(deleteTarget, deleteUserArg) ?? deleteUserArg;
|
|
266
|
+
deleteUser(deleteTarget, deleteUserId);
|
|
267
|
+
console.log(`Deleted user ${deleteUserId} from ${deleteTarget}`);
|
|
268
|
+
return 0;
|
|
269
|
+
}
|
|
217
270
|
const wasCurrent = getCurrentPlatform() === deleteTarget;
|
|
218
271
|
deletePlatform(deleteTarget);
|
|
219
272
|
console.log(`Deleted platform: ${deleteTarget}`);
|
|
@@ -224,10 +277,12 @@ Login options:
|
|
|
224
277
|
return 0;
|
|
225
278
|
}
|
|
226
279
|
if (target === "logout") {
|
|
227
|
-
const
|
|
280
|
+
const logoutUserArg = readOption(args, "--user");
|
|
281
|
+
const positionalArgs = args.slice(1).filter((a) => a !== "--user" && a !== logoutUserArg);
|
|
282
|
+
const resolvedTarget = positionalArgs[0] ? resolvePlatformIdentifier(positionalArgs[0]) : getCurrentPlatform();
|
|
228
283
|
const logoutTarget = resolvedTarget && /^https?:\/\//.test(resolvedTarget) ? normalizeBaseUrl(resolvedTarget) : resolvedTarget;
|
|
229
284
|
if (!logoutTarget) {
|
|
230
|
-
console.error("Usage: kweaver auth logout [platform-url|alias]");
|
|
285
|
+
console.error("Usage: kweaver auth logout [platform-url|alias] [--user <userId|username>]");
|
|
231
286
|
console.error("No current platform. Specify a platform to logout.");
|
|
232
287
|
return 1;
|
|
233
288
|
}
|
|
@@ -235,8 +290,10 @@ Login options:
|
|
|
235
290
|
console.error(`No saved token for ${logoutTarget}.`);
|
|
236
291
|
return 1;
|
|
237
292
|
}
|
|
238
|
-
|
|
239
|
-
|
|
293
|
+
const logoutUserId = logoutUserArg ? resolveUserId(logoutTarget, logoutUserArg) ?? logoutUserArg : undefined;
|
|
294
|
+
clearPlatformSession(logoutTarget, logoutUserId);
|
|
295
|
+
const userHint = logoutUserId ? ` (user: ${logoutUserId})` : "";
|
|
296
|
+
console.log(`Logged out: ${logoutTarget}${userHint}`);
|
|
240
297
|
console.log(`Run \`kweaver auth login ${logoutTarget}\` to sign in again.`);
|
|
241
298
|
return 0;
|
|
242
299
|
}
|
|
@@ -246,22 +303,82 @@ Login options:
|
|
|
246
303
|
console.error(" kweaver auth status [platform-url|alias]");
|
|
247
304
|
console.error(" kweaver auth list");
|
|
248
305
|
console.error(" kweaver auth use <platform-url|alias>");
|
|
249
|
-
console.error(" kweaver auth
|
|
250
|
-
console.error(" kweaver auth
|
|
306
|
+
console.error(" kweaver auth users [platform-url|alias]");
|
|
307
|
+
console.error(" kweaver auth switch [platform-url|alias] --user <userId>");
|
|
308
|
+
console.error(" kweaver auth logout [platform-url|alias] [--user <userId>]");
|
|
309
|
+
console.error(" kweaver auth delete <platform-url|alias> [--user <userId>]");
|
|
251
310
|
return 1;
|
|
252
311
|
}
|
|
253
|
-
function
|
|
254
|
-
const
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
312
|
+
function resolvePlatformArg(args) {
|
|
313
|
+
const positional = args.find((a) => !a.startsWith("-"));
|
|
314
|
+
const resolved = positional ? resolvePlatformIdentifier(positional) : null;
|
|
315
|
+
if (resolved && /^https?:\/\//.test(resolved))
|
|
316
|
+
return normalizeBaseUrl(resolved);
|
|
317
|
+
return resolved ?? getCurrentPlatform();
|
|
318
|
+
}
|
|
319
|
+
function runAuthUsersCommand(args) {
|
|
320
|
+
if (args[0] === "--help" || args[0] === "-h") {
|
|
321
|
+
console.log(`kweaver auth users [platform-url|alias]
|
|
322
|
+
|
|
323
|
+
List all user profiles stored for a platform.
|
|
324
|
+
Each line shows: userId (username) where username is decoded from the id_token.
|
|
325
|
+
You can use either userId or username with --user in switch/logout/delete.`);
|
|
326
|
+
return 0;
|
|
327
|
+
}
|
|
328
|
+
const platform = resolvePlatformArg(args);
|
|
329
|
+
if (!platform) {
|
|
330
|
+
console.error("No active platform. Run `kweaver auth login <platform-url>` first.");
|
|
331
|
+
return 1;
|
|
332
|
+
}
|
|
333
|
+
const profiles = listUserProfiles(platform);
|
|
334
|
+
if (profiles.length === 0) {
|
|
335
|
+
console.error(`No user profiles for ${platform}.`);
|
|
336
|
+
return 1;
|
|
337
|
+
}
|
|
338
|
+
const active = getActiveUser(platform);
|
|
339
|
+
console.log(`Platform: ${platform}`);
|
|
340
|
+
for (const p of profiles) {
|
|
341
|
+
const marker = p.userId === active ? "*" : "-";
|
|
342
|
+
const displayName = p.username ? ` (${p.username})` : "";
|
|
343
|
+
console.log(`${marker} ${p.userId}${displayName}`);
|
|
344
|
+
}
|
|
345
|
+
return 0;
|
|
346
|
+
}
|
|
347
|
+
function runAuthSwitchCommand(args) {
|
|
348
|
+
if (args[0] === "--help" || args[0] === "-h") {
|
|
349
|
+
console.log(`kweaver auth switch [platform-url|alias] --user <userId|username>
|
|
350
|
+
|
|
351
|
+
Switch the active user for a platform.
|
|
352
|
+
You can specify either the userId (sub claim) or the username (preferred_username from id_token).`);
|
|
353
|
+
return 0;
|
|
264
354
|
}
|
|
355
|
+
const userArg = readOption(args, "--user");
|
|
356
|
+
if (!userArg) {
|
|
357
|
+
console.error("Usage: kweaver auth switch [platform-url|alias] --user <userId|username>");
|
|
358
|
+
return 1;
|
|
359
|
+
}
|
|
360
|
+
const filteredArgs = args.filter((a) => a !== "--user" && a !== userArg);
|
|
361
|
+
const platform = resolvePlatformArg(filteredArgs);
|
|
362
|
+
if (!platform) {
|
|
363
|
+
console.error("No active platform. Run `kweaver auth login <platform-url>` first.");
|
|
364
|
+
return 1;
|
|
365
|
+
}
|
|
366
|
+
const resolvedId = resolveUserId(platform, userArg);
|
|
367
|
+
if (!resolvedId) {
|
|
368
|
+
console.error(`User '${userArg}' not found for ${platform}.`);
|
|
369
|
+
const profiles = listUserProfiles(platform);
|
|
370
|
+
if (profiles.length > 0) {
|
|
371
|
+
const hints = profiles.map((p) => p.username ? `${p.userId} (${p.username})` : p.userId);
|
|
372
|
+
console.error(`Available users: ${hints.join(", ")}`);
|
|
373
|
+
}
|
|
374
|
+
return 1;
|
|
375
|
+
}
|
|
376
|
+
setActiveUser(platform, resolvedId);
|
|
377
|
+
const profiles = listUserProfiles(platform);
|
|
378
|
+
const profile = profiles.find((p) => p.userId === resolvedId);
|
|
379
|
+
const displayName = profile?.username ? ` (${profile.username})` : "";
|
|
380
|
+
console.log(`Switched to user ${resolvedId}${displayName} on ${platform}`);
|
|
381
|
+
return 0;
|
|
265
382
|
}
|
|
266
383
|
function runAuthWhoamiCommand(args) {
|
|
267
384
|
if (args[0] === "--help" || args[0] === "-h") {
|
|
@@ -295,11 +412,17 @@ Options:
|
|
|
295
412
|
console.error("Failed to decode id_token.");
|
|
296
413
|
return 1;
|
|
297
414
|
}
|
|
415
|
+
const displayNameValue = token.displayName ?? null;
|
|
298
416
|
if (jsonOutput) {
|
|
299
|
-
|
|
417
|
+
const out = { platform, ...payload };
|
|
418
|
+
if (displayNameValue)
|
|
419
|
+
out.displayName = displayNameValue;
|
|
420
|
+
console.log(JSON.stringify(out, null, 2));
|
|
300
421
|
return 0;
|
|
301
422
|
}
|
|
302
423
|
console.log(`Platform: ${platform}`);
|
|
424
|
+
if (displayNameValue)
|
|
425
|
+
console.log(`Username: ${displayNameValue}`);
|
|
303
426
|
console.log(`User ID: ${payload.sub ?? "(unknown)"}`);
|
|
304
427
|
console.log(`Issuer: ${payload.iss ?? "(unknown)"}`);
|
|
305
428
|
if (payload.sid)
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { type BknEncodingImportOptions } from "../utils/bkn-encoding.js";
|
|
2
|
+
export declare function parseKnBuildArgs(args: string[]): {
|
|
3
|
+
knId: string;
|
|
4
|
+
wait: boolean;
|
|
5
|
+
timeout: number;
|
|
6
|
+
businessDomain: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function runKnBuildCommand(args: string[]): Promise<number>;
|
|
9
|
+
export declare function runKnValidateCommand(args: string[]): Promise<number>;
|
|
10
|
+
export interface KnPushOptions {
|
|
11
|
+
directory: string;
|
|
12
|
+
branch: string;
|
|
13
|
+
businessDomain: string;
|
|
14
|
+
pretty: boolean;
|
|
15
|
+
encodingOptions: BknEncodingImportOptions;
|
|
16
|
+
}
|
|
17
|
+
export declare function parseKnPushArgs(args: string[]): KnPushOptions;
|
|
18
|
+
export interface KnPullOptions {
|
|
19
|
+
knId: string;
|
|
20
|
+
directory: string;
|
|
21
|
+
branch: string;
|
|
22
|
+
businessDomain: string;
|
|
23
|
+
}
|
|
24
|
+
export declare function parseKnPullArgs(args: string[]): KnPullOptions;
|
|
25
|
+
export declare function packDirectoryToTar(dirPath: string): Buffer;
|
|
26
|
+
export declare function extractTarToDirectory(tarBuffer: Buffer, dirPath: string): void;
|
|
27
|
+
export declare function runKnPushCommand(args: string[]): Promise<number>;
|
|
28
|
+
export declare function runKnPullCommand(args: string[]): Promise<number>;
|
|
29
|
+
export declare function parseKnCreateFromDsArgs(args: string[]): {
|
|
30
|
+
dsId: string;
|
|
31
|
+
name: string;
|
|
32
|
+
tables: string[];
|
|
33
|
+
build: boolean;
|
|
34
|
+
timeout: number;
|
|
35
|
+
businessDomain: string;
|
|
36
|
+
pretty: boolean;
|
|
37
|
+
};
|
|
38
|
+
/** Generate a BKN ObjectType YAML markdown file for a table. */
|
|
39
|
+
export declare function generateObjectTypeBkn(tableName: string, dvId: string, pk: string, dk: string, columns: Array<{
|
|
40
|
+
name: string;
|
|
41
|
+
type: string;
|
|
42
|
+
}>): string;
|
|
43
|
+
export declare function runKnCreateFromDsCommand(args: string[], sampleRows?: Record<string, Array<Record<string, string | null>>>): Promise<number>;
|
|
44
|
+
export declare function parseKnCreateFromCsvArgs(args: string[]): {
|
|
45
|
+
dsId: string;
|
|
46
|
+
files: string;
|
|
47
|
+
name: string;
|
|
48
|
+
tablePrefix: string;
|
|
49
|
+
batchSize: number;
|
|
50
|
+
tables: string[];
|
|
51
|
+
build: boolean;
|
|
52
|
+
timeout: number;
|
|
53
|
+
businessDomain: string;
|
|
54
|
+
};
|
|
55
|
+
export declare function runKnCreateFromCsvCommand(args: string[]): Promise<number>;
|
|
56
|
+
export interface ActionScheduleParsed {
|
|
57
|
+
action: string;
|
|
58
|
+
knId: string;
|
|
59
|
+
itemId: string;
|
|
60
|
+
body: string;
|
|
61
|
+
extra: string;
|
|
62
|
+
yes: boolean;
|
|
63
|
+
pretty: boolean;
|
|
64
|
+
businessDomain: string;
|
|
65
|
+
}
|
|
66
|
+
export declare function parseActionScheduleArgs(args: string[]): ActionScheduleParsed;
|
|
67
|
+
export declare function runKnActionScheduleCommand(args: string[]): Promise<number>;
|
|
68
|
+
export interface JobParsed {
|
|
69
|
+
action: string;
|
|
70
|
+
knId: string;
|
|
71
|
+
itemId: string;
|
|
72
|
+
yes: boolean;
|
|
73
|
+
pretty: boolean;
|
|
74
|
+
businessDomain: string;
|
|
75
|
+
}
|
|
76
|
+
export declare function parseJobArgs(args: string[]): JobParsed;
|
|
77
|
+
export declare function runKnJobCommand(args: string[]): Promise<number>;
|