@odla-ai/cli 0.10.1 → 0.11.0
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 +4 -4
- package/REQUIREMENTS.md +3 -1
- package/dist/bin.cjs +44 -12
- package/dist/bin.cjs.map +1 -1
- package/dist/bin.js +1 -1
- package/dist/{chunk-MWVKOIGR.js → chunk-KUQCJ6KA.js} +45 -13
- package/dist/chunk-KUQCJ6KA.js.map +1 -0
- package/dist/index.cjs +44 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.js +1 -1
- package/package.json +7 -9
- package/skills/odla/SKILL.md +4 -2
- package/skills/odla/references/build.md +6 -5
- package/skills/odla/references/sdks.md +6 -5
- package/skills/odla-migrate/SKILL.md +3 -2
- package/skills/odla-migrate/references/phase-2-db.md +6 -5
- package/skills/odla-migrate/references/phase-2b-calendar.md +2 -2
- package/skills/odla-migrate/references/phase-4-ai.md +4 -3
- package/skills/odla-migrate/references/phase-5-cutover.md +2 -2
- package/skills/odla-migrate/references/troubleshooting.md +3 -3
- package/dist/chunk-MWVKOIGR.js.map +0 -1
- package/llms.txt +0 -1270
package/dist/index.cjs
CHANGED
|
@@ -1133,6 +1133,28 @@ function unique(values) {
|
|
|
1133
1133
|
return [...new Set(values.filter(Boolean))];
|
|
1134
1134
|
}
|
|
1135
1135
|
|
|
1136
|
+
// src/calendar-errors.ts
|
|
1137
|
+
var PLATFORM_NOT_READY_CODES = /* @__PURE__ */ new Set([
|
|
1138
|
+
"calendar_google_oauth_not_configured",
|
|
1139
|
+
"calendar_token_vault_not_configured",
|
|
1140
|
+
"calendar_db_ingress_not_configured"
|
|
1141
|
+
]);
|
|
1142
|
+
var CalendarRequestError = class extends Error {
|
|
1143
|
+
/** HTTP status returned by the registry. */
|
|
1144
|
+
status;
|
|
1145
|
+
/** Machine-readable `error.code` from the response body, when present. */
|
|
1146
|
+
code;
|
|
1147
|
+
constructor(message, status, code) {
|
|
1148
|
+
super(message);
|
|
1149
|
+
this.name = "CalendarRequestError";
|
|
1150
|
+
this.status = status;
|
|
1151
|
+
if (code !== void 0) this.code = code;
|
|
1152
|
+
}
|
|
1153
|
+
};
|
|
1154
|
+
function isCalendarPlatformNotReady(error) {
|
|
1155
|
+
return error instanceof CalendarRequestError && error.code !== void 0 && PLATFORM_NOT_READY_CODES.has(error.code);
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1136
1158
|
// src/redact.ts
|
|
1137
1159
|
var REPLACEMENTS = [
|
|
1138
1160
|
[/odla_(sk|dev)_[A-Za-z0-9._-]+/g, "odla_$1_[redacted]"],
|
|
@@ -1298,7 +1320,8 @@ async function calendarJson(ctx, suffix, init) {
|
|
|
1298
1320
|
if (!response.ok) {
|
|
1299
1321
|
const code = textField(body.error?.code, 128);
|
|
1300
1322
|
const message = textField(body.error?.message, 500);
|
|
1301
|
-
|
|
1323
|
+
const detail = `${code ? ` ${code}` : ""}${message ? `: ${message}` : ""}`;
|
|
1324
|
+
throw new CalendarRequestError(redactSecrets(`calendar request failed (${response.status})${detail}`), response.status, code);
|
|
1302
1325
|
}
|
|
1303
1326
|
return body;
|
|
1304
1327
|
}
|
|
@@ -2349,17 +2372,6 @@ async function provision(options) {
|
|
|
2349
2372
|
if (cfg.services.includes("calendar")) {
|
|
2350
2373
|
const calendarCtx = { platform: cfg.platformUrl, appId: cfg.app.id, env, token, fetch: doFetch };
|
|
2351
2374
|
await applyCalendarBookingPage(calendarCtx, calendarBookingPageUrl(cfg, env), out);
|
|
2352
|
-
await ensureCalendarConnected(
|
|
2353
|
-
calendarCtx,
|
|
2354
|
-
{
|
|
2355
|
-
open: options.open,
|
|
2356
|
-
interactive: options.interactive,
|
|
2357
|
-
openConsentUrl: options.openApprovalUrl,
|
|
2358
|
-
wait: options.calendarPollWait,
|
|
2359
|
-
pollTimeoutMs: options.calendarPollTimeoutMs,
|
|
2360
|
-
stdout: out
|
|
2361
|
-
}
|
|
2362
|
-
);
|
|
2363
2375
|
}
|
|
2364
2376
|
}
|
|
2365
2377
|
for (const env of cfg.envs) {
|
|
@@ -2423,6 +2435,26 @@ ${env}: credentials are already saved; retry "odla-ai secrets push --env ${env}$
|
|
|
2423
2435
|
writeDevVars(devVarsTarget, credentials, env, o11yDevVars(cfg));
|
|
2424
2436
|
out.log(`dev vars: wrote ${displayPath(devVarsTarget, cfg.rootDir)} for ${env}`);
|
|
2425
2437
|
}
|
|
2438
|
+
if (cfg.services.includes("calendar")) {
|
|
2439
|
+
for (const env of cfg.envs) {
|
|
2440
|
+
try {
|
|
2441
|
+
await ensureCalendarConnected(
|
|
2442
|
+
{ platform: cfg.platformUrl, appId: cfg.app.id, env, token, fetch: doFetch },
|
|
2443
|
+
{
|
|
2444
|
+
open: options.open,
|
|
2445
|
+
interactive: options.interactive,
|
|
2446
|
+
openConsentUrl: options.openApprovalUrl,
|
|
2447
|
+
wait: options.calendarPollWait,
|
|
2448
|
+
pollTimeoutMs: options.calendarPollTimeoutMs,
|
|
2449
|
+
stdout: out
|
|
2450
|
+
}
|
|
2451
|
+
);
|
|
2452
|
+
} catch (error) {
|
|
2453
|
+
if (!isCalendarPlatformNotReady(error)) throw error;
|
|
2454
|
+
out.log(`${env}: calendar consent skipped (${error.code}); resume with "odla-ai calendar connect --env ${env}" once the platform is configured`);
|
|
2455
|
+
}
|
|
2456
|
+
}
|
|
2457
|
+
}
|
|
2426
2458
|
}
|
|
2427
2459
|
function serviceRank(service) {
|
|
2428
2460
|
if (service === "db") return 0;
|