@composable-os/cli 0.1.0-beta.10 → 0.1.0-beta.13
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/{accounts-X4CKM3HL.js → accounts-GOCNY6WI.js} +17 -14
- package/dist/app-RPRZMLU5.js +43 -0
- package/dist/app-upload-YJVEKZC6.js +198 -0
- package/dist/{blocks-YWDHEBOK.js → blocks-DE4RRWPJ.js} +207 -25
- package/dist/{chunk-VY64DMQO.js → chunk-2B6YUYZV.js} +23576 -11674
- package/dist/{run-RT2HVWMK.js → chunk-2CCHB37H.js} +9 -146
- package/dist/{chunk-DU6OIFOU.js → chunk-3OGDWKJ3.js} +530 -434
- package/dist/chunk-5D7BDF4Y.js +141 -0
- package/dist/{chunk-WO6D3XP3.js → chunk-6CM3WZG5.js} +13 -2470
- package/dist/chunk-CIBJGB5H.js +962 -0
- package/dist/chunk-EPDTPGZJ.js +330 -0
- package/dist/{chunk-LLULPZAJ.js → chunk-HAYF4G5V.js} +66 -23
- package/dist/chunk-HCG6T53D.js +61904 -0
- package/dist/chunk-JX4IFWNT.js +330 -0
- package/dist/{chunk-A4NTSYWV.js → chunk-KFHKNXGH.js} +786 -386
- package/dist/chunk-KMFMD52Z.js +13276 -0
- package/dist/{chunk-E4WCYTCT.js → chunk-LX2TTLVY.js} +174 -55
- package/dist/{chunk-GYTEW66E.js → chunk-O3R4FS2J.js} +1 -1
- package/dist/{chunk-LJFLENFC.js → chunk-Q6Y45DY6.js} +25 -2
- package/dist/{chunk-Y7JZFSTQ.js → chunk-QJZGYJVV.js} +823 -44
- package/dist/{chunk-6VXHPKGG.js → chunk-QQ3YSL5F.js} +172 -16
- package/dist/chunk-RGKJKC5T.js +876 -0
- package/dist/{chunk-IFG4FRW5.js → chunk-RSEWEFAV.js} +12 -2
- package/dist/{chunk-2ABSVMGB.js → chunk-SMJZIK2O.js} +1 -1
- package/dist/{chunk-CP6BXI6F.js → chunk-U72NEGCT.js} +8818 -3829
- package/dist/{chunk-WC5LHBBA.js → chunk-Z4IKF23A.js} +11 -7
- package/dist/chunk-Z7OVQ6BC.js +713 -0
- package/dist/{chunk-6UWRT4VM.js → chunk-ZJSFX4RD.js} +175 -3
- package/dist/{cli-2DFENR62.js → cli-OKQHHSOE.js} +17 -23
- package/dist/{cli-YIOVSKOD.js → cli-VYSD2S4Z.js} +231 -82
- package/dist/cli.js +5 -5
- package/dist/{client-repo-PRU3VCQQ.js → client-repo-NNUCHQ2Y.js} +7 -5
- package/dist/create.js +5 -5
- package/dist/{fields-2NC7LSYE.js → fields-GTHE6TTS.js} +27 -3
- package/dist/gateway-DPPEQZT4.js +25 -0
- package/dist/grants-6JY4XZO7.js +27 -0
- package/dist/invoke-MRONRZ5Q.js +33 -0
- package/dist/moves-UAUCMWL5.js +36 -0
- package/dist/{order-PUWD65BC.js → order-RKLGT74L.js} +2 -2
- package/dist/{person-WIQQ7ITU.js → person-YOZTFV4Q.js} +11 -11
- package/dist/plan-on-sale-H4F26YIN.js +26 -0
- package/dist/platform/migrations/0610_waitlists.sql +54 -0
- package/dist/platform/migrations/0630_subscription_changes.sql +122 -0
- package/dist/platform/migrations/0650_person_links.sql +90 -0
- package/dist/platform/migrations/0670_unmoved_guard.sql +52 -0
- package/dist/platform/migrations/0690_sellable_refund_due.sql +98 -0
- package/dist/platform/migrations/0730_practitioners.sql +79 -0
- package/dist/platform/migrations/0750_routine_mail.sql +98 -0
- package/dist/platform/migrations/0770_clear_fixed_role_grants.sql +64 -0
- package/dist/platform/migrations/0810_recurrence_exceptions.sql +66 -0
- package/dist/platform/migrations/0811_staff_time.sql +109 -0
- package/dist/platform/migrations/0812_staff_offers.sql +112 -0
- package/dist/platform/migrations/0813_pay_periods.sql +241 -0
- package/dist/platform/migrations/0814_staff_feed.sql +47 -0
- package/dist/platform/migrations/0815_checklists.sql +237 -0
- package/dist/platform/migrations/0816_checklist_schedules.sql +121 -0
- package/dist/platform/migrations/0817_checklist_day_window.sql +35 -0
- package/dist/platform/migrations/0850_agreements.sql +271 -0
- package/dist/platform/migrations/0851_agreement_acceptances.sql +387 -0
- package/dist/platform/migrations/0853_agreement_enforcement.sql +58 -0
- package/dist/platform/migrations/0854_agreement_copy.sql +149 -0
- package/dist/platform/migrations/0855_agreement_retention.sql +279 -0
- package/dist/platform/migrations/0856_subscription_cooling_off.sql +159 -0
- package/dist/platform/migrations/0857_agreement_copy_guardian.sql +337 -0
- package/dist/platform/migrations/0858_agreement_desk.sql +175 -0
- package/dist/platform/migrations/0910_routine_messages.sql +99 -0
- package/dist/platform/migrations/0911_texts.sql +60 -0
- package/dist/platform/migrations/0913_contact_consent.sql +93 -0
- package/dist/platform/migrations/0916_contact_mailbox_index.sql +29 -0
- package/dist/platform/migrations/0930_stock_movements.sql +95 -0
- package/dist/platform/migrations/0931_stock_low.sql +25 -0
- package/dist/platform/migrations/0932_order_delivery.sql +78 -0
- package/dist/platform/migrations/0950_order_adjustments.sql +111 -0
- package/dist/platform/migrations/0951_order_price_guards.sql +33 -0
- package/dist/platform/migrations/0952_order_paid_another_way.sql +194 -0
- package/dist/platform/migrations/0953_discount_uses.sql +183 -0
- package/dist/platform/migrations/0955_folded_addresses.sql +92 -0
- package/dist/platform/migrations/0970_published_text.sql +59 -0
- package/dist/platform/migrations/0971_publish_acks.sql +68 -0
- package/dist/platform/migrations/0990_customer_email_change.sql +65 -0
- package/dist/platform/migrations/1010_intake_links.sql +148 -0
- package/dist/platform/migrations/1030_invoices.sql +747 -0
- package/dist/platform/migrations/1031_invoice_orders.sql +327 -0
- package/dist/platform/migrations/1050_inbox_conversations.sql +83 -0
- package/dist/platform/migrations/1090_staff_hours.sql +43 -0
- package/dist/platform/migrations/1091_staff_time_margins.sql +12 -0
- package/dist/platform/migrations/1092_client_guard.sql +26 -0
- package/dist/platform/migrations/1095_thing_time.sql +70 -0
- package/dist/platform/migrations/1130_devices.sql +162 -0
- package/dist/platform/migrations/1135_person_codes.sql +88 -0
- package/dist/platform/migrations/1150_finance_periods.sql +316 -0
- package/dist/platform/migrations/1151_payouts.sql +202 -0
- package/dist/platform/migrations/1153_finance_money_dates.sql +18 -0
- package/dist/platform/migrations/1170_journeys.sql +318 -0
- package/dist/platform/migrations/1171_person_birthday.sql +52 -0
- package/dist/platform/migrations/1175_person_signals.sql +29 -0
- package/dist/platform/migrations/1190_restricted_values.sql +25 -0
- package/dist/platform/migrations/1230_note_levels.sql +113 -0
- package/dist/platform/migrations/1231_person_carers.sql +33 -0
- package/dist/platform/migrations/1232_note_kinds.sql +122 -0
- package/dist/platform/migrations/1270_time_entries.sql +145 -0
- package/dist/platform/migrations/1271_leave.sql +249 -0
- package/dist/platform/migrations/1273_time_entry_reopened.sql +21 -0
- package/dist/platform/migrations/1330_accounting.sql +260 -0
- package/dist/platform/migrations/1350_customer_feed.sql +24 -0
- package/dist/platform/migrations/1390_locations.sql +77 -0
- package/dist/platform/migrations/1410_outside_copy.sql +213 -0
- package/dist/platform/migrations/1430_inbox_activities.sql +231 -0
- package/dist/platform/migrations/1450_wrong_guesses.sql +23 -0
- package/dist/platform/sdk/acknowledge.ts +100 -0
- package/dist/platform/sdk/agreements.ts +185 -0
- package/dist/platform/sdk/allowance.ts +98 -8
- package/dist/platform/sdk/automation-check.ts +120 -9
- package/dist/platform/sdk/automation.ts +78 -10
- package/dist/platform/sdk/behaviour.ts +26 -6
- package/dist/platform/sdk/calendar-entry.ts +258 -0
- package/dist/platform/sdk/capacity.ts +103 -2
- package/dist/platform/sdk/checklists.ts +118 -0
- package/dist/platform/sdk/contract.ts +514 -27
- package/dist/platform/sdk/discount.ts +408 -0
- package/dist/platform/sdk/document.ts +4 -2
- package/dist/platform/sdk/field-types.ts +5 -0
- package/dist/platform/sdk/formula/compile.ts +10 -0
- package/dist/platform/sdk/index.ts +17 -0
- package/dist/platform/sdk/intake.ts +380 -0
- package/dist/platform/sdk/journey-signals.ts +215 -0
- package/dist/platform/sdk/manifest.ts +1313 -66
- package/dist/platform/sdk/mine.ts +161 -0
- package/dist/platform/sdk/occupies.ts +192 -0
- package/dist/platform/sdk/questions.ts +681 -0
- package/dist/platform/sdk/recurring.ts +90 -9
- package/dist/platform/sdk/restricted-fields.ts +129 -0
- package/dist/platform/sdk/rich-text.ts +112 -0
- package/dist/platform/sdk/routine-mail.ts +1272 -0
- package/dist/platform/sdk/runtime.ts +25 -12
- package/dist/platform/sdk/screens.ts +91 -0
- package/dist/platform/sdk/sellable.ts +595 -1
- package/dist/platform/sdk/slug.ts +7 -2
- package/dist/platform/sdk/staffed.ts +474 -0
- package/dist/platform/sdk/states.ts +220 -64
- package/dist/platform/sdk/stock.ts +332 -0
- package/dist/platform/sdk/team.ts +83 -0
- package/dist/platform/sdk/testing.ts +70 -6
- package/dist/platform/sdk/worked-on.ts +134 -0
- package/dist/{products-2H5DR232.js → products-GCQLSZ3U.js} +2 -2
- package/dist/run-7ID64RA6.js +65 -0
- package/dist/run-FH7OGGTV.js +131 -0
- package/dist/run-OYZIAP6M.js +3363 -0
- package/dist/{run-Y7T4TVOL.js → run-QOFRRSZV.js} +41 -60
- package/dist/{run-PZUCSDDL.js → run-TJAEWR5U.js} +21 -51
- package/dist/{src-XTOD7EXW.js → src-52VERUPK.js} +312 -4
- package/dist/src-PHRELWN5.js +40 -0
- package/dist/visibility-SZCINPP4.js +58 -0
- package/package.json +2 -2
- package/dist/chunk-6GDEDOV7.js +0 -157
- package/dist/chunk-6UPUF4ML.js +0 -29998
- package/dist/chunk-7CQGMVDO.js +0 -63
- package/dist/chunk-GYSGVT6R.js +0 -284
- package/dist/chunk-JJHHNV46.js +0 -227
- package/dist/chunk-K6T42YCH.js +0 -704
- package/dist/chunk-M7A6FR2Z.js +0 -2586
- package/dist/chunk-O2UIZHND.js +0 -249
- package/dist/chunk-Q4N55M2Z.js +0 -552
- package/dist/chunk-QGGJ2G6Z.js +0 -349
- package/dist/chunk-R4W5XAUD.js +0 -837
- package/dist/chunk-TQFGGSA4.js +0 -748
- package/dist/chunk-YJJHF65I.js +0 -759
- package/dist/chunk-Z3RMMB6S.js +0 -668
- package/dist/grants-QXMKYMGB.js +0 -32
- package/dist/invoke-I3NNNXVL.js +0 -39
- package/dist/plan-on-sale-NB774CQL.js +0 -26
- package/dist/src-GYS6NBQB.js +0 -44
- package/dist/visibility-DLGHU4YN.js +0 -33
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
withDeploymentVar,
|
|
44
44
|
workersDevHostname,
|
|
45
45
|
writeDeploymentState
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-3OGDWKJ3.js";
|
|
47
47
|
import {
|
|
48
48
|
PROVIDER_INFO,
|
|
49
49
|
ROLE_PRESETS,
|
|
@@ -53,10 +53,12 @@ import {
|
|
|
53
53
|
import {
|
|
54
54
|
DEFAULT_PRODUCT,
|
|
55
55
|
products
|
|
56
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-SMJZIK2O.js";
|
|
57
57
|
import {
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
LOCATION_HINTS,
|
|
59
|
+
PRODUCT_LABEL_VAR,
|
|
60
|
+
isLocationHint
|
|
61
|
+
} from "./chunk-ZJSFX4RD.js";
|
|
60
62
|
|
|
61
63
|
// src/io.ts
|
|
62
64
|
import { createInterface } from "node:readline/promises";
|
|
@@ -143,7 +145,22 @@ A client repo (stage 24)
|
|
|
143
145
|
copy a block from the release; show its upstream changes
|
|
144
146
|
(--accept: record them as merged by hand)
|
|
145
147
|
(cos add with no block lists them, with their skins)
|
|
146
|
-
cos client generate in a client repo: each app's typed client, again
|
|
148
|
+
cos client generate in a client repo: each app's typed client, again (and
|
|
149
|
+
the mobile app's brand.ts from product.ts)
|
|
150
|
+
cos app check the mobile app before a store build: ids, icon, listing,
|
|
151
|
+
nothing bought in the app, "Delete my account", no key
|
|
152
|
+
file in the repo (stage 63, docs/app-publishing.md)
|
|
153
|
+
cos app credentials [--check --for ios|android|record]
|
|
154
|
+
the app workflow's secrets and how a person sets each;
|
|
155
|
+
never a value (--check: fail on any one missing)
|
|
156
|
+
cos app build-info [--env <name>] [--json]
|
|
157
|
+
the next build number (the host's records) and the API
|
|
158
|
+
version of the app's generated client
|
|
159
|
+
cos app record [--env <name>] --platform ios,android --build <n> [--commit <sha>]
|
|
160
|
+
record the builds a run sent to the testing tracks
|
|
161
|
+
cos app upload --platform android [--env <name>] --file <app.aab> [--listing] [--draft]
|
|
162
|
+
the Android build to the store's internal testing track;
|
|
163
|
+
nothing is released to the public
|
|
147
164
|
cos content import <folder> --host <url> [--email <you>] [--dry-run] [--publish] [--yes]
|
|
148
165
|
load posts and their pictures into the host as you,
|
|
149
166
|
signed in for the run (by code with --email, else in the
|
|
@@ -169,6 +186,17 @@ A client repo (stage 24)
|
|
|
169
186
|
cos subscriptions offers report --host <url> [--status taken] [--out <file.csv>]
|
|
170
187
|
who has taken their offer and when they are charged from,
|
|
171
188
|
so you end exactly those old subscriptions
|
|
189
|
+
cos programs import <folder> --host <url> [--email <you>] [--dry-run]
|
|
190
|
+
load exercises, class types, programs in the pack's
|
|
191
|
+
shorthand and past training (sessions and their sets), as
|
|
192
|
+
you; checks everything first, a re-run makes nothing
|
|
193
|
+
twice, an edit since is kept; what it brings in starts no
|
|
194
|
+
automation and sends no message (docs/importing.md)
|
|
195
|
+
cos rostering import <roster.csv> --host <url> [--email <you>] [--apply]
|
|
196
|
+
duties and who works them (weekly patterns, one-off
|
|
197
|
+
shifts); the host checks every date for someone on two
|
|
198
|
+
shifts at once and names it; a dry run unless --apply;
|
|
199
|
+
staff are invited first, never made (docs/importing.md)
|
|
172
200
|
|
|
173
201
|
Installing a product with no client repo
|
|
174
202
|
cos install [options] install, or repair an existing install (idempotent)
|
|
@@ -195,6 +223,11 @@ Options
|
|
|
195
223
|
--hostname <h> "workers.dev" (default) or a hostname on one of your zones
|
|
196
224
|
--zone <name> the zone of a custom hostname (default: inferred from it)
|
|
197
225
|
--identity <i> better-auth (default) or cloudflare-access
|
|
226
|
+
--location <hint> a location hint for the D1 database and R2 buckets a first install
|
|
227
|
+
creates: none (default), or ${Object.keys(LOCATION_HINTS).join(", ")}
|
|
228
|
+
(oc is Oceania). A preference Cloudflare follows where it can, not a
|
|
229
|
+
guarantee; KV, queues and Vectorize take none. An existing install is
|
|
230
|
+
never moved (docs/deploying.md "Where data is stored")
|
|
198
231
|
--gatekeepers <list> optional gatekeeper Workers to install, e.g. google,email-send
|
|
199
232
|
--ai <on|off> in-app AI: Workers AI and the demo-records Vectorize index (default on,
|
|
200
233
|
or COS_AI). Off: AI features say "AI is not configured". Upgrades keep
|
|
@@ -262,7 +295,11 @@ function parseArgs(argv) {
|
|
|
262
295
|
"dry-run",
|
|
263
296
|
"publish",
|
|
264
297
|
"invite",
|
|
265
|
-
"reissue"
|
|
298
|
+
"reissue",
|
|
299
|
+
"apply",
|
|
300
|
+
"check",
|
|
301
|
+
"listing",
|
|
302
|
+
"draft"
|
|
266
303
|
].includes(key);
|
|
267
304
|
let value = true;
|
|
268
305
|
if (takesValue) {
|
|
@@ -280,6 +317,7 @@ var CliError = class extends Error {
|
|
|
280
317
|
};
|
|
281
318
|
var PACKS_VAR = "COS_PACKS";
|
|
282
319
|
var CUSTOMER_SECRET = "CUSTOMER_AUTH_SECRET";
|
|
320
|
+
var DESK_SECRET = "DESK_SECRET";
|
|
283
321
|
var ORG_EXTENSIONS_VAR = "COS_ORG_EXTENSIONS";
|
|
284
322
|
function str(flags, key) {
|
|
285
323
|
const value = flags[key];
|
|
@@ -448,11 +486,25 @@ function aiChoice(flags, env) {
|
|
|
448
486
|
if (value === "off" || value === "false") return false;
|
|
449
487
|
throw new CliError("--ai is on or off");
|
|
450
488
|
}
|
|
489
|
+
function locationChoice(flags) {
|
|
490
|
+
const value = str(flags, "location")?.trim().toLowerCase();
|
|
491
|
+
if (value === void 0 || value === "") return void 0;
|
|
492
|
+
if (value === "none" || isLocationHint(value)) return value;
|
|
493
|
+
throw new CliError(
|
|
494
|
+
`--location is none or a location hint: ${Object.keys(LOCATION_HINTS).join(", ")}`
|
|
495
|
+
);
|
|
496
|
+
}
|
|
497
|
+
function describeLocation(hint) {
|
|
498
|
+
return hint ? `${hint} (${LOCATION_HINTS[hint]})` : "none";
|
|
499
|
+
}
|
|
451
500
|
function randomSecret() {
|
|
452
501
|
return toHex(crypto.getRandomValues(new Uint8Array(32)));
|
|
453
502
|
}
|
|
454
503
|
var FAKE_PROVIDER_VAR = "PAYMENTS_FAKE_PROVIDER";
|
|
455
504
|
var FAKE_SECRET = "FAKE_WEBHOOK_SECRET";
|
|
505
|
+
function fakeProviderOn(vars) {
|
|
506
|
+
return vars?.[FAKE_PROVIDER_VAR] === "true" || vars?.TEXT_PROVIDER === "fake";
|
|
507
|
+
}
|
|
456
508
|
function generateFakePaymentsSecrets(manifest, gatekeepers, vars, secrets, stored, redactor) {
|
|
457
509
|
for (const name of gatekeepers) {
|
|
458
510
|
const worker = manifest.workers.find((w) => w.name === name);
|
|
@@ -461,7 +513,7 @@ function generateFakePaymentsSecrets(manifest, gatekeepers, vars, secrets, store
|
|
|
461
513
|
const { [FAKE_SECRET]: _plain, ...rest } = vars[name];
|
|
462
514
|
vars[name] = rest;
|
|
463
515
|
}
|
|
464
|
-
if (vars[name]
|
|
516
|
+
if (!fakeProviderOn(vars[name])) continue;
|
|
465
517
|
if (stored.get(name)?.includes(FAKE_SECRET) || secrets[name]?.[FAKE_SECRET]) continue;
|
|
466
518
|
const secret = randomSecret();
|
|
467
519
|
redactor.add(secret);
|
|
@@ -554,6 +606,24 @@ async function install(flags, deps) {
|
|
|
554
606
|
if (identity !== "better-auth" && identity !== "cloudflare-access") {
|
|
555
607
|
throw new CliError("--identity is better-auth or cloudflare-access");
|
|
556
608
|
}
|
|
609
|
+
const locationFlag = locationChoice(flags);
|
|
610
|
+
let locationHint = previous?.locationHint;
|
|
611
|
+
if (!previous) {
|
|
612
|
+
let choice = locationFlag;
|
|
613
|
+
if (choice === void 0 && io.interactive && !flags.yes) {
|
|
614
|
+
choice = await choose(
|
|
615
|
+
io,
|
|
616
|
+
"Data location hint for the new database and file bucket (a preference Cloudflare follows where it can, not a guarantee; oc is Oceania):",
|
|
617
|
+
["none", ...Object.keys(LOCATION_HINTS)],
|
|
618
|
+
"none"
|
|
619
|
+
);
|
|
620
|
+
}
|
|
621
|
+
locationHint = choice === void 0 || choice === "none" ? void 0 : choice;
|
|
622
|
+
} else if (locationFlag !== void 0 && (locationFlag === "none" ? void 0 : locationFlag) !== previous.locationHint) {
|
|
623
|
+
io.out(
|
|
624
|
+
`Location: this host exists, made with location hint ${describeLocation(previous.locationHint)}. Its database and file buckets stay where Cloudflare put them: a setting cannot move them (moving one is an export into a new install). --location ${locationFlag} changes nothing here.`
|
|
625
|
+
);
|
|
626
|
+
}
|
|
557
627
|
const optional = manifest.workers.filter((w) => w.optional);
|
|
558
628
|
const requested = (str(flags, "gatekeepers") ?? "").split(",").map((g) => g.trim()).filter(Boolean).map(
|
|
559
629
|
(g) => g.startsWith(s.product.names.gatekeeperPrefix) ? g : `${s.product.names.gatekeeperPrefix}${g}`
|
|
@@ -585,6 +655,12 @@ async function install(flags, deps) {
|
|
|
585
655
|
deps.redactor.add(appSecrets.BETTER_AUTH_SECRET);
|
|
586
656
|
}
|
|
587
657
|
appSecrets.BETTER_AUTH_URL ??= `https://${hostname}`;
|
|
658
|
+
if (hostnameMode === "custom" && !appSet.includes(DESK_SECRET) && !appSecrets[DESK_SECRET]) {
|
|
659
|
+
let secret = randomSecret();
|
|
660
|
+
while (secret === appSecrets.BETTER_AUTH_SECRET) secret = randomSecret();
|
|
661
|
+
appSecrets[DESK_SECRET] = secret;
|
|
662
|
+
deps.redactor.add(secret);
|
|
663
|
+
}
|
|
588
664
|
const customerAuthUrl = str(flags, "customer-auth-url");
|
|
589
665
|
if (customerAuthUrl !== void 0) {
|
|
590
666
|
if (!/^https?:\/\/[^/]+$/.test(customerAuthUrl)) {
|
|
@@ -695,6 +771,11 @@ async function install(flags, deps) {
|
|
|
695
771
|
Installing ${s.product.label} ${version} into account ${s.accountId} at https://${hostname}`
|
|
696
772
|
);
|
|
697
773
|
if (!ai) io.out("In-app AI is off (--ai off): no Workers AI or Vectorize bindings.");
|
|
774
|
+
if (!previous && locationHint) {
|
|
775
|
+
io.out(
|
|
776
|
+
`Location hint: ${describeLocation(locationHint)}, sent when the D1 database and R2 buckets are created. Cloudflare follows it where it can; it is not a guarantee of where data is kept, and KV, queues, Vectorize and logs take no hint.`
|
|
777
|
+
);
|
|
778
|
+
}
|
|
698
779
|
io.out("Resources:");
|
|
699
780
|
const resources = {
|
|
700
781
|
...previous?.resources ?? {},
|
|
@@ -703,7 +784,8 @@ Installing ${s.product.label} ${version} into account ${s.accountId} at https://
|
|
|
703
784
|
s.accountId,
|
|
704
785
|
neededResources(manifest, gatekeepers, { ai }),
|
|
705
786
|
(l) => io.out(l),
|
|
706
|
-
previous?.resourceNames ?? names?.resources
|
|
787
|
+
previous?.resourceNames ?? names?.resources,
|
|
788
|
+
{ locationHint }
|
|
707
789
|
)
|
|
708
790
|
};
|
|
709
791
|
const base = {
|
|
@@ -724,6 +806,7 @@ Installing ${s.product.label} ${version} into account ${s.accountId} at https://
|
|
|
724
806
|
...previous?.resourceNames ? { resourceNames: previous.resourceNames } : names && Object.keys(names.resources).length ? { resourceNames: names.resources } : {},
|
|
725
807
|
vars,
|
|
726
808
|
...sendEmail && Object.keys(sendEmail).length ? { sendEmail } : {},
|
|
809
|
+
...locationHint ? { locationHint } : {},
|
|
727
810
|
resources,
|
|
728
811
|
bundleDigest: digest,
|
|
729
812
|
installedAt: previous?.installedAt ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -840,6 +923,12 @@ async function upgrade(flags, deps) {
|
|
|
840
923
|
const { io } = deps;
|
|
841
924
|
const s = await session(flags, deps);
|
|
842
925
|
const { databaseId, state: found } = await locate(s, flags);
|
|
926
|
+
const locationFlag = locationChoice(flags);
|
|
927
|
+
if (locationFlag !== void 0) {
|
|
928
|
+
io.out(
|
|
929
|
+
`Location: an upgrade never changes where data is stored. This host was made with location hint ${describeLocation(found.locationHint)}; its database and file buckets stay where they are (moving one is an export into a new install). --location changes nothing.`
|
|
930
|
+
);
|
|
931
|
+
}
|
|
843
932
|
const channel = found.channel;
|
|
844
933
|
const target = str(flags, "version") ?? await latestVersion(s, channel);
|
|
845
934
|
if (compareVersions(target, found.version) <= 0) {
|
|
@@ -1012,6 +1101,9 @@ async function status(flags, deps) {
|
|
|
1012
1101
|
io.out(
|
|
1013
1102
|
` sign-in: ${state.identityProvider}; gatekeepers: ${state.gatekeepers.join(", ") || "none"}; AI: ${state.ai === false ? "off" : "on"}`
|
|
1014
1103
|
);
|
|
1104
|
+
io.out(
|
|
1105
|
+
` location hint at install: ${describeLocation(state.locationHint)} (a preference, not a guarantee)`
|
|
1106
|
+
);
|
|
1015
1107
|
io.out(
|
|
1016
1108
|
newer.length ? ` available: ${newer.map((r) => r.version).join(", ")} (run \`cos upgrade\`)` : " up to date"
|
|
1017
1109
|
);
|
|
@@ -1082,7 +1174,7 @@ async function uninstall(flags, deps) {
|
|
|
1082
1174
|
async function ext(argv, deps) {
|
|
1083
1175
|
let runExt;
|
|
1084
1176
|
try {
|
|
1085
|
-
({ runExt } = await import("./cli-
|
|
1177
|
+
({ runExt } = await import("./cli-VYSD2S4Z.js"));
|
|
1086
1178
|
return await runExt(argv, deps.io);
|
|
1087
1179
|
} catch (error) {
|
|
1088
1180
|
if (error.code === "ERR_MODULE_NOT_FOUND") {
|
|
@@ -1096,7 +1188,7 @@ async function ext(argv, deps) {
|
|
|
1096
1188
|
}
|
|
1097
1189
|
async function client(argv, deps) {
|
|
1098
1190
|
if (argv[0] === "generate" && !argv.includes("--out")) {
|
|
1099
|
-
const repo = await import("./client-repo-
|
|
1191
|
+
const repo = await import("./client-repo-NNUCHQ2Y.js");
|
|
1100
1192
|
const parsed = parseArgs(["client", ...argv.slice(1)]);
|
|
1101
1193
|
const dir = str(parsed.flags, "dir") ?? process.cwd();
|
|
1102
1194
|
if (repo.isClientRepo(dir)) {
|
|
@@ -1110,7 +1202,7 @@ async function client(argv, deps) {
|
|
|
1110
1202
|
}
|
|
1111
1203
|
}
|
|
1112
1204
|
try {
|
|
1113
|
-
const { runClient } = await import("./cli-
|
|
1205
|
+
const { runClient } = await import("./cli-OKQHHSOE.js");
|
|
1114
1206
|
return await runClient(argv, deps.io);
|
|
1115
1207
|
} catch (error) {
|
|
1116
1208
|
if (error.code === "ERR_MODULE_NOT_FOUND") {
|
|
@@ -1138,7 +1230,7 @@ async function content(argv, deps) {
|
|
|
1138
1230
|
deps.io.err(error.message);
|
|
1139
1231
|
return 2;
|
|
1140
1232
|
}
|
|
1141
|
-
const { contentImport } = await import("./run-
|
|
1233
|
+
const { contentImport } = await import("./run-TJAEWR5U.js");
|
|
1142
1234
|
try {
|
|
1143
1235
|
return await contentImport(
|
|
1144
1236
|
positional,
|
|
@@ -1176,7 +1268,7 @@ async function courses(argv, deps) {
|
|
|
1176
1268
|
deps.io.err("--wait is minutes, a whole number");
|
|
1177
1269
|
return 2;
|
|
1178
1270
|
}
|
|
1179
|
-
const { coursesImport } = await import("./run-
|
|
1271
|
+
const { coursesImport } = await import("./run-FH7OGGTV.js");
|
|
1180
1272
|
try {
|
|
1181
1273
|
return await coursesImport(
|
|
1182
1274
|
positional,
|
|
@@ -1195,8 +1287,68 @@ async function courses(argv, deps) {
|
|
|
1195
1287
|
return 1;
|
|
1196
1288
|
}
|
|
1197
1289
|
}
|
|
1290
|
+
async function programsCommand(argv, deps) {
|
|
1291
|
+
const { PROGRAMS_USAGE, programsImport } = await import("./run-OYZIAP6M.js");
|
|
1292
|
+
if (argv[0] !== "import") {
|
|
1293
|
+
deps.io.err(PROGRAMS_USAGE);
|
|
1294
|
+
return 2;
|
|
1295
|
+
}
|
|
1296
|
+
const rest = argv.slice(1);
|
|
1297
|
+
const positional = rest[0] && !rest[0].startsWith("-") ? [rest[0]] : [];
|
|
1298
|
+
let parsed;
|
|
1299
|
+
try {
|
|
1300
|
+
parsed = parseArgs(["import", ...rest.slice(positional.length)]);
|
|
1301
|
+
} catch (error) {
|
|
1302
|
+
deps.io.err(error.message);
|
|
1303
|
+
return 2;
|
|
1304
|
+
}
|
|
1305
|
+
try {
|
|
1306
|
+
return await programsImport(
|
|
1307
|
+
positional,
|
|
1308
|
+
{
|
|
1309
|
+
...str(parsed.flags, "host") ? { host: str(parsed.flags, "host") } : {},
|
|
1310
|
+
...str(parsed.flags, "email") ? { email: str(parsed.flags, "email") } : {},
|
|
1311
|
+
dryRun: Boolean(parsed.flags["dry-run"])
|
|
1312
|
+
},
|
|
1313
|
+
deps.io
|
|
1314
|
+
);
|
|
1315
|
+
} catch (error) {
|
|
1316
|
+
deps.io.err(`Error: ${error.message}`);
|
|
1317
|
+
return 1;
|
|
1318
|
+
}
|
|
1319
|
+
}
|
|
1320
|
+
async function rostering(argv, deps) {
|
|
1321
|
+
const { ROSTER_USAGE, rosteringImport } = await import("./run-7ID64RA6.js");
|
|
1322
|
+
if (argv[0] !== "import") {
|
|
1323
|
+
deps.io.err(ROSTER_USAGE);
|
|
1324
|
+
return 2;
|
|
1325
|
+
}
|
|
1326
|
+
const rest = argv.slice(1);
|
|
1327
|
+
const positional = rest[0] && !rest[0].startsWith("-") ? [rest[0]] : [];
|
|
1328
|
+
let parsed;
|
|
1329
|
+
try {
|
|
1330
|
+
parsed = parseArgs(["import", ...rest.slice(positional.length)]);
|
|
1331
|
+
} catch (error) {
|
|
1332
|
+
deps.io.err(error.message);
|
|
1333
|
+
return 2;
|
|
1334
|
+
}
|
|
1335
|
+
try {
|
|
1336
|
+
return await rosteringImport(
|
|
1337
|
+
positional,
|
|
1338
|
+
{
|
|
1339
|
+
...str(parsed.flags, "host") ? { host: str(parsed.flags, "host") } : {},
|
|
1340
|
+
...str(parsed.flags, "email") ? { email: str(parsed.flags, "email") } : {},
|
|
1341
|
+
apply: Boolean(parsed.flags.apply)
|
|
1342
|
+
},
|
|
1343
|
+
deps.io
|
|
1344
|
+
);
|
|
1345
|
+
} catch (error) {
|
|
1346
|
+
deps.io.err(`Error: ${error.message}`);
|
|
1347
|
+
return 1;
|
|
1348
|
+
}
|
|
1349
|
+
}
|
|
1198
1350
|
async function subscriptions(argv, deps) {
|
|
1199
|
-
const { OFFERS_USAGE, offersImport, offersReport } = await import("./run-
|
|
1351
|
+
const { OFFERS_USAGE, offersImport, offersReport } = await import("./run-QOFRRSZV.js");
|
|
1200
1352
|
if (argv[0] !== "offers" || argv[1] !== "import" && argv[1] !== "report") {
|
|
1201
1353
|
deps.io.err(OFFERS_USAGE);
|
|
1202
1354
|
return 2;
|
|
@@ -1243,8 +1395,11 @@ async function runCli(argv, input) {
|
|
|
1243
1395
|
if (argv[0] === "content") return content(argv.slice(1), deps);
|
|
1244
1396
|
if (argv[0] === "courses") return courses(argv.slice(1), deps);
|
|
1245
1397
|
if (argv[0] === "subscriptions") return subscriptions(argv.slice(1), deps);
|
|
1398
|
+
if (argv[0] === "rostering") return rostering(argv.slice(1), deps);
|
|
1399
|
+
if (argv[0] === "programs") return programsCommand(argv.slice(1), deps);
|
|
1246
1400
|
if (argv[0] === "ext") return ext(argv.slice(1), deps);
|
|
1247
1401
|
if (argv[0] === "client") return client(argv.slice(1), deps);
|
|
1402
|
+
if (argv[0] === "app") return (await import("./app-RPRZMLU5.js")).runApp(argv.slice(1), deps);
|
|
1248
1403
|
const positional = ["create", "add", "diff"].includes(argv[0] ?? "") && argv[1] && !argv[1].startsWith("-") ? [argv[1]] : [];
|
|
1249
1404
|
let parsed;
|
|
1250
1405
|
try {
|
|
@@ -1257,8 +1412,8 @@ async function runCli(argv, input) {
|
|
|
1257
1412
|
deps.io.out(HELP);
|
|
1258
1413
|
return argv.length ? 0 : 2;
|
|
1259
1414
|
}
|
|
1260
|
-
const repo = await import("./client-repo-
|
|
1261
|
-
const blocks = await import("./blocks-
|
|
1415
|
+
const repo = await import("./client-repo-NNUCHQ2Y.js");
|
|
1416
|
+
const blocks = await import("./blocks-DE4RRWPJ.js");
|
|
1262
1417
|
const commands = {
|
|
1263
1418
|
install,
|
|
1264
1419
|
// In a client repo (its product.ts is a client product), `cos upgrade` moves the repo to a
|
|
@@ -1291,6 +1446,7 @@ ${HELP}`);
|
|
|
1291
1446
|
export {
|
|
1292
1447
|
Redactor,
|
|
1293
1448
|
terminalIo,
|
|
1449
|
+
parseArgs,
|
|
1294
1450
|
CliError,
|
|
1295
1451
|
str,
|
|
1296
1452
|
releaseSource,
|