@mediamonks/canopy-cli 0.7.4 → 0.7.5

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/docs/sdk.md CHANGED
@@ -38,10 +38,11 @@ const canopy = createCanopy();
38
38
  // canopy.auth, canopy.db, canopy.blob, canopy.ai, canopy.services
39
39
  ```
40
40
 
41
- | Option | Type | Default | What it does |
42
- | --------- | -------------- | -------------- | ---------------------------------------------------------------------------------------------------- |
43
- | `baseUrl` | `string` | `"/_api"` | Base URL of the platform data API. The default is same-origin, so it works untouched in the browser. |
44
- | `fetch` | `typeof fetch` | global `fetch` | Override how requests are sent — a backend worker passes its platform service binding here. |
41
+ | Option | Type | Default | What it does |
42
+ | --------- | -------------- | -------------- | --------------------------------------------------------------------------------------------------------------------- |
43
+ | `baseUrl` | `string` | `"/_api"` | Base URL of the platform data API. The default is same-origin, so it works untouched in the browser. |
44
+ | `token` | `string` | none | A project-scoped `cnpy_` token sent as a bearer on every request — for scripts and CI running outside Canopy hosting. |
45
+ | `fetch` | `typeof fetch` | global `fetch` | Override how requests are sent — a backend worker passes its platform service binding here. |
45
46
 
46
47
  In the browser no config is needed. In a backend worker (the `worker`
47
48
  template), the platform is reachable through the `CANOPY` service binding, so
@@ -55,6 +56,18 @@ app.get("/api/hello", async (c) => {
55
56
  });
56
57
  ```
57
58
 
59
+ Outside Canopy hosting — a local Node script, a CI job — there is no session
60
+ and no service binding. Mint a dev token (`canopy dev` does this for you, or
61
+ `POST /control/v1/projects/:slug/dev-token`) and pass it with the platform's
62
+ API host:
63
+
64
+ ```ts
65
+ const canopy = createCanopy({
66
+ baseUrl: "https://api.canopy.website",
67
+ token: process.env.CANOPY_TOKEN, // a project-scoped cnpy_ token
68
+ });
69
+ ```
70
+
58
71
  ## One instance, shared
59
72
 
60
73
  In the browser, create the client once and import it everywhere. The scaffolds
@@ -1,4 +1,4 @@
1
- import { t as version } from "./package-DBEmT6Uh.mjs";
1
+ import { t as version } from "./package-yVoO2pq4.mjs";
2
2
  import { n as siteConfig } from "./site-BUlQR117.mjs";
3
3
  import { i as latestKnownVersion, r as compareSemver } from "./version-check-CcsA1QjI.mjs";
4
4
  import { n as reportErrors } from "./ui-CpdtK7mt.mjs";
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as version } from "./package-DBEmT6Uh.mjs";
2
+ import { t as version } from "./package-yVoO2pq4.mjs";
3
3
  import { r as siteHeaderLine, t as setInvocationProfile } from "./site-BUlQR117.mjs";
4
4
  import { a as notifyOfUpdate, o as runRefresh } from "./version-check-CcsA1QjI.mjs";
5
5
  import { defineCommand, runMain } from "citty";
@@ -78,9 +78,9 @@ const main = defineCommand({
78
78
  db: () => import("./db-D3RKaLVU.mjs").then((m) => m.dbCommand),
79
79
  usage: () => import("./usage-wpew0a2M.mjs").then((m) => m.usageCommand),
80
80
  open: () => import("./open-CLSh6oez.mjs").then((m) => m.openCommand),
81
- docs: () => import("./docs-IxKmYx_G.mjs").then((m) => m.docsCommand),
82
- skill: () => import("./skill-D3MHtg4s.mjs").then((m) => m.skillCommand),
83
- upgrade: () => import("./upgrade-PcE6l9uj.mjs").then((m) => m.upgradeCommand),
81
+ docs: () => import("./docs-DQmUReJR.mjs").then((m) => m.docsCommand),
82
+ skill: () => import("./skill-12Ga-2UT.mjs").then((m) => m.skillCommand),
83
+ upgrade: () => import("./upgrade-Du6U0xjp.mjs").then((m) => m.upgradeCommand),
84
84
  logs: () => import("./logs-DBLDS3aQ.mjs").then((m) => m.logsCommand)
85
85
  }
86
86
  });
@@ -1,4 +1,4 @@
1
1
  //#region package.json
2
- var version = "0.7.4";
2
+ var version = "0.7.5";
3
3
  //#endregion
4
4
  export { version as t };
@@ -1,4 +1,4 @@
1
- import { t as version } from "./package-DBEmT6Uh.mjs";
1
+ import { t as version } from "./package-yVoO2pq4.mjs";
2
2
  import { n as reportErrors } from "./ui-CpdtK7mt.mjs";
3
3
  import { defineCommand } from "citty";
4
4
  import { cpSync, existsSync, mkdirSync, rmSync, symlinkSync, writeFileSync } from "node:fs";
@@ -7,7 +7,7 @@
7
7
  "build": "tsc && vite build"
8
8
  },
9
9
  "dependencies": {
10
- "@mediamonks/canopy": "^0.0.1",
10
+ "@mediamonks/canopy": "^0.0.4",
11
11
  "react": "^19.1.0",
12
12
  "react-dom": "^19.1.0"
13
13
  },
@@ -7,7 +7,7 @@
7
7
  "build": "tsc && vite build"
8
8
  },
9
9
  "dependencies": {
10
- "@mediamonks/canopy": "^0.0.1",
10
+ "@mediamonks/canopy": "^0.0.4",
11
11
  "hono": "^4.8.0",
12
12
  "react": "^19.1.0",
13
13
  "react-dom": "^19.1.0"
@@ -112,7 +112,7 @@ const upgradeCommand = defineCommand({
112
112
  const spec = `${PACKAGE_NAME}@${args.version ?? "latest"}`;
113
113
  const command = pmCommand(pm);
114
114
  const cmd = installArgs(pm, spec);
115
- const { skillInstalled } = await import("./skill-D3MHtg4s.mjs");
115
+ const { skillInstalled } = await import("./skill-12Ga-2UT.mjs");
116
116
  const refreshSkill = skillInstalled(process.cwd());
117
117
  console.log(`Upgrading via ${command}: ${command} ${cmd.join(" ")}`);
118
118
  await run(command, cmd);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mediamonks/canopy-cli",
3
- "version": "0.7.4",
3
+ "version": "0.7.5",
4
4
  "description": "Canopy CLI — create, develop and deploy Canopy projects.",
5
5
  "bin": {
6
6
  "canopy": "./dist/index.mjs"
@@ -20,7 +20,7 @@
20
20
  "esbuild": "^0.28.1",
21
21
  "hono": "^4.8.0",
22
22
  "vite-server": "npm:vite@^7",
23
- "@mediamonks/canopy": "0.0.3",
23
+ "@mediamonks/canopy": "0.0.4",
24
24
  "@mediamonks/canopy-data-plane": "0.0.2"
25
25
  },
26
26
  "devDependencies": {