devflare 1.0.0-next.23 → 1.0.0-next.24
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/LLM.md +77 -2
- package/dist/account-5nm1xn0v.js +475 -0
- package/dist/browser.d.ts +22 -2
- package/dist/browser.d.ts.map +1 -1
- package/dist/build-vctfnmsf.js +54 -0
- package/dist/cli/commands/deploy/prepare.d.ts.map +1 -1
- package/dist/cli/commands/deploy.d.ts.map +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/config/schema-env.d.ts +22 -2
- package/dist/config/schema-env.d.ts.map +1 -1
- package/dist/config/schema-runtime.d.ts +11 -1
- package/dist/config/schema-runtime.d.ts.map +1 -1
- package/dist/config/schema-types-runtime.d.ts +3 -0
- package/dist/config/schema-types-runtime.d.ts.map +1 -1
- package/dist/config/schema-types.d.ts +2 -2
- package/dist/config/schema.d.ts +33 -3
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config-rq32csms.js +105 -0
- package/dist/deploy-krj3k9zm.js +1055 -0
- package/dist/deploy-mem96qyn.js +1066 -0
- package/dist/dev-apkr7cfv.js +2597 -0
- package/dist/doctor-9asw8x18.js +259 -0
- package/dist/index-4j9ah79n.js +1033 -0
- package/dist/index-bfjpjs07.js +581 -0
- package/dist/index-cna43592.js +1573 -0
- package/dist/index-d00njc1f.js +147 -0
- package/dist/index-dgeamyfk.js +1426 -0
- package/dist/index-ftf7yqhs.js +74 -0
- package/dist/index-h332fg62.js +1205 -0
- package/dist/index-ja2rdbt0.js +476 -0
- package/dist/index-kc207nyr.js +52 -0
- package/dist/index-meq8ydc0.js +895 -0
- package/dist/index-myfjejs0.js +185 -0
- package/dist/index-qkfvd3cs.js +109 -0
- package/dist/index-rnz879kf.js +1426 -0
- package/dist/index-s96e5dd9.js +699 -0
- package/dist/index.js +3 -3
- package/dist/login-g9rb7dj3.js +77 -0
- package/dist/previews-ykamw25e.js +1337 -0
- package/dist/productions-4m1pd6ts.js +505 -0
- package/dist/secrets-gywxctdh.js +91 -0
- package/dist/sveltekit/index.js +3 -3
- package/dist/test/index.js +6 -6
- package/dist/types-17kkqw37.js +705 -0
- package/dist/vite/index.js +4 -4
- package/dist/worker-4fd49jm0.js +513 -0
- package/package.json +1 -1
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import {
|
|
2
|
+
loadConfig,
|
|
3
|
+
resolveConfigPath
|
|
4
|
+
} from "./index-cna43592.js";
|
|
5
|
+
import {
|
|
6
|
+
getEffectiveAccountId,
|
|
7
|
+
getPrimaryAccount,
|
|
8
|
+
getWorkspaceAccountId
|
|
9
|
+
} from "./index-1d4jg11n.js";
|
|
10
|
+
|
|
11
|
+
// src/cli/command-utils.ts
|
|
12
|
+
function asOptionalString(value) {
|
|
13
|
+
return typeof value === "string" && value.trim() ? value.trim() : undefined;
|
|
14
|
+
}
|
|
15
|
+
function resolveNamedSelection(options) {
|
|
16
|
+
if (options.explicitValue) {
|
|
17
|
+
return {
|
|
18
|
+
value: options.explicitValue,
|
|
19
|
+
source: "option"
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
if (options.fallbackValue) {
|
|
23
|
+
return {
|
|
24
|
+
value: options.fallbackValue,
|
|
25
|
+
source: "arg"
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
if (options.configuredValue) {
|
|
29
|
+
return {
|
|
30
|
+
value: options.configuredValue,
|
|
31
|
+
source: "config"
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
value: undefined,
|
|
36
|
+
source: "none"
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
async function getConfiguredAccountId(cwd) {
|
|
40
|
+
const workspaceAccountId = getWorkspaceAccountId();
|
|
41
|
+
if (workspaceAccountId) {
|
|
42
|
+
return workspaceAccountId;
|
|
43
|
+
}
|
|
44
|
+
const envAccountId = process.env.CLOUDFLARE_ACCOUNT_ID?.trim();
|
|
45
|
+
if (envAccountId) {
|
|
46
|
+
return envAccountId;
|
|
47
|
+
}
|
|
48
|
+
const configPath = await resolveConfigPath(cwd);
|
|
49
|
+
if (!configPath) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
try {
|
|
53
|
+
const config = await loadConfig({ cwd });
|
|
54
|
+
return config.accountId;
|
|
55
|
+
} catch {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
async function resolveCloudflareAccountId(options) {
|
|
60
|
+
if (options.explicitAccountId) {
|
|
61
|
+
return options.explicitAccountId;
|
|
62
|
+
}
|
|
63
|
+
if (options.configuredAccountId) {
|
|
64
|
+
return options.configuredAccountId;
|
|
65
|
+
}
|
|
66
|
+
const primaryAccount = await getPrimaryAccount(options.apiOptions);
|
|
67
|
+
if (!primaryAccount) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
const effective = await getEffectiveAccountId(primaryAccount.id);
|
|
71
|
+
return effective.accountId;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export { asOptionalString, resolveNamedSelection, getConfiguredAccountId, resolveCloudflareAccountId };
|