@zalify/cli 0.17.2 → 0.18.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 +1 -0
- package/dist/cli.js +19 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -101,6 +101,7 @@ its new home under `shop`.
|
|
|
101
101
|
| --- | --- |
|
|
102
102
|
| `ads create <dir>` | Provision an Autopilot brand-instance GitHub repo (POST `/api/repos`, GitHub App), scaffold the starter locally (`identity.yaml`, `brand.yaml`, `policy/`, `campaigns/`, `media-plans/`, `signals/`, `decisions/`), and push with a short-lived repo-scoped token. Writes `.zalify/brand-repo.json` so later commands run arg-free. The directory name becomes the slug — use the workspace's store slug so the service's digest writer can find the repo |
|
|
103
103
|
| `ads` / `ads list` | List the workspace's brand instances and their provisioning status |
|
|
104
|
+
| `ads remove <slug>` | Deprecate a brand instance — soft-deletes the record (drops out of `ads list` and the service's repo-token minting; survives for history). The GitHub repo is deliberately untouched: deleting real campaign intent is a human-on-GitHub decision |
|
|
104
105
|
|
|
105
106
|
The engine commands — `plan` / `apply` / `creative` / `report` — join this
|
|
106
107
|
group as `@zalify/ads-engine` merges in. Until then, drafting and applying
|
package/dist/cli.js
CHANGED
|
@@ -13193,14 +13193,15 @@ function apiError3(status, json) {
|
|
|
13193
13193
|
return new Error(`repos API ${status}: ${JSON.stringify(json)}`);
|
|
13194
13194
|
}
|
|
13195
13195
|
async function request2(auth, method, path9, body) {
|
|
13196
|
+
const hasBody = method !== "GET";
|
|
13196
13197
|
const url = method === "GET" ? `${auth.appUrl}${path9}${path9.includes("?") ? "&" : "?"}workspaceId=${auth.workspaceId}` : `${auth.appUrl}${path9}`;
|
|
13197
13198
|
const res = await fetch(url, {
|
|
13198
13199
|
method,
|
|
13199
13200
|
headers: {
|
|
13200
13201
|
Authorization: `Bearer ${auth.key}`,
|
|
13201
|
-
...
|
|
13202
|
+
...hasBody ? { "Content-Type": "application/json" } : {}
|
|
13202
13203
|
},
|
|
13203
|
-
...
|
|
13204
|
+
...hasBody ? { body: JSON.stringify({ workspaceId: auth.workspaceId, ...body }) } : {}
|
|
13204
13205
|
});
|
|
13205
13206
|
const json = await res.json().catch(() => ({}));
|
|
13206
13207
|
if (!res.ok)
|
|
@@ -13313,6 +13314,19 @@ Next steps:
|
|
|
13313
13314
|
` + ` - flip consent: true once the brand owner has signed off
|
|
13314
13315
|
` + ` - the Autopilot service picks the instance up from there`);
|
|
13315
13316
|
}
|
|
13317
|
+
async function adsRemove(slug) {
|
|
13318
|
+
const auth = requireActive();
|
|
13319
|
+
const json = await request2(auth, "GET", "/api/repos");
|
|
13320
|
+
const row = (json.repos ?? []).find((r) => r.slug === slug);
|
|
13321
|
+
if (!row) {
|
|
13322
|
+
throw new Error(`No brand instance "${slug}" in workspace "${auth.workspaceName}" — see \`zalify ads list\`.`);
|
|
13323
|
+
}
|
|
13324
|
+
await request2(auth, "DELETE", `/api/repos/${row.id}`);
|
|
13325
|
+
console.log(`✓ removed ${slug}`);
|
|
13326
|
+
if (row.githubRepo) {
|
|
13327
|
+
console.log(` ${row.githubRepo} itself is untouched — archive or delete it on GitHub if it should go too.`);
|
|
13328
|
+
}
|
|
13329
|
+
}
|
|
13316
13330
|
async function adsList() {
|
|
13317
13331
|
const auth = requireActive();
|
|
13318
13332
|
const json = await request2(auth, "GET", "/api/repos");
|
|
@@ -13923,6 +13937,9 @@ ads.command("create <dir>").description("Provision the brand-instance GitHub rep
|
|
|
13923
13937
|
ads.command("list", { isDefault: true }).description("List the workspace's brand instances").action(async () => {
|
|
13924
13938
|
await adsList();
|
|
13925
13939
|
});
|
|
13940
|
+
ads.command("remove <slug>").description("Deprecate a brand instance (record soft-deleted; the GitHub repo is left untouched)").action(async (slug) => {
|
|
13941
|
+
await adsRemove(slug);
|
|
13942
|
+
});
|
|
13926
13943
|
var theme = program2.command("theme").description("Theme source code — scaffold a copy and upgrade it without losing your edits");
|
|
13927
13944
|
theme.command("create <dir>").description("Scaffold only — no Zalify hosting (self-host path; `site create` is the fully-hosted launch)").option("-t, --template <name>", "liquid | hydrogen | nextjs", "nextjs").option("--editor", "include the Zalify canvas-editor (z1) wiring").option("--store-domain <domain>", "your-store.myshopify.com (default: mock.shop demo data)").option("--storefront-token <token>", "public Storefront API access token").option("--to <version>", "theme version (default: latest)").option("--no-install", "skip dependency install").option("--no-git", "skip git init + initial commit").option("--tarball <path>", "use a local @zalify/theme-templates .tgz instead of npm").action(async (dir2, options) => {
|
|
13928
13945
|
await themeCreate(dir2, options);
|