linkque-cli-v2 1.2.4 → 1.2.5
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/linkquejs.js +34567 -23068
- package/package.json +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/chunk-7OQJF6OX.js +30 -0
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-F3IESVDW.js → chunk-E5KGGPEP.js} +81 -101
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/chunk-YYBDYBTX.js +21613 -0
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/runtime/handler/chat.js +41800 -220
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/runtime/handler/clientCapability.js +4 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/runtime/protocol.js +2 -7
- package/worker.js +100108 -99561
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/chunk-BBS46AHY.js +0 -61386
package/package.json
CHANGED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import {
|
|
2
|
+
EModelProvider
|
|
3
|
+
} from "./chunk-YYBDYBTX.js";
|
|
4
|
+
|
|
5
|
+
// ../linkque-agent-appwrite-integrate/dist/esm/runtime/protocol.js
|
|
6
|
+
var baked;
|
|
7
|
+
function getBakedProtocol() {
|
|
8
|
+
if (baked)
|
|
9
|
+
return baked;
|
|
10
|
+
return {
|
|
11
|
+
agentId: "__unbaked__",
|
|
12
|
+
name: "__unbaked__",
|
|
13
|
+
version: "0.0.0",
|
|
14
|
+
agent: {
|
|
15
|
+
model: { provider: EModelProvider.TEST, defaultModel: "" },
|
|
16
|
+
systemPrompt: { content: "" },
|
|
17
|
+
multimodel: { enabled: false },
|
|
18
|
+
resources: []
|
|
19
|
+
// harness 缺省:走 runtime 内置默认预制提示梁(DEFAULT_HARNESS_PROMPT 兜底)。
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function setBakedProtocol(protocol) {
|
|
24
|
+
baked = protocol;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export {
|
|
28
|
+
getBakedProtocol,
|
|
29
|
+
setBakedProtocol
|
|
30
|
+
};
|
package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-F3IESVDW.js → chunk-E5KGGPEP.js}
RENAMED
|
@@ -15,6 +15,10 @@ import {
|
|
|
15
15
|
import {
|
|
16
16
|
require_json_bigint
|
|
17
17
|
} from "./chunk-2NGJGNYB.js";
|
|
18
|
+
import {
|
|
19
|
+
RUNTIME_CONFIG_DEFAULTS,
|
|
20
|
+
RuntimeConfigProvider
|
|
21
|
+
} from "./chunk-YYBDYBTX.js";
|
|
18
22
|
import {
|
|
19
23
|
__commonJS,
|
|
20
24
|
__require,
|
|
@@ -7328,6 +7332,41 @@ var require_agent = __commonJS({
|
|
|
7328
7332
|
}
|
|
7329
7333
|
});
|
|
7330
7334
|
|
|
7335
|
+
// ../linkque-agent-appwrite-integrate/dist/esm/runtime/appbaseRuntimeConfigProvider.js
|
|
7336
|
+
var LINKQUE_ENDPOINT_PRE = "https://linkquegw-pre.alipay.com";
|
|
7337
|
+
var APPBASE_RUNTIME_CONFIG_DEFAULTS = Object.freeze({
|
|
7338
|
+
...RUNTIME_CONFIG_DEFAULTS,
|
|
7339
|
+
LINKQUE_MODEL_PROVIDER: "LINKQUE",
|
|
7340
|
+
AGENT_CONFIG_URL: `${RUNTIME_CONFIG_DEFAULTS.LINKQUEGW_KNOWLEDGE_BASE_URL}/api/agent/config`,
|
|
7341
|
+
AGENT_CONFIG_URL_PRE: `${LINKQUE_ENDPOINT_PRE}/api/agent/config`,
|
|
7342
|
+
LINKQUE_BASE_URL_PRE: `${LINKQUE_ENDPOINT_PRE}/api/anthropic`,
|
|
7343
|
+
LINKQUEGW_KNOWLEDGE_BASE_URL_PRE: LINKQUE_ENDPOINT_PRE,
|
|
7344
|
+
LINKQUEGW_EVENT_BASE_URL_PRE: LINKQUE_ENDPOINT_PRE,
|
|
7345
|
+
LINKQUEGW_MCP_SIGN_ENDPOINT_PRE: `${LINKQUE_ENDPOINT_PRE}/api/mcp/signature`,
|
|
7346
|
+
RUN_DATABASE_ID: "linkque",
|
|
7347
|
+
RUN_TABLE_ID: "linkque_conversation_runs",
|
|
7348
|
+
SESSION_DATABASE_ID: "linkque",
|
|
7349
|
+
SESSION_TABLE_ID: "linkque_sessions",
|
|
7350
|
+
SESSION_LEASE_DATABASE_ID: "linkque",
|
|
7351
|
+
SESSION_LEASE_TABLE_ID: "linkque_session_leases",
|
|
7352
|
+
RUN_INDEX_DATABASE_ID: "linkque",
|
|
7353
|
+
RUN_INDEX_TABLE_ID: "linkque_conversation_run_index",
|
|
7354
|
+
SEARCH_DATABASE_ID: "linkque",
|
|
7355
|
+
SEARCH_TABLE_ID: "linkque_conversation_message_search",
|
|
7356
|
+
CLIENT_CAPABILITY_DATABASE_ID: "linkque",
|
|
7357
|
+
CLIENT_CAPABILITY_TABLE_ID: "linkque_client_cap_invocations",
|
|
7358
|
+
A2UI_ACTION_DATABASE_ID: "linkque",
|
|
7359
|
+
A2UI_ACTION_TABLE_ID: "linkque_a2ui_action_invocations",
|
|
7360
|
+
RUN_CHUNK_SIZE: "30",
|
|
7361
|
+
RUN_CANCEL_POLL_INTERVAL_MS: "500",
|
|
7362
|
+
LOG_LEVEL: "INFO"
|
|
7363
|
+
});
|
|
7364
|
+
var AppbaseRuntimeConfigProvider = class extends RuntimeConfigProvider {
|
|
7365
|
+
constructor(env = process.env) {
|
|
7366
|
+
super(env, APPBASE_RUNTIME_CONFIG_DEFAULTS);
|
|
7367
|
+
}
|
|
7368
|
+
};
|
|
7369
|
+
|
|
7331
7370
|
// ../linkque-agent-appwrite-integrate/dist/esm/runtime/auth.js
|
|
7332
7371
|
var LINKQUE_AUTHORIZATION_HEADER = "x-linkque-authorization";
|
|
7333
7372
|
var LinkqueGatewayAuthError = class extends Error {
|
|
@@ -7347,6 +7386,7 @@ var LinkqueGatewayAuthUnconfiguredError = class extends Error {
|
|
|
7347
7386
|
}
|
|
7348
7387
|
};
|
|
7349
7388
|
function resolveLinkqueGatewayAuth(headers, env = process.env, logCtx) {
|
|
7389
|
+
const config = new AppbaseRuntimeConfigProvider({ ...env });
|
|
7350
7390
|
const log = (...a2) => logCtx?.log?.("[auth-resolve]", ...a2);
|
|
7351
7391
|
const logError = (...a2) => logCtx?.error?.("[auth-resolve]", ...a2);
|
|
7352
7392
|
log("stage=start");
|
|
@@ -7374,7 +7414,7 @@ function resolveLinkqueGatewayAuth(headers, env = process.env, logCtx) {
|
|
|
7374
7414
|
throw new LinkqueGatewayAuthError();
|
|
7375
7415
|
}
|
|
7376
7416
|
log("stage=user-token-validation, state=success, scheme=Bearer");
|
|
7377
|
-
const provider2 = resolveProvider(
|
|
7417
|
+
const provider2 = resolveProvider(config.get("LINKQUE_MODEL_PROVIDER"), log, logError);
|
|
7378
7418
|
log("stage=complete, mode=user-token, source=request-header");
|
|
7379
7419
|
return {
|
|
7380
7420
|
mode: "user-token",
|
|
@@ -7385,13 +7425,13 @@ function resolveLinkqueGatewayAuth(headers, env = process.env, logCtx) {
|
|
|
7385
7425
|
}
|
|
7386
7426
|
log("stage=header-inspection, state=absent");
|
|
7387
7427
|
log("stage=aak-fallback, state=start, source=env:LINKQUE_AGENT_ACCESS_KEY");
|
|
7388
|
-
const apiKey =
|
|
7428
|
+
const apiKey = config.get("LINKQUE_AGENT_ACCESS_KEY");
|
|
7389
7429
|
if (!apiKey) {
|
|
7390
7430
|
logError("stage=failed, reason=aak-unconfigured");
|
|
7391
7431
|
throw new LinkqueGatewayAuthUnconfiguredError();
|
|
7392
7432
|
}
|
|
7393
7433
|
log("stage=aak-fallback, state=configured");
|
|
7394
|
-
const provider = resolveProvider(
|
|
7434
|
+
const provider = resolveProvider(config.get("LINKQUE_MODEL_PROVIDER"), log, logError);
|
|
7395
7435
|
log("stage=complete, mode=aak, source=env:LINKQUE_AGENT_ACCESS_KEY");
|
|
7396
7436
|
return {
|
|
7397
7437
|
mode: "aak",
|
|
@@ -7410,8 +7450,6 @@ function resolveGatewayAuthContext(gatewayAuth, env = process.env, logCtx, calle
|
|
|
7410
7450
|
return resolveLinkqueGatewayAuth(void 0, env, logCtx);
|
|
7411
7451
|
}
|
|
7412
7452
|
function parseProvider(raw) {
|
|
7413
|
-
if (!raw)
|
|
7414
|
-
return "LINKQUE";
|
|
7415
7453
|
const upper = raw.toUpperCase();
|
|
7416
7454
|
if (upper === "LINKQUE")
|
|
7417
7455
|
return "LINKQUE";
|
|
@@ -11752,85 +11790,36 @@ function isConflict(error) {
|
|
|
11752
11790
|
|
|
11753
11791
|
// ../linkque-agent-appwrite-integrate/dist/esm/runtime/diagnostics.js
|
|
11754
11792
|
function maskSecret(raw) {
|
|
11755
|
-
|
|
11756
|
-
return "<unset>";
|
|
11757
|
-
const len = raw.length;
|
|
11758
|
-
if (len <= 4)
|
|
11759
|
-
return `<len=${len}>`;
|
|
11760
|
-
return `${raw.slice(0, 4)}****<len=${len}>`;
|
|
11793
|
+
return raw ? "<set>" : "<unset>";
|
|
11761
11794
|
}
|
|
11762
11795
|
function maskEndpoint(raw) {
|
|
11763
|
-
|
|
11764
|
-
return "<unset>";
|
|
11765
|
-
return raw.replace(/\/+$/, "");
|
|
11796
|
+
return raw ? raw.replace(/\/+$/, "") : "<unset>";
|
|
11766
11797
|
}
|
|
11767
11798
|
function isDebugLogLevel(env) {
|
|
11768
|
-
return env.LOG_LEVEL === "debug";
|
|
11799
|
+
return new AppbaseRuntimeConfigProvider(env).get("LOG_LEVEL") === "debug";
|
|
11769
11800
|
}
|
|
11770
11801
|
function whichSource(env, candidates) {
|
|
11771
|
-
|
|
11772
|
-
|
|
11773
|
-
return name;
|
|
11774
|
-
}
|
|
11775
|
-
return "<none>";
|
|
11776
|
-
}
|
|
11777
|
-
function envValue(env, name) {
|
|
11778
|
-
const v = env[name];
|
|
11779
|
-
if (v === void 0 || v === "")
|
|
11780
|
-
return "<unset>";
|
|
11781
|
-
return v;
|
|
11782
|
-
}
|
|
11783
|
-
function firstHit(env, candidates) {
|
|
11784
|
-
for (const name of candidates) {
|
|
11785
|
-
const v = env[name];
|
|
11786
|
-
if (v !== void 0 && v !== "")
|
|
11787
|
-
return v;
|
|
11788
|
-
}
|
|
11789
|
-
return "<unset>";
|
|
11790
|
-
}
|
|
11791
|
-
function envLine(name, value) {
|
|
11792
|
-
return `${name}=${value}`;
|
|
11793
|
-
}
|
|
11794
|
-
function apiKeySource(env, hasRequestKey) {
|
|
11795
|
-
if (hasRequestKey)
|
|
11796
|
-
return "request:x-appwrite-key";
|
|
11797
|
-
if (env.APPWRITE_FUNCTION_API_KEY !== void 0)
|
|
11798
|
-
return "APPWRITE_FUNCTION_API_KEY";
|
|
11799
|
-
if (env.APPWRITE_API_KEY !== void 0)
|
|
11800
|
-
return "APPWRITE_API_KEY";
|
|
11801
|
-
return "APPBASE_API_KEY";
|
|
11802
|
+
const config = new AppbaseRuntimeConfigProvider(env);
|
|
11803
|
+
return candidates.find((name) => config.getRaw(name) !== void 0) ?? "<none>";
|
|
11802
11804
|
}
|
|
11803
11805
|
function describeRuntimeEnv(env, hasRequestKey = false) {
|
|
11804
|
-
const
|
|
11805
|
-
|
|
11806
|
-
|
|
11807
|
-
|
|
11808
|
-
|
|
11809
|
-
|
|
11810
|
-
|
|
11811
|
-
|
|
11812
|
-
lines
|
|
11813
|
-
|
|
11814
|
-
|
|
11815
|
-
|
|
11816
|
-
|
|
11817
|
-
|
|
11818
|
-
|
|
11819
|
-
|
|
11820
|
-
|
|
11821
|
-
lines.push(envLine("SESSION_TABLE_ID", envValue(env, "SESSION_TABLE_ID")));
|
|
11822
|
-
lines.push(envLine("SESSION_LEASE_DATABASE_ID", envValue(env, "SESSION_LEASE_DATABASE_ID")));
|
|
11823
|
-
lines.push(envLine("SESSION_LEASE_TABLE_ID", envValue(env, "SESSION_LEASE_TABLE_ID")));
|
|
11824
|
-
lines.push(envLine("CLIENT_CAPABILITY_DATABASE_ID", envValue(env, "CLIENT_CAPABILITY_DATABASE_ID")));
|
|
11825
|
-
lines.push(envLine("CLIENT_CAPABILITY_TABLE_ID", envValue(env, "CLIENT_CAPABILITY_TABLE_ID")));
|
|
11826
|
-
lines.push(envLine("A2UI_ACTION_DATABASE_ID", envValue(env, "A2UI_ACTION_DATABASE_ID")));
|
|
11827
|
-
lines.push(envLine("A2UI_ACTION_TABLE_ID", envValue(env, "A2UI_ACTION_TABLE_ID")));
|
|
11828
|
-
lines.push(envLine("RUN_INDEX_DATABASE_ID", envValue(env, "RUN_INDEX_DATABASE_ID")));
|
|
11829
|
-
lines.push(envLine("RUN_INDEX_TABLE_ID", envValue(env, "RUN_INDEX_TABLE_ID")));
|
|
11830
|
-
lines.push(envLine("SEARCH_DATABASE_ID", envValue(env, "SEARCH_DATABASE_ID")));
|
|
11831
|
-
lines.push(envLine("SEARCH_TABLE_ID", envValue(env, "SEARCH_TABLE_ID")));
|
|
11832
|
-
lines.push(envLine("RUN_CHUNK_SIZE", envValue(env, "RUN_CHUNK_SIZE")));
|
|
11833
|
-
lines.push(envLine("LOG_LEVEL", envValue(env, "LOG_LEVEL")));
|
|
11806
|
+
const config = new AppbaseRuntimeConfigProvider(env);
|
|
11807
|
+
const endpointSource = whichSource(env, ENDPOINT_SOURCES);
|
|
11808
|
+
const projectSource = whichSource(env, PROJECT_SOURCES);
|
|
11809
|
+
const apiKeySource = [
|
|
11810
|
+
"APPWRITE_FUNCTION_API_KEY",
|
|
11811
|
+
"APPWRITE_API_KEY",
|
|
11812
|
+
"APPBASE_API_KEY"
|
|
11813
|
+
].find((name) => Boolean(config.getRaw(name)));
|
|
11814
|
+
const lines = [
|
|
11815
|
+
`LINKQUE_AGENT_ACCESS_KEY=${maskSecret(config.get("LINKQUE_AGENT_ACCESS_KEY"))}`,
|
|
11816
|
+
`APPBASE_ENDPOINT=${maskEndpoint(config.getRaw(endpointSource))}(src=${endpointSource})`,
|
|
11817
|
+
`APPBASE_PROJECT_ID=${config.getRaw(projectSource) || "<unset>"}(src=${projectSource})`,
|
|
11818
|
+
`APPBASE_API_KEY=${hasRequestKey ? "<set>" : maskSecret(apiKeySource ? config.getRaw(apiKeySource) : void 0)}(src=${hasRequestKey ? "request:x-appwrite-key" : apiKeySource ?? "<none>"})`
|
|
11819
|
+
];
|
|
11820
|
+
for (const name of Object.keys(APPBASE_RUNTIME_CONFIG_DEFAULTS)) {
|
|
11821
|
+
lines.push(`${name}=${config.get(name)}(src=${config.getSource(name)})`);
|
|
11822
|
+
}
|
|
11834
11823
|
return lines;
|
|
11835
11824
|
}
|
|
11836
11825
|
|
|
@@ -11851,39 +11840,33 @@ var PROJECT_SOURCES = [
|
|
|
11851
11840
|
];
|
|
11852
11841
|
function resolveRunStorage(env = process.env, logCtx) {
|
|
11853
11842
|
const log = (...a2) => logCtx?.log?.("[runStorage]", ...a2);
|
|
11854
|
-
const
|
|
11855
|
-
|
|
11856
|
-
|
|
11857
|
-
|
|
11858
|
-
const tableId = env.RUN_TABLE_ID;
|
|
11859
|
-
if (!tableId) {
|
|
11860
|
-
throw new Error("RUN_TABLE_ID \u672A\u914D\u7F6E:\u8BF7\u5728 AppBase Function \u53D8\u91CF\u4E2D\u8BBE\u7F6E");
|
|
11861
|
-
}
|
|
11862
|
-
const chunkSize = parsePositiveInt(env.RUN_CHUNK_SIZE, 30, "RUN_CHUNK_SIZE");
|
|
11843
|
+
const config = new AppbaseRuntimeConfigProvider(env);
|
|
11844
|
+
const databaseId = config.get("RUN_DATABASE_ID");
|
|
11845
|
+
const tableId = config.get("RUN_TABLE_ID");
|
|
11846
|
+
const chunkSize = parsePositiveInt(config.get("RUN_CHUNK_SIZE"), "RUN_CHUNK_SIZE");
|
|
11863
11847
|
log("\u843D\u5E93\u914D\u7F6E\u89E3\u6790\u6210\u529F, databaseId=", databaseId, "tableId=", tableId, "chunkSize=", chunkSize);
|
|
11864
11848
|
return { databaseId, tableId, chunkSize };
|
|
11865
11849
|
}
|
|
11866
11850
|
function createAppBaseClient(env = process.env, logCtx, executionApiKey) {
|
|
11867
11851
|
const log = (...a2) => logCtx?.log?.("[appbase-client]", ...a2);
|
|
11868
|
-
const
|
|
11852
|
+
const config = new AppbaseRuntimeConfigProvider(env);
|
|
11853
|
+
const endpoint = config.getRaw("APPWRITE_FUNCTION_API_ENDPOINT") ?? config.getRaw("APPWRITE_API_ENDPOINT") ?? config.getRaw("APPWRITE_ENDPOINT") ?? config.getRaw("APPBASE_API_ENDPOINT") ?? config.getRaw("APPBASE_ENDPOINT");
|
|
11869
11854
|
if (!endpoint) {
|
|
11870
11855
|
throw new Error("APPBASE_ENDPOINT \u672A\u914D\u7F6E:\u5E73\u53F0\u4E0D\u6CE8\u5165 AppBase API \u5165\u53E3\u70B9\u7531 deploy \u5199\u5165 APPBASE_ENDPOINT");
|
|
11871
11856
|
}
|
|
11872
|
-
const projectId =
|
|
11873
|
-
const apiKey = executionApiKey?.trim() ||
|
|
11857
|
+
const projectId = config.getRaw("APPWRITE_FUNCTION_PROJECT_ID") ?? config.getRaw("APPWRITE_PROJECT_ID") ?? config.getRaw("APPWRITE_PROJECT") ?? config.getRaw("APPBASE_PROJECT_ID") ?? config.getRaw("APPBASE_PROJECT");
|
|
11858
|
+
const apiKey = executionApiKey?.trim() || config.getRaw("APPWRITE_FUNCTION_API_KEY") || config.getRaw("APPWRITE_API_KEY") || config.getRaw("APPBASE_API_KEY");
|
|
11874
11859
|
if (!projectId) {
|
|
11875
11860
|
throw new Error("APPBASE_PROJECT_ID \u672A\u914D\u7F6E:\u5E73\u53F0\u5E94\u6CE8\u5165 APPWRITE_FUNCTION_PROJECT_ID,\u6216\u7531 deploy \u5199\u5165 APPBASE_PROJECT_ID");
|
|
11876
11861
|
}
|
|
11877
11862
|
if (!apiKey) {
|
|
11878
11863
|
throw new Error("Appwrite Server API Key \u7F3A\u5931:\u5E73\u53F0\u5E94\u5728 x-appwrite-key \u6CE8\u5165\u52A8\u6001 key,\u6216\u7531\u672C\u5730/\u6D4B\u8BD5 export APPWRITE_FUNCTION_API_KEY/APPWRITE_API_KEY/APPBASE_API_KEY");
|
|
11879
11864
|
}
|
|
11880
|
-
log("AppBase Client \u6784\u9020, endpoint=", maskEndpoint(endpoint), "(source=", whichSource(env, ENDPOINT_SOURCES), ") projectId=", projectId, "(source=", whichSource(env, PROJECT_SOURCES), ") apiKey=", maskSecret(apiKey), "(source=", executionApiKey?.trim() ? "request:x-appwrite-key" :
|
|
11865
|
+
log("AppBase Client \u6784\u9020, endpoint=", maskEndpoint(endpoint), "(source=", whichSource(env, ENDPOINT_SOURCES), ") projectId=", projectId, "(source=", whichSource(env, PROJECT_SOURCES), ") apiKey=", maskSecret(apiKey), "(source=", executionApiKey?.trim() ? "request:x-appwrite-key" : config.getRaw("APPWRITE_FUNCTION_API_KEY") ? "APPWRITE_FUNCTION_API_KEY" : config.getRaw("APPWRITE_API_KEY") ? "APPWRITE_API_KEY" : "APPBASE_API_KEY", ")");
|
|
11881
11866
|
const client = new Client().setEndpoint(endpoint).setProject(projectId).setKey(apiKey);
|
|
11882
11867
|
return { client, databases: new Databases(client) };
|
|
11883
11868
|
}
|
|
11884
|
-
function parsePositiveInt(raw,
|
|
11885
|
-
if (raw === void 0 || raw === "")
|
|
11886
|
-
return def;
|
|
11869
|
+
function parsePositiveInt(raw, name) {
|
|
11887
11870
|
const n = Number(raw);
|
|
11888
11871
|
if (!Number.isFinite(n) || n < 1 || !Number.isInteger(n)) {
|
|
11889
11872
|
throw new Error(`${name} \u5FC5\u987B\u662F\u6B63\u6574\u6570,\u5B9E\u9645="${raw}"`);
|
|
@@ -12219,11 +12202,12 @@ async function clientCapability(ctx) {
|
|
|
12219
12202
|
let result;
|
|
12220
12203
|
try {
|
|
12221
12204
|
const handle = createAppBaseClient(process.env, { log: ctx.log, error: ctx.error }, readAppwriteApiKey(ctx.req.headers));
|
|
12222
|
-
const
|
|
12205
|
+
const config = new AppbaseRuntimeConfigProvider();
|
|
12206
|
+
const store = createClientCapabilityStore(handle.databases, config.get("CLIENT_CAPABILITY_DATABASE_ID"), config.get("CLIENT_CAPABILITY_TABLE_ID"));
|
|
12223
12207
|
const trigger = readAppwriteTrigger(ctx.req.headers);
|
|
12224
12208
|
result = await runClientCapability(trigger, ctx.req.method, resolveBodyJSON(ctx.req), readAuthenticatedUserId(ctx.req.headers), store);
|
|
12225
|
-
if (trigger === "schedule"
|
|
12226
|
-
const paymentDeleted = await createPaymentActionStore(handle.databases,
|
|
12209
|
+
if (trigger === "schedule") {
|
|
12210
|
+
const paymentDeleted = await createPaymentActionStore(handle.databases, config.get("A2UI_ACTION_DATABASE_ID"), config.get("A2UI_ACTION_TABLE_ID")).cleanup((/* @__PURE__ */ new Date()).toISOString());
|
|
12227
12211
|
result = {
|
|
12228
12212
|
status: 200,
|
|
12229
12213
|
body: { ...result.body, paymentDeleted }
|
|
@@ -12262,14 +12246,10 @@ function isRecord(value) {
|
|
|
12262
12246
|
function nonEmpty(value) {
|
|
12263
12247
|
return typeof value === "string" && value.trim().length > 0;
|
|
12264
12248
|
}
|
|
12265
|
-
function requiredEnv(name) {
|
|
12266
|
-
const value = process.env[name];
|
|
12267
|
-
if (!value)
|
|
12268
|
-
throw new Error(`${name} \u672A\u914D\u7F6E`);
|
|
12269
|
-
return value;
|
|
12270
|
-
}
|
|
12271
12249
|
|
|
12272
12250
|
export {
|
|
12251
|
+
APPBASE_RUNTIME_CONFIG_DEFAULTS,
|
|
12252
|
+
AppbaseRuntimeConfigProvider,
|
|
12273
12253
|
LinkqueGatewayAuthError,
|
|
12274
12254
|
LinkqueGatewayAuthUnconfiguredError,
|
|
12275
12255
|
resolveLinkqueGatewayAuth,
|