@layers/amba 4.1.2 → 4.1.3

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.
@@ -403,6 +403,8 @@ export interface FunctionDeployContext {
403
403
  * step skips the storage binding in that case.
404
404
  */
405
405
  r2_bucket_name: string | null;
406
+ /** Per-project key prefix for shared storage; empty for a dedicated bucket. */
407
+ r2_path_prefix: string | null;
406
408
  }
407
409
  export declare function getFunctionDispatchNamespace(projectId: string): Promise<ApiResponse<FunctionDeployContext>>;
408
410
  export interface InternalCredentialsResponse {
@@ -749,6 +751,16 @@ export declare function removeSiteDomainViaApi(projectId: string, siteName: stri
749
751
  hostname: string;
750
752
  deleted: true;
751
753
  }>>;
754
+ /** Force the provider lifecycle to be re-read and persist both site-domain states. */
755
+ export declare function refreshSiteDomainViaApi(projectId: string, siteName: string, hostname: string): Promise<ApiResponse<SiteDomainRow & {
756
+ ssl_validation: DomainValidationRecord[];
757
+ ownership_verification: DomainOwnershipVerification | null;
758
+ ownership_verification_http: {
759
+ http_url?: string;
760
+ http_body?: string;
761
+ } | null;
762
+ note?: string;
763
+ }>>;
752
764
  /**
753
765
  * Roll a live deployment back to a prior `deployment_id`. Rollback creates
754
766
  * a NEW deployment that serves the prior bundle (git-revert semantics,
@@ -41,6 +41,9 @@ export interface SitesDomainAddOptions {
41
41
  }
42
42
  export declare function sitesDomainAddCommand(hostname: string, options: SitesDomainAddOptions): Promise<void>;
43
43
  export declare function sitesDomainListCommand(siteName: string): Promise<void>;
44
+ export declare function sitesDomainRefreshCommand(hostname: string, options: {
45
+ site: string;
46
+ }): Promise<void>;
44
47
  export declare function sitesDomainRemoveCommand(hostname: string, options: {
45
48
  site: string;
46
49
  zoneId?: string;
package/dist/index.js CHANGED
@@ -1137,6 +1137,10 @@ async function addSiteDomainViaApi(projectId, siteName, hostname) {
1137
1137
  async function removeSiteDomainViaApi(projectId, siteName, hostname) {
1138
1138
  return request("DELETE", `/projects/${projectId}/sites/${encodeURIComponent(siteName)}/domains/${encodeURIComponent(hostname)}`);
1139
1139
  }
1140
+ /** Force the provider lifecycle to be re-read and persist both site-domain states. */
1141
+ async function refreshSiteDomainViaApi(projectId, siteName, hostname) {
1142
+ return request("POST", `/projects/${projectId}/sites/${encodeURIComponent(siteName)}/domains/${encodeURIComponent(hostname.toLowerCase())}/refresh-cert`);
1143
+ }
1140
1144
  /**
1141
1145
  * Roll a live deployment back to a prior `deployment_id`. Rollback creates
1142
1146
  * a NEW deployment that serves the prior bundle (git-revert semantics,
@@ -5479,7 +5483,7 @@ async function loadProjectConfig(cwd = process.cwd()) {
5479
5483
  if (!apiUrl) apiUrl = parsed["AMBA_API_URL"];
5480
5484
  if (projectId && apiUrl) break;
5481
5485
  }
5482
- if (!projectId) throw new Error(`AMBA_PROJECT_ID not found. Run ${pc.cyan("amba init")} or set it in .env.local.`);
5486
+ if (!projectId) throw new Error(`AMBA_PROJECT_ID not found. Export it, pass --project where supported, or run ${pc.cyan("amba init")} in this directory. The CLI reads .env.local/.env from the current working directory and does not search parent directories.`);
5483
5487
  return {
5484
5488
  projectId,
5485
5489
  apiUrl: apiUrl ?? "https://api.amba.dev"
@@ -9073,6 +9077,15 @@ async function sitesDomainListCommand(siteName) {
9073
9077
  for (const d of res.data) console.log(` ${pc.bold(d.hostname)} ${formatDomainStatus(d)}`);
9074
9078
  console.log();
9075
9079
  }
9080
+ async function sitesDomainRefreshCommand(hostname, options) {
9081
+ validateSiteName(options.site);
9082
+ validateHostname(hostname);
9083
+ const projectConfig = await loadProjectConfig();
9084
+ const normalisedHostname = hostname.toLowerCase();
9085
+ const res = await refreshSiteDomainViaApi(projectConfig.projectId, options.site, normalisedHostname);
9086
+ console.log(` ${pc.bold(res.data.hostname)} ${formatDomainStatus(res.data)}`);
9087
+ if (res.data.note) console.log(pc.dim(` ${res.data.note}`));
9088
+ }
9076
9089
  async function sitesDomainRemoveCommand(hostname, options) {
9077
9090
  validateSiteName(options.site);
9078
9091
  validateHostname(hostname);
@@ -9674,7 +9687,7 @@ async function diffConfigCommand(file = DEFAULT_BUNDLE_FILE, options = {}) {
9674
9687
  //#endregion
9675
9688
  //#region src/index.ts
9676
9689
  const program = new Command();
9677
- program.name("amba").description("amba — agent-native backend-as-a-service for mobile apps.").version("4.1.2");
9690
+ program.name("amba").description("amba — agent-native backend-as-a-service for mobile apps.").version("4.1.3");
9678
9691
  program.option("--token <pat>", "Use a Personal Access Token for headless / CI / agent use (overrides ~/.amba/credentials.json + AMBA_PAT env)");
9679
9692
  program.hook("preAction", (thisCommand) => {
9680
9693
  setBearerOverride(resolveTokenSource({
@@ -10035,6 +10048,9 @@ sitesDomain.command("add <hostname>").description("Attach a custom hostname (DV
10035
10048
  sitesDomain.command("list <site>").description("List custom hostnames attached to a site").action(async (site) => {
10036
10049
  await runAction(() => sitesDomainListCommand(site));
10037
10050
  });
10051
+ sitesDomain.command("refresh <hostname>").description("Re-check hostname ownership and certificate status").requiredOption("--site <name>", "Site name the hostname is attached to").action(async (hostname, opts) => {
10052
+ await runAction(() => sitesDomainRefreshCommand(hostname, { site: opts.site }));
10053
+ });
10038
10054
  sitesDomain.command("remove <hostname>").description("Detach a custom hostname (best-effort edge detach + control-plane row delete)").requiredOption("--site <name>", "Site name the hostname is attached to").option("--zone-id <id>", "DNS zone id (default: env AMBA_DNS_ZONE_ID)").action(async (hostname, opts) => {
10039
10055
  await runAction(() => sitesDomainRemoveCommand(hostname, {
10040
10056
  site: opts.site,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@layers/amba",
3
- "version": "4.1.2",
3
+ "version": "4.1.3",
4
4
  "description": "amba — agent-native backend-as-a-service. Functions, collections, storage, AI, email, queues, sites, and `amba ship` to take an Expo app live on the App Store + Google Play. `npx @layers/amba init` to start.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -50,7 +50,7 @@
50
50
  "typescript": "^5.8.3",
51
51
  "vitest": "^3.2.4",
52
52
  "@layers/amba-shared": "4.0.4",
53
- "@layers/amba-mcp": "4.0.6"
53
+ "@layers/amba-mcp": "4.0.7"
54
54
  },
55
55
  "scripts": {
56
56
  "build": "tsdown && tsc --emitDeclarationOnly",